NHL ’94 follow-​​up

Mar 26, 2010 19:02


This is an addendum to this post where I was try­ing to make NHL ’94 more challenging.

I’ve all but given up on try­ing to give the com­puter an extra use­ful player in shootout mode. Giv­ing the com­puter an extra player who stands and does noth­ing is trivial. Unfor­tu­nately, the “AI” for shootout mode is - maybe not sur­pris­ingly - hard-​​coded - it doesn’t even take into con­sid­er­a­tion the pos­i­tion of the goalie - and rewrit­ing the AI in 65C816 assembly is bey­ond the scope of my free time. This is easy to show by watch­ing the dif­fer­ing beha­viour between when the com­puter gets a break­away (in reg­u­lar mode) com­pared to how it behaves in shootout mode.

So I play in reg­u­lar mode with a 3-​​man han­di­cap. E.g., we play 5-​​on-​​2. If you watched the first video from my last post, you’ll notice that han­di­cap­ping your­self makes the game beep con­stantly. It’s very very irrit­at­ing. Fix­ing this is actu­ally not com­pletely trivial. For those that are impa­tient, here are the memory addresses I’m using:
Address Descrip­tion Example value 7E17A6 Num­ber of play­ers for the home team 3 7E18BA Good ques­tion! See below 12 7E1864 Num­ber of seconds left in the penalty 40
Using the val­ues above will stop the incess­ant beeping.

I haven’t had time to fully explore the implic­a­tions of 7E18BA. Just from obser­va­tion, it seems that that the 7E1860 - 7E18C0 range is an array of player state and 7E18BA is an off­set into that array which per­tains to the pen­alty. By set­ting 7E18BA to 0x12, it seems, you indic­ate which ele­ment of the array from which to draw penalty-​​time-​​remaining inform­a­tion. I only use the value of 0x12 and the asso­ci­ated address 7E1864 because those are what came up for me dur­ing debug­ging (Mike Gart­ner, if you’re curi­ous). I haven’t found any rhyme or reason to the num­ber 0x12 yet, but I don’t really care too much at this point.

As a side note, someone really needs to come up with a bet­ter tool for “RAM cheat­ing”. For those unfa­mil­iar, the gen­eral pro­ced­ure for this style of black-​​box debug­ging - usu­ally used for cheat­ing, though in my case I guess it’s anti-​​cheating - is to snap­shot RAM at vari­ous stages of play. You then com­pare the RAM images accord­ing to what state you’re look­ing for. E.g., if you want to know where the num­bers of play­ers on the ice is stored in RAM, you snap­shot when you have 6 play­ers on the ice a few times and again when you have 5 play­ers on the ice and look for the num­bers “6” and “5” to con­sist­ently appear in RAM.

If you have a hacker men­tal­ity, this way of doing things can be pro­duct­ive, but it’s pretty crude. Gen­er­ally the tools avail­able don’t allow you to com­pare bit-​​values, only byte-​​values, and com­par­ison oper­at­ors are pretty lim­ited. After half-​​heartedly try­ing to fol­low along with Jasna’s AI assign­ments, I’d be sur­prised if this prob­lem hasn’t been solved gen­er­ally and prop­erly in the AI aca­demic com­munity. Oh well.

Originally published at Wizardlike research. You can comment here or there.

silly

Previous post Next post
Up