Monday, 4 August 2014

Need to update my enemy AI...

The code for enemy movement is so simple and lovely but it has some issues... Gotta think of a nice way of solving this without breaking the rest of the behavior.

2 comments:

  1. What about introducing a regret variable. When a ship moves, if it would chose the space it was at before-last he chooses again with probability `regret'. He time he indeed lands on the space before-last, regret rises. On moving to a different space, regret resets.

    That is probably a bad idea as it inspires unpredictability. Perhaps an outright ban on revisiting the old space?

    ReplyDelete
  2. There are cases where they would want to change direction and revisit a square, like if they're chasing you and finally give up and turn back.

    It's solved enough for now, I made the forcefield ability fade over 3 turns and allowed ships to stay still if they want to. Everything looks natural-enough now but there are probably still a few corner-cases.

    ReplyDelete