clones clones strike

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

clones clones strike

#1 Post by Zireael »

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.
Last edited by Zireael on Tue Apr 22, 2014 5:39 pm, edited 1 time in total.

Marson
Uruivellas
Posts: 645
Joined: Thu Jan 16, 2014 4:56 am

Re: garbage collection of dead mobs sometimes bugs out

#2 Post by Marson »

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.

Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: garbage collection of dead mobs sometimes bugs out

#3 Post by Zireael »

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.

Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: garbage collection of dead mobs sometimes bugs out

#4 Post by Zireael »

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?

Marson
Uruivellas
Posts: 645
Joined: Thu Jan 16, 2014 4:56 am

Re: clones clones strike

#5 Post by Marson »

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.

Post Reply