From time to time, when playtesting Veins, I will get a mob which steadfastly refuses to be removed from the map.
I get the XP for killing it and I can see the results of on_takeHit and die() triggering (removing effects etc.), but the mob still sits there and refuses to disappear even after getting hps in the -100s.
Usually it's only mildly annoying, made worse if it sits on the stairs or in a narrow corridor.
Browsing through the forums revealed an old thread which says that this is an engine bug which sometimes resurfaces.
Help? I've plugged safeguards (removing all effects, calling self:die() below -10 hp etc.) practically everywhere I could think of, and even tried to write a function which would kill off any mobs remaining in the level with hp below -10 every turn, but nope, these buggers keep popping up.
If I'm really unlucky, I get 2-3 in a single playthrough, and in one case, I got three in a single level!
EDIT: Only noticed it lately but checked every change last made that could have an effect and nope, still happens.
clones clones strike
Moderator: Moderator
clones clones strike
Last edited by Zireael on Tue Apr 22, 2014 5:39 pm, edited 1 time in total.
Re: garbage collection of dead mobs sometimes bugs out
Is it still in the map's entities list? It sounds like it may be removed from there, but is still being pointed to by the map tile. As long as it has a reference somewhere, garbage collection won't touch it.
You could try my AWOL addon and see if that helps narrow down the issue.
http://te4.org/games/addons/tome/marson-awol
BTW, there are certain functions that you must use to affect an actor. For instance, just changing its x and y coordinates can cause funky issues (like clones); you must use entity:move(x,y) to avoid them.
You could try my AWOL addon and see if that helps narrow down the issue.
http://te4.org/games/addons/tome/marson-awol
BTW, there are certain functions that you must use to affect an actor. For instance, just changing its x and y coordinates can cause funky issues (like clones); you must use entity:move(x,y) to avoid them.
Re: garbage collection of dead mobs sometimes bugs out
Thanks, I grabbed the addon and I think I'll integrate it with my game as I am working on a debug menu right now.
Re: garbage collection of dead mobs sometimes bugs out
I love you, Marson. The buggy entities weren't in the entities list, so I used the kill clones key to kill them off.
Is there a way to automate killing those? Every game turn?
Is there a way to automate killing those? Every game turn?
Re: clones clones strike
Cycle through every single map grid every turn. Since clones have the same UID as the original, I can't think of a way to determine which is which other than:
1. check each square for an entity
2. use the UID of that entity to lookup the x,y coords for that entity.
3. if the x.y coords of the map square don't match the coords of the entity, it's probably a clone.
I haven't tried it, but that may slow things down if you run that loop every turn. I chose to make it manual for the sake of those on slower machines. You generally know if a clone spawned, since it will just sit there. If you didn't mind that, you could just take the code I have attached to CTRL-C and hook it into move or action hooks.
1. check each square for an entity
2. use the UID of that entity to lookup the x,y coords for that entity.
3. if the x.y coords of the map square don't match the coords of the entity, it's probably a clone.
I haven't tried it, but that may slow things down if you run that loop every turn. I chose to make it manual for the sake of those on slower machines. You generally know if a clone spawned, since it will just sit there. If you didn't mind that, you could just take the code I have attached to CTRL-C and hook it into move or action hooks.