m-byte918 / MultiOgarII

A continued version of the original MultiOgar, an open source Ogar server implementation written with Node.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In the Experimental gamemode, viruses stop spawning

joelsgp opened this issue · comments

commented

After a while you end up with all mother cells and no viruses.
I suspect this is because they both share the same limit, and mother cells tend to spawn more often. I'll probably read the code properly and make a pr if no one else does it first.

commented

I am having this same problem on my instance of MultiOgarII.

commented

After some more digging it seems like they don't share the same limit, maybe some collission issue stopping viruses from spawning when there are too many red cells? I'm finding it hard to test because when I reduce timeStep to speed up the server it seems to stop red cells from spawning at all.

commented

Does this happen in other gamemodes too?

After reading some more and running a server for a few hours with debug prints added, I think the problem might be that in the spawning process, a new entity is instantiated, then collision is checked, and if the check fails, it doesn't spawn. A virus is only spawned when one is eaten (and when the server starts but that's irrelevant), and the chance of a virus spawning is less than 1 due to collision, so eventually there will be no viruses.

The simple fix is to make a loop of checking collision and getting a new random position.

fixed in #1570