CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.7k stars 4.2k forks source link

Add fourth dimension - allowing multiple 3d game spaces #76673

Open martinrhan opened 2 months ago

martinrhan commented 2 months ago

Is your feature request related to a problem? Please describe.

Currently, the include some places that should not be within the main 3d space, which means multiple 3d spaces is needed. For example, in Aftershock, the player can get into some space station, which is currently worked around by placing it at the lowerst level. This feature is also neccessary for future implementations of the Backrooms mod, as each level will be a 3d space.

Solution you would like.

Currently a world only consist of a single space. We should change it, make it multiple.

Describe alternatives you have considered.

No response

Additional context

No response

andrei8l commented 2 months ago

Feel free to pick up #66454

kevingranade commented 2 months ago

To clarify, we have discussed "multiple worlds" vs "expanded coordinate system", and "expanded coordinate system" presents too many complications for too few features we're interested in.

  1. We're not particularly interested in agents being able to seamlessly navigate between dimensions i.e. as a pathfinding exercise. Dimensional transit is a lot more special case than that. (and if there are rare exceptions we can fake it)
  2. Unifying coordinate systems between dimensions is not desireable, in fact the mapping might be nonlinear or chaotic, so it would happen at the point of transit instead of being a thing you can reason about.
  3. Having dynamic interactions between dimensions, i.e. player is on one side of a gate and interacting (examining, shooting) something on the other side is not something of great interest. (and if there are rare exceptions we can fake it)

As such, the preferred implementation is that there are distinct "worlds", implemented as distinct subdirectories under save// Then various classes get extended to have the "current world" be an enumerated toggle instead of being fixed, and a process like interacting with a portal will cause a transit to the appropriate world while toggling that value and resetting the appropriate data structures. I.e. you would do something like:

overmapbuffer.clear();
mapbuffer.clear();
overmapbuffer.load(dimension, coordinates);
mapbuffer.load(dimension, coordinates);

Further extensions would push that dimension ID down into mapgen, item group handling, monster groups, etc.

Probably the simplest initial testbed would be a second world that's generated the same as the first but has a distinct map and spawn location, then we could proceed to expand on making the new world distinct from there.

Actually the simplest might be something funky like start a new game of dda in a nested virtual dda instance.