Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isekai #76955

Draft
wants to merge 53 commits into
base: master
Choose a base branch
from
Draft

Isekai #76955

wants to merge 53 commits into from

Conversation

kevingranade
Copy link
Member

Summary

Features "Load other worlds/dimensions and move player to them and back."

Purpose of change

This is a continuation of #76692
I made some somewhat extensive requests for cleanups and the author isn't feeling it, so I took it on.
The larger context is this is a key piece something we've wanted for a very long time, a completely separate set of save files representing an entirely different world the player can visit.
This piece sets the stage for further development by allowing the player to transit to an arbitrary new world that is generated in the same way as the existing game world. The new world and the old world are both persistent and the player can move back and forth, well, using debug features anyway.

Describe the solution

This injects some new logic into the save path handling code to support the idea of different "dimensions" that can co-exist in the same world directory. It also adds some code to safely unload the current world and load the new world, generating it as necessary.

Describe alternatives you've considered

There's a lot more pieces of this, but as long as we can proceed step-wise without breaking existing content, I think that's the way to go.
We're definitely going to want some hooks to inject entirely different mapgen so that the visited world can be different in specific ways, but that can wait for later.

Testing

Open the debug menu -> Game... -> Activate EOC -> EOC_dimension_swap_test -> type whatever into the prompt
The game should show a different area than you were in previously, but one consistent with normal mapgen, and the map view should likewise show a small area around you that is different but typical.
Revisiting the above menu and typing 'default' at the prompt should return you to the same place where you departed from, unless you moved around in which case you're translated by the distance moved. i.e. coordinates map to each other in a 1:1 way.
Monsters should be swapped out, items shouldn't carry over, vehicles should be replaced, map memory, etc.

bombasticSlacks and others added 30 commits October 10, 2024 10:25
… added a check to prevent revification when swapping worlds, as that might cause crashes.
…ixed issues with the maps not being properly saved when swapping
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added <Enhancement / Feature> New features, or enhancements on existing <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Mechanics: Weather Rain, snow, portal storms and non-temperature environment EOC: Effects On Condition Anything concerning Effects On Condition json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Oct 11, 2024
@@ -71,7 +71,7 @@ int camp_reference::get_distance_from_bounds() const

cata_path overmapbuffer::terrain_filename( const point_abs_om &p )
{
return PATH_INFO::world_base_save_path_path() / string_format( "o.%d.%d", p.x(), p.y() );
return PATH_INFO::current_dimension_save_path_path() / string_format( "o.%d.%d", p.x(), p.y() );
}

cata_path overmapbuffer::player_filename( const point_abs_om &p )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add dimension stuff here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, thanks, I missed that the "player" part was all "seen" data, need to wrap up the last of those.

@kevingranade
Copy link
Member Author

Just checking in with progress, turns out master.gsav is messy in several ways.
Some of it needs to be split out to be per-dimension and some of it needs to be augmented to be dimension aware.
For example weather needs an independent instance per save, overmapgen state (tracking which specials have spawned) needs separate per-dimension state, but missions should be global and dimension aware, if you have a mission that says go to X/Y, it needs to be go to X/Y/nether or X/Y/earth.

@Blueflowerss Blueflowerss mentioned this pull request Oct 17, 2024
4 tasks
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 28, 2024
@kevingranade kevingranade marked this pull request as draft October 31, 2024 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing EOC: Effects On Condition Anything concerning Effects On Condition [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs Mechanics: Weather Rain, snow, portal storms and non-temperature environment NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants