Any ideas to mod railroads?

Predator145

Prince
Joined
May 22, 2020
Messages
455
Unlimited movement of rails is one of the aspects I'd like to change. This is however not possible with the editor. And there is no way to change the road multiplier at a certain point within the game either.

That leaves me with getting rid of railroads as an option. I could make a production boosting building available with steam engine to compensate for shields. But food is much harder. The Quintillus editor has a "+1 food in water" flag for buildings but none for other tiles. I could give irrigation +2 food but that just like road multiplier is not something you could time with a tech and would lead to a drastically different early and mid game.

So are there any other ways to mitigate the movement effects of rails while still preserving the post steam engine food and shield output without breaking early game?
 
A search of the Creation & Customisation will reveal many, many threads on this topic, and none with overly satisfying answers. The main drawback to the land-transport approach is that the AI will not use them and therefore become extremely disadvantaged. It's a big shame because the implementation of roads/railroads is probably one of my least favourite aspects of Civilization 3.
 
I could give irrigation +2 food but that just like road multiplier is not something you could time with a tech and would lead to a drastically different early and mid game.
If you increased the irrigation output, as a compensation you could also give all the early-game governments (Despot to Feudalism) the Despot-penalty, but leave the late-game govs without it (Demo to Fascism); you could also add a 'Modern Republic' and/or a 'Constitutional Monarchy' gov(s) — with Steam, or maybe Nationalism — which had all the same settings as the Ancient versions, but were non-penalised.

By revolting to one of the non-penalised govs, (irrigated) food- (and mined shield) outputs could thus be increased by +1 around the time of Industrialization, even without Rails — albeit at the cost of a second Anarchy period (likely longer than the first, unless you also gave all the tribes the 'Religious' trait, as @Civinator did in CCM).

Bears mentioning that you can also adjust irrigation outputs per each terrain-type, so you could have irrigated Grass produce more food (+2f?) than irrigated Plains (+1f), for example — or allow Hills to be irrigated (+1f, -1s?), but disallow irrigation of Deserts (0f).
 
If you increased the irrigation output, as a compensation you could also give all the early-game governments (Despot to Feudalism) the Despot-penalty, but leave the late-game govs without it (Demo to Fascism); you could also add a 'Modern Republic' and/or a 'Constitutional Monarchy' gov(s) — with Steam, or maybe Nationalism — which had all the same settings as the Ancient versions, but were non-penalised.

By revolting to one of the non-penalised govs, (irrigated) food- (and mined shield) outputs could thus be increased by +1 around the time of Industrialization, even without Rails — albeit at the cost of a second Anarchy period (likely longer than the first, unless you also gave all the tribes the 'Religious' trait, as @Civinator did in CCM).

Bears mentioning that you can also adjust irrigation outputs per each terrain-type, so you could have irrigated Grass produce more food (+2f?) than irrigated Plains (+1f), for example — or allow Hills to be irrigated (+1f, -1s?), but disallow irrigation of Deserts (0f).

Despot penalty isn't something i've thought of. That's one way to tech time food, commerce and shield output. Unfortunately even after a -1 penalty an +2 food irrigated grassland will still yield 3 food if I'm not mistaken. This would still drastically change the early game as settler factories can be created much more easily. Not sure if that helps the AI or the human more.

Giving everyone religious sounds great as anarchy is tedious, unfun and prevents the player to utilize different govs. I could make 2 cheap new worship buildings available with an untradeable tech only OG religious civs start with. Everyone else builds double priced temples and caths. This gives the trait the ability to stack double of the amount of happiness+culture buildings. But I need to come up with another bonus to compensate for OG religious civs now that everyone has half of their perks. Otherwise religious would be pretty useless to a warmonger like me.

Right now I'm leaning towards removing rails and giving +2 irrigation to all irrigatable terrain, tundra and dessert extra food as well as another +1 food from water building. This should help cities grow to at least size 12 even with low food terrain. It will speed the game up a lot.

Post steam engine mobility can be compensated with land transports. A 4 movement train unit sounds good. Let's hope with auto production and air transport flag+land unit flag the AI would make use of it.
 
Predator145, when giving all civs the religious trait, in my eyes it leads to far better results to assign another trait to the civs that originally had the religious trait. In that case also take into consideration, that now a GA based on GWs must fullfill the religious trait too, even for civs, that didn´t have that trait in their original settings. If you need an inspiration about other traits for civs that originally did start with the religious trait, you can have a look into my mods CCM1 and CCM2.

About railroads: Unfortunately we forgot to ask Antal1987 about a fix of the infinite movement for railroads in Civ 3. May be a master in hexediting could find the key line about switching the infinite movement for railroads into other movement factors. Concerning railroads, Civ 3 seems to be very similar to Civ 2. For decades in Civ 2 there was only the option to adjust the movement factor of roads, but not the infinite movement for railroads, until TNO found the decisive passage in the code and with his Civ2 TOTPP now the movement factor for railroads can be adjusted as it is for roads - for Civ 3 for us normal human beeings this unfortunately at present is not possible.

I think you are only reflecting about C3C games on random maps - and here the landtransport in my eyes in games against the KI is defenitely no proper solution. If you think the speed for units in the last eras should be accelerated, you can give them simply more movement points. For the food supply in the later eras in my eyes it is more easy to add some new resources that provide the additional food and shields, than to experimentise with the irrigation factor.

For fixed maps there are some other options to break the infinite railroad movement. You can interrupt the railway by tiles that don´t allow to build any roads and railroads on them and add a resource to that tile, that looks like the continuation of the rails, or you can even use a chain of mini-teleporters or even change the airlift function to railroad-connections (but here you must be very careful in your plannings, so your railroad (airlift) connection doesn´t allow you to send your 'trains' over the oceans).

Here are some screenshots about the solution of interrupted rails that are connected with resources, that are looking like rails, that I have used in the scenario SOE. So in that scenario there doesn´t exist any Civ 3 railroads and I only used railroad graphics for roads and their interruptions to create tons of 'microzones' on the map, this methode can also be used with real Civ 3 railroads.
Spoiler :






 
Last edited:
Predator145, when giving all civs the religious trait, in my eyes it leads to far better results to assign another trait to the civs that originally had the religious trait. In that case also take into consideration, that now a GA based on GWs must fullfill the religious trait too, even for civs, that didn´t have that trait in their original settings. If you need an inspiration about other traits for civs that originally did start with the religious trait, you can have a look into my mods CCM1 and CCM2.

About railroads: Unfortunately we forgot to ask Antal1987 about a fix of the infinite movement for railroads in Civ 3. May be a master in hexediting could find the key line about switching the infinite movement for railroads into other movement factors. Concerning railroads, Civ 3 seems to be very similar to Civ 2. For decades in Civ 2 there was only the option to adjust the movement factor of roads, but not the infinite movement for railroads, until TNO found the decisive passage in the code and with his Civ2 TOTPP now the movement factor for railroads can be adjusted as it is for roads - for Civ 3 for us normal human beeings this unfortunately at present is not possible.

I think you are only reflecting about C3C games on random maps - and here the landtransport in my eyes in games against the KI is defenitely no proper solution. If you think the speed for units in the last eras should be accelerated, you can give them simply more movement points. For the food supply in the later eras in my eyes it is more easy to add some new resources that provide the additional food and shields, than to experimentise with the irrigation factor.

For fixed maps there are some other options to break the infinite railroad movement. You can interrupt the railway by tiles that don´t allow to build any roads and railroads on them and add a resource to that tile, that looks like the continuation of the rails, or you can even use a chain of mini-teleporters or even change the airlift function to railroad-connections (but here you must be very careful in your plannings, so your railroad (airlift) connection doesn´t allow you to send your 'trains' over the oceans).

Here are some screenshots about the solution of interrupted rails that are connected with resources, that are looking like rails, that I have used in the scenario SOE. So in that scenario there doesn´t exist any Civ 3 railroads and I only used railroad graphics for roads and their interruptions to create tons of 'microzones' on the map, this methode can also be used with real Civ 3 railroads.
Spoiler :







Giving all civ3 3 traits I'm afraid would cause too much overlap considering I'm playing on mostly random map pangaea and have modded the seafaring trait out. Unless one can add new traits? I don't see that option in the editor. For now I'll just give the OG religious civs a non era, untradeable tech that gives them a "Tribal Council" gov from the start. It's just despotism with problematic corruption. Maybe even free Mysticism so that they can race to Monarchy faster. With nerfed Republic this could be a cool thing.

Fixing railroads in the editor would be the best improvement ever.

Bonus resources unlocked with steam engine is a great idea! I guess you'd need to add a lot of them to compensate the food.

I don't want to give ind era units extra movement points. This would make them move faster in enemy territories. This changes combat too much from stock game for my taste.

The train land transport unit is kinda meh now that I think of it. Being able to move anywhere as well as penetrating deep into enemy territory is not what trains do. I already have a truck doing that. And making them move with re base would cause trains to become airplanes, transporting overseas. The human player can refrain from doing that. And the AI probably uses transports so badly it needs all the advantage it could get. I haven't had the time to test this yet.

Thank you for your great ideas!
 
Those are some very interesting ideas from @tjs282, my only tiny nitpick would be that disallowing Irrigation on Desert tiles would hurt agricultural civilisations, as it negates their +1 food bonus to irrigated desert.
 
my only tiny nitpick would be that disallowing Irrigation on Desert tiles would hurt agricultural civilisations, as it negates their +1 food bonus to irrigated desert.
Yes. It does. That's the idea! ;)

Seriously though, since 'food is power', the Agri-trait is arguably the strongest of all the traits, on any map-type. On randomly generated maps, the runaway AI-civ is frequently one of the Agricultural civs. So nerfing the trait slightly is not problematic, in my view.
 
  • Like
Reactions: md4
I don't want to give ind era units extra movement points. This would make them move faster in enemy territories. This changes combat too much from stock game for my taste.

Not if you also raise the movement costs on every terrain drastically as I did it in my CCM mods. In that case the additional movement points only trigger a movement over longer distances on tiles with roads on them in your own or friendly territory - but not in enemy territory.

And making them move with re base would cause trains to become airplanes, transporting overseas. The human player can refrain from doing that. And the AI probably uses transports so badly it needs all the advantage it could get. I haven't had the time to test this yet.

I wrote about the airlift function in standard Civ 3 airports and not about the rebase option. As posted, this only works on premade maps with very careful settings for the prerequisites of the construction of such a railyard (= airport). I didn´t find the screenshot I have done about such an option for the 'fast train connection' between two German cities on the same continent, in SOE long time ago, replacing the aircraft symbols by a locomotive symbol in two cities of a civ. It must be assured that such 'railyards' cannot been built by the civ on other continents and not in every city of the civ at the same continent.
 
Not if you also raise the movement costs on every terrain drastically as I did it in my CCM mods. In that case the additional movement points only trigger a movement over longer distances on tiles with roads on them in your own or friendly territory - but not in enemy territory.



I wrote about the airlift function in standard Civ 3 airports and not about the rebase option. As posted, this only works on premade maps with very careful settings for the prerequisites of the construction of such a railyard (= airport). I didn´t find the screenshot I have done about such an option for the 'fast train connection' between two German cities on the same continent, in SOE long time ago, replacing the aircraft symbols by a locomotive symbol in two cities of a civ. It must be assured that such 'railyards' cannot been built by the civ on other continents and not in every city of the civ at the same continent.

Movement cost on terrain sounds great. The only nitpick would be the unupgraded units wouldn't suddenly get more mobility. I'm just too OCD to implement that :lol:.
 
How does airlifting work in civ3? Is it hardcoded into the building "Airport"? I don't see a flag for it in the Quintillus Editor or is it "Air Trade" as well?. So how about I rename the building "Rail Station" and make it available with Steam Power and give a new cheaper "Airport" building with the "veteran air unit" flag at Flight? This "Rail Station" building shouldn't be too expensive so that you can rush it on the front (helps nerf communism as well). Units airlifted can't act right afterwards and would help remedy the overpoweredness of rail movements but would still enhance mobility in a railroadless game.
 
You'd still be able to "rail-lift" across water.
I guess the human player can just refrain from doing it. And the AI is so incompetent with naval operations it could use any boost. Even after I removed the "requires escort" flag from transport ships they still do the same silly escort routine, rendering their combat fleet useless.
 
"Any ideas to mod railroads?" - YES ... But we need a serious programmer to tackle the task.

[...] About railroads: Unfortunately we forgot to ask Antal1987 about a fix of the infinite movement for railroads in Civ 3. May be a master in hexediting could find the key line about switching the infinite movement for railroads into other movement factors.]

Not entirely true. I did some digging. In a thread from 2014 called "C3C New Movement Possibilities," which began about the possible implementation of "true" canals, midway through the thread (Post #46), @Steph asked, "Is there a way to modify the roads system?"

In reply (Post #47) @Antal1987replied:"In theory, yes. it requires at least 1 byte of class_Tile data space. This byte would be an 8-flag set: a bit per a direction (see directions above). Therefore the road between A, B (lets say A looks at B in 1-st direction, B looks at A in opposite (5-th direction)) would exist only if A has 1-th bit of that byte and B has 5-th one.

There are some known unused bytes in class_Tile object data. This byte might be stored at 0x2C offset in low byte. I recall that int value (0x2C) contains real and base tile types, but it use only 2-nd byte of the int value."

This was preceded (bear with me) Anatal's Post #27, which remained directed at the Canal question -

Spoiler :

Finally, I've managed to modify game rendering. Here is the first step of implementing canals:

The following things were changed, rewritten or added
- Canals and Bridges images are loaded along with other PCX resources. It's stored in Patch Framework memory, not in the game original's one.
- The function, responsible for loading map images (class_Map_Renderer::m72_Load_Tile_Images) is fully rewritten. It includes now new subfunction, which loads canals and bridges images
- The function, responsible for rendering tile buildings (such as mines, outposts, and so on) is fully rewritten. It includes now new subfunction, which renders canals
- I added new tile overlay flag (0x200) which defines a canal.

The followings things are to do:
- Rewrite function (class_Unit::Can_Pass_Tile) responsible for unit's movement abilities.
- Add new worker job (first step is to provide hard coded job, second step is to modify Civ3ConquestsEdit to make it provide new job)
- Add new unit action button (requires new button image, new shortcut, rewriting functions, responsible for initializing Main GUI Form's controls and procesing of Control Click Event)
- Add bridges over canals
- Modify trade net logic to forbid land unit moves over canals without bridged
- Forbid roads and railroads over canals
- Make the Trade Net thinking that bridge over a canal is like a land tile with roads/railroads depending on neighbour tiles.
- Add canals over land bottlenecks. Requires combination of canal and bridge images.
- Add navigatable rivers (first of all it requires corresponding images).

I attached some files to test the new possibility
1) Render_1.zip contains:
- Game EXE and Patch Framework DLL files to be unpacked into %Conquests% directory
- PCX images in Art\Terrain folder to be unpacked into %Conquest%\Art\Terrain directory

2) Save files with canals applied.
Above screenshot was made during that saved game.

NB: A "Render_1.zip" & a "Test-Canals.sav" are attached, in this post!

Now, in direct ect answer to Steph's follow up question, " Can you use this function to change the way railroad are working? Maybe implement several levels of roads? Like "roads" with brown graphics, and where speed is half of normal, and "paved roads" where it is 25%?" Antal replied: "Absolutely. New levels of roads requires new Overlays flags. And there are several unused ones, like 0x200 which is used now for land canals. But new roads level means different weight in appropriate road graph being constructed every time a Unit makes an automatic move (it also happens when you're using Go To Action).
And haven't understood Trade Net working completely."

Steph's next question: "How many unused overlays to you have available?"

Antal's reply, in detail:
Spoiler :

Tile object contains 3 fields of terrain flags:
00000028 Overlays dd ?
0000002C SquareType dd ?
00000030 Terrain_Overlays dd ?

Overlays has the followings known flags:
0x01 - Road (0)
0x02 - Railroad (1)
0x04 - Mines (2)
0x08 - Irrigation (3)
0x10 - Fortress (4)
0x20 - Goody Hut (5)
0x40 - Pollution (6)
0x80 - Barbarian Camp (7)
0x100 - Craters (8)
0x10000000 - Barricade (28)
0x20000000 - Airfield (29)
0x40000000 - Radar tower (30 bit)
0x80000000 - Outpost (31 bit)

Other bits seem to be unused. (19 new flags)

SquareType stores real and base tile type ids in 2-nd byte (counting from 0). 0-th, 1-st and 3-rd bytes are unused. In theory it also can be used to store new flags. (24 new flags)

Terrain_Overlays has the followings known flags:
0x01 00 00 - Special_Resource (16)
0x10 00 00 - Mountain Snowcaps (20)
0x20 00 00 - Forest Pines (21)
0x20 00 00 00 - Landmark (29)
also bits 15, 17 - 19, 23 - 28 are used.
It seems first bits 0 - 14 are unused too. (15 new flags).

Total: 58 new possible flags


Furthermore, within this algorithmic set of statements, new types of tile buildings can be provided -
Spoiler :

There is another interesting field in Tile class:
0000001C Tile_BuildingID dw ?

It defines Id of the one of following game objects:
- Airfield, if Overlays has Airfield flag
- Radar Tower, if Overlays has Radar Towerflag
- Outpost, if Overlays has Outpostflag
- Colony, otherwise

Each Tile Building has its own object with some fields. For example Airfield object has bool field, responsible for being used status.


SO:
  1. Yes, RR limitations are possible, as are:
  2. Entirely new types of buildings!!
BUT - Is anyone up to tackling this?? :borg:
 
I ditto your Comments and Questions Ozy... it would be Fantastic if anyone can accomplish the Railroads and AI... that and the AI using Land Transports.

I second this. :) Oz great find! :thumbsup:
 
How does airlifting work in civ3? Is it hardcoded into the building "Airport"? I don't see a flag for it in the Quintillus Editor or is it "Air Trade" as well?. So how about I rename the building "Rail Station" and make it available with Steam Power and give a new cheaper "Airport" building with the "veteran air unit" flag at Flight? This "Rail Station" building shouldn't be too expensive so that you can rush it on the front (helps nerf communism as well). Units airlifted can't act right afterwards and would help remedy the overpoweredness of rail movements but would still enhance mobility in a railroadless game.

Many years ago, I made the icons for such an air-trade railyard for some tests with the WWII scenario SOE. May be this will be a part (in a modified form) of the next version of that scenario. The icon is attached to this post. :)



 

Attachments

  • Air and Harbor.jpg
    Air and Harbor.jpg
    6.5 KB · Views: 518
  • airAndHarb.zip
    1 KB · Views: 31
  • SOE-Railyard.jpg
    SOE-Railyard.jpg
    590.5 KB · Views: 593
Last edited:
Top Bottom