Scale of map and impacts on vehicle efficiency

Just to interject the missing piece here, the reason solar cars work in dda is because our distances are minuscule. Towns are incredibly close together and trips between them take mere minutes so of course you’re not spending a significant amount of energy compared to IRL scenarios where you can barely get out of the house and do something without driving for 10-plus minutes and that’s within the same town.


Why are distances so miniscule? If the reason for that is “not to bore the player to death while driving”, then an auto-drive AI could be added, which automatically drives at the set speed and hands control to player when danger appears.

Such an addition would be automatically rejected.

Now, if that seems a bit harsh, and you’re wondering why, it’s because it already exists (W on the overmap, in a vehicle or on foot).
It’s not amazingly smart, but it works well enough.

Two of the major contributing factors to distances being so small are as follows:

  1. Our road network is nonsense. Our roads system generates pretty much a single path connecting everything. This doesn’t remotely resemble a real road network, and makes traveling around annoying and hard.
  2. Our city mapgen does not cope very well with being large, and does not generate in such a way that a scenario where you need several minutes of driving would surface, even if other problems with scaling it up were resolved.
1 Like

its because scale-wise, things dont make that much sense currently, the cars for example, most of the regular cars take up 4 spaces wide, but a skeletal juggernaut only takes up 1? that sorta thing. its because everything is tile based, and its not like you can micro-size the cars to be within reasonable scale, because then they would be tiny compared to everything else.

Aside from what anothersimulacrum and I have written a few posts back, there’s also a file size problem.
For example: Let’s say, we make cities the distance of Wentworth to Warren (two cities that are pretty close to each other; 7 km or 4.4 miles). Based on the lowest possible driving speed of 6 km/h, (which usually covers one tile, we can be generous again and say it covers two tiles), that would span 3500 tiles.
Since every overmap tile is 24 tiles and every overmap is 180 overmap tiles, you’d need to move almost a full overmap to reach an other city (146 overmap tiles).
If you’re lucky and can move in a straight line, that would generate and save 6 (reality bubble) times 146 overmap tiles to your computer, only to move from one (close) city to another.

Although people usually have hard drives with TB of storage capacity, I’m not sure everyone would like it if they get filled with files of “empty” space.

And that was an example of two cities that are close. Imagine driving from Manchester to Portland (~ 150 km / 100 miles)!
Now, while that would make some visible impact on your electric car, it also will drown your harddrive in “useless” files…

that too… i’ve seen people complain when the files are as low as 40,000… that its somehow ‘impacting their gameplay’ every time it saves.

(Depending on settings?) many towns end up completely disconnected from surrounding towns. It’s like America was a collection of argumentative city-states like Italy in the 1500’s. So, much like the 2030’s if the pessimists are right.

i havent seen any towns so far that are disconnected from a road?

I tend to have small-ish town/cities and widely spaced. They won’t be disconnected from all roads, but if you’ve got like towns
then picking two towns at random there likely won’t be a way to get between them without swimming or offroading (possibly through a forest). It shows up a lot when you get the ‘find the refugee center’ mission from the computer terminal and you get the message ‘you mark the location, but can’t work out any way to get there’ because the road network is disconnected.

This is my current map. Circle is where I started. As you can see, there is no road linking the EAST to the WEST. This is actually one of the better connected maps I’ve played. I think the problem is that so many of the roads off towns are ‘go to this farm then DIE’. In real life, it’s usually ‘go to the next town - drop a few farms on either side on the way’.

i generally get lots of roads connected all which-ways

theres two other towns over to the west as well including a biiig farm that IS in fact connected to the road, in the bottom left corner

Well, you no longer have to imagine it, I’ve made a test…

I’ve crossed 17 overmaps in a straight line and it generated 150 MB of files.
I’ve disabled cities, disabled all monsters and NPCs as well, set the item spawn rate to 0.01… Just to make sure the files don’t get filled with these informations.

Saving of even just one additional tile walked now takes seconds (on a high-end computer, my normal gameplay usually saves within 1 or 2 seconds, and an additional tile walked just quickly blinks the message).
Saving every 2 to 3 overmaps I’ve walked took about half a minute each.

If you drive at high speeds you might not think about saving all the time - this will result in very long save times in the end and might even crash the game, as it has to keep everything in memory until you finally save.

To sum it up, the reason the scale is kind of warped is that there are a number of technical issues keeping IRL-representative distances from working right now.
I think these obstacles are surmountable, and once they’re sorted out, we WILL have giant (compared to now) towns and cities miles and miles between towns and fast travel between them, but we need to proceed carefully because these issues are pretty hard to address and if they’re not all done and we crank up the distances, it could completely wreck the game.


I didn’t know that it’s planned (long term) to have realistic distances. Good to know!

Also, happy forum anniversary!

For example, when you drive past a forest tile and don’t interact with it, do we really need to save it, or should we just toss it and then regenerate it later? That probably leads to some rather “interesting” hauristics, but I think we can avoid persisting like 90% of the incidental map data that we generate.

1 Like

Might it not work to reduce the ‘reality bubble size’ when you are inside a vehicle and using auto-drive? That does have the drawbacks of a) you need the roads drawn in on the overmap first and b) using auto-drive has a large risk of ending crunch, smash, tinkle but a judicious save before and some care might be enough for the second with ‘hunting for maps’ helping for the first.

just removing empty values/entities from the saves would also save some space
“relic_data”, for example. Every item have it and it’s always(okay, technically in 99.9999999% cases) empty.
Or not saving empty contents in all its glory ":{"contents":[{"pocket_type":4,"contents":[],"_sealed":false},{"pocket_type":3,"contents":[],"_sealed":false},{"pocket_type":6,"contents":[],"_sealed":false}]}} - especially if it’s contents of bird feces.
Or pipeline .map files through zip, which will reduce their sizes about 6-10 times. Would it be too much of saving/loading performance hit?

I’m torn with this idea… On one side, it probably will work great and is for example - if I remember right - the way how Dwarf Fortress does it in adventure mode.
On the other side, due to frequent updates, almost all changes to the content will influence the terrain and item generation (even if there’s just one more item in the spawn group or a new tree, the same seed will probably generate wildly different results after an update)…
I think this might be the goto method in the end, but still…

It might also be worth considering to just completely black out the users screen, show a “progress” bar or something and abstract the whole travel; In the background the game just checks if there are obstacles in the way (Zombies/Wildlife/Cars/Special map tiles) from point A to B. If there are, the game cancels the auto travel and positions you a few tiles back (same if you interrupt the auto-traveling).
If there are no obstacles, the game could save the route as “obstacle free”, so it will never generate obstacles there, even if the versions change and it has to recalculate the route.

True, but please remember that in my test there were a massively reduced amount of items around and it still generated 150 MB… I could run another test, deleting all items and monster/animals beforehand, just to check how much space tiles only take up, but I’d imagine that it wouldn’t have that big of an impact and it would also skew the test results, since at some point you clearly would run into monsters/items along the road…

Given that there already was a performance hit while saving (I sadly forgot to also test to load up such a big map :expressionless: ), I’d expect even more problems if the files are zipped…

Dwarf Fortress regenerates maps whenever they are needed and stores only delta contents. However, the maps are generated from RNG seeds, which ensures they’re generated exactly the same each time. It would presumably be possible for CDDA to do the same, i.e. have each higher order map structure contain the seeds for each of the ones at the next level (that would also result in locations being generated the same if you kill the game and reload a save to visit that same location). Actually, you’d probably just need a single set of seeds at the higher map level if you have a well defined process for generating the seeds for each of the lower level maps from it.

If you want to reduce the size of the save data you should use a save format that isn’t extremely inefficient, i.e. not store it as text, but in binary form. It would still be possible to compress it further by using compression, but, as mentioned, there are performance issues involved with performing the compression.

Another way to reduce save impact would be to automatically save maps as they’re unloaded from the reality bubble into a temporary working save folder. Once a “real” save is performed (either auto or manual) the remaining maps are saved to the temporary folder, the files in that folder are then copied over to replace the corresponding ones in the real save folder, and the temporary save folder is cleared. Obviously, it would require the game to first look for maps that need to be loaded in the temp folder, and it also would have to have logic to handle clearing of a dirty temp folder on start (if quitting without saving, regardless of whether it was controlled or uncontrolled), and recovery from a crash during saving (by clearing the temp folder unless it’s marked with a file that indicates the saving has completed and copying can commence, in which case it would finish the copying before clearing the folder).

The point is, as mentioned, you don’t get the same results if you change spawn lists, which will happen quite often from one experimental version to another.
This applies to Minecraft and almost any game that uses seeded procedural generation - as well as Dwarf Fortress, and Cataclysm DDA will be no exception from that.

You can save the spawn list versions used when first generating a map, but that would require you to build a growing library of spawn list version contents as you go from experimental version to experimental version.

Edit: It can be noted that Dwarf Fortress doesn’t really support changing RAW definitions. When a world is generated the RAW files used are copied into the save. It’s still possible to hack things in a game using the copies in the save, but only some things take effect, so you have to know what you’re doing (and you can corrupt the save by doing the wrong edits). The RAW files are Dwarf Fortress’ files corresponding to the JSON files CDDA use, by the way.