blitz capacities or my capacities?

Blitz3D Forums/Blitz3D Beginners Area/blitz capacities or my capacities?

Santiworld(Posted 2008) [#1]
hi, i work in a big war game...

the question i have, is, when i add new vehicles, rockets, sprites smoke, clouds, the game is to heavy, no to the video card, is heavy to process the collisions i thing... or the code i wrote for de IA... i dont know...

but what can i do, i can have 40 vehicules driving by IA, firing, smoking, etc...?

i use low poly objets, but i thing i wrong with the program code...


boomboom(Posted 2008) [#2]
unless you post up your code, we can't really do anything when you ask about a question relating to specifically your code.


GfK(Posted 2008) [#3]
How many polys is 'low poly'?


Dreamora(Posted 2008) [#4]
well, bone animated < 2000, static stuff < 5000 polygons (for a whole car ).
not more than 50000-75000 polygons on screen at once and onscreen means anything even those stuff that you don't see because its blocked by something else (use the rendered polygons command to retrieve the real number)


Stevie G(Posted 2008) [#5]
What kind of collisions are you doing? How may poly's is the level mesh you are colliding with? What collisions are in place for the vehicles?


GfK(Posted 2008) [#6]
Dreamora - I was asking the original poster. How can you possibly know what he deems to be low poly??


Ross C(Posted 2008) [#7]
You could try setting up proxy meshes for collisions. Super low poly meshes you will use to check collisions, but draw the actual mesh. And try and set aside a limited time for AI, processing it over the course of multiple loops, rather than letting the AI decide when it's finished.


boomboom(Posted 2008) [#8]
As these replies show, it could be a load of things. If your still at a miss, post your code :)


Tab(Posted 2008) [#9]
You hide the entities when they are out of view?


Dreamora(Posted 2008) [#10]
I know that you asked him. Just wanted to give him a reference on what "low poly" is meant to be in Blitz3D.

But there is another thing to add there: If you model your level mesh or the like check out Rottbots chunked mesh resource in the code archives. That will split it into sub meshes, making collision checks far more performant (if you own Sswifts Shadow System this would allow to use it as well)

but yes, Tabs point is vital. you need to disable anything that is not in view, especially particle system and cloud system (I assume you use PCL Clouds or a similar efficient one?)


Ross C(Posted 2008) [#11]
Just a side note. I wouldn't use HideEntity on AI's if they are not in view. As they will continue to move around, they will need collisions. If you hide them, they will go straight through the terrain upon colliding. Not a good thing ;o)


GfK(Posted 2008) [#12]
Entities that are not within the camera view aren't rendered anyway, so hiding them is pointless.

Also, EntityInView is determined by the entity's axis, so if an object has a central axis, which has just gone off the screen, and you hide the entity, the remaining bit that's actually still visible to the player will simply disappear. And whichever way you cook it up, that's going to look crap.


Ross C(Posted 2008) [#13]
The only benefit you get is to disable collisions, which in some cases, isn't a good idea.


Stevie G(Posted 2008) [#14]
I'm with Gfk on the hideentity thing. What is the point of hiding and showing entities when blitz automatically culls them if they're outwith the camera's view fostrum. This point is not vital.


Ross C(Posted 2008) [#15]
Indoor levels would need this. There's not much point of having 20 rooms being rendered, if you can only see 2 or 3.


Dreamora(Posted 2008) [#16]
GFK: rendering and hide entity have 0 to do with each other
Alpha 0 and out of view are the same.

HideEntity is a far larger scale command:
1. It disables animation updates
2. It disables collision
3. It disables picking
4. On terrain it disables the terrain detail update
in short: It disables ANYTHING related to UpdateWorld (so if you hideentity something before updateworld and show it afterwards, it will render fine without affecting the world)


Santiworld(Posted 2008) [#17]
hi...

my vehicles, consist in a cube(), and my vehicle mesh, is parent to this cube...

the collision are sphere to mesh...
Collisions 3,1,2,2 ;contra el tanque
Collisions 3,2,2,2 ;contra las torretas
Collisions 3,10,2,2 ;contra el piso
Collisions 3,11,2,1

1 tank body (is a cube)
2 torret body (another cube)
10 terrain
11 water

3 is the munition sprite, is created when a tank fire...
entitytype 2, radius 2

screenshot :
http://www.blitzbasic.com/gallery/view_pic.php?id=1786&gallery=&page=1

the whells are another entitys.. without collision...


i see when i reduce the camerarange limit... the game run in 70 FPS... until the enemy tanks appears... and the fps go to 30 or 20...

is not necesari hide the far tanks, or not visibles, becouse when i dont see a tank, the video run fast...

i count the polys, each tank have 16493 triangles (poly)
maibe is that... :(

thanks people, i go to try to reduce de polys... like say Dreamora, no more than 5000, maibe i can reduce more...

this is my first big program, thank to all for the answers.. are very helpfull...


Santiworld(Posted 2008) [#18]
if i hide an entity, is the same when i use the camerarange?..
or the camerarange afect the alpha?...

dreamora, you say i can use this?..

hideentity tank
updateworld
showentity tank
renderworld


days ago, i use this... and the game, run a little more fast.. but this is not good, becouse, there are 3 frames when the collision not detect..


i=i + 1
if i = 4 then
updateworld
i = 0
end if
renderworld


Ross C(Posted 2008) [#19]
CameraRange will reduce what is rendered, BUT, things will still get updated. Animation, collisions... etc

16,000 polygons seems a hell of alot for a tank. I think you could reduce that by 1/4 without much noticable lose in quality.

Also, when using FLIP, your game will run at the framerate as the monitor refresh rate.

Use:

Flip 0


To see the true FPS of your game.


Santiworld(Posted 2008) [#20]
wow.. i change like u say..
with FLIP 0 the game run 170 frames...

i have to much to learn... :) thanks!!!..


Santiworld(Posted 2008) [#21]
of corse, 150 frames witout tanks in camerarange.. :p


Ross C(Posted 2008) [#22]
It's because the framerate is locked basically. It it can't keep up with 70 fps, which seems to be the vertical refresh rate, it will effectively half the fps.


chwaga(Posted 2008) [#23]
...are you french, a bad speller, or both?


SLotman(Posted 2008) [#24]
That tank in the screenshot uses 16k triangles?! Each?! No wonder you're having slowdowns...

By the looks of it it could be done with less then 2k (I think maybe even less, like 1k), with the exact same visual... you should find a better 3d artist ;)

Also are you using copyentity to duplicate tanks, or are you loading the same mesh a lot of times (once for each tank?). Second option would be a big waste of resources...

And I hope your tank uses a single texture, instead of multiple ones...? more textures used on more meshes, means more slowdown... try to group as much as you can in a single texture, then UV map it accordingly.


Mustang(Posted 2008) [#25]

That tank in the screenshot uses 16k triangles?!



Cool - every Gears Of War main character had less polygons... meaning WHAT ARE DOING? Way too much polys, and for a simple form like that is overkill. If you want smooth shapes, use at least LODs.


Ross C(Posted 2008) [#26]
chwaga, he's from argentina, which is pretty easy to find by clicking on his profile. Do you know the language of Argentina? :oP


Santiworld(Posted 2008) [#27]
:) render of the tank with 16k poly is this..

my error, becouse, the rockets and other objets have to many polys, i fix that now.... and reduce to 6k.

--------------------
other error...
i load one mesh for each car... :(

tanques = 15
for i = 0 to tanques
tank(i) = loadmesh("tank...
torret(i) = loadmesh("torrat.3ds...
whell1(i) = loadmesh ...
whell2(i)..
etc...
next
-----------

maibe is better if i use type for each tank?...

the texture of the tank, is a single bmp, 1024x1024.. using Unwrap UVW....

thanks again, the only way i have to finish the game, is by this forum :)...

i new in blitzbasic, i come from qbasic 4.5, so, this is a big help to me...


Ross C(Posted 2008) [#28]
I'd say the most polygons are in the wheels, and the missiles. If you can reduce the polygon count of those, it will help alot.

Even 6k polygons is alot. Remember. If you are using bones to rotate the wheels, this will cause a farily decent slowdown, as all bone transformations are done on the CPU.

You might be best putting the tank together in your unwrap program if you can. Then export it and load it as an animated mesh. Then in blitz, you can use find child to break up the model again. Saves you messing about loading wheels and positioning them etc etc.

It's really up to you though.


Mustang(Posted 2008) [#29]
One single texture for everything is always good, but remember that EVERY separate mesh is separate surface... so having one big texture with body + wheel textures is useless unless you have one mesh and use bones for wheel rotation.

If you load every wheel separately you can use separate texture for it since it won't get any speedup from one unified texture anyway.

Blitz is bit old techwise and current GPUs are not "optimized" for legacy fixed function pipelines like they are for modern shaders... and since bones are handled with CPU anyway it's a problem to design good setup for Blitz.

But CPUs are fast these days (although Blitz can't use multiple CPUs) so I would probably bone the whole tank/apc, that way it would be ready for more modern languages as well. But it is also more work compared to loading every piece separately.


Santiworld(Posted 2008) [#30]
i like try the bones.. but i never use... i don't know how..

exist here a tutorial for that?...


Mustang(Posted 2008) [#31]
For bones you need for starters suitable modeling app... MAX or Lightwave will work because both have usermade converters to convert the mesh to Blitz3D's .B3D custom format which has bone support.

Blitz3D can NOT load directly any other format that has bones...it can load .X format but only the older version that does not support bones like current .X does. You can also use Ultimate Unwrapper 3D for conversion work, I think...

Bones ARE more work in the modeling/setup/conversion phase but you got very efficient model in the end, so it might be worth it.


Ross C(Posted 2008) [#32]
I think he'll need to take the poly count down a good bit. Boning and animating a mesh at 6000 polygons * teh number of tanks, might cause an even bigger slowdown.


Dreamora(Posted 2008) [#33]
yupp with bones, 2000 - 3000 is the max per object. less is better
because otherwise users of weak graphic chips will only see an ugly stutter as the bandwidth is the restricting factor today, not CPU or GPU when it comes to cpu driven bone animation!