Hex editing house.

Creating and editing buildings and Commodities.
zzc
Watchman
Posts: 65
Joined: Sat May 23, 2020 9:17 pm

Hex editing house. Unread post

I'd like to play around with house buildings, to increase the demand.

I have the building planner spreadsheet but I just cannot get the values to correspond with the house demands. The float - hex is really confusing.

Can anyone help with a step by step?
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Hex editing house. Unread post

Which hex editor are you using?
zzc
Watchman
Posts: 65
Joined: Sat May 23, 2020 9:17 pm

Re: Hex editing house. Unread post

XVI32 and HxD. Which is better?
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Hex editing house. Unread post

I don't like either of them. :D My comments about hex editors:

viewtopic.php?f=31&t=1107&start=20#p36376
and
viewtopic.php?f=31&t=1107&start=20#p36390

RoR uses HexEdit, and seems to like it: viewtopic.php?f=84&t=68&start=10#p43633
User avatar
RulerofRails
CEO
Posts: 2061
Joined: Sun Dec 08, 2013 1:26 am

Re: Hex editing house. Unread post

The links for HexEdit main site are dead. It seems the last update was in 2012. You can still get it here: https://hexedit.software.informer.com/4.0/

There seem to be a number of programs called "HexEdit", the one I'm using was developed by Expert Commercial Software Pty Ltd.

The good things about it are that it's completely free, no catches, and the UI is pretty classic for windows. Pretty simple, but gets the job done. I think it's good for people with little experience. If you try it, I could also try to help if you run into an issue.
zzc
Watchman
Posts: 65
Joined: Sat May 23, 2020 9:17 pm

Re: Hex editing house. Unread post

I get link is missing when I try your link ROR.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Hex editing house. Unread post

RulerofRails wrote: Thu May 28, 2020 10:55 amThere seem to be a number of programs called "HexEdit", the one I'm using was developed by Expert Commercial Software Pty Ltd.
Does that one have unlimited permanent bookmarks, that you can save between sessions, for any file or file type? IMO that's the main feature you really want for this sort of job. It makes things a lot easier on the brain.
zzc
Watchman
Posts: 65
Joined: Sat May 23, 2020 9:17 pm

Re: Hex editing house. Unread post

I managed to get the program, it displays a calculator when using the go to address option.

I've also found a float point converter online and tested it. The demand values are reversed - 0.05 is 3d 4c cc cd but entered as cd cc 4c 3d with a padding of 00 = 00 cd cc 4c 3d

There are 2 house types, with the large one having 4x the demands and passenger/mail.

Is there a way to force more large house to spawn?

Higher house demand = less available cargo[cargo is consumed faster], higher prices?

I'll start with medicine since it is consumed awfully slowly.
zzc
Watchman
Posts: 65
Joined: Sat May 23, 2020 9:17 pm

Re: Hex editing house. Unread post

It works perfectly, medicine demand changed to 1 and now it shows as 1. Previously 0.02.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Hex editing house. Unread post

I load per house per year will result in massive demand all over the map. ;)

zzc wrote: Thu May 28, 2020 9:10 pmI've also found a float point converter online and tested it. The demand values are reversed - 0.05 is 3d 4c cc cd but entered as cd cc 4c 3d with a padding of 00 = 00 cd cc 4c 3d
RT3 hex files use Little Endian format, which is the name for what you found out by yourself (all hex is front to back and arse frontwards). any hex editor should recognise this, although you may have to set it to Little Endian to start with. Should be fine once set though.

I'm pretty sure HexEdit includes a converter for floats/hex/decimal too. Most good hex editors have this built in. RoR will know how it works.
zzc
Watchman
Posts: 65
Joined: Sat May 23, 2020 9:17 pm

Re: Hex editing house. Unread post

Gumboots wrote: Thu May 28, 2020 11:32 pm I load per house per year will result in massive demand all over the map. ;)


That would be great for prices right? yum!!!!
User avatar
RulerofRails
CEO
Posts: 2061
Joined: Sun Dec 08, 2013 1:26 am

Re: Hex editing house. Unread post

I never used bookmarks. But they do exist, and they are saved from a previous session. Not sure how to make bookmaks for types of files though. I think templates are designed for that. When editing the bca files, it's not uncommon to even add new supply/demand/conversion functions. In other words, the file size can vary a lot, and the templates (at least the little I know about them) don't really like that. There is probably a way to use bookmarks or templates to make life very easy, I just didn't put the time in to dig right into it. Also, the info online for an older program is a little scarce.


What I did for editing bca files was to format my display. First thing is to change your address system to decimal (there is a button in the toolbabar or shortcut Alt+D).

The RT3 notes by Pjay and Milo, where Pjay gives specs of the main game files are a must have. In those we see that the header is always 55 characters long. Then each production entry (supply/demand/conversion) is 188 chracters long. The idea is to make your field of view visually a multiple of 188. 47 characters wide means each production entry will take up 4 lines. But also their attributes will line up visually in a column.

The last step is to change the offset at the start of the file (there is a little tab that you simply click and drag). To make each production enttry start at the beginning of a line use an offset of 42. There is a clue of where the start of some of the entries are: the first byte of any {Demand Only} entry is 01.


In order to make edits, the Properties box is your friend. If you don't have it on-screen already, right-click and it's the last option. The main tabs used for the bca files are Integer (16-bit) and Real. Make sure the Big Endian option is unticked for both. For the Real tab, select IEEE 32-bit format. If the boxes are greyed out, that means that the file is open as read-only. Right-click on the file and select "Allow changes."

The Properties box interprets the current data for you. But the neat thing is that you can also make changes with it. If you enter the value (in real numbers) that you want, then press Enter, the program automatically updates the file with the corresponding hex value. Easy. !*th_up*!
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Hex editing house. Unread post

That's a good dodge with display width. I have always set mine to 12 bytes wide, just because that was the sanest way of dealing with hex editing coordinates for loco models (X, Y and Z values line up in columns). Since nobody in their right mind will be modifying models by direct hex editing of mesh and UV's these days, the twelve byte width isn't really relevant anymore. I still love a good bookmarking system though. Having colour-coded blocks for each chunk of code means I can just dive into any file and not have to guess what the bytes are doing. :)
zzc
Watchman
Posts: 65
Joined: Sat May 23, 2020 9:17 pm

Re: Hex editing house. Unread post

Thanks everyone I got the house to demand more med concrete and electronic.

Now to try making a new factory using an existing building skins.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Hex editing house. Unread post

Take a look at BlackHawk's 1.06 building reskins. There's some good extra material in those. :)
zzc
Watchman
Posts: 65
Joined: Sat May 23, 2020 9:17 pm

Re: Hex editing house. Unread post

Which part of the main site? Reskins is all loco skins, and buildings has no user named blackhawk?
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Hex editing house. Unread post

zzc
Watchman
Posts: 65
Joined: Sat May 23, 2020 9:17 pm

Re: Hex editing house. Unread post

I have that already, to better find those buildings. Too many recipe warehouses make them difficult to differentiate. Thinking of a coal to oil factory. Or maybe just add that production cycle to another building.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Hex editing house. Unread post

Beware of having multiple production chains in one building. The problem is that it will always chose whichever chain is most profitable, so effectively it ends up only having one chain at a time. This can make things more difficult than intended. ;)

Although I have used it deliberately at times, with warehouses and ports. If you want them to chew up a bit of something, to make a demand centre for a cargo. If you want to keep demand more or less stable you don't want to flood the area with one product, because that will drop demand due to profitability going through the floor. But, if you set the warehouse up so it deliberately oscillates between one product and another, depending on local price at the time, then it will more or less make one product half the time and the other product the other half of the time. This can give a useful result in some circumstances.
zzc
Watchman
Posts: 65
Joined: Sat May 23, 2020 9:17 pm

Re: Hex editing house. Unread post

Could you give an oscillate example gumboots? I dont quite get your explanation.
Post Reply