Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Lots of Bots; Please, help my framerate!
Topic Started: Nov 22 2012, 07:14 AM (716 Views)
RonBurgundy
Member Avatar
Forum Borat
[ *  *  *  *  *  * ]
So I want to have at least 5 bots in a scene. THe problem is it kills the frame rate.
Guess what I'am looking for are some tips to help me increase/maintain a consistent framerate.

Info:
-Room Speed is 300.
-Total Triangles: around 6000.
-9 total objects in room.(1 light object)
-The bots themselves are so low poly its sad, around 38kb per each model.
-Models are in .u3d format.
-Guns are attached to each bot via martix code. The guns are around 20-30kb.
-Textures for bots are 256x256, guns 128x128.
-Without ANY bots FPS can reach a max of 80.
-With 5 bots it drops to around max of 44, almost half the original framerate.
-I've tried taking out all the AI code in the step event for the bots, fps maxes out at 56, AI code can't really be optimized any further.(Only around 65 lines.)
-Each AI does need to cast 3 rays: One for map checking, player checking, and another for map checking directed at the player.
(I would use GetIntersectedObject(), however because it loops through all objects it kills my framerate even more.)

I'am releasing Matrices/Vectors properly. And releasing as many variables as possible.
My hardware is 7 years old so maybe this can't be helped. Just hoping I can improve somewhere, any tips would be very much appreciated.
Edited by RonBurgundy, Nov 22 2012, 07:47 AM.
!!! DEFEND POP PUNK !!!
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
6000 triangles is nothing so that can't be the problem. Must be somewhere in your code, a bad loop or something.
Offline Profile Quote Post Goto Top
 
PoniesForPeace
Member Avatar
Elite Member
[ *  *  *  * ]
6000 triangles as a render is nothing...

When you add bones to those triangles, it's even laggier.

When you use math functions with those bones, it's even laggier.

When you add AI routines, it's even laggier.

When you add lightmaps to those triangles, it's even laggier.

When you constantly call AttemptMove and CheckRay with those triangles it goes steadily downhill.

I like to keep my maps under 2000 triangles.
favorite soda: oogave agave watermelon Cream

favorite cheese: blueberry winsledale

Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
PoniesForPeace
Nov 22 2012, 08:11 PM

I like to keep my maps under 2000 triangles.
It doesn't work that way. It depends on the style of your game.Sure, you could probably make a GTA style city with less than 6000 triangles, but it would probably look like shit and be made solely out of cubes. My current level is a few hundred thousand triangles including all prop models, but that's with Unity so it's a completely different story.

How old is your machine and what else do you have in the scene besides the bots?
Offline Profile Quote Post Goto Top
 
Reikyrr
Forum God
[ *  *  *  *  *  * ]
Despellanion
Nov 23 2012, 11:43 AM
PoniesForPeace
Nov 22 2012, 08:11 PM

I like to keep my maps under 2000 triangles.
It doesn't work that way. It depends on the style of your game.Sure, you could probably make a GTA style city with less than 6000 triangles, but it would probably look like shit and be made solely out of cubes. My current level is a few hundred thousand triangles including all prop models, but that's with Unity so it's a completely different story.

How old is your machine and what else do you have in the scene besides the bots?
Quote:
 
7 years old

I dont think 44 fps is that bad for a machine that predates my brother, however gamemaker objects drop the framerate alot, you could try to make the bots out of one instance. instead of an instance for each bot.
~Inspirational quote~
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Reikyrr
Nov 23 2012, 08:24 PM

I dont think 44 fps is that bad for a machine that predates my brother, however gamemaker objects drop the framerate alot, you could try to make the bots out of one instance. instead of an instance for each bot.
So there's only the bots in the scene and nothing else?
Offline Profile Quote Post Goto Top
 
RonBurgundy
Member Avatar
Forum Borat
[ *  *  *  *  *  * ]
Sorry I'm late.

Thanks Ponybro. I took this into consideration and moved the ellipsoid checking to an alarm event that repeats itself every 3 steps instead of every begin/end/step. Gave me around 10 extra FPS, so far no bots have gone through the walls even though they do shake a bit.

@Desp
Okay In the scene there is:
1 Map object around 30kb.
1 light point
5 bots
6 guns
1 player (same model as bots)
1 ray object to do bullet stuff.
PC Specs:
Intel Celeron processor @ 2.93Ghz
1 Gb RAM (another Gb on the way)
Nvidia Geforce 6200 with 128mb RAM



@Reikyrr I Like your suggestion. Would it still be possible however to do individual collision checking with each bot if I did put them in one object?

EDIT: Ugh Speaking of bots... <_<
My favorite one is Cleaning Bath Towel: For Basic and Specific functions.
Edited by RonBurgundy, Nov 24 2012, 06:42 AM.
!!! DEFEND POP PUNK !!!
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
RonBurgundy
Nov 24 2012, 06:17 AM

EDIT: Ugh Speaking of bots... <_<
My favorite one is Cleaning Bath Towel: For Basic and Specific functions.
I got it Posted Image

How many triangles is your map? And how many textures does it use?
Offline Profile Quote Post Goto Top
 
Reikyrr
Forum God
[ *  *  *  *  *  * ]
RonBurgundy
Nov 24 2012, 06:17 AM
Sorry I'm late.
I Like your suggestion. Would it still be possible however to do individual collision checking with each bot if I did put them in one object?
Pooh, I wouldn't know for sure. I just know that you can have multiple u3d objects in one gamemaker object, you can call step for them etc. There is an example for it, but it's kinda ancient. http://s9.zetaboards.com/Ultimate3D_community/topic/173042/1/
Edited by Reikyrr, Nov 24 2012, 04:50 PM.
~Inspirational quote~
Offline Profile Quote Post Goto Top
 
RonBurgundy
Member Avatar
Forum Borat
[ *  *  *  *  *  * ]
@Desp Nice! No job Rambo smiley can't handle.
My map has...

Get ready for it...

514 tris.

It's a test map too with 4 textures.
@1024,256,256 and 512.

Thanks Reikyrr, I was playing around with that but couldn't to manipulate each file individualy. Ill keep trying.
!!! DEFEND POP PUNK !!!
Offline Profile Quote Post Goto Top
 
PoniesForPeace
Member Avatar
Elite Member
[ *  *  *  * ]
keep the textures 256x256 or lower, i read something somewhere about any textures higher than that aren't optimized or something like that.
favorite soda: oogave agave watermelon Cream

favorite cheese: blueberry winsledale

Offline Profile Quote Post Goto Top
 
RonBurgundy
Member Avatar
Forum Borat
[ *  *  *  *  *  * ]
PoniesForPeace
 
keep the textures 256x256 or lower,

Gross. This game will look like a Playstation 1 game by the time it's done. I'll resize teh imagez den.

Honestly, Using the GetIntersectedobject is what's really killing my FPS. It's only being used once for shoosting.

I'll try Luenardi's version instead to see if that speeds things up, but..

I really think the main issue is just having to loop through all objects. I'll Report back latah.

EDIT: Nope. No luck with Luenardi's either just about the same result. :-/
Edited by RonBurgundy, Nov 26 2012, 01:36 AM.
!!! DEFEND POP PUNK !!!
Offline Profile Quote Post Goto Top
 
alexmach1
Member Avatar
Graphics addict
[ *  *  *  *  *  * ]
PoniesForPeace
Nov 26 2012, 12:43 AM
keep the textures 256x256 or lower, i read something somewhere about any textures higher than that aren't optimized or something like that.
I'd say it depends on the textured object. if it is something that rarely appears like dropships or certain objects, high res textures won't be a problem. if it is something like the occasional enemy ala metroid prime's space pirates, 1024x1024 should work. if it's something that appears very often, 512 and below. particles are 128 to 8 pixels, usually.
Offline Profile Quote Post Goto Top
 
Reikyrr
Forum God
[ *  *  *  *  *  * ]
RonBurgundy
Nov 26 2012, 01:07 AM
PoniesForPeace
 
keep the textures 256x256 or lower,

Gross. This game will look like a Playstation 1 game by the time it's done. I'll resize teh imagez den.

Honestly, Using the GetIntersectedobject is what's really killing my FPS. It's only being used once for shoosting.

I'll try Luenardi's version instead to see if that speeds things up, but..

I really think the main issue is just having to loop through all objects. I'll Report back latah.

EDIT: Nope. No luck with Luenardi's either just about the same result. :-/
Try using bounding box models.
~Inspirational quote~
Offline Profile Quote Post Goto Top
 
PoniesForPeace
Member Avatar
Elite Member
[ *  *  *  * ]
RonBurgundy
Nov 26 2012, 01:07 AM
PoniesForPeace
 
keep the textures 256x256 or lower,

Gross. This game will look like a Playstation 1 game by the time it's done. I'll resize teh imagez den.

Honestly, Using the GetIntersectedobject is what's really killing my FPS. It's only being used once for shoosting.

I'll try Luenardi's version instead to see if that speeds things up, but..

I really think the main issue is just having to loop through all objects. I'll Report back latah.

EDIT: Nope. No luck with Luenardi's either just about the same result. :-/
I'm sorry, but this is Game maker were dealing with. Playstation 1 gfx it is... ^_^

Posted Image
favorite soda: oogave agave watermelon Cream

favorite cheese: blueberry winsledale

Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply