Undocumented Renderable Actor Limit?
#1

Hi folks!

I've been fiddling around with the actors a bit lately, and there seems to be some sort of undocumented actor limit of around 50 in any particular area. I've found a couple of posts suggesting the same thing (here and here), but there's no mention of this on the wiki under either CreateActor or Limits. In my test server, I've created a 31 x 31 grid of actors (961 total), which is within the limit of 1000, however there only seem to be about 50 of them showing at any one time.

I have uploaded an image that I've annotated with numbers here: https://i.imgur.com/qvX9bFJ.png

The scene in the above image was generated with the following code:
Code:
for(new Float:x= 1400.0; x < 1432.0; x += 1.0)
	for(new Float:y= 1400.0; y < 1432.0; y += 1.0)
		CreateDynamicActor(286, x, y, 15.0, 0.0);
I've made sure they're not falling through the map using a timer as some people have suggested, and I've tried both with and without the Streamer plugin in case that was imposing its own limit.

I've been a bit out of the SA-MP loop, so I apologise if this is a known issue, but if that's the case I'd appreciate the wiki being updated with the latest information!
Reply
#2

So extend your tests then update the wiki with your findings.

- There appears to be 51 reorganize their spawn in a tight circular formation
- Create a command to show/hide an additional test actor
- Does the actor appear? How far away from the grouping do actors appear? If an actor appears can you create additional in the same location?
Reply
#3

Quote:
Originally Posted by Pottus
View Post
So extend your tests then update the wiki with your findings.

- There appears to be 51 reorganize their spawn in a tight circular formation
- Create a command to show/hide an additional test actor
- Does the actor appear? How far away from the grouping do actors appear? If an actor appears can you create additional in the same location?
I don't have an account on the wiki and account creation seems to be disabled. I posted here because I wanted to know if anybody else had encountered this, or indeed if anybody knew the actual limit - I'm sure I can't be the first person to try this, and I wouldn't have thought that I'm any sort of authority on this matter. Is there a place I should post this so that the wiki maintainers can update things?

I've already tried creating additional test actors with a command and they don't appear until I remove the others around me, so the server is definitely only showing me 51 actors at any one time. My current test tries to spawn 6 5x5 grids of actors. It happily spawns 2 entire grids, and puts one additional person next to that. Depending on the direction you approach the area from, different sets of actors spawn. I haven't completely pinned down how this is being figured out, but it roughly seems to be that the closest groups to your approach are the ones that get rendered.
Reply
#4

Try this spawn a 100x100 grid of them 10 meters apart then approach them out of stream from different angles. Do the same NPC's only appear? Or do only the first 51 to stream in show?
Reply
#5

Quote:
Originally Posted by Pottus
View Post
Try this spawn a 100x100 grid of them 10 meters apart then approach them out of stream from different angles. Do the same NPC's only appear? Or do only the first 51 to stream in show?
Good thought - I've tried that and it looks like the ones that the game draws first are kept. I tried approaching the grid from the North East, North West, South East and the South West, and the corresponding corners of actors were the first to load. Continuing down that path, I decreased my game's draw distance and it indeed looks like the actors that are drawn first are kept.

I've made a quick gif of this here.

I'd be interested in knowing if this limit is the same for everybody. The quick snippet of code I wrote to generate my grid of actors is as follows:
Code:
new Float:basex = 1400.0;
new Float:basey = 1400.0;
for(new Float:x= 0.0; x < 100.0; x += 10.0)
	for(new Float:y= 0.0; y < 100.0; y += 10.0)
		CreateDynamicActor(286, basex + x, basey + y, 15.0, 0.0);
Let me know if you get a chance to try it, and if the number is the same as yours!
Reply
#6

Seems like it is a client limitation then, the curious thing about it is why is it 51 actors? What makes that number so special? It just seems like such an arbitrary value you wouldn't expect.
Reply
#7

Quote:
Originally Posted by Y_Less
View Post
TBH I wouldn’t be surprised if you were the first person to try this. Neither this system nor SA were designed for large crowds. Yes, people slowly push the features as far as they can until they start hitting fundamental engine limits, but this takes a while. Actors were intended for standing around on their own, for example in shops or street corners, and most uses of them conform to that. I’m neither surprised nor upset that someone is trying something bigger. I’m also not surprised that it took this long, or that the engine can’t take it.

And if there’s no mention of a limit on the wiki, it just means no-one found or documented it yet, not that it doesn’t exist. As for why its 51 not 50, that could be a number of things. An OBOE somewhere, or during development a mapper wanted to place more actors somewhere, couldn’t, and they pushed the limit to exactly what was needed for that scene. A disturbing number of things in games are hard-coded to exactly what’s needed at that moment.
Great reply, and never seen OBOE acronym-ised before!

If it's not some sort of trade secret, how do the actors work under the hood? I just tried loading in NPCs and they render alongside the actors just as well as I do. Are there different kinds of entities in GTA SA, or are we all just people?

Lastly, how do I get the wiki updated?
Reply
#8

Quote:
Originally Posted by jonrb
View Post
Lastly, how do I get the wiki updated?
Try logging in with your SA-MP forum details.
Reply
#9

Quote:
Originally Posted by Dignity
View Post
Try logging in with your SA-MP forum details.
It gives me the following:

Quote:

Login error: There is no user by the name "Jonrb". Check your spelling, or create a new account.

Note that I normally log into the forums as "JonRB", but I tried that and "jonrb", and it rejected both on the wiki with the above message.
Reply
#10

This is probably a GTA SA limit, I don't remember any point in the game when it had over 20 peds. They probably didn't need more.
Reply
#11

Quote:
Originally Posted by MEGADETHS
View Post
This is probably a GTA SA limit, I don't remember any point in the game when it had over 20 peds. They probably didn't need more.
I wonder .. does it makes differences with the limit when his code was done in caligulas casino (in the shop script there are many peds like actors) unfortunately i dont see anything related for this in F5 info

Sorry for a little offtopic
Reply
#12

The limit is not related to Peds as such, since you can have more than 200 NPC Peds rendered plus 50 actors plus some players (although at that point it's getting glitchy, exceptions start popping up etc).

Hit this limit with a script I made sometime ago and replaced them with NPCs, there can be a lot more NPCs/Players (which should have a shared limit) than actors. It may be an intentional limit so that actors don't take too many slots which would result in players and NPCs to vanish or not streaming in, since actors aren't really important, or at least much less important than other players.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)