|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T o
Length: 3521 (0xdc1) Types: TextFile Names: »ogre.oscillation.bug.fix«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/General/Ogre/bugfixes/ogre.oscillation.bug.fix«
From mcvax!seismo!cmcl2!rna!dan Thu Nov 22 05:52:29 1984 Relay-Version: version B 2.10.1 6/24/83 (MC830919); site turing.UUCP Posting-Version: version B 2.10.1 6/24/83; site rna.UUCP Path: turing!mcvax!seismo!cmcl2!rna!dan From: dan@rna.UUCP (Dan Ts'o) Newsgroups: net.sources.bugs Subject: Ogre oscillation bug fix... Message-ID: <319@rna.UUCP> Date: Thu, 22-Nov-84 05:52:29 GMT Article-I.D.: rna.319 Posted: Thu Nov 22 05:52:29 1984 Date-Received: Fri, 23-Nov-84 03:13:36 GMT Organization: Rockefeller Neurobiology, NYC Lines: 106 plugh Ogre turns out to be a cute little game - quite well done. However I found that the oscillation bug (as mentioned in the manual page) makes it considerably easier to the win game since the Ogre just oscillates back and forth while you shoot. (A situation which makes it oscillate 90% of the time is to put your CP in the upper right hand corner, place a howitzer a few hexes to the left and force the Ogre to go in between the howizter and the crater in front of the CP. The Ogre just can't bring itself to go closer to the howizter.) I have made an attempt to fix this oscillation bug. The diffs are given below. It basically remembers the previous direction the Ogre moved and weights against moving in the opposite direction. This "fix" will not catch oscillation which, for example, would cause the Ogre to move in a circle. However I have never seen that happen. The Ogre has yet to oscillate with this fix in. Someelse mentioned the bug which doesn't allow you to win even if the Ogre's movement points are zero. I didn't see a fix for this bug (forgive me if one was posted) so I made one up - a simple call to check_over() in the resolve code. Cheers, Dan Ts'o Dept. Neurobiology Rockefeller Univ. 1230 York Ave. NY, NY 10021 212-570-7671 ...cmcl2!rna!dan Fix for "can't win" bug: line 99 resolve.c /* dyt - check if over now */ check_over(); } Fix for oscillation bug: *** ogrecom.c.org Wed Nov 21 18:49:47 1984 --- ogrecom.c Wed Nov 21 21:12:19 1984 *************** *** 30,35 int i, max; char a, b; char olda, oldb; a = ogre.l_hex; b = ogre.r_hex; --- 30,39 ----- int i, max; char a, b; char olda, oldb; + /* dyt - prevent oscillation */ + static int osccnt; + static int oscdir; + static int mapdir[7] = { 0, 4, 5, 6, 1, 2, 3 }; a = ogre.l_hex; b = ogre.r_hex; *************** *** 44,49 weight[5] = getweight(a + 1, b); weight[6] = getweight(a, b - 1); max = 0; for(i = 1; i < 7; i++) if(weight[i] > weight[max]) max = i; --- 48,56 ----- weight[5] = getweight(a + 1, b); weight[6] = getweight(a, b - 1); + /* dyt - prevent oscillation - decrease weight if returning to old position */ + weight[mapdir[oscdir]] -= 10 * osccnt; + max = 0; for(i = 1; i < 7; i++) if(weight[i] > weight[max]) max = i; *************** *** 47,52 max = 0; for(i = 1; i < 7; i++) if(weight[i] > weight[max]) max = i; switch(max) { --- 54,70 ----- max = 0; for(i = 1; i < 7; i++) if(weight[i] > weight[max]) max = i; + + /* dyt - record new direction */ + if (max == mapdir[oscdir]) + osccnt++; + else + osccnt = 0; + oscdir = max; + + /* display(17, "max %d weight %d cnt %d odir %d ndir %d", + max, weight[max], osccnt, oscdir, mapdir[oscdir]); + cycle(); */ switch(max) {