Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!usc!randvax!ucla-an!stb!michael From: michael@stb.uucp (Michael Gersten) Newsgroups: comp.sources.games.bugs Subject: Re: Conquer bug or just annoying change? Keywords: conquer, movement, nomads, zone of control Message-ID: <1989Dec12.045829.5237@stb.uucp> Date: 12 Dec 89 04:58:29 GMT References: <844@wet.UUCP> Reply-To: michael@stb.uucp (Michael Gersten) Organization: The Serial Tree BBS, +1 213 397 3137 Lines: 102 There is an ****ANNOYING**** "feature" of conquer version 4 that when an NPC nation -- including nomads, savages, and lizards -- goes to run its turn, it gets the present state of the board to work from, not the PREVIOUS state of the board which a user gets. This makes it impossible to pin anybody because no matter what you did, they can always move out. Put another way, if you want to move to place A but an army in B is in front of A, you will stop at B. Whether or not army B is there to stop you when your move executes, you will stop at B. That NPC army B may move out before you get there. Now turn it around. If you move your army B out of the way, the NPC's can now move straight to your army A. I made a simple solution that solves PART of this for nomads, savages, and lizards. Since most of those armies are running around in attack mode looking for something to attack, and since the combat code insures that a combat will occur if one army is in attack mode, I had the nomad/lizard/savage movement code test to see if a combat would occur first before they move. As distributed there is a 0% -- yes, 0%-- chance of a battle occuring in the sector that they start in because they are guaranteed to leave to a different sector. Here's the code I changed. Its pretty simple. Put it in npc.c /* Determine if a fight will occur in sector x,y. Approximate--must be an attacking army (of a real country) in the sector. Currently used for savages etc. FOR NPCs DISPLOMACY MUST BE ACCOUNTED FOR. Check for ispc not isactive -- although npc's should stop us as well, nomads and savages do not. This is NOT used for pirates -- they are navies, not armies. */ fight_scene (x,y, stat) { int country, armynum; for (country=0; countryarm[j]; /* if((aptr->sold>0) /* &&(aptr->stat>=ATTACK) /* &&(aptr->stat<=SORTIE||aptr->stat>=NUMSTATUS) /* &&(!fought[aptr->xloc][aptr->yloc])){ */ /* }} */ /* Also check if this army is attacking */ for (armynum=0; armynum=ATTACK && ASOLD>0 && (ASTAT <= SORTIE || ASTAT>=NUMSTATUS) ) /* Or we are attacking */ || (stat >= ATTACK && stat <= SORTIE) ) { /** printf ("Fight occurs\n"); **/ return 1; } else { /** printf ("No fight "); **/ return 0; } /* if in attack mode */ } /* if x and y */ return 0; } The "No fight" section occurs if there are no armies in attack mode in the sector -- it turns out this only occurs with lizard armies in garison mode (some of which may choose to go out and attack neighboring sectors) Then, in do_savage, do_nomad, and do_lizard, the following change void do_savage() { short armynum; int x, y; printf("updating savage (nation %d)\n",country); for(armynum=0;armynum0){ P_ASTAT=ATTACK; if(P_ATYPE> /* If combat they do not move */ -->> if (fight_scene (P_AXLOC, P_AYLOC, P_ASTAT)) -->> continue; P_AMOVE=(curntn->maxmove * *(unitmove+P_ATYPE%UTYPE))/10; Michael