Evil Genius at work

Discussion of Pop Top's last release of RRT.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Evil Genius at work Unread post

Wolverine@MSU wrote:If someone skilled at using Blender were so inclined, I'm sure a custom "loco" could be coded that consisted of a team of 4 horses, complete with moving legs.
The moving legs is the hard part. The cart and horses are easy, but RT3 locomotive files aren't really set up to do walking horse legs. They'll only do connecting rods and pistons. However, if you want steam-powered horses on rollerskates, that would be easy. :mrgreen:
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: Evil Genius at work Unread post

Thanks for the links, RulerofRails.

I was starting to wonder what kind of math was being used in the game. What you posted in the thread about events lines up with what i have been seeing. I also think that the source of the error I experienced was not related to the YYYYMM trigger, but rather a sort of "divide by zero" collapse of the event engine. In repeating the event, it was repeating passenger production -75%. With straight math -75 + -75 = -150, or negative passenger production. Whereas percentages are usually multiplication 0.75 x 0.75 = 0.5625 or 56.25% , not a negative number.

So, I finally hammered out a solution using a monthly test against the game year: Always True - (one time event) if GY > 1799 AND if GY <1810 then X affects the whole world, with all the effects being set to expire the month before the next event.

But with the % being used as straight addition/subtraction, it would be perhaps better to have written a more complex (or maybe simple) series of events:

Event A causes global effect during 180001 (YYYYMM) through 180912;
Event B triggers beginning of month 181001 reversing all effects of Event A;
Event C causes global effect during 181001 through 181912;
Event D triggers beginning of month 182001 reversing all effects of Event C;
Event E causes global effect during 182001 through 182812;
Event F triggers beginning of month 182901 reversing all effects of Event E

The sad thing is that I can likely achieve most of these effects with the yet-to-be-done custom locos. Still, it is good to know all the "personality" of the game's event engine. All those little things that make you head-desk because you didn't know before one of broke everything :lol:

Still haven't ventured into slow date yet - been too busy cutting down the money tree - scratch that, money orchard. I've gotten it pared down that it's actually challenging the first 10years. You set up here, the commodities you need are over there... bonds? Not if you're bleeding cash and your company's net worth is tied up in industries that have all been losing money for 3 years before you bought them on the cheap :lol:

Still need to figure out how to get the AI players to be more frisky. I had one connect to one of my cities for the first time ever in this last set of tests. It made me wonder, do Competitors pay you anything for using your company's rails? Or is it just human players that have to pay? I don't see any money notification of it in the scrolling "I never read that unless it's green or red" stuff. Nothing noted in the Ledger either. If not, just typical AI cheating, nothing new there.
Gumboots wrote:The moving legs is the hard part. The cart and horses are easy, but RT3 locomotive files aren't really set up to do walking horse legs. They'll only do connecting rods and pistons. However, if you want steam-powered horses on rollerskates, that would be easy.
Isn't that what everyone wants? I'll figure something out, even if all they do is hop up and down a bit as they move along :lol:
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Evil Genius at work Unread post

Just Crazy Jim wrote:I haven't seen a thread on making custom locomotives yet, mostly because I haven't looked. But I foresee that I will be looking into that relatively soon. I guessing it can be as simple as cloning and re-skinning an existing engine, like Tim (Itsa Timmy) Gabel's "Dorchester" and Kimmo (bombardiere) Jaske's "South African Rwy Class 25". With the difficulty scaling up to Gumboots' "Suburban Tank Double Header" and "Shay Double Header".
The Shay double header was actually very easy, because it required no modelling or skinning work at all. I simply set another Shay loco as a tender, by making some minor edits to .lco files, etc.

The Suburban Tank was a remodelling of the default P8, so did require some mesh work and remapping of UV's, but it's still done on the default P8 DDS image with just a few edits. Very little graphics work was required. Again, the double header version is just edits to a few files, so no big deal.

The actual mesh modelling is very easy with Blender, even if you want to build an entire locomotive from scratch. The hard parts are:

1/ deciding how brutal you are going to be with simplifying the prototype for use in the game (this is where I got lost on the Schools class). Some testing I did indicated that a total count of verts+tris around 3,000 should be ok. Default locos are often around the 2,000 mark and are fine, but a test model I made at around 4,300 (H10 Mikado double header) was starting to put too much load on.

2/ figuring out how to map all the UV's for best effect. This can drive you bonkers. :roll:

3/ making a top notch skin in Photoshop, that doesn't look like a drunken gorilla found a box of crayons. This can also drive you bonkers. (0!!0)

...is a locomotive with the Reliability value set at 01 appreciably worse than one with the value set at 02?
Yes. Definitely. The breakdown chance follows a parabolic curve (y = kx^2, if you remember your high school maths).

So far it's starting show positive results... mostly. The learning curve for making hex-hacks is a bit uncharitable.
Which editor are you using? Some of them are more user-friendly than others. Although I must admit hex files are not friendly by nature. I have made screenshots of some files with various elements highlighted for clarity, if you'd find those useful.

If this starts to look promising, I will get to work on making custom content locomotives for the prototypes. A team of horses as a locomotive will be the closing phase of this madness. I've never done much with Blender, mostly because the interface gives me a tendency to cuss the paint off the wall.
I know what you mean, but it's amazing how clear it suddenly becomes if you start with their Noob to Pro tutorials. You cannot just jump into Blender and expect it to all be intuitive. Anyone who tries that invariably goes nuts.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Evil Genius at work Unread post

Just Crazy Jim wrote:Thanks for the links, RulerofRails.

I was starting to wonder what kind of math was being used in the game. What you posted in the thread about events lines up with what i have been seeing. I also think that the source of the error I experienced was not related to the YYYYMM trigger, but rather a sort of "divide by zero" collapse of the event engine. In repeating the event, it was repeating passenger production -75%. With straight math -75 + -75 = -150, or negative passenger production. Whereas percentages are usually multiplication 0.75 x 0.75 = 0.5625 or 56.25% , not a negative number.
The way the game does "percentages" is to always use a percentage of the original base value. It never uses a percentage of the current value.

So if you have four consecutive events that reduce a variable by 25% each time, you end up at zero instead of ending up at 31.6% (which is where you would expect to be). It's nuts, and I don't know why they did it what way, and yes it's definitely a bit of a trap.

The sad thing is that I can likely achieve most of these effects with the yet-to-be-done custom locos. Still, it is good to know all the "personality" of the game's event engine. All those little things that make you head-desk because you didn't know before one of broke everything :lol:
Welcome to RT3 coding. You'll love it. ^**lylgh

If you want to, you can make any number of "custom locos" quickly and easily, then re-jig their stats to suit yourself. Just pick a default model like the Planet and rename of bunch of them to different custom locos for testing (needs .lco and .car edits for each one). If you want different skins to distinguish them just do a basic colourise or something. We can give you tips on the process if you want them.

Gumboots wrote:The moving legs is the hard part. The cart and horses are easy, but RT3 locomotive files aren't really set up to do walking horse legs. They'll only do connecting rods and pistons. However, if you want steam-powered horses on rollerskates, that would be easy.
Isn't that what everyone wants? I'll figure something out, even if all they do is hop up and down a bit as they move along :lol:
Ah. Now that you could do. What you could do is make the horses as "locomotive pistons" for game purposes. So your cart would be the standard loco body, with wheels and all, and the connecting rods would be invisible. You would also need an invisible "ghost" drivewheel in the middle of the horses. By playing around with drivewheel stroke you can adjust how much the horses move vertically (in simple harmonic motion, or near enough) and if you wanted to you could also offset the piston attachment point to get the horses to surge forwards and backwards slightly.
User avatar
RulerofRails
CEO
Posts: 2064
Joined: Sun Dec 08, 2013 1:26 am

Re: Evil Genius at work Unread post

Just Crazy Jim wrote:Still need to figure out how to get the AI players to be more frisky. I had one connect to one of my cities for the first time ever in this last set of tests. It made me wonder, do Competitors pay you anything for using your company's rails? Or is it just human players that have to pay? I don't see any money notification of it in the scrolling "I never read that unless it's green or red" stuff. Nothing noted in the Ledger either. If not, just typical AI cheating, nothing new there.
There's some ideas in this thread. The general idea is to give them an extra advantage over the human player.

The AI seem quite picky about which two cities form a good "starting pair". As mentioned in the thread I linked, flat ground is best and a city by a river is no good. Generally a map with city size more close to a uniform medium size is better than having a few large ones and more small (as in reality). So basically a geographically boring map is better for the AI. "Go West" isn't a geographically boring map so it isn't great for AI, as you have discovered.

When considering the "starting pairs" that are allowed (who knows how they chose exactly), my personal observation is that they use the color coding of what industries are profitable to help decide. If they find two nearby cities with "green" industries, they are more likely to start a company in order to build that starting connection.

PS. The AI running on your track will be awarded to the Mic. Revenue (as shown in ledger) for your company. There is no notification, just cash to your account.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: Evil Genius at work Unread post

Some data on the files I'm hacking for this insane 1800-starting scenario. Welcome to the wall of text! I welcome your feedback.

Files modded for 1796 (04 07):

BuildingTypes\
..Bakery.bca
..Brewery.bca
..FarmCattle.bca
..FarmDairy.bca
..FarmGrain.bca
..FarmSheep.bca
..Farm Corn.bca
..Farm Orchard.bca
..Iron Mine.bca
..Logging Camp.bca
..Lumber Mill.bca
..Munitions Factory.bca (1)
..Weapons Factory.bca (2)
..Oil Well.bca (3)
..PaperMill.bca
..Port.bca
..Textile Mill.bca (4)
..Tool And Die.bca
..Warehouse.bca

CargoTypes\ (5)
..Ammunition.cty (1)
..Oil.cty
..Weapons.cty

EngineTypes\ (5)
..TankA.car (6)


1) probably will be changed back to 1848

2) to simulate ship building

3) to simulate whale oil

4) by no means was New England USA = Liverpool/Manchester UK, but American whalers and other sailing ships primarily used woolen sails and those were (probably) made somewhere in New England

5) The 3 year lag for the production economy (freight) after starting the scenario gives me to think part of the problem lies in the fact that the date in the CTY files may be linked to the "cargo walking" economy that competes with rail. The CTY and CAR files for all the cargos may need to be changed to start in 1796 to get freight cargos and the industries using them started during the seeding phase. The default start date for most CAR files is 1800 (08 07 @ position 258, 259)... *sigh* more files to hack. At this rate I am beginning to wonder how many layers are in this layer cake. :-|

6) !#2bits#! I am not sure that I understand why PopTop went with no real Era A tanker. I think we're all familiar with the Budweiser Clydesdales and the wagon laden with kegs they pull. Early transport of salted meat and liquids (other than milk) was placed in barrels and placed on a flatcar in a manner similar to beer wagons or placed on-end in a gondola or a fenced flatcar. AFAIK, the earliest true tankers appear circa 1865 as large tubs on flatcars for the purpose of transporting petroleum crude (a liquid shipping design which continued to be used well into the 1890s for molasses and water, most oil barons were not the sort to spend money on that sort of thing until steel prices started to come down in the late 1880s), before that, petroleum crude was barreled and shipped in the same manner as beer barrels and hogsheads of salt pork/salt beef/salt fish would be.
Gumboots wrote:If you want to, you can make any number of "custom locos" quickly and easily, then re-jig their stats to suit yourself. Just pick a default model like the Planet and rename of bunch of them to different custom locos for testing (needs .lco and .car edits for each one). If you want different skins to distinguish them just do a basic colourise or something. We can give you tips on the process if you want them.
Yes, please? :lol:
Gumboots wrote:Which editor are you using? Some of them are more user-friendly than others. Although I must admit hex files are not friendly by nature. I have made screenshots of some files with various elements highlighted for clarity, if you'd find those useful.
The editor I'm using is Hex Edit 4.0 by Expert Commercial Software Pty Ltd (http://www.hexedit.com) - it's a little friendlier than most resource hacker apps I've used in the past, but has a few quirks that took getting used to.
RulerofRails wrote:There's some ideas in this thread. The general idea is to give them an extra advantage over the human player.

The AI seem quite picky about which two cities form a good "starting pair". As mentioned in the thread I linked, flat ground is best and a city by a river is no good. Generally a map with city size more close to a uniform medium size is better than having a few large ones and more small (as in reality). So basically a geographically boring map is better for the AI. "Go West" isn't a geographically boring map so it isn't great for AI, as you have discovered.

When considering the "starting pairs" that are allowed (who knows how they chose exactly), my personal observation is that they use the color coding of what industries are profitable to help decide. If they find two nearby cities with "green" industries, they are more likely to start a company in order to build that starting connection.
Thank you for the link. What say here and what I see in the thread lines up with my observations. It's a sort of "path of least resistance to profit" coding. I may need to squash the terrain a wee bit, and/or make Canada a little more "interesting" for the AI.
RulerofRails wrote:PS. The AI running on your track will be awarded to the Mic. Revenue (as shown in ledger) for your company. There is no notification, just cash to your account.
AH! now I understand! I may have a whole new strategy for this game... when I get to play it again, that is... :lol:

...now... I really need to read this whole thread from start to finish, follow all the links, read those threads, then come back and reply to all the things you fine Tycoonians have posted. Or I could sleep... Sleep is for the weak!

I may be weak.... !!jabber!!
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Evil Genius at work Unread post

6) !#2bits#! I am not sure that I understand why PopTop went with no real Era A tanker. I think we're all familiar with the Budweiser Clydesdales and the wagon laden with kegs they pull. Early transport of salted meat and liquids (other than milk) was placed in barrels and placed on a flatcar in a manner similar to beer wagons or placed on-end in a gondola or a fenced flatcar. AFAIK, the earliest true tankers appear circa 1865 as large tubs on flatcars for the purpose of transporting petroleum crude (a liquid shipping design which continued to be used well into the 1890s for molasses and water, most oil barons were not the sort to spend money on that sort of thing until steel prices started to come down in the late 1880s), before that, petroleum crude was barreled and shipped in the same manner as beer barrels and hogsheads of salt pork/salt beef/salt fish would be.
Interesting. I didn't know that. It would be easy to make an A era tanker if there was a use for it.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: Evil Genius at work Unread post

The evolution goes something like this:
Barrels on-end on a flatcar
Barrels on-end on a flatcar
index.jpg (16.01 KiB) Viewed 6168 times
A gondola specifically for barrels of flour
A gondola specifically for barrels of flour
Important enough that someone patented the idea
Important enough that someone patented the idea
Still clinging to the idea of tubs
Still clinging to the idea of tubs
Here the family tree separates - the tubs go off to become hoppers, the barrels go on to become tankers
The better idea
The better idea
half-way there
half-way there
et Voila!
et Voila!
Last edited by Just Crazy Jim on Fri Oct 21, 2016 11:39 am, edited 2 times in total.
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: Evil Genius at work Unread post

Well, a new bug to figure my way through. It seems that Watto Game Extractor and Windows 7 (x64) do not like each other very much.

I am starting to think it's time to regress this beast to Windows XP :D
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Evil Genius at work Unread post

You shouldn't need to use Watto. I tried to use it some time back (can't remember if that was on my old XP box or on W7) and found it was a PITA, so went with other tools. If you're trying to unpack and repack PK4's there's a handy command line script that works perfectly.

Idiot-proof instructions here and here (re-packing). !*th_up*!

The tool itself is in the Trainmaster dev kit. If you don't want to download that, I can attach the relevant bits.

Edit: Oh yeah I forgot, you don't actually need to use the CLI for unpacking and repacking PK4's. You can do it just by double clicking the batch file.

I should go through this stuff and sort out new instructions that account for everything. For instance Windows PowerShell is great if you need to rename a stack of files, as is fairly common, and that requires using the CLI.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Evil Genius at work Unread post

Just Crazy Jim wrote:
Gumboots wrote:If you want to, you can make any number of "custom locos" quickly and easily, then re-jig their stats to suit yourself. Just pick a default model like the Planet and rename of bunch of them to different custom locos for testing (needs .lco and .car edits for each one). If you want different skins to distinguish them just do a basic colourise or something. We can give you tips on the process if you want them.
Yes, please? :lol:
Ok. :-D

It's basically all just renaming the .3dp and .dds files to have your new loco's name instead of the original, and then editing the loco's .lco and .car files and the tender's .car file to have the new name too. It really is that simple. You don't even have to pack the .3dp and .dds files into a PK4 if you don't want to. I usually do it anyway, simply because it keeps the ExtraContent folders a lot cleaner and easier to deal with. I already have every steam loco (including custom ones) unpacked on my box. Let me know if you want a unpacked "kit" for one.

Say you're starting with the Planet. The .3dp files for it are:

PlanetL_TrackPoint.3dp
PlanetL_TsmokeLiteGreyC1.3dp
PlanetT_body.3dp
PlanetT_bogie1.3dp
PlanetT_bogie2.3dp
PlanetT_bogie3.3dp
PlanetT_bogie4.3dp
PlanetT_LengthPoint.3dp
PlanetT_TrackPoint.3dp
PlanetL_body.3dp
PlanetL_bogie1.3dp
PlanetL_bogie2.3dp
PlanetL_bogie3.3dp
PlanetL_bogie4.3dp
PlanetL_LengthPoint.3dp
PlanetL_light1.3dp

So you'd rename those to:

GrasshopperL_TrackPoint.3dp
GrasshopperL_TsmokeLiteGreyC1.3dp
GrasshopperT_body.3dp
GrasshopperT_bogie1.3dp
GrasshopperT_bogie2.3dp
GrasshopperT_bogie3.3dp
GrasshopperT_bogie4.3dp
GrasshopperT_LengthPoint.3dp
GrasshopperT_TrackPoint.3dp
GrasshopperL_body.3dp
GrasshopperL_bogie1.3dp
GrasshopperL_bogie2.3dp
GrasshopperL_bogie3.3dp
GrasshopperL_bogie4.3dp
GrasshopperL_LengthPoint.3dp
GrasshopperL_light1.3dp

Do the same with the .dds skin files. You need to haul out the "BeautyShot" (the scenic image you see in the loco stats pop-up) and profile icon (for your train list) which have to be dug out from some of the big PK4's too, and rename those. The profile icon needs a _Profile.imb to call it.

After that it's just .lco and .car edits. Rename those files to match the new loco's name. Edit their innards to call the new .3dp and skin names. Tweak pulling power and other stats to suit.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: Evil Genius at work Unread post

Thank you! Thanks to your brilliant instructions I am most of the way through my first attempt at making a locomotive clone. At the moment, I am facing 2 problems.

1) I've unpacked all the PK4s in the backup install of RRT3 and cannot find the base Planet beauty shot with the naming convention you specify (*_Profile.imb). I did locate this file in the IMB PK4: PlanetL_NE.imb, which I renamed to PenydarrenL_NE.imb. The CAR files specify a file: CarSideView_1.imb, but it seems most every PopTop Loco and Tender CAR call this file.

2) In the LCO file, the section with long sections of CDs is followed by 00 00 C8 41 (positions 34-37 inclusive) - PJay's notes on LCO files indicates that the speed goes here and no matter how I turn it, I don't arrive at those figures coming to 25 (Aside: the in-game top speed of the Planet is 25, although historically, the Planet ran (without consist) a sort of victory lap at Rainhill with a top speed of 35 m.p.h.). How do I calculate what to place in those bytes to set the top speed as 5 m.p.h.?

My guess it setting the top speed isn't a straight forward thing.

The Pen-y-Darren locomotive had great power (it pulled 20 tonnes of coal with ease) and great reliability (except for breaking the cast iron track), but was troubled by speed, traction (climbing) and acceleration. After being made stationary, the Pen-y-darren engine remained in service at the namesake mine for nearly 80 years, so I think it reasonable to say it was reliable and economical to use, thus great fuel economy. Which brings me to ask is 1 m.p.h. over irregular terrain at normal game speed something anyone wants to play? 1800 to 1810 goes by fairly quickly, but still...

Anyway - so far, so good, just need to find that rascally rabbit... erm... loco beauty shot
The great gobwallow of files
The great gobwallow of files
Edit: In viewing the LCO for the Fairlie 0-6-6-0 the top speed is (00 00 90 41), the documentation says that is 18 m.p.h., but this doesn't help me figure out what figure to place in my Pen-y-darren. I remember enough of my maths to know that 200 (hex C8) - 144 (hex 90) does not result in 7 (hex 07), so I am going to throw a wild guess into the air and say top speed is some manner of factorial (?) related to the weight of the locomotive?
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: Evil Genius at work Unread post

Well, now... I thought I had it worked out, poaching the _Profile stuff from Itsa Timmy's Dorchester - which conveniently has the same number of letters in the name as Penydarren, but I get the bong of doom and the game crashes to the desktop.

I checked my work, I had renamed everything, even had remembered to hack the renamed Dorchester_profile.imb to point to Penydarren_Profile (a DDS file in this case, although the IMB file seems to want a TGA file), so now I'm confuzzled. Also there is a weird name displaying "0ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ" (not certain about how many ÌÌÌÌÌs) given as missing a profile.
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Evil Genius at work Unread post

The top speeds are floats*, not integers. If you want a 5 mph top speed, use 00 00 A0 40 for the hex. To do much RT3 coding your hex editor needs to have a normal English to floats converter, otherwise you'll go nuts.

No, top speed has nothing to do with loco weight. You can make it weigh nothing and set top speed to 1,000 mph if you like. The game doesn't care.

*Can explain what those are if you haven't heard of them. I hadn't when I started.

The "beauty shots" are in 2D/rt3_2DDS.PK4 and are named as AdlerL_NE_A etc.

The bong of doom may be because you forgot the 00 byte after the name. Or could be something else. If you get fed up with it and can't find the problem, post the files up here and I'll take a look at them.

And you don't need to call CarSideView1 if you don't want to. Not for locomotives anyway. Don't get me started on !!^@%!&! custom cargo cars. :roll:

Then again, if you're just rejigging stats on a default loco you might be happy with the default profile icon too, in which case it should work.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Evil Genius at work Unread post

Just Crazy Jim wrote:I checked my work, I had renamed everything, even had remembered to hack the renamed Dorchester_profile.imb to point to Penydarren_Profile (a DDS file in this case, although the IMB file seems to want a TGA file)...
Don't worry about the text in the file that mentions TGA. The game will accept TGA but prefers DDS.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: Evil Genius at work Unread post

Gumboots wrote:The bong of doom may be because you forgot the 00 byte after the name. Or could be something else. If you get fed up with it and can't find the problem, post the files up here and I'll take a look at them.
You got it on the first guess! I had neglected to add a 00 byte after the name in the files. I will make another 4PK. But I have a question about the internal name in the IMB file. It directs to the PlanetL_NE for now, which is good since (for now at least) I'm making a clone of the Planet.

But later, when I retexture the loco or make a new model, I would change that to point to "PenydarrenL_NE" inside the IMB file?

And, when it comes time to do that, do I over-type the 20s? Or, is it safe to add bytes for the changed name?

So far the list of files in the PK4 are:

Code: Select all

PenydarrenL_A.dds
PenydarrenL_B.dds
PenydarrenL_body.3dp
PenydarrenL_bogie1.3dp
PenydarrenL_bogie2.3dp
PenydarrenL_bogie3.3dp
PenydarrenL_bogie4.3dp
PenydarrenL_C.dds
PenydarrenL_D.dds
PenydarrenL_E.dds
PenydarrenL_F.dds
PenydarrenL_G.dds
PenydarrenL_LengthPoint.3dp
PenydarrenL_light1.3dp
PenydarrenL_NE.imb
PenydarrenL_NE_A.dds
PenydarrenL_NE_B.dds
PenydarrenL_NE_C.dds
PenydarrenL_TrackPoint.3dp
PenydarrenL_TsmokeLiteGreyC1.3dp
PenydarrenT_A.dds
PenydarrenT_B.dds
PenydarrenT_body.3dp
PenydarrenT_bogie1.3dp
PenydarrenT_bogie2.3dp
PenydarrenT_bogie3.3dp
PenydarrenT_bogie4.3dp
PenydarrenT_C.dds
PenydarrenT_D.dds
PenydarrenT_E.dds
PenydarrenT_F.dds
PenydarrenT_LengthPoint.3dp
PenydarrenT_TrackPoint.3dp
Penydarren_BeautyShot_A.dds
Penydarren_BeautyShot_B.dds
Penydarren_BeautyShot_C.dds
Penydarren_Profile.imb
Penydarren_Profile_A.dds
Have I missed anything?
Gumboots wrote:And you don't need to call CarSideView1 if you don't want to. Not for locomotives anyway. Don't get me started on !!^@%!&! custom cargo cars.
Heh, I read your post about that earlier this morning while looking for a solution to my errors on the "letter to the editor" portion of the forum. I had a very similar problem doing edits of the Gamefont file for Civilization 4, another one of those "image file with mapping hard-coded in the exe" sort of things... The air was colorful in my computer room for weeks :lol:
Gumboots wrote:Can explain what those are if you haven't heard of them. I hadn't when I started.
Yes, please do. Hacking the RRT3 files, I have seen "float(ing point)" references a good deal lately, back when I tried my hand at some light programming in C (for Neverwinter Nights), my instructors said "avoid them at all costs" and "find another way". Beyond that, all I know is that they work as a sort of "zip file" to express non-binary data in a binary system (such as non-integer values like Pi (3.1415...etc)). So, I have heard of them, but no one has ever really explained how to translate them from XX into a real world number or the reverse. :lol:
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: Evil Genius at work Unread post

Welll, a half-success...
Success.jpg
Or_not.jpg
This is farther than I've gotten until now. At least I'm not getting the bong of doom!

I was sure I had everything done properly, so at this point, I need a 2nd set of eyes to check my work. If you would, Gumboots, please take a look at the files and see where I've gone wrong.

On a happier note, I have set the scenario to start in 1804 and this seems to have solved the problem of getting the freight economy started during the map seeding phase. I suspect there is something hard-coded into the EXE that balks at populating certain buildings onto the map before 1800 even if the associated BCA and CGO files have been hacked to allow their start date set to 1796.
Attachments
Penydarren.rar
(702.24 KiB) Downloaded 150 times
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Evil Genius at work Unread post

Just Crazy Jim wrote:But later, when I retexture the loco or make a new model, I would change that to point to "PenydarrenL_NE" inside the IMB file?
AFAIK you can call it anything you like. For instance, when I made my Berkshire I called the images A1_Berkshire_BeautyShot_A etc and used this in the .imb file.

Code: Select all

TGAName A1_Berkshire_BeautyShot
TGA etc...
And, when it comes time to do that, do I over-type the 20s? Or, is it safe to add bytes for the changed name?
Most of the RT3 files have fixed lengths, but the .imb files are one of the exceptions. With .imb files you just adjust the length of the file to suit whatever names you are putting in.

The important bit is to have the correct syntax for the beginning/end bytes for each section. So you have to keep the default text descriptions, and the 0D 0A before each of them, and the 20 after them. Apart from that, just go for it and type in whatever you want. !*th_up*!
So far the list of files in the PK4 are:

Code: Select all

PenydarrenL_A.dds
PenydarrenL_B.dds
PenydarrenL_body.3dp
PenydarrenL_bogie1.3dp
PenydarrenL_bogie2.3dp
PenydarrenL_bogie3.3dp
PenydarrenL_bogie4.3dp
PenydarrenL_C.dds
PenydarrenL_D.dds
PenydarrenL_E.dds
PenydarrenL_F.dds
PenydarrenL_G.dds
PenydarrenL_LengthPoint.3dp
PenydarrenL_light1.3dp
PenydarrenL_NE.imb
PenydarrenL_NE_A.dds
PenydarrenL_NE_B.dds
PenydarrenL_NE_C.dds
PenydarrenL_TrackPoint.3dp
PenydarrenL_TsmokeLiteGreyC1.3dp
PenydarrenT_A.dds
PenydarrenT_B.dds
PenydarrenT_body.3dp
PenydarrenT_bogie1.3dp
PenydarrenT_bogie2.3dp
PenydarrenT_bogie3.3dp
PenydarrenT_bogie4.3dp
PenydarrenT_C.dds
PenydarrenT_D.dds
PenydarrenT_E.dds
PenydarrenT_F.dds
PenydarrenT_LengthPoint.3dp
PenydarrenT_TrackPoint.3dp
Penydarren_BeautyShot_A.dds
Penydarren_BeautyShot_B.dds
Penydarren_BeautyShot_C.dds
Penydarren_Profile.imb
Penydarren_Profile_A.dds
Have I missed anything?
Doesn't seem to be missing anything, as far as I can tell on my first cup of coffee on Sunday morning (which is always a dodgey call) but you don't need to include Penydarren_BeautyShot_A.dds, Penydarren_BeautyShot_B.dds and Penydarren_BeautyShot_C.dds if you are using the L_NE naming for those images.
Gumboots wrote:Can explain what those are if you haven't heard of them. I hadn't when I started.
Yes, please do. Hacking the RRT3 files, I have seen "float(ing point)" references a good deal lately, back when I tried my hand at some light programming in C (for Neverwinter Nights), my instructors said "avoid them at all costs" and "find another way". Beyond that, all I know is that they work as a sort of "zip file" to express non-binary data in a binary system (such as non-integer values like Pi (3.1415...etc)). So, I have heard of them, but no one has ever really explained how to translate them from XX into a real world number or the reverse. :lol:
Ok, you asked for it. :mrgreen:

Their official title is IEEE-754 single-precision floating-point format. Yes, they are as gruesome as that makes them sound. You don't really need to know the mathematical theory behind them. My eyes glazed over rapidly, and I usually like maths. All you need to know is that they're intractable mongrels of things for humans to deal with, and the only sane option is to use a nifty gizmo that will do the conversion for you. This is the important bit. (0!!0)

You're using HexEdit. I looked at that back when I was trying to find a good free hex editor for people to use. It seemed very good, definitely the best freebie I found, although I can't remember everything about it. Anyway, it has a decimal to float converter built in. Take a look in the Help and see if you can track it down. IIRC it worked in the usual manner, being visible in a sidebar if enabled. If you can't find it, give me a yell and I'll install it again and take a look.

And in case you're wondering, I use the standard (not free) HexEditorNeo myself. It has awesome bookmarking functionality (custom colour highlighting of an infinite number of groups) and at the time it only cost me $20 US (the Australian dollar was getting around $1.20 US back then). The visible group bookmarking has saved my brain on many occasions.
User avatar
Gumboots
CEO
Posts: 4830
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: Evil Genius at work Unread post

Just Crazy Jim wrote:Welll, a half-success...

This is farther than I've gotten until now. At least I'm not getting the bong of doom!

I was sure I had everything done properly, so at this point, I need a 2nd set of eyes to check my work. If you would, Gumboots, please take a look at the files and see where I've gone wrong.

On a happier note, I have set the scenario to start in 1804 and this seems to have solved the problem of getting the freight economy started during the map seeding phase. I suspect there is something hard-coded into the EXE that balks at populating certain buildings onto the map before 1800 even if the associated BCA and CGO files have been hacked to allow their start date set to 1796.
I'll take a look at the files later today. Maybe tonight (I think I'm about 10 hours time difference to you).

Good that you got the seeding thing figured out. There are all sorts of unmarked traps whenever anyone tries anything out of the ordinary with this game. You'll probably find more of them that nobody ever knew about.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: Evil Genius at work Unread post

Gumboots wrote:Ok, you asked for it. :mrgreen:

Their official title is IEEE-754 single-precision floating-point format. Yes, they are as gruesome as that makes them sound. You don't really need to know the mathematical theory behind them. My eyes glazed over rapidly, and I usually like maths. All you need to know is that they're intractable mongrels of things for humans to deal with, and the only sane option is to use a nifty gizmo that will do the conversion for you. This is the important bit. (0!!0)
I think I had the same eye-glazing effect viewing the page I saw following that link.

Part of what confused me is the order of the couplets is reversed from what I expected. Ex.: where the top speed of 5 m.p.h. is 00 00 A0 40 in the Penydarren LCO file and I was expecting 40 A0 00 00. In fact, when I used the several floating point converters I found online, they all gave the order as 40 A0 00 00 (or 4 x 1.25) for 5. This backwards order and using 4 couplets for a float seems a bit more difficult that it has to be, especially when as an integer the possible range of 00000000 to FFFFFFFF gives a spread of 0 to 4,294,967,295, even accounting for a negative bit creeping in, that's still a range of 0 to 2,147,483,647, which should sure be more than any locomotive should need for a top speed. I am beginning to see why my instructors said to avoid them. :lol:
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
Post Reply