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

Rare and unused messages in CivDos

Discussion in 'Civ1 - General Discussions' started by tupi, Aug 26, 2020.

  1. tupi

    tupi Warlord

    Joined:
    Jun 25, 2011
    Messages:
    103
    Location:
    Russia
    This thead will be about some unused or very rare messages in the game. Like, I always was fastinating about some messages in KING.TXT (GAPE/CRUSADE/HELPME). I had found only one statement on the forums that somebody saw '*GAPE' message. Btw, I tried to fulfil all conditions for that (and even NOP them), but it still doesn't work and I have no idea why.

    First, let's talk about SDI. Apart from it's role as end-game cash cow, it's pretty mysterious, isn't it? Civilopedia says that it protects city from nuclear weapons... When a city with SDI is attacked, you will get message 'SDI protects <City Name>'. But pollution still will be here and city popuation decreases as usually. Also all units around the city will be destroyed. At least units in the city are not destroyed (as usually) if city has a SDI. Presumably SDI does not function properly/unfinished (at least in civdos, maybe it was fixed in civnet - because of multiplayer functionality). Thing is, AI never attacks player's cities which have SDI, so you never can see it in action anyway! Barbarian AI can attack with a nuke, but barbarians can't have nukes. Only way to see SDI message is to get SDI in an AI city somehow and then attack this city (or give some nukes to barbarians:crazyeye:). But AI never builds SDI and even when it captures your city with SDI, SDI will be always destroyed (as a building with number more than 15). So - has anybody ever seen this message in normal game?

    mess_sdi.png

    Another message I want to talk about was cut from the game altogether. It is '<Civ name> agree to an exchange of ambassadors.' from civ.exe. The conditions for it was presumably following: 1) AI civ just discovered Writing 2) difficulty is Chieftain 3) player has a contact with this civ or any other diplomacy status (?) 4) player don't have Embassy with this civ yet. What does it do? Give you Intelligence Report screen (F3) and Embassy diplomacy status with this civ.

    But there's some strange things here... At first everything is ok:
    Code:
    8b 76 06        MOV        SI,word ptr [BP + param_civ1]
    d1 e6           SHL        SI,1
    8b 3e ee d7     MOV        DI,word ptr [HUMAN_CIV]
    b1 04           MOV        CL,0x4
    d3 e7           SHL        DI,CL
    03 fe           ADD        DI,SI
    81 c7 98 e4     ADD        DI,DIPLOMACY_STATUS //now we have dimplomacy status between player and AI civ in DI...
    83 3d 01        CMP        word ptr [DI],0x1 //check for contact (0x1) status... strange that it don't check bit mask, but value...
    //We can only guess what it checked next: for >= 1 (any diplomacy status - more likely) or != 1 (don't have a contact yet - doesn't seem reasonable).
    
    But after that:
    Code:
    1b c0           SBB        AX,AX //what?
    f7 d8           NEG        AX //what?
    a8 40           TEST       AL,0x40 //some remains from check for Embassy status (0x40), I presume...
    
    Though logically it should be something like that:
    Code:
    JB    LAB_check_gunpowder_and_combustion //no contact and no any other diplomacy status (just my guessing)
    TEST    word ptr [DI], 0x40 //check Embassy status
    JNZ    LAB_check_gunpowder_and_combustion //already has Embassy - go further...
    
    Even with some minimal compiler optimizations, this code should not even be in the program at all, because flow never goes here. So I can only presume that probably these SBB, NEG commands was manually inserted here to 'off' this message. Or that there's some kind of bug.

    mess_ambass.png mess_ambass2.png

    Third message I want to talk about is '*GAPE' from king.txt. Conditions for it should be following:

    1) civ is not player civ
    2) civ just discovered some tech
    3) you have no embassy with this civ
    4) this tech was not discovered by anybody before
    5) civ knows Navigation
    6) player civ doesn't know this tech
    then with 1/3 chance game will call function which should show "An emissary from the <civ> wishes to speak with you. Will you recieve him?" message (with -1 x coord, which means it doen't change the camera position). If you agree, game should show you diplomacy screen with GAPE message. And then the game should show civilopedia reference about the tech.

    The thing is, it just doesn't work (in both .01 and .05 versions). Why it's so is the mystery for me. By all indications it should. So, my question: has anybody ever seen this 'gape' message? Maybe there's some bug which prevent it from working. Maybe it works in CivWin, I did not check it yet. CRUSADE/HELPME can be not working due to same bug, actually - their realization is very similar to GAPE (interrupt 0x3a for call 'Will you recieve him?' dialog from overlay 6). Though reports about working CRUSADE/HELPME are not that scarce! Maybe they are working in some versions of the game (maybe even not in Dos version).

    There's still some other very rare or unused messages to talk about (for example, can city even proclaim independence, as some text in civ.exe suggests?), but I did not reverse engineered all the overlays yet.
     
    Last edited: Mar 24, 2021
    Tristan_C and axx like this.
  2. axx

    axx Warlord

    Joined:
    Feb 19, 2011
    Messages:
    125
    Nice job! Can't wait to see more.
     
  3. Tristan_C

    Tristan_C Emperor

    Joined:
    Aug 16, 2006
    Messages:
    1,716
    Welp, you got me curious about what the *GAPE message is.

    kek

    Nope, never seen that one. Just a wild guess, but I noticed you don't have it down as checking for contact or war status with the civ, just embassy. Maybe it is doing something incorrectly somewhere?
     
  4. Proudhon55

    Proudhon55 Chieftain

    Joined:
    Jun 6, 2020
    Messages:
    5
    Just today I was playing a game and a barbarian diplomat sabotaged my production after his legion “escort” was defeated. That’s quite a rare message, 99%+ of the time they try to run away.
     
  5. tupi

    tupi Warlord

    Joined:
    Jun 25, 2011
    Messages:
    103
    Location:
    Russia
    From my investigations of civ.exe I knew that when AI builds a wonder of the world in a 'normal' way, without cheating, you should get newspaper message about it. But I thought it's just a useless code/remains of some old logic, because AI can't choose to build a wonder in its main 'select what to build' routine. But... I played as English on Earth today and I got a newspaper message that Russians built Michelangelo's Chapel in Leningrad! After that I checked Leningrad with debug cheat and indeed there it is. Sadly I did not screenshot this message. And now I think that sometimes I already saw this message before... Maybe even always with Michelangelo - can be some sort of overflow bug? Leningrad had a pretty high production too, so maybe AI can select to build a wonder in a city in a normal way after all, but this logic still unparsed by me...
     
    Last edited: Sep 19, 2020
  6. Lone Wolf

    Lone Wolf Deity

    Joined:
    Dec 4, 2006
    Messages:
    9,908
    The GAPE message is present and works as it should in Civ2.
     
  7. tupi

    tupi Warlord

    Joined:
    Jun 25, 2011
    Messages:
    103
    Location:
    Russia
    "Independence", sadly, turned out to be not so interesting. I hoped it should switch 1 city to a free civ slot, similar to a civil war, but just one city. But actually it's just an alternative message for city bribery when you play as barbarians. And then city will become barbarian, of course (you will capture it, like after normal city bribery). Nothing is different here, only this message is different (normal one is "<Civ> rebel! Civil war in <City Name>. <Your civ> influence suspected'). Interestingly that game has so many checks for human player as barbarians, like they (well, him, one and only) expected that somebody will play as barbarians.

    Though even if you play as barbarians, there are almost no sources of income anyway to bribe a city. No taxes. Even when barbarians capture a city, they don't get any money to their treasury. So you also should cheat some money for you. Though extortion on diplomacy screen may work, I think? Also you can sell buildings.

    independence.png
     
    Last edited: Mar 3, 2021
  8. Tancretus

    Tancretus Chieftain

    Joined:
    Oct 26, 2020
    Messages:
    22
    Gender:
    Male
    Location:
    Between subsets of Infinity
    What's the logic for having so many checks if player is barbarian?
     
  9. Theov

    Theov Deity

    Joined:
    Feb 11, 2008
    Messages:
    2,214
    Location:
    Taiwan
    I have definitely seen that message before. But I don't remember if that was in Civ1 or Civ2.
    Maybe I remember it from Civ2.

    The SDI message I've also seen, I think when nuking a city - I'm not sure why you say that the AI doesn't build them.
     
  10. tupi

    tupi Warlord

    Joined:
    Jun 25, 2011
    Messages:
    103
    Location:
    Russia
    Because there's no rules in the game for AI to build SDI, if I understand code of the game correctly. Same with mass transit. So lucky you. I have never seen that. Sometimes AI actually builds strange things (carriers, even wonders without cheating), probably because of memory corruption, but it should not do that.
     
    Tancretus likes this.
  11. Theov

    Theov Deity

    Joined:
    Feb 11, 2008
    Messages:
    2,214
    Location:
    Taiwan
    Did I play another version than you are?
     
  12. tupi

    tupi Warlord

    Joined:
    Jun 25, 2011
    Messages:
    103
    Location:
    Russia
    I'm reversing .5. I have been playing as Earth England today in my free time because of your post. At the moment my lovely Russians are conquering Americas and building '203'/-53... 'something' in two cities (max number for building should be, I think, -46, Cure for Cancer?). This -53 thing has no name at the city screen. Also they are building United Nations in one of their cities (214/-43). I should research more. Either there's some additional rules or the game is really pretty buggy for big AI empires. And if it is this buggy, SDI is not beyond of possible.

    Another thing is that AI rarely even research superconductors: if it researched robotics first, it will not do any further research. Sometimes it does superconductors before that, but often it doesn't. At least I can say that (for now) I've never seen that AI builds something for which it has no technology (code to create 'what city can build' list works properly every time). Well, with exception of -53 thing...

    Honestly, I even have very vague memories from my childhood that I indeed saw this message. But I decided that's just false memories. I trust the code more. Another thing is that in my opinion SDI reaction is pretty buggy/unfinished (but maybe I'm wrong and it was intended that way).

    Edit: strange production happens in cities number 0 and 1 (Moscow and Babylon). Now they are building 140/-116 thing. It costs 5 rows. -53 costs 3 rows. Well, game simply read some data in memory after city improvements/wonders array. When city finishes such a... thing, nothing happens. Also just now they moved their capital 2 times in the row in one turn.

    Edit 2: sadly, Russians researched Robotics first and now their science rate is 0%, so they won't research superconductor. So no luck about SDI. But they did not build another 'forbidden' for AI city improvement anywhere: mass transit. SDI should be not different. If AI can do it, it should be a very rare glitch.

    And finally: it can be simply be different in early versions. But I don't believe that. Rules to 'what to build' are pretty simple and I don't think that they was changed at all. Should check it someday, though.
     
    Last edited: Dec 9, 2020
  13. Theov

    Theov Deity

    Joined:
    Feb 11, 2008
    Messages:
    2,214
    Location:
    Taiwan
    Have you tried nuking them?
     
  14. tupi

    tupi Warlord

    Joined:
    Jun 25, 2011
    Messages:
    103
    Location:
    Russia
    I added 1 nuke near every of russian 35 or so cities in jcived. It was fun and even useful: I have found that I was mistaken about nuclear pollution chance. It's 2/3, not 1/3. Fixed it in CivGenesis. But of course no SDI messages, because there are no any SDI in AI cities.
     
  15. tupi

    tupi Warlord

    Joined:
    Jun 25, 2011
    Messages:
    103
    Location:
    Russia
    Well, for example, in AI city production logic there's a check "if human player plays as barbarians, do not build a diplomat". Because AI builds diplomats only to steal tech and there's nothing to steal from barbs... I can't remember anything else right now, but I think I saw some other places...
     
    Tancretus likes this.
  16. Dracul JOSHI

    Dracul JOSHI Chieftain

    Joined:
    May 18, 2015
    Messages:
    67
    Are you telling me, that some things in this game work BECAUSE of Bugs? I could swear it should be the other way around according to my education XD
     

Share This Page