1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

City square behaviour - patch suggestion

Discussion in 'Civ1 - General Discussions' started by Renergy, Jun 7, 2014.

  1. Renergy

    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]
     
  2. kirkham7

    kirkham7 Warlord

    Joined:
    Dec 22, 2012
    Messages:
    288
    Location:
    Hayward, CA
    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:).
     
  3. Renergy

    Renergy Warlord

    Joined:
    Nov 2, 2010
    Messages:
    197
    Location:
    Czech Republic
    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).
     
  4. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    600
    This railroad in city square keeps coming back in your requests, guys :) I'll take some time to look into it, probably tomorrow.
     
  5. kirkham7

    kirkham7 Warlord

    Joined:
    Dec 22, 2012
    Messages:
    288
    Location:
    Hayward, CA
    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.
     
  6. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    600
    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!
     

    Attached Files:

  7. Renergy

    Renergy Warlord

    Joined:
    Nov 2, 2010
    Messages:
    197
    Location:
    Czech Republic
    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.
     
  8. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    600
    Hehe, I'm quite the amateur of Queen myself...

    :culture: Here we are, born to be kings,
    We're the princes of the CivDOS games!
    :culture:

    And, you're welcome, too.
     
  9. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    600
    Also, I did find the code to patch for versions 03 and 04, and updated the patch info in the post above, but I didn't test them. kirkham7, if I recall correctly, I think you have one of those, would you mind confirming?
     
  10. kirkham7

    kirkham7 Warlord

    Joined:
    Dec 22, 2012
    Messages:
    288
    Location:
    Hayward, CA
    Yeah, I'll have a look.
     
  11. kirkham7

    kirkham7 Warlord

    Joined:
    Dec 22, 2012
    Messages:
    288
    Location:
    Hayward, CA
    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!
     
  12. darkpanda

    darkpanda Dark Prince

    Joined:
    Oct 28, 2007
    Messages:
    600
    Great :)
    I know you also suggested setting railroad flag on completion of mass transit, I'm keeping this in mind for later.
     
  13. kirkham7

    kirkham7 Warlord

    Joined:
    Dec 22, 2012
    Messages:
    288
    Location:
    Hayward, CA
    Sweet, thanks for all of your work.
     
  14. Svetkavitsa

    Svetkavitsa Chieftain

    Joined:
    Sep 12, 2010
    Messages:
    46
    Location:
    Utah, USA
    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 :) .
     
  15. GoldBerg

    GoldBerg CivDosPlayer of '91

    Joined:
    Aug 20, 2003
    Messages:
    564
    Gender:
    Male
    Location:
    Palace Improvement
    Does the AI use 'railroad on cities' too,
    when it is patched?
     
  16. DragonFart

    DragonFart Chieftain

    Joined:
    May 14, 2015
    Messages:
    3
    So which file does one edit, in order for this to work?
     
  17. kirkham7

    kirkham7 Warlord

    Joined:
    Dec 22, 2012
    Messages:
    288
    Location:
    Hayward, CA
    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.
     

Share This Page