Tag Info

New answers tagged

1

I'm having difficulty because cells can have behaviour. They can be just a tile with no behaviour; a portal which sends the player somewhere (snake or a ladder); an exit, which has no behaviour but must be coupled with an entrance for rendering purposes (so the player would know what entrance the exit belongs to). But my instinct tells ...


0

I think this situation would benefit from a Hierarchical State Machine which is the type I use in my games to solve this problem. Some links: Ai Game Dev Game Programming Design Patterns (Read the whole article, it's very good) A hierarchical state machine (HSM) is a state machine where states are grouped together and have parent states. Therefore ...


1

Right off the bat I think your units don't need neighbours. Zones should hold neighbouring zones but I would likely add a class called a zoneEdge that contains two pointers one for each zone sharing the edge. Each zone would hold a list of edges. Walking the edges would get the neighbouring zones. When it comes to pathfinding this will really help. Zones ...



Top 50 recent answers are included