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

Ride data summary #4

Closed
kevinburke opened this issue Apr 22, 2014 · 1 comment
Closed

Ride data summary #4

kevinburke opened this issue Apr 22, 2014 · 1 comment

Comments

@kevinburke
Copy link
Contributor

Starting at address 0x00597c9d (or 0x00997c9d, I am not sure why the difference is there, but my Go program had to read the data from 0x005..), there are a bunch of track piece properties. For each track piece listed here: https://github.com/UnknownShadow200/RCTTechDepot-Archive/blob/master/trackelements.html

there's an 8 byte long struct containing more information about the track piece.

// byte 0:
// value 2: end station
// value 7: vertical loop
// value 13: s bend
// 17: twist
// 18: half loop
// 19: corkscrew
// 20: tower base
// 21: small helix
// 22: large helix
// 23: unbanked large helix
// 24: brakes
// 26: on ride photo
// 27: water splash
// 29: barrel roll
// 30: powered lift
// 31: half loop
// 33: log flume reverser
// 36: whoa belly
// 43: lift hill
// 46: spinning tunnel
// 47: rotation control toggle
// 52: rapids (rct2 only)
// 152: waterfall/whirlpool
// 172: brake for drop

// byte 1:
// 2: ends at 25 degree up
// 4: ends at 60 degree up
// 6: ends at 25 degree down
// 8: ends at 60 degree down
// 10: 90 degree up (tower, whoa belly)
// 18: 90 degree down

// byte 2:
// 2: starts at 25 degree up
// 4: starts at 60 degree up
// 6: starts at 25 degree down
// 8: starts at 60 degree down
// 10: 90 degree up (also tower, whoa belly)
// 18: 90 degree down

// byte 3:
// 2: ends with left bank
// 4: ends with right bank
// 15: ends upside down

// byte 4:
// 2: starts with L bank
// 4: starts with R bank
// 15: starts upside down

// byte 5:
// 64: half loop up
// 192: half loop down
// 208: something relating to vertical loops. same for both L and R
// 224: corkscrew down

As far as I can tell, bytes 6 and 7 are always empty.

The 2nd address listed, track_config_table_2, seems to be for RCT1 and has missing data in some places - for example 0x73, ELEM_25_DEG_DOWN_LEFT_BANKED, has data in track_config_table_1 but not in #2.

I have this data/parser in a file, here: https://gist.github.com/kevinburke/11188314

I think there is more data to be found in the binary somewhere. For example, this has no flags for diagonal pieces, no data about direction changes (for turns), and no data about the diameter of a turn.

Happy to add this to the project, but curious about the best way to represent the struct and the constants in it.

@IntelOrca
Copy link
Contributor

Thanks for the analysis, I will add this to the project.

In response to your address differences, 0x00597c9d is the physical exe address, when the exe is run, the code segment is copied to a virtual memory address, base offset of 0x400000 which is usually the default for most applications. IDA therefore shows you both what the address is for data in the EXE and what the address will be when the game is running.

IntelOrca pushed a commit that referenced this issue Aug 19, 2014
IntelOrca pushed a commit that referenced this issue Mar 20, 2015
duncanspumpkin pushed a commit that referenced this issue Jun 15, 2016
wolfreak99 pushed a commit to wolfreak99/OpenRCT2 that referenced this issue Jul 4, 2017
rename path bits (var_06) to (flags)
janisozaur added a commit that referenced this issue Feb 14, 2018
While looking at
#7176 (comment)
I got a crash with stacktrace:

    #0 0x7f9e81fa2e30 in object_entry_get_entry(int, unsigned long) ../src/openrct2/object/ObjectList.cpp:181
    #1 0x7f9e81fa24ae in get_loaded_object_entry(unsigned long) ../src/openrct2/object/ObjectList.cpp:142
    #2 0x7f9e8215d64f in S6Exporter::Export() ../src/openrct2/rct2/S6Exporter.cpp:169
    #3 0x7f9e8216de71 in scenario_save(char const*, int) ../src/openrct2/rct2/S6Exporter.cpp:757
    #4 0x7f9e81c932b0 in game_autosave() ../src/openrct2/Game.cpp:1590
    #5 0x7f9e828625b6 in scenario_autosave_check() ../src/openrct2/scenario/Scenario.cpp:297
    #6 0x7f9e81c8a958 in game_update() ../src/openrct2/Game.cpp:439
    #7 0x7f9e81c6731f in OpenRCT2::Context::Update() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10f331f)
    #8 0x7f9e81c6674c in OpenRCT2::Context::RunVariableFrame() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10f274c)
    #9 0x7f9e81c6402d in OpenRCT2::Context::RunFrame() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10f002d)
    #10 0x7f9e81c638f4 in OpenRCT2::Context::RunGameLoop() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10ef8f4)
    #11 0x7f9e81c627bf in OpenRCT2::Context::Launch() (/home/janisozaur/workspace/OpenRCT2/build/libopenrct2.so+0x10ee7bf)
    #12 0x7f9e81c5b08a in OpenRCT2::Context::RunOpenRCT2(int, char const**) ../src/openrct2/Context.cpp:170
    #13 0x56323695b95e in main ../src/openrct2-ui/Ui.cpp:60

Sadly I cannot reproduce it anymore
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

2 participants