Woes with activation regions
Posted: Fri Sep 02, 2011 1:57 am
Hello there, once again.
While I was able to solve the issues I was having with weirdly disappearing enemies / healthbars thanks to skydereign's help, another issue arose, this time exclusively related to activations regions, or, well, the use I'm giving to them.
On my current game iteration, my activation regions for each room overlap a bit so my player actor has an existing and definite target to move to when moving across rooms. However, this causes issues at times. For example, sometimes enemies or objects spawn twice, or they disappear because the view just left the other activation region they belong to, or some control variables I have are set more than once because as long as the player is in the intersection of the regions, both will seemingly exist.
I'm trying to look for a solution to this problem, one thing I was thinking about was to actually spawn enemies/items not when they come into view (Because view enters their activation region when overlapping), but rather when the player actor reaches his destination (Collision event with "prevmk" and "nextmk" actors, which I'm using as destination locations when moving between rooms), but I imagine this would cause a delay that would turn annoying with a sizable number of actors, and would limit my placement options (It would be bad to place an enemy right next to a "door", because it would not be there by the time the player gets inside, but would suddenly appear as it gets spawned, for example). Another option would be ensuring the existence of only one spawned actor per spawner, but would things like emitters rather impractical. I would like to know if anyone else has experienced things like these, and if they did, which approach you used to solve them. Thanks a lot in advance!
While I was able to solve the issues I was having with weirdly disappearing enemies / healthbars thanks to skydereign's help, another issue arose, this time exclusively related to activations regions, or, well, the use I'm giving to them.
On my current game iteration, my activation regions for each room overlap a bit so my player actor has an existing and definite target to move to when moving across rooms. However, this causes issues at times. For example, sometimes enemies or objects spawn twice, or they disappear because the view just left the other activation region they belong to, or some control variables I have are set more than once because as long as the player is in the intersection of the regions, both will seemingly exist.
I'm trying to look for a solution to this problem, one thing I was thinking about was to actually spawn enemies/items not when they come into view (Because view enters their activation region when overlapping), but rather when the player actor reaches his destination (Collision event with "prevmk" and "nextmk" actors, which I'm using as destination locations when moving between rooms), but I imagine this would cause a delay that would turn annoying with a sizable number of actors, and would limit my placement options (It would be bad to place an enemy right next to a "door", because it would not be there by the time the player gets inside, but would suddenly appear as it gets spawned, for example). Another option would be ensuring the existence of only one spawned actor per spawner, but would things like emitters rather impractical. I would like to know if anyone else has experienced things like these, and if they did, which approach you used to solve them. Thanks a lot in advance!