Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Performance is Horrible

Author
Message
tomjscott
19
Years of Service
User Offline
Joined: 18th Aug 2005
Location:
Posted: 25th Nov 2007 05:24
I'm trying the latest Dark GDK on VC++ Express and noticing abysmal performance. I thought Dark GDK would be a nice little engine for creating some games with, but my tests show that it's hardly useable for anything. I created a simple application that loads the Zombie from Dark Matter 2 and then clones it 30 times. The zombies are randomly placed within a 200 unit area. One of the zombies is animated while the others are just standing there. With just these 31 objects and nothing else, the frame rate drops from 60 fps to around 20. With 61 zombies it drops to 13 fps. Alos, the frame rate doesn't change at all when I move the camera so the objects are out of view. Doesn't the engine have any visibility testing?

If the engine performas this badly in this test, how could someone create a game with terrain, trees, buildings, vegetation, and characters and monsters running around? Not to mention particle effects thrown in there. Is anyone actually making games with this engine? If so, are there special things that must be done to get it to perform?

My system specs are as follows:

3Ghz P4, 1.5GB RAM, GeForceFX 5700 Ultra 128MB, Windows Vista Home Premium

Note that the test program was built in Release mode.
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 25th Nov 2007 09:51
Instead of cloning these objects why not try instancing them. You should find a significant speed up by taking this approach.

Also how about posting your code. Might be the case that some simple changes result in much better performance.
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 25th Nov 2007 10:43
I'm finishing a simulation, not exactly a game, but it usually stays above 30fps even with 'all turned on'. (Tested mainly on 6600gt and 9700pro, a little bit faster than yours).

I don't know how many polygons that zombie has, but perhaps you should post that simple application code...Or maybe it is about the object animation itself and how many resources it eats.

For improving performance, of course I try to check if objects are in screen and in range, hiding & excluding those that are not
tomjscott
19
Years of Service
User Offline
Joined: 18th Aug 2005
Location:
Posted: 26th Nov 2007 17:58
I'll post the code later when I get a chance. As far as instancing goes, I didn't know the engine supported that. In regards to visibility testing, I didn't realize that I needed to code that myself. Since this is a game engine, my assumption is that it handles those things for me. That is pretty basic functionality that I'd expect an engine to do for me.
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 26th Nov 2007 18:08
The engine will do frustum culling so a lot of the time it will be hiding models. Not so sure that is the problem in this case. I'm guessing it is something else. Will be useful to see the code and check out the models.
tomjscott
19
Years of Service
User Offline
Joined: 18th Aug 2005
Location:
Posted: 28th Nov 2007 00:55
Sorry I haven't had a chance to post the code yet. I've been a bit busy. The model itself is the Zombie from dark Matter 2 so I'm sure you should have access to that already. If I remember, I will post the code when I get home tonight.

I don't believe the engine is doing frustum culling at all since the frame rate does not change at all when the camera is facing away from the zombies into empty space. If it was doing culling then the frame rate would jump to max since there is nothing visible in the scene when the camera is facing away from the zombies.

BTW, the forum feature for e-mail notifications is not working. I should be getting e-mails when there are responses to my posts, but I'm not. I am showing that mailback is enabled.
tomjscott
19
Years of Service
User Offline
Joined: 18th Aug 2005
Location:
Posted: 28th Nov 2007 06:48 Edited at: 28th Nov 2007 06:49
Here is the code:

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 28th Nov 2007 09:17
Dark Basic, and therefore Dark GDK, does not cull offscreen animated objects. Therefore you see a performance drop for every single object you create in this manner despite the direction the camera is pointing. The workaround is simple, cycle through your animated objects, test to see if it's on screen, if it is not then Exclude it and do the opposite when it comes on screen.


Come see the WIP!
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 28th Nov 2007 14:34
That's right Cash. The problem is because the animation is continuing to play and remember it is doing it on the CPU so it's not ideal.

How about trying this:

* have a loop that cycles through your objects
* for each object call dbObjectInScreen
* if this returns false then stop your objects animation by calling dbStopObject
* if this returns true then play your animation

Cash mentioned using exclusion. This will work well for objects that are not involved in the scene. Check out the functions dbExcludeObjectOn and dbExcludeObjectOff. You can get some major speed ups by using these.

Also another alternative is to use a shader to animate the models. This will result in the work being pushed onto the GPU rather than the CPU which should bring a boost to your frame rate.

As a quick test I tried out the example code posted and was able to get 400 zombies on screen all animating at 30 fps. Having 200 zombies ended up with a solid 60 fps.
tomjscott
19
Years of Service
User Offline
Joined: 18th Aug 2005
Location:
Posted: 28th Nov 2007 17:09
Quote: "As a quick test I tried out the example code posted and was able to get 400 zombies on screen all animating at 30 fps. Having 200 zombies ended up with a solid 60 fps."


That's very interesting. As I stated before, only one of my zombies is animated. You can see this from the code. I'd sure be interested in finding out why I can only get 13 FPS with 61 zombies and only one of them animated.
Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 28th Nov 2007 18:48
Can you try this code. What frame rate do you get from it?

Login to post a reply

Server time is: 2024-09-29 05:21:55
Your offset time is: 2024-09-29 05:21:55