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

Take initial game state from archive.dat #379

Open
dertseha opened this issue Aug 6, 2020 · 1 comment
Open

Take initial game state from archive.dat #379

dertseha opened this issue Aug 6, 2020 · 1 comment

Comments

@dertseha
Copy link

dertseha commented Aug 6, 2020

Hello there!

When a new game is started, the inital state of the game and hacker is hardcoded. Most notably, various game variables, as well as the initial email, are set. See player.c, init_player() for details.
This also limits where and how fan-missions can start, as even the starting location is hardcoded.

With this this feature request I'd like to bring this port here to feature parity with the source port, which has extra behaviour. tl;dr below.

Background:
When Nightdive was working on the source port, I got in a chat with Axemeleon about the initial game state. I convinced them to implement a way that the engine would consider what is stored in archive.dat for the Player struct:
The behaviour that is in objsim.c, obj_create_player() was (probably) expanded to init_player(): When the first member of Player.edms_state is not zero, then (most) values from archive.dat are taken over.
(I guess this needed also some resurrection from commented code in gamewrap.c, create_initial_game_func().
During all of this, Axemeleon sent me an overview of what they implemented. As this was during the storm of "we're releasing soon, still working on details, ..." I wasn't sure whether this was implemented and implemented to spec.

Long story short, I finally (many moons past) came round to verify and publicly document it, and now I am in the process of implementing this in HackEd.

tl;dr
The details which fields and variables are set to which value by the source port is now documented in ss-specs.

If you need test archives, it'll take a little longer, as HackEd is not yet ready for this.

@dertseha
Copy link
Author

Update: HackEd v1.5.0 has been released. This allows to create an archive with modified state.
I also created a sample mission for "New Game Plus" games, with some initial inventory here. This can be used as an example to work with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant