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 Chieftain

    Jun 25, 2011
    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 protect 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?


    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:
    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:
    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:
    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 is 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: Sep 19, 2020
    Tristan_C and axx like this.
  2. axx

    axx Chieftain

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

    Tristan_C Emperor

    Aug 16, 2006
    Welp, you got me curious about what the *GAPE message is.


    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

    Jun 6, 2020
    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 Chieftain

    Jun 25, 2011
    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

    Dec 4, 2006
    The GAPE message is present and works as it should in Civ2.

Share This Page