Limit entities, how to

  • Thread starter Thread starter utunnels
  • Start date Start date
U

utunnels

Guest
Entities became unlimited a while back until you run out of memory. But I found some side effects recently.

Battletoads was the first mod that hit the odl max entities limit. And I tested Night Slashers X using recent unlimited version, hit flashes/blood drops easily went over 500 in the first stage. I'm pretty sure in latter stages it could easily go over 1000. That will kill any console but PC.

So recent builds have a new command in levels.txt called maxentities, which will bring back this limit if you wish.

The smallest value is 150, so you need to use 150/300/450... etc, usually 150 is enough, unless you are making a pc game, but if so, you don't need this at all.

This is also a new entity header command called priority, it has no effect when set to 0 or above. But if it is negative, entity can be overridden by another if certain limit is reached. Usually those flash or dust entities are less important and can be safely overridden.

The limit is called spawnoverride, you need to set it in levels.txt, of course, it should be less than or equal to maxentities.

For example:

maxentities 150
spawnoverride 50
 
yeah i had like gazillion zombies in a couple of stages but i beat the stages without losing life so i thought ah ill leave it . ;D
 
so if i have enemies that only will be used on the first stage for example i can set priority -1 for then and let they be overriden by another enemies later on in my game? or the memory dont work this way?
 
So there won't be like more than 150 maxentities anymore? If so, would I set to, like, 500 or 700 or so?

I got a problem with spawning none type entities and I put them together in the stage. It's limited to like 8, 9, or 10 spawns in a stage. I already set several entities in code so the first ones show in-game, but the last ones don't show. I'm using 3701.
 
You need to use a more recent version.

Usually you don't need to change anything, unless you want to have a limit.


rafhot said:
so if i have enemies that only will be used on the first stage for example i can set priority -1 for then and let they be overriden by another enemies later on in my game? or the memory dont work this way?

No, I mean entities, not models.
 
Is there warning if entities limit has been reached?

If not, I request a warning in log file so modders or players at least could be notified if limit has been reached.
 
No.

Currently it will automatically increase the limit. If you are using maxentities command, you can just draw a debug message on screen using openborvariant("count_entities").
 
Back
Top Bottom