Reverse engineering in OLoco & ORCT2

Got problems with Locomotion? Find assistance here!

Moderator: Locomotion Moderators

Post Reply
User avatar
luk3Z
Traffic Manager
Traffic Manager
Posts: 197
Joined: 25 Dec 2005 17:42
Location: Kielce, Poland (Mars sometimes)

Reverse engineering in OLoco & ORCT2

Post by luk3Z »

For those who may wonder how it was made (for educational purposes only):

https://www.youtube.com/user/duncanspumpkin/videos
https://www.youtube.com/@duncanfrot4318/videos
https://www.youtube.com/watch?v=cwBoUuy4nGc
I've begun disassembling Loco.exe. It's a tough one to figure out because Atari used all kinds of bit transfers (32 bit to 64 bit and back again) for all kinds of things. Mainly time critical things like dates, speeds, etc. This seems like poor programming, giving higher cpu driven function more things to process thus slowing down the whole game.

I've tried pretty hard to figure out how the game calculates the year and I haven't figured it out yet. I also learned something interesting on that topic. The game actually keeps track of leap years! No idea why, but it does. Though they made a mistake and didn't include the year 2000 into the leap year calculations, but who's criticizing, right?

I've broken down the exe into the main parts (file I/O, time, speeds, and monetary things) and now I'm in the process of figuring out exactly how each one works. I'm hoping to find enough information to begin large scale modifications (mainly real-time changes) so I can begin doing things like TTD Patch does with TTD. It is proving very difficult due to 2 things. One, my lack of ASM understanding and two, my lack of time to do such things.

For those intrested, the game has both static and dynamic memory allocations on a large scale (which is odd). For example, some of the static memory addresses include player data (money, loan, delivered cargo, etc). Some of the dynamic addresses include Years, vehicle speeds, and vehicle reliability.
by Rapture » 12 Sep 2005, o 03:08
viewtopic.php?t=20749

C++ tools to make life easier:
https://en.wikipedia.org/wiki/Sourcetrail
https://en.wikipedia.org/wiki/Cppcheck

Wiki:
https://github.com/OpenLoco/OpenLoco/wiki
https://www.tt-wiki.net/wiki/Category:L ... evelopment
Find new graphics easier:
GRFCrawler -> http://grfcrawler.tt-forums.net
BaNaNaS -> https://bananas.openttd.org/
32 bit gfx in OTTD (32bpp) -> https://wiki.openttd.org/en/Community/N ... 20graphics
TTDPatch 2.6 -> viewtopic.php?f=19&t=67694
How to subtract tax from income (workaround) -> viewtopic.php?t=89763&start=20
How to ban distance from income -> Simple Cargo Decay Override
User avatar
luk3Z
Traffic Manager
Traffic Manager
Posts: 197
Joined: 25 Dec 2005 17:42
Location: Kielce, Poland (Mars sometimes)

Re: Reverse engineering in OLoco & ORCT2

Post by luk3Z »

And now for something completely different - RE in RCT (knowledge partly apply to Loco):

Modding RollerCoaster Tycoon into a Peele Horror Film (Game Modding/Reverse Engineering Tutorial):
https://www.youtube.com/watch?v=1MOrjGZ4hbo

[Game Mod Code Deep Dive] Modding RollerCoaster Tycoon into a Peele Horror Film:
https://www.youtube.com/watch?v=PYOUgevLRfc
Find new graphics easier:
GRFCrawler -> http://grfcrawler.tt-forums.net
BaNaNaS -> https://bananas.openttd.org/
32 bit gfx in OTTD (32bpp) -> https://wiki.openttd.org/en/Community/N ... 20graphics
TTDPatch 2.6 -> viewtopic.php?f=19&t=67694
How to subtract tax from income (workaround) -> viewtopic.php?t=89763&start=20
How to ban distance from income -> Simple Cargo Decay Override
Post Reply

Return to “Locomotion Problems, FAQs and Tutorials”

Who is online

Users browsing this forum: No registered users and 19 guests