.lco files and engine stats editing?

Creating and Editing Rollingstock
User avatar
Sabratha
Hobo
Posts: 11
Joined: Fri Dec 06, 2013 8:06 am

.lco files and engine stats editing? Unread post

Hello,

I know that the engine stats (speed etc) are in the .lco files. I wanted to edit the stats of some existing engines (not add new one, just edit).

I know this is done by a hex editor, but I don't know which part edits which stat.

Currently I wanted t start by editing the shinkansen series 0 expiry date. In the game its 1995, but in relaity these trains ran until 2008.
So for starters I just want to change the expiry date of this engine from 1995 to 2008. Can anyone tell me which file part is responsible for the expiry dates? :?:
User avatar
Tomix
Brakeman
Posts: 105
Joined: Sun Sep 29, 2013 9:58 pm

Re: .lco files and engine stats editing? Unread post

I remember seeing a thread on here with all the details for .lco files. I can't remember where it is though.
User avatar
Hawk
The Big Dawg
Posts: 6503
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: .lco files and engine stats editing? Unread post

You might find some useful info in the following files found on this page: http://hawkdawg.com/rrt/rrt3/Xtras/Tips_Tuts_Utils.htm

RT3 Notes by PJay and Milo

Hex Editing Building Planner Spread-Sheet by Michael (WP&P) Rountree

Trainmaster Rolling-Stock Developer Kit by Ned Fumpkin

RRT3 Engine Building Tutorial by Kimmo (Bombardier) Jaske
Hawk
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: .lco files and engine stats editing? Unread post

Availability date is not in the .lco file. It's in the .car file.
CAR file spec (272 bytes)
============================
000 : 4 : EA03 0000 : 1002
004 : 4 : int : car group
008 : 4 : int : car id (not always unique !!)
012 : 60 : in-game car name
072 : 60 : LCO file name
132 : 30 : 3DP file name
162 : 30 : DDS/TGA file name (sometimes same for loco/tender, sometimes different)
192 : 60 : IMB file name (CarSideView_1.imb or CarSideView_2.imb, CarSideView_3.imb for CtC trains)
252 : 4 : int : engine id (loco+tender, for each CarSideView a new count)
256 : 2 : ? : 0101
258 : 4 : int : start year
262 : 2 : ? : 0101
264 : 4 : int : stop year
268 : 4 : float : car-weight (empty/full?)
272
User avatar
Sabratha
Hobo
Posts: 11
Joined: Fri Dec 06, 2013 8:06 am

Re: .lco files and engine stats editing? Unread post

Hawk wrote:You might find some useful info in the following files found on this page: http://hawkdawg.com/rrt/rrt3/Xtras/Tips_Tuts_Utils.htm

RT3 Notes by PJay and Milo

Hex Editing Building Planner Spread-Sheet by Michael (WP&P) Rountree

Trainmaster Rolling-Stock Developer Kit by Ned Fumpkin

RRT3 Engine Building Tutorial by Kimmo (Bombardier) Jaske
How do I download? The site doesn't seem to recognize me being logged in.
User avatar
Hawk
The Big Dawg
Posts: 6503
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: .lco files and engine stats editing? Unread post

Probably because you're not. As it states at the top of every page in the archives:
Please Note:
If you are a forum member, your forum log in info will not work for the archives. You must create a separate account for the archives.
Note.jpg
Note.jpg (74.53 KiB) Viewed 7356 times
You'll need to create a separate account for the archives.
Unfortunately, due to bandwidth abuse and spammers, I have disabled registration for new accounts for the time being. I may enable it again in the future.
However, if you'll send me the following information via Email or PM (don't post that info in a post), I can create an account for you.

Name
Email Address
Username
Password

Also, you might want to read this topic in the forums about multiple installs, if you plan on installing the 1.06 patch or Trainmaster.

viewtopic.php?f=82&t=2363

Hawk
Hawk
User avatar
Sabratha
Hobo
Posts: 11
Joined: Fri Dec 06, 2013 8:06 am

Re: .lco files and engine stats editing? Unread post

Thanks guys, I'm now registered.

Unfortunately the info available on hex editing the files is either a bit too vague for me to find the proper position coordinates, or too complicated for someone with my limited hex editing experience
User avatar
Tomix
Brakeman
Posts: 105
Joined: Sun Sep 29, 2013 9:58 pm

Re: .lco files and engine stats editing? Unread post

I know that feeling. I can't continue my Thomas rollingstock set due to the .lco and .car files.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: .lco files and engine stats editing? Unread post

Shouldn't be too hard to figure out. I've attached a screenshot from the relevant file for the first loco in my installation. These are the files that are named ************_L.car or ************_Loco.car.

The start and stop years are highlighted. What is probably messing you up is the formatting, which is Little-Endian hex. They do this just to annoy you, but you can outsmart them. :mrgreen:

In hex, the last column at the right is ones (same as decimal). This is just the base raised to the power of 0. Anything to the power of zero is 1, whether the base is 2 or 8 or 10 or 16.

The second last column is the base to the power of 1, which is 16 in the case of hex (10 in the case of decimal of course). Third last column in hex counts in increments of 256 (base to the power of 2).

That's for "normal" hexadecimal, which is called ""Big Endian" because it puts the biggest values first, much like normal decimal does. RRT3 hex files uses the opposite order (Little Endian) with the smallest values first. This is done for programming reasons and is a bit of a nuisance. You just have to flip the order for it to make more sense.

Taking the start year for this locomotive, the bytes are 9A 07 00 00. Flip the order of that and you get 00 00 07 9A. The leading zeros are unimportant, so the value in question is actually 79A.

That's (7 x 256) + (9 x 16) + 10 when converted to decimal, and equals 1946.

The end year is A8 07 00 00, which equals 1960 in standard decimal. (0!!0)
Attachments
loco_car_file_start_stop_years.png
loco_car_file_start_stop_years.png (17.81 KiB) Viewed 7301 times
User avatar
Sabratha
Hobo
Posts: 11
Joined: Fri Dec 06, 2013 8:06 am

Re: .lco files and engine stats editing? Unread post

Thanks, I figured it out. Turns out the main problem was me using a hex editor (tinyhex) that wasn't displaying the dec lines in the same system as Pjay's notes.

I tried XVI32 hex editor and it does use the same dec lines as Pjay's notes, so suddenly everything started making sense.

Here's the fixed Shinkansen .car file.
http://speedy.sh/7Xx3t/shinkansen-series.car

Now, as it should it becomes obsolete in 2007. Its a pretty usefull engine, so you now get 10 more years to use it.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: .lco files and engine stats editing? Unread post

I only play steam. :mrgreen:
User avatar
Sabratha
Hobo
Posts: 11
Joined: Fri Dec 06, 2013 8:06 am

Re: .lco files and engine stats editing? Unread post

Gumboots wrote:I only play steam. :mrgreen:
Ah a classic engine player. Now that I finally have a grasp on the hex editing here, I may look into the stats of other engines as well.
User avatar
Hawk
The Big Dawg
Posts: 6503
Joined: Fri Nov 10, 2006 10:28 am
Location: North Georgia - USA

Re: .lco files and engine stats editing? Unread post

Have you seen this thread?

viewtopic.php?f=67&t=3441

Just pointing it out so you don't do something someone else has already done. ;-)
Hawk
User avatar
Sabratha
Hobo
Posts: 11
Joined: Fri Dec 06, 2013 8:06 am

Re: .lco files and engine stats editing? Unread post

Hawk wrote:Have you seen this thread?

viewtopic.php?f=67&t=3441

Just pointing it out so you don't do something someone else has already done. ;-)
Thanks, I'll certainly go and see what's being said up there.
User avatar
Altoona+BeachCreek
Conductor
Posts: 211
Joined: Wed Jun 27, 2012 8:44 pm
Location: Altoona, PA-Former PRR Shops!

Re: .lco files and engine stats editing? Unread post

I still hav not the slightest clue on anything hex, |--0 but you figuring it out so fast gave me hope. I'll have to try it again some day. Stupid GG1 having stupid "acceptable" passenger rating... Stupid, stupid stupid
"Train roll on, on down the line. Take me many miles from my home."
User avatar
Sabratha
Hobo
Posts: 11
Joined: Fri Dec 06, 2013 8:06 am

Re: .lco files and engine stats editing? Unread post

Altoona+BeachCreek wrote:I still hav not the slightest clue on anything hex, |--0 but you figuring it out so fast gave me hope. I'll have to try it again some day. Stupid GG1 having stupid "acceptable" passenger rating... Stupid, stupid stupid
Here's how I did it:

1) Download the: "RT3 Notes by PJay and Milo".
2) Then download a hex editor called XVI32.
3) Make a copy of one of the .car files (for example the shinkansen).
4) Open the copy of that file with XVI32
5) Look for one of the parameters mentioned in the "RT3 Notes by PJay and Milo".
6) Try changing one of the more visible parameters (starting date would be a good idea).
7) Backup the original .car file and launch the game using the modified .car file.
8) Check if the starting date indeed changed to what you intended.

Let me know if you still have issues. As I said: for me the first big mistake was using the wrong kind of hex editor.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: .lco files and engine stats editing? Unread post

If you don't like XVI32 (I wasn't that keen on it) I have tried HxD and HexEditorNeo. Both are pretty good. I ended up going with the (paid) Standard of HexEditorNeo, largely because of the awesome bookmarking ability.
Laie
Cat
Posts: 2
Joined: Thu Jan 02, 2014 12:48 pm

Re: .lco files and engine stats editing? Unread post

This is the thread that I got when I asked google for "rrt3 lco format". Not much useful information so far, but I found out at least a few things and will post them here.

Code: Select all

00000000: d507 0000 4d6f 6775 6c4c 0000 0000 0000  ....MogulL......
00000010: 0000 00cd cdcd cdcd cdcd cdcd cdcd cdcd  ................
00000020: cdcd 0000 4842 0000 7042 0000 a040 0000  ....HB..pB...@..
00000030: 003f 1005 0000 0001 0000 0005 0000 0000  .?..............
00000040: 04a6 4700 0000 0000 00c0 4000 803b 4601  ..G.......@..;F.
00000050: 0000 cd02 0000 0003 0000 00              ...........
Above is the unadultered hexdump of an lco file. Below follows a modified one with placeholders for the values I found out:

Code: Select all

00000000: d507 0000 4d6f 6775 6c4c 0000 0000 0000  ....MogulL......
00000010: 0000 00cd cdcd cdcd cdcd cdcd cdcd cdcd  ................
00000020: cdcd 0000 VMAX 0000 FRWG 0000 POWR 0000  ....HB..pB...@..
00000030: 003f 10XX 0000 00YY 0000 00ZZ 0000 0000  .?..............
00000040: 04CO_ST00 0000 0000 00CO_NS00 80MN_TC01  ..G.......@..;F.
00000050: 0000 cd02 0000 0003 0000 00              ...........
Where:
VMAX = V_max, maximum Speed
FRWG = Free weight
POWR = Pulling Power
CO_ST = Cost (price)
CO_NS = Consumption (Fuel economy)
MN_TC= maintenance

XX = Accelleration
YY = Passenger Appeal
ZZ = Reliability

The Two-Letter thingys are actually only small numbers 00-05 where 00 means "very poor" and 05 is "very good".
The four-letter words are actual dwords I don't really understand: for V_max, I get this picture:

Code: Select all

4842 hex =  16968 decimal -> 50 MPH
b841 = 16842 -> 23 MPH
cc42 = 17100 -> 102 MPH
Well, all I can say is that higher numbers make the train go faster (or more expensive, more consumption, ...) -- I can't figure out the formula behind those numbers.

Things to note:
Fuel Consumption in the game is represented by terms like "above / below average" just like reliability or passenger appeal. However, it's more fine-grained than that. In my game files, I found values between 083f (outstanding) and 2041 (abysmal).

Someone who can do it better than I could should perhaps explain that little-endian thing. Some people are bound to be confused.

What the stuff means:
V_max, Cost, Maintenance, Appeal and Acceleration are quite straightforward.

"Free Weight" and "Pulling Power" demand some explanation, though. "Pulling Power", in and of itself, would be simple: think of it as a Horsepower or Kilowatt value of the engine's power. A more powerful engine can handle heavier loads and/or steeper grades. However, the game developers added the concept of "Free Weight" to make things more confusing. I don't even know if one should take that term, "Free Weight", too literally -- I've seen it in some table somewhere and thought I'd better stick with it, if only because it's the established name. Anyways, it's another knob that adjusts how an engine manages heavy loads and steep grades. I presume that Free Weight is a kludge to keep the game interesting. I've read that in real life, even a 1% incline requires twice the power (compared to level track). But in the game, 4-6% isn't too uncommon, often unavoidable. With real-life physics, an engine powerful enough to handle a 5% climb could probably pull *any* load in the plains.

Fuel Consumption isn't something you see in the game as such -- it only shows up as running cost in the ledger. Especially, it doesn't mean that your water lasts any longer -- the distance between refills is the same for all steam locomotives.
Last edited by Laie on Fri Jan 03, 2014 4:57 pm, edited 1 time in total.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: .lco files and engine stats editing? Unread post

All of this was already known and has been noted earlier in this thread and in other threads before this one, so I'm not sure how you got the idea that there was "Not much useful information so far".

As far as I can tell, the reliability rating doesn't affect oil consumption. Oil and water and sand are consumed at the same rate for all steam locos. The reliability rating only affects the chance of breakdowns. Yes, the chance of breakdowns does increase as oil level drops, and this will have a worse effect on less reliable locos, but the oil level still drops at the same rate for all.
Laie
Cat
Posts: 2
Joined: Thu Jan 02, 2014 12:48 pm

Re: .lco files and engine stats editing? Unread post

Gumboots wrote:All of this was already known and has been noted earlier in this thread and in other threads before this one, so I'm not sure how you got the idea that there was "Not much useful information so far".
In this thread? No sirra. There's the explanation of the .car file and that's that. As to other threads explaining this, if they exist, I didn't find them (and I did more than one search). The one thread that's mentioned a few times above ( viewtopic.php?f=67&t=3441) holds much discussion on how some loco or another should be slower or stronger than it currently is, and quite a lot about skinning, but if there is any mention of .lco format I managed to miss it, twice (I just browsed the whole thread again and didn't see a thing).

I didn't expect my findings to be "new", but seeing as I couldn't find that info anywhere I had to discover the stuff myself (making me easily the ten-thousandth person to do so). I then posted it where I think it will be found, namely in the thread that came up high in the results when I was looking for this, and that already explains the other file's structure. Maybe someone else will be spared from reinventing the wheel.
As far as I can tell, the reliability rating doesn't affect oil consumption. Oil and water and sand are consumed at the same rate for all steam locos. The reliability rating only affects the chance of breakdowns. Yes, the chance of breakdowns does increase as oil level drops, and this will have a worse effect on less reliable locos, but the oil level still drops at the same rate for all.
Ready, test, ...ooops?
I once played a scenario where the improved oil consumption of the better locos had a huge impact, but a quick test right now shows no difference whatsoever. *shakes head*
I'll edit my previous post accordingly.
Post Reply