I hadn't seen this video before, thanks for the link.steve wrote: ↑11 Jul 2020, 15:48Regarding the implementation I've seen you've followed some nice guide for the AI, anyway if you didn't see there is also a nice video on it: https://www.youtube.com/watch?v=ataGotQ7ir8&t=943s
Well spotted, it's probably the main difference between the original ghost AI's and my implementation, but there are many others as well Originally I was aiming to implement the ghost AI perfectly, (even the overflow in tracking that causes the ghost targets to offset to the left and top), but I quickly realised that I was going to run out of RAM before I could implement it fully, (this was even before sound effects, scoring and lives had been added). So I had to walk a fine line between trade-offs and a crappy implementation, (the source code has lots of comments in it describing my pain); the following is a short list:
Code: Select all
* Note i, j is in cell space and x, y is in pixel space. - Ghosts stay in the ghost home when scared until scared mode is over. - Collision detection between Ghosts and Puc do not use a simple does i == j test, but instead do a ABS(xy - xy) < 3 test. This means the bug, in the original game, whereby Puc and Ghosts can warp through each other is missing. - Distance calculations are mostly simulated using simple delta i and delta j IF statements instead of using Taxi-Cab or Cartesian calculations. - I forgo the random algorithm that ghosts use when they are in scared mode, instead I turn them blue and send them into scatter mode instead. - Blinky is missing his Cruise Elroy mode. - There are no speed variations for Puc himself, i.e. when eating dots or for changing difficulty. - There are no speed variations for ghosts, except when they are in tunnels or scared mode. - Missing animation frames when ghosts are in scared mode. - Missing lost life animation frames for Puc. - Missing fruit and fruit bonuses. - More that I have forgotton and would have to check the source code to determine.