Caves


Adds a cave system to the game that contains the resources instead of the normal surface.

Content
7 years ago
0.15
22
Mining

i "Radar" view for cave entrance placement

7 years ago
(updated 7 years ago)

I find, with the preview window, sometimes it is hard to know exactly where the exit will place ... I wrote some code to try out a "radar" view to help with this, if you like the idea I can make a patch:

(note: using red/green graphics from aai-zones mod, will make custom later)
https://www.dropbox.com/s/wlx4l686w3kxknl/Screenshot%202017-08-01%2016.26.37.png?dl=0

https://www.dropbox.com/s/bn4sxbohof98qaz/Screenshot%202017-08-01%2016.40.35.png?dl=0

Also, there could be a setting to disable the cave preview, and only show the "radar", to make finding resource patches require entering the cave, or the radar could be made to have colors showing resources/buildings/biters etc :-D

Also, using the same radar mechanism, A "Ground penetrating radar" building could be added in late-game, to show underground resource locations on the surface map view (this could easily be a completely separate companion mod tho, I might actually start it, but would be nice to collaborate on the "radar" graphics look/feel).

7 years ago

lol you beat me to it, but I'm trying to figure out a method to prevent placing the entrance in the first place instead of destroying (currently it is the function "die" which leaves a corpse and a notification should switch it to "destroy") it after it is deployed. That could produce nasty desynchs in multiplayer.

One way would be to use a empty collision layer but I don't want to use that until custom layer arrive...

7 years ago
(updated 7 years ago)

Hmm, the red radar graphic could be an entity that blocks placement, also rendering red radar in cave to prevent placement in cave. I need to look into desyncs, the radar as entities is likely to cause them.

https://www.dropbox.com/s/w155mf9h2h953dn/Screenshot%202017-08-01%2023.25.17.png?dl=0

7 years ago

oh the radar should be fine if you only create and destroy them once.
I'm talking about the fast placement and destroying when you don't have something to prevent the spawning in the first place.

I'm currently working on the chunk generator it does a lot of unnecessary things, it basically runs the complete generator again and creates a copy of the overworld which is then overwritten by the cave gen.
When I'm done it runs only once after the overworld chunk is generated and copies the resources in variable % down into the cave after it is generated.
It has a nice settings string too which gives you full control and leaves resources not mentioned untouched :-)

7 years ago

It works so far pretty well (performance wise), but I have to write a proper generator now in order to avoid a wired save bug :-)
Once that is done it should work flawlessly with RSO and any other generator mod for the overworld ;-D

7 years ago

Hi,

not sure anymore but i think i ran into problems with destroy() instead of die(), i think it didn't take effect (but too long ago). Is there a desync caused there?

i like the red/green overlays conceptually; the cave-view i created is kind of a bad compromise to get it done as i didn't manage to block it in the first place.
(i do like to take a peak into caves from the map to check if everything is running smoothly though).

just fyi, i think mods like long-reach could screw up and bypass the red marks, so probably the check after placement would still be needed as a fallback.

7 years ago

if you find something to simplify the generator, that's great :)
some steps look unecessary but handle corner cases
for example when the chunk is created first, it is filled with walls, to ensure you can't outrun the generation and end up in a place that's not free.
and because things are placed later, the resources that should be placed by the default generator have to be regenerated in the last step once more when it is clear where walls are actually present...
i was considering saving the overworld generation (before deletion), but didn't do it because it seemed like a lot of data to synchronize over the network(all resources would be needed in the globals to avoid desyncs. and it seems like this is already causing severe lag in multiplayer); also if you have for example a lake on the surface, it prevents resources below that, might or might not be wanted.
But i do like that this makes it compatible with RSO, would be a major improvement

7 years ago

also one note for the radar view: in 0.1.5 i made it mandatory to leave one space to the north of an exit in order to avoid getting stuck, so you might have to update that check

7 years ago

I have it working with the new placement, still need to improve performance and test multi-player, I have it showing radar only when placing an entrance, hovering over existing entrances/exits shows the standard preview.

Also, if you place a cave radar and a surface radar, it will show each scanned cave resource on the surface map (as white patches to avoid confusion with surface resources)

https://www.dropbox.com/s/5wa0utc0dbmgmc3/Screenshot%202017-08-21%2022.59.44.png?dl=0

7 years ago

looks quite nice, yes showing such a view while an entrance is in hand (instead of the current preview) makes sense

New response