What is the maximum number of entities?

Just wondering, because it would be very useful to know. I wish there was an error message if you reach that number. Instead, currently spawned entities (when you are above the limit) are apparently just zero, which you have to account for if you don’t want your gamemode to become buggy.

Also keep in mind that a lot of things count as entities, for example, the icons you can generate. I wish they would slightly change the number of possible entities, since the current limit doesn’t allow for that many interesting gamemodes.

Edit: Apparently the limit is currently 32.

You could count how many are allowed.

Just create a loop that creates a entity, increments a variable by 1, shows that var on your hud and waits for like 0.5 seconds.

As soon as you see things despawning you know you hit the limit.

Just did. It’s just 32… that’s really low. Btw, entities don’t despawn, just the new ones are not created.

Well, there we go. 32 is indeed pretty low. You could make a request in the feature request thread to increase it.


The number of entities that exist has a big impact on performance, so I wouldn’t expect a great deal more even if they do raise the cap.

What you might be able to do is maintain some arrays with enough info to create the entities you need, and then actually spawn or despawn them with whatever radius or visibility constraints are needed to stay below the limit. I haven’t yet tested the limits around array length, but I think it’s a lot higher than 32.

It really doesn’t. An entity can be something as small as a 2D effect somewhere in the world (orb effect, for example). One single hero requires more performance.


It really doesn’t. An entity can be something as small as a 2D effect somewhere in the world (orb effect, for example). One single hero requires more performance.

The effect entities we can spawn with Workshop definitely seem comparatively cheap as entities go. As I understand it, spawning entities in general is still one of the few ‘weak spots’ (big air quotes here) in the OW engine because unlike most kinds of work, entity creation isn’t deferred until later in the frame, which in the OW design causes loss of cache locality benefits, which causes a temporary performance hit.

There’s a GDC talk from 2017 presented by Timothy Ford which is fantastic for a lot of reasons, and talks about this aspect of their rendering logic in a couple spots I’ve linked below, mostly in the context of “impact effects”, but also entity spawning in general. I’m not sure if Workshop effects count as ‘impact effects’ as described in the video, but they definitely count as entities.

first part, during the 'prepared remarks’

later in the video, in the Q&A (erm… slightly NSFW I guess)

If anyone is interested, the current entity limit is 130.

I created a loop that creates a new sphere effect every 0.5 seconds and stores the last created entity in a player variable. As soon as no more entities can be spawned, the player variable is equal “0”. This is when I stopped my counter.