Page 1 of 17

LocoTool V0.4.3 [30 Oct 2004]

Posted: 13 Sep 2004 17:06
by Patchman
The latest version is always at http://www.ttdpatch.net/loco/

Ignore the _src, _dll and _dyn zip files, just download the regular LocTool one for the latest version.

[old text]

I've been working on a couple of programs which should eventually allow the inclusion of new objects in Locomotion. This is a lot easier than in TTD, so all I have to do is decode the object file format.

Here's the first step, two programs to decode vehicle object files and write the vehicle stats in an xml file, available at http://www.ttdpatch.net/loco/locotools.zip and some sample xml files A380 Cattle truck 2 EMU1 HG 2/3 Hopper

All comments welcome, especially on the xml structure!

They're console mode programs, so don't expect any fancy buttons or windows or anything...

To look at a vehicle's data, first use objdump to decompress the file and then dmptrans to translate the data to xml. There's still some data missing in the xml file (descriptions/translations, required objects and of course the graphics), I'll be working on those the next few days and hope to have a fully working codec soon.

PS: Many thanks to the RCT Technical Information Depot for information on the basic file format.

Posted: 13 Sep 2004 17:09
by Born Acorn
already on top of loco, I see! :P

Posted: 13 Sep 2004 17:09
by orudge
Yay, will go and play with this very soon. :)

Posted: 13 Sep 2004 17:17
by leech1984
Sweet!! Cant wait for all the things you make/find out

Posted: 13 Sep 2004 17:29
by Patchman
By the way, here's the meaning of all the variables you can set...

A "variable" entry is something I know what it means.
A "unknown" entry is something I don't understand yet.
  • class = what does it run on, 0=rail, 1=road, 2=air, 3=water
  • nummods = how many track modifications are needed to run (e.g. 3rd rail); the specific ones will be in the "required objects" information which I don't decode yet
  • costind = purchase cost index (index into a table of base costs)
  • costfact = purchase cost factor (final cost = basecost[costind]*costfact)
  • runcostind = running cost index
  • runcostfact = running cost factor
  • numcompat = number of compatible vehicles, 0 if compatible with all
  • vehunk = mostly unknown structure, except
    • spriteind = seems to be an index into the sprite table
  • sprites = some information about which sprites to use
    • numdir = number of different view directions
    • flags = some flags, only one bit known so far
    • spritenum = first sprite to use for this
  • power = power
  • speed = top speed
  • rackspeed = top speed while on rack rail (and I think broken down speed for planes)
  • weight = weight
  • flags = vehicle settings
    • rackrail = whether vehicle can use a rackrail
    • dualhead = vehicle is dualheaded
    • refittable = vehicle is refittable
    • noannounce = vehicle will not be announced when it is new (this is set for train wagons)
  • visfxtype = how to draw the visual effect (what kind is set in the required object list)
  • wakefxtype = how to draw the wake effect (what kind is set in the required object list)
  • designed = year vehicle is designed, 0 if available from the beginng
  • obsolete = year vehicle becomes obsolete, 65535 if never
  • startsndtype = how to play the starting sound (what kind is set in the required object list)
  • numsnd = number of sound effects (the kinds are set in the required object list)
If you have an idea what any of the "unknown" fields mean let me know!

Posted: 13 Sep 2004 20:55
by mlw_1550
Josef, the man of the moment, once again! :D

Posted: 14 Sep 2004 00:40
by Mystic
mlw_1550 wrote:Josef, the man of the moment, once again! :D
I have to agree! Props to you Patchman!

I believe this will come in very handy, especially:

"obsolete = year vehicle becomes obsolete, 65535 if never "

I've always hated not being able to make steam engines after a certain date!

Posted: 14 Sep 2004 01:11
by PennCentral
Yay! GE Stepple cabs and Stephenson Interurbans aren't out of the question then. :D

Posted: 14 Sep 2004 06:06
by Singaporekid
Nice to see some steam enthusiasts here, hehe
Anyway, so is it possible to render our graphics with 3dsm max and blender?

Posted: 14 Sep 2004 07:03
by RaptorTycoon
singaporekid_92 wrote:Nice to see some steam enthusiasts here, hehe
Anyway, so is it possible to render our graphics with 3dsm max and blender?
Steamers are teh suck :twisted:

I cant wait till lomo-patch comes out, if ever ;)

I cant wait for the reliability issues being fixed.

But i must wait :p

Posted: 14 Sep 2004 07:11
by Singaporekid
Steamers are not the suck!, hehe
In locomotion, steamers have about the highest reliability i've seen

Posted: 14 Sep 2004 08:01
by Daan Timmer
singaporekid_92 wrote:Steamers are not the suck!, hehe
In locomotion, steamers have about the highest reliability i've seen
not true, those narrow gauge trains are by far more reliable then those steamers(not talking about the steaming narrow gauge locos)

and I must say, there arent that many steamers in game, as I like to see how they run with those wheels thingys how ya call 'm ?

those crossbars that connect the wheels with each other....

Posted: 14 Sep 2004 08:04
by Hyronymus
Get back ON topic, guys. Look at what the title suggests and what you are discussing here.

Posted: 14 Sep 2004 08:25
by Patchman
Alrighty then, an update. http://www.ttdpatch.net/loco/locotool_v0.02.zip

Now it's all in one, no more running objdump then dmptrans. Also it's called "locotool" now, it'll convert your vehicle dats into xml format again.

Now it includes all information from the .dat file, although I'm having some doubts about how best to add the sprites. Currently they're png files in CDATA sections, but that still stops the xml from being wellformed. Oh well... maybe I'll base64 encode them or something. It works fine for most vehicles, but not all of them for some reason.

Next step (after fixing that) will be to make it possible to encode those files again, but since I understand how everything works that shouldn't be too hard. And then to work on the other 32 object types...

Posted: 14 Sep 2004 08:34
by DeadFish
Mr Patchman , is choosing the size of map possible?

Posted: 14 Sep 2004 08:36
by Patchman
DeadFish wrote:Mr Patchman , is choosing the size of map possible?
Yes, you have three choices, 256x256, 256x256 or 256x256. Now stay on topic please!

Posted: 14 Sep 2004 08:45
by Severn
Patchman is Josef Drexler right?

Before everybody gets too excited, can I just add a few words of caution based on similar work that has gone on in the RCT2 arena?
  • There needs to be a database established so that new object makers can make sure that they don't reuse a filename and/or object handle that has already been allocated.
    Unlike RCT2 which has a 'save with objects' option, Locomotion does not. Based on 'missing object' posts here, it looks as though downloading a saved game which uses objects that you don't have will cause the game to crash.
    Chris Sawyer is still using a fixed memory model. Therefore the number of objects of each type that you can use in a scenario is fixed. Check out the scenario editor advanced tab for the limits.

Posted: 14 Sep 2004 09:21
by DeadFish
Yes, you have three choices, 256x256, 256x256 or 256x256. Now stay on topic please!
Well, since you are a programmer, i assumed u'd add some special code for choosing the size of map.

Posted: 14 Sep 2004 09:43
by RaptorTycoon
You cant just "add" a special code, its more complicated then that..

@ Patchman: What is now called LocoTools is like "LocoPatch" under a different name? or am i missing something?

Posted: 14 Sep 2004 10:52
by TBOT
raptortycoon wrote:@ Patchman: What is now called LocoTools is like "LocoPatch" under a different name? or am i missing something?
I'm not patchman, but I can answer the question. It's not a patch or something like that, it just are some tools which at the moment dump vehicle stats to a xml file, nothing more, nothing less.

And to patchman:
You're not free'ing your malloc'ed memory, tsssk ;)