Temple of The Roguelike Forums
Development => Programming => Topic started by: rhysmakesgames on March 21, 2016, 12:20:44 AM
-
I was just thinking about this and how it could be weird to program so i was wondering if there were some specific approaches that people knew of that would help?
Normally you'd just have monsters from the current floor be active in your game, so moving monsters between floors could get tricky. The only thought I had was when a monster is pathfinding to the player and the player goes down stairs, the game will register that that monster was x turns away from the stairs and once those x-turns are up it adds the monster to the new floor at the correct spot.
-
I was just thinking about this and how it could be weird to program so i was wondering if there were some specific approaches that people knew of that would help?
Normally you'd just have monsters from the current floor be active in your game, so moving monsters between floors could get tricky. The only thought I had was when a monster is pathfinding to the player and the player goes down stairs, the game will register that that monster was x turns away from the stairs and once those x-turns are up it adds the monster to the new floor at the correct spot.
That sounds like a good solution if you don't want to have multiple levels active. You could try having the level where player is active and the levels that can be reached from that level and see how big impact it has on performance. If you aren't keeping multiple levels active, you pretty much have to abstract movement somehow and counting x turns sounds like a good plan. Of course then you have to think what to do if the monster has some active spells or status effects (poison, being on fire and such) and think how to deal with them.
-
The only thought I had was when a monster is pathfinding to the player and the player goes down stairs, the game will register that that monster was x turns away from the stairs and once those x-turns are up it adds the monster to the new floor at the correct spot.
I believe this is how Brogue does it.
-
Thanks for the feedback guys. I also though for an even more simplistic system you could just move monsters that are directly next to the player down the stairs with them. I think DCSS does something like this.
-
Another solution could be, using some sort of behaviour/trait for monsters like aggressive monsters/hunter types, that follow player everywhere. So when player change level, hunter spawn from start of the level after X turns, like other mentioned