scrom / Experiments

a NodeJS text adventure - deliberately coded badly to re-experience the pain of legacy code
http://mvta.herokuapp.com/
2 stars 0 forks source link

Improve creature wandering to stop doubling back #363

Closed scrom closed 8 years ago

scrom commented 8 years ago

At the moment a randomly wandering creature can often double-back. I'd at least like a creature to take one more step before returning - if a player waits in 1 location for a while it's really obvious that they keep jumping in and out.

This requires storing a new creature attribute - either previous location or previous direction. When getting a random exit, we'd probably also need to pass that previous exit in to exclude (or test and repeat)

scrom commented 8 years ago

Also - if a creature reaches a dead-end, they might hang around a little.

scrom commented 8 years ago

basically a 50% chance (evey turn) of not using the exit when in a dead-end. It's enough to be less aggravating without slowing things down too much.