Ask the Experts / Hex Edit Tutorials

  • Levis%s's Photo
    Hex-Edit Tutorial

    Finally, it’s time to tell you all something about Hex Editing. First of all I want to warn you, all the things I’m going to tell you I have found out my self or with help from others, there was no guide to explain what we needed to do so maybe some things could have negative side effects or don’t work in other versions of rct2 …

    What is Hex-Editing ?

    Hex editing is editing of the Memory of the game.
    Before you can understand what hex editing is you first need to understand how rct2 works.
    In rct2 we have some different kinds of files, these work together to make the game in combination with the memory.
    We have the following kind of files:

    ---

    cssXX.dat
    The css files have some data for rct2, like music. Most of the css files have music in them (you can play these .dat files in mediaplayer). Some other have other things in them which manage the style’s of rct2.

    g1.dat
    This is the Graphic Users Interface (a.k.a GUI) file of rct2. It contains all the “hard coded” images of rct2 and all the graphic images. if you open the GUI file with the RCT2GUIeditor you can see al those images. here is a little index of the first part of the GUI file.

    0 - 3042 - LANDTILES
    3042 - 3122 - IMAGES FOR RIDE CONTRUCTION
    3122 - 3861 - SUPPORT
    4915 - 5047 - COLOR PALETTE
    5047 - 6408 - PICTOGRAMS
    6409 - 11260 - PEEPS
    11261 - 11440 - HANDYMAN
    11441 - 11880 - MECHANIC
    11880 - 11972 - GUARD
    11972 - 12128 - PANDA
    12128 - 12324 - TIGER
    12324 - 12544 - ELEPHANT
    12544 - 12676 - GORILLA
    12676 - 12892 - SNOWMAN
    12892 - 13104 - KNIGHT
    13104 - 13376 - BANDIT
    13376 - 13608 - PIRATE
    13608 - 13764 - SHERIFF
    13764 - 13896 - ASTRONAUT
    13896 - 14184 - ROMAN

    After this there are the track elements, the first coaster track (looping coaster) starts at 15004

    XXXXXXXX.dat
    The object and rides files are a very large part of rct2, in these files the data and the images of the objects and ride cars is stored. As you probably know you can edit these files with the ridemaker and object editor and landmark maker.

    rct2.exe
    The rct2.exe file is the engine which put everything together, it takes the data from all the other things and makes a image of it, it also recognise which keys you press and adjust the data in the memory so it can make a new image.

    ---

    So that are all kinds of files rct2 use, they work together with the memory to create the things you see on your screen.
    For example we take the red fir tree.
    In the program rct2.exe we give the commando to build an object. Rct2.exe looks in the loaded savegame file to see which objects are used in this game and shows them in the menu.
    We click build the object and rct2.exe edits the mapdata in the memory so there is a red fir tree in it on the right square. If we now save the game that mapdata will be transferred to the savegame file so the red fir tree is stored in there to.
    To show the image of the red fir tree rct2.exe looks in the memory wich .dat file he must link to the object and loads that object file, than he can put the image of the red fir tree in it. In the memory is coded which direction the tree faces so rct2.exe knows which image to take.

    If we are going to hex edit we take the string which describes this red fir tree and edit this string.

    How does Hex Edit works

    To enable hex editing we first need a program that allows us to edit the memory. You can use every program you like but I use Winhack.
    The interface of winhack isn’t that complex.

    Posted Image

    In the left part you see the hex numbers of the memory and in the right part you see the Ascii variables.
    In the top you can chose the process you want to edit and in the bottom of the program you have a search function to search in the memory.
    In the screen you see a part of the mapdata which is empty, this are a few landtiles on normal height from grass.
    If you look good you see that every 8 blocks a new string starts, so on every row there are two land tiles. If we go to some more advanced hex editing you must always remember that every object which is on 1 tiles uses 8 blocks. If it is on more tiles it uses more but it is spread out.

    So now we take a closer look that the red fir tree again. First we need to find this object. There are many ways to find the object you want. I prefer to do it with the landtiles. If you make the piece of land on which the object is place unique you can find it if you know the codes. So first we need to know how the land tiles works.
    If we take a closer look at the land tile we see this string:

    Posted Image

    Now I shall explain what these numbers mean:

    1: This number is the view, by changing this number you can make the tile give a underground view etc.

    2: I’m not sure what this mean, but I think it means if there is something build on the tile or not.

    3: The height of the land tile

    4: The height of the side of the land

    5: This changes the shape of the land.

    6: This changes the type of land, here is a list of every type of land and the variable it uses, some land types requires an other view (this is because some of the land need to cross the border of the tile and some not, I think):

    view=00

    00 = grass
    20 = sand
    40 = dirt
    60 = rock
    80 = red rock
    A0 = tan dirt
    C0 = grass/dirt
    E0 = ice

    View=01

    00 = red grid
    20 = yellow grid
    40 = purple grid
    60 = green grid
    80 = red clay
    A0 = checker


    7: This manage the diffrend states in which the land tile can be (like mowed or not).

    8: This manage if you own the land and if there is a border etc.

    ---

    So now we know how the land tile is constructed we can find every tile on the map if we know how it looks.
    To find the red fir tree I have given the land the red rock ground so I can find it.
    I use the search option of winhack to find that landtile:

    Posted Image

    Now we find the red fir tree:

    Posted Image

    First you see the code of the land tile and after that there is the code of the red fir tree. All objects on a tile are behind the tile you see now.

    At the moment I can’t explain the code of the red fir tree completely but the things I do know are this:
    ---
    1: in combination with number 2 this defines that it is a red fir tree

    2: in combination with number 1 this defines that it is a red fir tree

    3: this is the height on which the object is place

    4: this is the height of the clearance

    5: I don’t know yet

    6: I don’t know yet

    7: I don’t know yet

    8: I don’t know yet
    ---

    So what now?

    Now we know the basics of Hex-Editing, now we can look to some ways to use this.
    I’m now going to explain some hacks that are only possible with hex-editing:

    Make every type of track invisible

    This hack is just a rip off out of the Codex topic, the FF method used in LL can also be used in rct2.
    First we make a track:

    Posted Image

    After that we put objects under it.

    Posted Image

    Now we search the tiles that have the objects on it:

    Posted Image

    We take the first block of the object (the selected in this screen):

    Posted Image

    And we change this block to FF.
    We do this also on the other land tiles.
    After that we go back to rct2 and we see:

    Posted Image

    And you will see that trains still can travel over it:

    Posted Image

    The theory behind this hack is that by changing the first block of a object to FF it becomes deleted, normally it would be moved to the last place of the mapdata but because you edit it now it stays in front of the other things so all things behind it looks removed to but aren’t. .
    The only letdown of this hack is that you can build anything above this object anymore but there are way’s to conquer this problem also. For example you can build the track first a lot higher and move the object up. Now use the FF method and after that lower the track by hex-editing or by using a alternate colorscheme. Now you are able to build objects on the same height as the track.

    Fix a Black hole

    A black hole glitch sometimes comes in a park. This error is very tricky, what happens is that the mapdata of the landtile is changed into something else, in this way rct2 misses a landtile and that cause the black hole.

    Posted Image

    You can fix the black hole in this way:

    First we build a landtile we can track next to the blackhole:

    Posted Image

    We search for the landtile, this is what I find:

    Posted Image

    You see that after the landtile there are two objects but ingame we don’t see any objects, so we will change those two objects in landtiles again:

    Posted Image

    In this way we recovered the landtile that was missing, the other thing will be removed later by the game so you can use it again.

    Posted Image

    And this is how it looks ingame.

    Thanks to faceman for providing the black hole

    Make a vertical Lift

    Now we start on the real track hacking. Till now we only used object and land tiles, now we are also going to change the track pieces.
    First let’s examine the track piece code:

    Posted Image

    --
    1: This is the direction of the track and or is has a lift or not, if the first number is a 0 the track has no lift and if it is a 8 it has a lift. The second number is the direction of the track.
    2: This defines it is a track
    3: The height of the track
    4: The clearance height of the track
    5: This defines which track element it is I’m still working on a complete list of this
    6: If you track is a brake in this block the brake speed is defined, and for multi tile element is says which piece of the element it is.
    7: don’t know yet
    8: This is the track ID
    --

    So now we know how the track piece is made we can make a vertical lift because we know where the lift is coded.
    So we build a coaster.

    Posted Image

    And go to winhack and search the land tiles where the vertical lift needs to be.

    Posted Image

    The green blocks are the land tiles and the other things are the track elements.
    To make the vertical lift we change al those first numbers in a 8:

    Posted Image

    if we now go back to rct2 we will find that the track goes up the vertical piece:

    Posted Image

    So we’ve got ourself a vertical lift.

    An X-car coaster

    This hack is the same hack as the Vertical lift only now we don’t take a vertical piece of track but a half looping.
    We will get this as result:

    Posted Image

    To get this we first build the coaster and search the land tiles again in winhack.
    No we change the first numbers in a 8 again like you see here:

    Posted Image

    And we’ve got ourself an X-car coaster.

    Make a entrance and exit invisible (but still working)

    The trick we used for the track we can use for other things to.
    In this part I will explain also how you can using theming in combination with this hack.

    First we build the attraction and the path, I used a invisible path for the first pieces but you can use a normal path to.

    Posted Image

    As you see I’ve made 4 parts a different ground colour. These are the parts we will need to edit. If we look for the first tile we’ll find these stings:

    Posted Image

    The green part is the landtile.
    The brown part is the object we build under the path (this is just decorative and won’t serve any purpose).
    The red part is the string of the path.

    We’re going to raise the entrance and exit and the paths. So we change the third block (10) of the red string to a higher number (for example 30). This would raise the path.
    Now we search the next tile which has the good landtype and change the same number (because I build on every tile the same amount of things I can just take the same thing, if you don’t have the same amount on your tiles you need to check which one you need to raise, you can check this by looking at the height of the object in the first place).

    After we’ve raised all the things we go back to rct2 and build a track under the entrance and exit.

    Posted Image

    Now we bury this track.

    Posted Image

    We bury this now because all the other things (like theming) the game will see as underground. If we make the entrance invisible now with the FF methode it wont make the other things invisible and won’t cause errors also.
    After you buried the track you can remove the track again.

    To use the FF methode we need to place a object under the entrance and exit, so we do this, and after that you need to know how high your land now is so you can find it in winhack again.
    So you can use the height markers to see the height and translate that to hex numbers (remember that the land height is 2 clearence every time and it goes from -7 to 121 )

    Posted Image

    You see for me it’s 15 so that would make:

    15*2+14 = 44
    44/16=2.75
    16*0.75=12 (12=C)

    So it makes 2C.

    Now we’re going to search for the land tile with height 2C and land 80 so that would make us search for 2C2C0080.
    This is one of the results:

    Posted Image

    You’ll see now first go the landtile than the object and than the entrance/exit building.
    We change the following things:

    Posted Image

    You see that we lower the land again and lower the entrance/exit building to his old height and make it invisible by starting the object with FF.

    After this you only need to do the same modification to the other landtile to and search the landtiles with the path and lower the path to the original height also.
    I first raise the path because else it won’t connect good anymore after you make it invisible (at least I noticed that when I first did the hack).
    After I did it like this it does connect good.

    Result:

    Posted Image

    I hope you have fun with this hack, and if someone has suggestions please post them.
  • Levis%s's Photo
    Working Duel Station

    This is a hack that many people wanted for a long time already. We know that it is possible in rct LL so it must be possible in rct2. Well here you have the way how it must be done:

    The duel station will actually be 2 track above each other with the car lowered, so first we make the first track:

    Posted Image

    Now we need to raise this track 1 clearence, if we raise this track with the edit ride screen we raise it 2 clearence so we could do it all with winhack. But there is another way to, we can also raise it with Object Manipulation. So first we make sure that object manipulation can recognise the track by place an landtype under it we haven’t used somewhere else.

    Posted Image

    Now we go to object manipulation and raise the track 1 clearence.

    Posted Image

    After this we need the second track to, because this track needs to be at normal height we could build it trought the other with zero clearance on, but this could cause white glitches so I prefer to build it above the other track and lower it with the edit ride screen. But as we know the edit ride screen don’t raise the station so we need to build that in later.
    You may have also noticed that with the object manipulation the station also didn’t raise, this is a bug in the 8-cars trainer why we need winhack.
    Here you see the track above the other track:

    Posted Image

    Now we lower it with the edit ride, and we build the station:

    Posted Image

    And here you see the result:

    Posted Image

    You see that I also give the land under that station an other ground type, this is so I can find it in winhack now, because I still need to raise that other station 1 clearence. So I go to winhack and search the tiles:

    Posted Image

    We need to raise the track elements 1 clearence so we take there height and raise it with 1. we could also raise the clearance height of this track element to but it doesn’t matter if you do it or not.

    Posted Image

    I prefer to raise the exit of the ride to but you could also let the entrance at this height, you could also chose for lowering the ride entrance (or don’t raise that one with the object manipulation if possible).
    If you do want to raise the exit you need to make sure that you take that one to so search the memory with “Find Next” so you find the exit also:

    Posted Image

    Now we’ve got this:

    Posted Image

    Both rides can now be tested but 1 is still 1 clearence higher. We can solve this problem by putting the tracktype on “Shop (All types)” , but before we do this we first need to put the ride to test because a shop can’t be tested, so now you need to make all the adjustments to the ride that you want (like color of the train and the waiting time etc).
    So after you put it to test you can change the track type to shop all types:

    Posted Image

    After this you only need to build a new station and s curve at the place of the old ones because the went invisible.
    I have build the station in opposite direction to make the change of errors minimal but there are also ways in which you can get the station in the other way (you need to think them up by your self by now).

    Posted Image

    And we’ve got our self the Working Duel station now.

    How to change the size of the map without removing the rides

    This tutorial will describe how to change the mapsize without going to the SE. the process can be quite hard so if you have a choice, always choose to go back please.
    This tutorial requires some knowledge of the game so if you have never done hex editing before please stop reading now.

    The size of the map is stored in the savegame. So this is what he need to change. In rctll the size was just 2 bytes. but in rct2 this is incresed to 8 bytes. I don't know what all the numbers mean so we have to take a eleborate way to change this.
    Now I make a simple map which is 100*100 in the SE and I save this as a scenario. then I open it and save it as a savegame. this will be my game to show you how to do it. you can do this with whatever game you want.
    I use a program called RCTRLEdecode2.00b and I open my savegame in there.
    I use the decode option to get a (partly) decoded version of the savegame (note: this can be done with the rct2sgm also). The reason I choose for the rctrle decoder is cause it splits the game in some basic parts (called chunks).
    Chunk 6 is the part where the Game Data is stored so I go there.
    Now I go to adress 272478 this is where the mapsize is stored.
    For me it looks like this (the piece which is lined in red is the piece which is important):

    Posted Image

    You'll see it says 600C7E0D64005F0C. now I dont know what the bold things mean. but the thing which is underlined is the mapsize (64 is 100 in decimals).
    Now comes the real trick. just changing the 64 to the number you want wont do the trick so we need to get the data we need. This is how I do it.
    I now close my park and open this park in the SE. now all my rides are gone, but thats not important cause this is only to get data.
    I now open winhack and take the process rct2.exe and I search for the string I just found in the rledecoder.

    Posted Image

    You'll see the same string here now also. Now I'm going to change the mapsize in the SE.
    After you've done that check what data it says now.

    Posted Image

    Now you see for me it changed to A012BE1396009F12. This means I changed my mapsize to 150 (cause thats 96 in hex).
    Now I remember this string and I leave the SE again and I go to my savegame again.
    I now change the previous string with the one i found in the SE. When you go back to rct2 you'll see you'r map is increased in size.
    Now i dont know how this will affect the peeps and the entrances etc. but till now I haven't found any bugs with it.

    The End

    Now this is my gift to the community for now, I hope you guys like these tuts and I hope this solves some problems :) .
    I will try to update these tut’s with new things or improvements, and if somebody has comments please say it.
    Great thanks to the majesty members and rctrevalutions for checking the tuts for errors.
    Also thanks to some of the members of this site for supporting me with this.
    And thanks to Kumba for keeping this site alive.
  • Casimir%s's Photo
    Un...be...lie...va...ble...!
  • Evil WME%s's Photo
    Lovely levis. Took some time to figure that all out, and write it down so precisely. I've fixed black holes before but i had never gotten to anything concretely.

    A nice addition might be how to make any station 'adjacent' (As to synchronize stations, that aren't). The inspiration for this trick comes from the fact you can build 'fake' stations inbetween different stations and still be able to synchronize not totally adjacent (but parralel) stations. From there i played around, in the end what works is build one small station block on both sides of the different stations. Both should be of the other ride, the one you're trying to synchronize it with. You can do this with winhack, as well, of course (definitely faster, and easier, but not necessarry. All you have to find in winhack is the box where it numbers the stations (from 00 to 03). Change the number 01, to 00. That way the station will be 'the same station' as on another part of your map. Explaining it like this, without the pictures might be a reach, anyone that figures this out is welcome to add the pictures and exact position of these station numbers. Building a different station and changing the ride types accordingly works as well, of course. I think i'm the first one to introduce this little trick in outpost prehistorica, there's a nice use there but this extra option is quite nice (especially for fantasy oriented parks, i think). You could launch two flyers on top of each other, one flying and one lay-down at the start, geehwzz ;P.

    The duel station hack is nice, though the train does look like it's floating slightly this way, right? It's probably not too bad i guess. Anyways, major thumbs up!
  • Magnus%s's Photo
    That duel station hack you are doing there is probably the most difficult way possible to get it done.

    Just merge two rides so that the stations are on the same height, but the tracks on different levels (i.e. rapids station on coaster). Then use the guide to make the track that is on the wrong height invisible.

    End of story ...
  • X250%s's Photo
    Levis, you are a God at hacking! This guide is excellent, and makes perfect sense. However i think it will take a bit of getting used to for me to use this without thinking "wtf?", all those numbers will get me confused really easy lol. I'll try some stuff out though, thanks. :)

    -X-
  • Levis%s's Photo

    Lovely levis. Took some time to figure that all out, and write it down so precisely. I've fixed black holes before but i had never gotten to anything concretely.

    A nice addition might be how to make any station 'adjacent' (As to synchronize stations, that aren't). The inspiration for this trick comes from the fact you can build 'fake' stations inbetween different stations and still be able to synchronize not totally adjacent (but parralel) stations. From there i played around, in the end what works is build one small station block on both sides of the different stations. Both should be of the other ride, the one you're trying to synchronize it with. You can do this with winhack, as well, of course (definitely faster, and easier, but not necessarry. All you have to find in winhack is the box where it numbers the stations (from 00 to 03). Change the number 01, to 00. That way the station will be 'the same station' as on another part of your map. Explaining it like this, without the pictures might be a reach, anyone that figures this out is welcome to add the pictures and exact position of these station numbers. Building a different station and changing the ride types accordingly works as well, of course. I think i'm the first one to introduce this little trick in outpost prehistorica, there's a nice use there but this extra option is quite nice (especially for fantasy oriented parks, i think). You could launch two flyers on top of each other, one flying and one lay-down at the start, geehwzz ;P.

    The duel station hack is nice, though the train does look like it's floating slightly this way, right? It's probably not too bad i guess. Anyways, major thumbs up!


    I will talk to you about that station hack on AIM so you can explain it to me in dutch :p .
    the duel station hack has no glitch the train doesn't float a bit because you use the shop as track, in Nostalgia Vale I have used this hack.

    @ magnus -> there are many ways to do things, everyone has his own hacks, I prefer this methode at the moment and I'm willing to share it with others.

    @ X250 -> you get used to it after a while :) .
  • posix%s's Photo
    wow levis, just wow.
  • RCFanB&M%s's Photo
    Wow, this tut is just amazing....although it'll take a long time for me to get used to it :p
  • Kumba%s's Photo
    As much as I want to delete this topic coz of how much it gives away, I guess LL has codex, so RCT2 can have this.
  • Carl%s's Photo
    Oh come on Kumba, where is your sharing spirit? :lol:

    Tremendous work, Levis, you are the "Hack-Master"
  • posix%s's Photo

    I want to delete this topic coz of how much it gives away

    :lol:
  • zodiac%s's Photo
    All those who nominate Levis as the "Roomie of RCT2" please say I...

    I...
  • sfgadv02%s's Photo
    Beautiful guide Levis, thanks for shairng. :D
  • Ling%s's Photo
    I

    oh my freaking god... that's amazing! -ly confusing...
  • Milo%s's Photo
    Very awesome stuff there Levis. I'm so glad you took the time to do these. I'm going to try some of this stuff in LL...
  • Turtle%s's Photo
    Bloody hell. The lengths some people go to... I'm amazed.
  • RCTNW%s's Photo
    That is awesome! Excellent work Levis

    By the way "I"
  • Levis%s's Photo

    Wow, this tut is just amazing....although it'll take a long time for me to get used to it :p


    lol :p .

    @ turtle -> do you mean it is insane that I figured this out or do you mean something else with that :p ?
  • RCTFAN%s's Photo
    I think turtle is just amazed at how serious everyone takes the game now and the lengths they go to make it even more deep and complex. Well done on firguring this out Levis, i'll give it a go sometime!

Tags

  • No Tags

Members Reading