City square behaviour - patch suggestion

Renergy

Warlord
Joined
Nov 2, 2010
Messages
197
Location
Czech Republic
Hello there, or rather - Dear darkpanda ;)

Some patch suggestions/wishes.

Would it be possible to patch civ so one could build railroad on a city square? (settler - R key). Now it is only possible to have city square with a railroad if it existed before its founding.

My guess is this might be not so hard to do (as it is already possible to "mine" city square after the founding of the city). Guess there is simple check somewhere that could be inhibited by NOPs.


Completely different story is this imo (very) hard-to-implement change - two parts:
1) city square of a newly founded city would get irrigation only if neighbouring square had water or was already irrigated
2) it would be possible to extend irrigation from city square [now the city square is not taken into account in this regard when irrigating]
 
How about city square gains railroad once it is researched? If it's not possible just let me know (I'll just come up with another crazy idea :groucho:).
 
How about city square gains railroad once it is researched?

That would be imo very hard to do, requiring adding a major chunk of code, since civ does not do anything similar already.


What crossed my mind: Add railroad instead of irrigation to city square when founding it, from the beginning of the game. One could irigate the city square later - it is already possible to do so (e.g. when the city was found on jungle or forrest). That - perhaps - might be just a minor tweak (no need to be able to railroad a city square, then).
 
Well, I for one can't help it, it seems only natural that you should be able to add a railroad to a city. But yes, I have asked many times for it.
 
At last, Settlers can build Railroad in cities!

Unfortunately, I could only make a patch for all versions but EN474.03 and RN474.04... For some reason, their assembly is different... I'll look it up later, don't worry.

I did manage to find the assembly for 03 and 04, the patch is updated accordingly below, but untested.

Code:
offsets:
 EN474.01:[B] 0x5439[/B]
 EN475.01: [B]0x5439[/B]
 EN474.05: [B]0x546B[/B]
 FR474.05:[B] 0x554F[/B]
 
original bytes: [COLOR="Green"]83C4043D000075 03 E91200[/COLOR]
 patched bytes: [COLOR="Green"]83C4043D000075[/COLOR] [B][COLOR="Red"]0C[/COLOR][/B] [COLOR="Green"]E91200[/COLOR]

offsets:
 EN474.03:[B] 0x52BB[/B]
 EN474.04:[B] 0x52BB[/B]

original bytes: [COLOR="Green"]F646C001 7506 F646C010[/COLOR]
 patched bytes: [COLOR="Green"]F646C001[/COLOR] [B][COLOR="Red"]9090[/COLOR][/B] [COLOR="Green"]F646C010[/COLOR]

And some screenshots to see it in action, before, during and after railroading the city:

BEFORE: DURING: AFTER:

Enjoy!
 

Attachments

  • civ_886.png
    civ_886.png
    4.9 KB · Views: 630
  • civ_887.png
    civ_887.png
    5 KB · Views: 608
  • civ_888.png
    civ_888.png
    5 KB · Views: 620
Just tested it, works like a charm.

:culture: ...one byte, one stroke, then save and go
to railroad - a city square!...
:culture:

It's a kind of magic, or rather C'est magnifique! :goodjob: Thanks a lot, darkpanda.
 
Alright, works just fine. My first time through I used my ten key and it added to the filesize (big no no), of course civ didn't load then, but I tried it again with my normal number keys, and it worked. Must have pressed my num lock or something, lol. Anyways, it works just fine for me. Thanks a bunch!
 
I just tried this out on patch EN474.04 and it worked like a charm. It always bugged me that you can't railroad cities, and now I don't have to worry about it anymore :) .
 
Does the AI use 'railroad on cities' too,
when it is patched?
 
The executable for civ (civ.exe). Make sure to back up your file before making changes. To start out, just download darkpanda's jCivED program, it will patch your file for you.
 
Top Bottom