123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|682|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> How many entities is too many?

Fri, 11 Apr 2008, 14:36
Orion Pax
I have read in some places that 8000-10000 entities is pushing it for blitz. Mostly depending on the stats of the machine as well. So would it be suffice to say that 3-5k is enough?

I am looking at 200 planets at max. 200 ports at max. no more than 200 stars generated at one time, they are repositioned as their distance from cam gets too far to create a moving effect. 25 players at max per game. no more than 20 shots per person I think at one time (500 max). Limited by a delay and a overheat. 20 nebula's with 10-20 images each (400 max).

So with just those we have 1525 visible entities. Not on screen at one time. Now there are other things I am not accounting for as this is the basics here. There will be mines. Maybe use sprites for those as well.

Now I know some people are going to say "Why load it all at one time?" I am not really sure how to go about removing and displaying everything when its withing range. I talked a bit about this earlier and think I might have a way to go about it but not sure. Is there a way to determine how far away an object is with just its coordinates and no physical entity created? Deleting when its out of sight is easy. Its just bringing it back once in range is the hard thing.
Fri, 11 Apr 2008, 15:04
JL235
I'd recommend just implementing it where you load them all and getting it working. You can add optimisations later to load them out and in when they are of visibility later. Even then only if speed is an issue, because it might not be at all.
Fri, 11 Apr 2008, 15:06
Orion Pax
So you believe that a limit of 3k of entities is suffice? Just making sure because I cant seem to find a definite answer.
Fri, 11 Apr 2008, 15:07
Jayenkai
If you build everything up, then HideEntity it all, that should (should, but not 100% sure.. test it!) remove the hidden ones from the renderer, and speed things back up.

If you get within X distance of a planet/moon ShowEntity it, and then just hide it again when you're too far away.

DX=MyX-PlanetX
DY=MyY-PlanetY
Distance = sqr((DX*DX)+(DY*DY))
^ You're probably best doing that test as little as you can, since the math's'll probably slow things down.. Maybe check about 20-or-so planets every frame, or something?

-=-=-
''Load, Next List!''
Fri, 11 Apr 2008, 15:13
JL235
It'll probably be easier to just check along the x and y axis and not do the sqr root. Especially since if it's outside of either co-ordinate then it'll be offscreen. i.e.

diffX = abs(myX - planetX)
diffY = abs(myY - planetY)

if (diffX > OFFSCREEN_WIDTH || diffY > OFFSCREEN_HEIGHT) {
hidePlanet()
}

I'm also not giving any value on how many entities you should or could have. I'm simply saying just build it and worry about speed later. If you really think it will be a problem then by structuring your program well it'll be easier to add further optimisations later in order to have planets be removed or hidden.
Fri, 11 Apr 2008, 15:51
HoboBen
Not considering speed or memory, there is a real upper-limit to surfaces, triangles and vertices in Blitz (IIRC it's one of those "32-bit integers aren't big enough" things), but I don't think you're likely to hit that limit!

But in your case, the only thing to do would be to test it. Get it working, and if it runs ok on your PC, post a demo in the showcase if you want and we can check it out. If you're afraid of us nicking your ideas perhaps use a few friends as testers.

-=-=-
blog | work | code | more code
Fri, 11 Apr 2008, 16:04
Orion Pax
Lol. Not afraid of you guys nicking my ideas. I have to admit that at first I didnt like the ideam of downsizing but after taking a look at it all and giving it a try, it looks just as good. I am more likely to give a demo here for ya'll to bash and trash...