Original Post
So, I'm working on a little Roguelike game(on XNA, if it matters), and I can't quite figure out how to efficiently handle initiative...i.e. who moves when. Play is turn-based. Entities(the player, npcs, monsters, etc.) in the game have a Speed Rating. The player's speed starts at 100, but can go up or down during the game. Faster monsters will have a speed of 20, 50, etc. while slower ones might be 150, 200, etc. The speed essentially determines how long an Entity waits before performing a turn. So a monster with a speed of 20 can perform 4-5 turns for each move the player(at speed 100) makes. Inefficient solution? (I'm pretty sure this would be terrible if there were lots of entities) After each player move I could subtract 5 from every Entity's Speed on the level, with Entities performing a Move when they get to zero, with their Speed then restored. Better solution? Was thinking I could instead place the entities in an ordered list, ranked by Speed. A(20) B(20) C(25) D(40) E(50) F(60) G(Player)(100) H(120) A goes first, then moved on the list to (current speed + speed) or (40), between D and E. B is next, get placed between A and E. C goes next, gets put behind E, then D is put behind F. A(20) B(20) E(50) C(25) F(60) D(40) G(Player)(100) H(120) A and B end up after F, E behind G(Player), etc. This seems to work okay, but I was wondering if I'm overlooking a simpler solution?