- Joined
- Aug 7, 2013
- Messages
- 1,342
Hi,
In many games with overworlds, there is a random encounter mechanic where every so often enemies will suddenly attack the player. I am not going to move the player to a separate area to do the battle--instead the enemies will just appear in some range around the player.
I think the catalyst should be whenever the player moves, so I am assuming there is
The next issues are handling running away--what do I do with those creeps? Or do I make them follow the player forever? Or disappear after an amount of time.
And then also making sure I don't spawn more creeps if the player is moving around in a battle--it would quick snowball. But I do not, REPEAT, do not want to make use of a battle detection system (e.g. tell whether a player is under attack or in battle).
I need to also control the frequency of encounters to make sure they happen often enough, but not too frequent to tire the player.
Also, for spawning the creeps, I guess I can just pick a random point that is within some distance of the player?
For different regions (and different creeps) I suppose I can use flags that tell me what "region" a player is in, so I know what creep tables to use.
Any suggestions?
In many games with overworlds, there is a random encounter mechanic where every so often enemies will suddenly attack the player. I am not going to move the player to a separate area to do the battle--instead the enemies will just appear in some range around the player.
I think the catalyst should be whenever the player moves, so I am assuming there is
TriggerRegisterPlayerUnitEvent(..., PLAYER_UNIT_MOVE_EVENT)
that detects whenever one of the players units moves or is ordered to move. The next issues are handling running away--what do I do with those creeps? Or do I make them follow the player forever? Or disappear after an amount of time.
And then also making sure I don't spawn more creeps if the player is moving around in a battle--it would quick snowball. But I do not, REPEAT, do not want to make use of a battle detection system (e.g. tell whether a player is under attack or in battle).
I need to also control the frequency of encounters to make sure they happen often enough, but not too frequent to tire the player.
Also, for spawning the creeps, I guess I can just pick a random point that is within some distance of the player?
For different regions (and different creeps) I suppose I can use flags that tell me what "region" a player is in, so I know what creep tables to use.
Any suggestions?