Author Topic: Monsters moving between levels  (Read 6855 times)

rhysmakesgames

  • Newcomer
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Monsters moving between levels
« 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.

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: Monsters moving between levels
« Reply #1 on: March 21, 2016, 08:39:46 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.

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.
Everyone you will ever meet knows something you don't.
 - Bill Nye

wire_hall_medic

  • Rogueliker
  • ***
  • Posts: 160
  • Karma: +0/-0
    • View Profile
Re: Monsters moving between levels
« Reply #2 on: March 24, 2016, 05:11:51 PM »
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.

rhysmakesgames

  • Newcomer
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Monsters moving between levels
« Reply #3 on: March 29, 2016, 01:12:59 AM »
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.

Gornova

  • Rogueliker
  • ***
  • Posts: 79
  • Karma: +0/-0
    • View Profile
Re: Monsters moving between levels
« Reply #4 on: March 31, 2016, 09:09:00 PM »
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
Blog | Last game A droid story