Multi floor vehicles

This has been suggested a while ago but I didn’t want to necro the 3.5 year old topic, so I’m starting a new one with more details. Also, with new vehicle Z level transitions this has probably become even closer to being possible.

Tall multi floor vehicles are pretty realistic and I’m not talking only about doble decker buses: according to Wikipedia, Romans 2000 years ago had the arcane knowledge of building vehicles that took up 9 Z levels (although they needed a shit ton of npcs as a crew). This technology had later been seen in many corners of the world.

Now to technical details. I’m not yet familiar with the Z level spanning mechanics from 0.F but apparently vehicles can now be split between Z levels and still move as a whole. If they are fully 3D, the problem is basically solved, but even with 0.E 2D vehicles you can simulate multiple floors by processing each level as a separate subvehicle with additional calculations for holding them together: if the lower one moves, everything moves accordingly; if any level crashes into something, the crash is processed for the whole vehicle; power and fluid grids are merged across levels; mass, air drag and center of mass are calculated for the whole vehicle etc.

What would need to be added:

  1. Ladders. You install a ladder on one level and can ascend to the next.
  2. “On roof” location mutually exclusive with frames on the next Z level in the same tile.
    2.5. Cameras and turrets installable on a wall instead of a roof.
  3. Some sort of stability mechanic to prevent overly tall towers with all the weight concentrated on the top. Not very complex, probably calculate the Z coordinate of the center of mass, divide it by the minimum of X and Y wheel base spans and reduce the max speed accordingly.
  4. Improve the view across Z levels: you should be able to look at any Z level you can currently see without it impeding your movement. This is more of a side request but it would be useful for elevated cockpits. [Again, not familiar with the experimental build, maybe helicopters have already solved it].
3 Likes

This sounds amazing! I love the idea of making a double layer deathmobile! This could potentially be used as a way to get to higher Z levels without climbing built in staircases. Think something like Siege Towers.

One Z-level is approximately 3 to 5 meters high.

Vehicles split across multiple z-levels are still the same vehicle. It required some smacking around of the vehicle cache but I managed it.

The kind of multi-level vehicle implementation you’re talking about is something I plan to do for 0.G. No guarantees - life is what happens when you’re making other plans - but it’s something I hope to do. I’d be happy to help someone else do it; there’s a moderately complicated change to get the ball rolling (changing the mount points of vehicle points from 2D points to 3D tripoints) and then a lot of tedious little details and bug-stomping.

If anyone who knows how to program is interested in doing some complicated C++ coding in the vehicles code and wants to take this on, please contact me.

Well, I’m a programmer myself but I may be too lazy for setting up the infrastructure and then trying to understand the vehicle and Z level code in its full complexity to avoid all of the possible bugs. I’ll still look into it but is there any documentation on the code?

The Guide for new contributor’s section on C++ structure is the best overview, plus most of the header files are documented. The vehicle code overall has decent headers: try src/vehicle.h, src/veh_type.h, and src/veh_interact.h for most of the relevant bits.

Thanks, I’ll have a look but no promises yet.

Multi-floor vehicles would be a possible solution for some of the “vehicle on flatbed” problems. I guess it would be like a vertical bike-rack solution. Drive your car up onto the flatbed, then lock it down.

You’d still need a vehicle ramp part and some kind of special “cargo” parts that allowed a vehicle to be driven (and parked) on top of them. I’m not even sure you’d need multiple Z level vehicles for that to work. Multi Z level vehicles might allow logic to get the loaded vehicle to actually move with its carrier, though.

If you don’t have something (Z-level, or other) to distinguish ‘transported’ vehicle parts from ‘transporter’ vehicle parts it all gets a bit messy.

That’s not how I intend to implement flatbed carriers at all. Though doing flatbed carriers as vertically aligned bike racks almost would be a good, quick hack to get something out, it would also cause a lot of weirdness because in my preferred model of vehicle z-levels, you can’t have “under” parts on z+1 and you can’t have “roof”/“on_roof” parts on z+0.

My plan for flatbed carriers is to store each individual frame of the carried vehicle in each individual vehicle part of the flatbed, and just transfer damage over. This is going to be reasonably tricky to implement, but I think it can work. Alternately, I may end up moving the carried vehicle’s vehicle instance to a pointer held by the carrier vehicle and remove the carried vehicle from the vehicle cache and make it only accessible through the carrier vehicle. Six of one, half-dozen of the other, and I think it’s going to be an implementation detail that I will work out sometime before 0.G, hopefully.

2 Likes

Ah, multi floor vehicles. At last we’ll be able to play a survivor in the ruins of Great Britain!

1 Like

I look forward to taking a sharp corner in my 6 story tall monoblock and falling right over

5 Likes