Here is how it happened, by now it has happened wuite enouth for me to notice how it works :
- someone killed alien OM
- I entered the alien base and clearly noticed that all turrets were offline
- I see an OM and attack it, since it wasn't finished building, I don't really know when it's killed ( but that is a different bug ), anyway, soon enouth it explodes violently
- Alien turrets then got back online at that point !!!
For the end of the story, I got stuck by an offline trapper on the way back I've entered the base and died :/
I think the same bug happens when you kill a egg in building which would have been the only egg powering nearby turrets.
thers more, I was just in a game where I killed GROWING om, and 10 seconds later granger that 0.2 seconds before just made an egg. So the egg was made a good 10 seconds after growing OM exploded (id didnt grow 100% before explosion).
I think I pinpointed the problem. In src/game/g_buildable.c, we do the test if a buildable as finished spawning/building and set their ent->spawned flag to true. But we do that even if the buildable was killed already.
It is only a problem for aliens because their building remains as an acid pool on the floor when they die. Human buildings which get killed during spawn will simply disapear.
Created attachment 1093[details]
partial patch for building eggs just after growing om exploded
I'm not 100% sure it works (3 tries worked = couldnt build egg just after the om blew up). I have only one computer able to run trem , and its hard to check things that need 2 grangers and a human that way :).
Someone willing to help me test it would be GREATLY appreciated.
this patch adds && (tempent->health > 0 ) when checking if OM is available, and doesnt let to build anything when OMs health is below one. Same has to be done to evolve code.
Now that Im aware of this bug I cant keep myselfe from seeing it in almost every game, ppl build eggs/evolve when 'not fully grown om blows up' all the time :(( its driving me crazy :/
BTW I tested this bug extensivelly and cant make ACID work when om blows up, will try with eggs/trappers later.
trappers dont work either when om gets blown up, either normal om or before its fully grown.
There is one other thing that drives me nuts, grangers have to wait till blown OMs acid wears out before they can build new om, something like
case BA_A_OVERMIND:
if( tempent->spawned && ( tempent->health > 0 ) ) break;
reason = IBE_OVERMIND;
break;
on line 2525 would let grangers build om as soon as old one gets killed (health <1).
Created attachment 1096[details]
Patch to prevent a killed om/egg from powering alien buildings
I'll have to find a way to create a fix and test it. For now, I have made only client changes :)
Ok, I pretty sure now of what is the exact cause and I'll put my hands on a second computer to test that soon.
I don't think your patch will work because the killed OM ( and eggs ) have more than 0 hp ( nothing in BuildableThink prevents an already killed but not finished building from gaining health and getting the ent->spawned flag to true.
Here is a patch which fixes that. Tested and working for OM death. I have no doubts it'll work too for egg death but that one is harder to test since the other buildings will decay fast when there are no eggs to sustain them.
No need to touch at the EVO code. The same that my patch doesn't touch at the "build" code. I changed the fact that alien buildings would still regen their health even if killed before finished building. Now, since they do not regen health at all, all the places in the code where we check for OM->health > 0 and/or OM->spawned are fixed by my patch.
Of course, you can't be sure until you've tested it, yet I'm sure it'll work :)
I'll just note that we need both patch applied if we want to fix that for good.
My patch makes it so that an alien OM/egg killed before it finished building will not be considered finished and working until the acid disapears. The other patch will make it so that an already FINISHED OM but killed and in the "acid pool" state will not unlock the ability to build.
The second case maybe isn't considered a bug, but it sure makes egg hunts harder since even if you kill the OM as soon as it spawned, the aliens will still have a few precious seconds during which they can still build as many eggs as they want.
Created attachment 1093 [details] partial patch for building eggs just after growing om exploded I'm not 100% sure it works (3 tries worked = couldnt build egg just after the om blew up). I have only one computer able to run trem , and its hard to check things that need 2 grangers and a human that way :). Someone willing to help me test it would be GREATLY appreciated. this patch adds && (tempent->health > 0 ) when checking if OM is available, and doesnt let to build anything when OMs health is below one. Same has to be done to evolve code. Now that Im aware of this bug I cant keep myselfe from seeing it in almost every game, ppl build eggs/evolve when 'not fully grown om blows up' all the time :(( its driving me crazy :/ BTW I tested this bug extensivelly and cant make ACID work when om blows up, will try with eggs/trappers later.
Created attachment 1096 [details] Patch to prevent a killed om/egg from powering alien buildings I'll have to find a way to create a fix and test it. For now, I have made only client changes :) Ok, I pretty sure now of what is the exact cause and I'll put my hands on a second computer to test that soon. I don't think your patch will work because the killed OM ( and eggs ) have more than 0 hp ( nothing in BuildableThink prevents an already killed but not finished building from gaining health and getting the ent->spawned flag to true. Here is a patch which fixes that. Tested and working for OM death. I have no doubts it'll work too for egg death but that one is harder to test since the other buildings will decay fast when there are no eggs to sustain them.