Jump to content
Sign in to follow this  
  • entries
  • comments
  • views

Nuclear Cannons are Cool

Sign in to follow this  
Sir Sapo


Hey everyone!

Thanks to Programmer16, I discovered a few bugs that were sapping FPS, and in the process, found a couple other inefficient things that were eating up frames.

Forest Fires
I was a bit perplexed by Programmer16's comment in my prior entry about how many texture swaps he was getting in a seemingly simple scene. Well, after a little bit of snooping around, I found the culprit: trees. Yes its true, the trees were the reason the texture binding was happening so often, even though there were none on screen. As it turns out, when the trees catch on fire, they create a fire emitter, but when that emitter dies off, the tree just keeps it there, updating it and attempting to render it. Since the emitter is 'dead', the rendering does nothing, except bind a new texture, which is then immediatly swapped out for the next objects texture, which is not a good thing. Needless to say, this bug is fixed now, so problem solved!

Stupid Code
While I was tracking down that fire bug, I stumbled upon the following line of code in my animation class:

usedisplaylists = false;

Yeah, turns out I was rendering everything in immediate mode, which is not a good thing to do, so I switched that flag to true, and I immediately got a 200 frame boost in FPS, which is nice[grin] Anyways, this improvement is in the new Angels 22 Performance Test that you can download below:

Now this program doesn't let you fly around or drive anything(I still want to tweak that), it does let you zoom around the level using the arrow keys, and it even lets you spawn bombs at the center of the screen, so you can cause some real carnage. There are 3 figures at the top left of the screen, the first on is the FPS(which varies about + or - 5 frames because my timer is crappy), the next figure is the number of times glBindTexture is called per frame, which doesn't really matter to you guys. The last figure is how many textured quads are being rendered each frame. All I really care about is what kind of FPS you guys are getting. I would also like to know at what point it starts to get choppy and laggy (you can use the QUADS RENDERED figure to help me out on this one). Anyways, the link is below, so download it, run it, and let me know how it does.

Angels 22 Performance Test Mark II (997Kb)

Arrow keys - move around
Enter - Spawn bomb
Escape - quit
(That should be it, but I probably left a button in there I shoudln't)

Nuclear Artillery
Today I sat down and coded up the huge artillery piece that Mark drew up, and after about 2 hours of trying to align the various parts together (its pretty well segmented for the firing animation) I finally got it working right. So here it is, barrel elevated at a 45 degree angle, and ready to fire. It's actually animated right now, but you'll have to wait to see that, because I don't feel like wrestling with Windows Movie Maker to make a movie for it, but I will soon. Anyways, here's a screen of the cannon, rendered in game (I really need to expand my test level, I'm running out of new places for screenshots[grin]):

Well, please download the Performance Test and let me know how it runs, you know the drill[smile] As always, ideas are welcome, and I'll talk to you guys later. Peace Out!
Sign in to follow this  


Recommended Comments

That cannon is so awesome.

I tried your new performance test and got some odd results. Although my FPS would go alot higher (I got over 200 at one point), it fluxuated hella-bad. Just sitting there (doing nothing, before even pressing a key) it was jumping from between 27 to 170.

The good news is that it didn't drop below 27 even at over 4500 quads rendered.

AMD Athlon 64 3200+ 2.01GHz
256MB Sapphire Radeon X700 Pro
Windows XP (Home)

Share this comment

Link to comment
well... i dont think I got above 90 FPS

Intel Pentium IV 3.06Ghz
64MB Mobility Radeon 9000
Windows XP Pro

Share this comment

Link to comment
Well, windowed I had around 23 FPS with ~2500 quads. (Not that it matters much, but I run at 1280x1024)
Full screen I had 19FPS with ~2600 quads - an entire hill burning with LOTS of bombs dropping :)

Intel P4 2.66Ghz
1gb ram (2x512)
Nvidia GeForce 4 440 MX (64mb AGP 4x ... :( ...)
XP Home


Share this comment

Link to comment
That's pretty awesome! The lack of graphics card in my machine made it a constant FPS of 2. [sad]

Share this comment

Link to comment
Intel Pentium IV 3Ghz
128MB NVidia Quadro XGL 980
1024MB RAM
Windows XP Pro

No movement, no action (only clouds moving):
- 246 - 500 FPS (mostly in between 360 - 400)
- 29 swaps
- 92 - 93 quads

No movement, lots of bombs:
- 29 FPS
- 55 swaps
- 3400 quads

No movement, no action (only clouds moving):
- 187 - 503 FPS (mostly in between 300 - 440)
- 29 swaps
- 97 - 102 quads

No movement, lots of bombs:
- 29 FPS
- 55 swaps
- 3400 quads

Share this comment

Link to comment
Yeah, I think my FPS counter is a little screwy, I'm using GLFW's timer, and I'm not thinking its that accurate. Was it still moving smoothly for everyone, even with that fluctuating of an FPS?

Share this comment

Link to comment
Back again.

FPS: 30 - 42
Quads: 4500

FPS: 35 - 42
Quads: 4500 - 4900

Intel P-M 2.13Ghz
Nvidia 6800 Go
[xps laptop]

Share this comment

Link to comment
Renderedquads: ~4300 FPS: ~60

AMD Athlon 64 X2 Dual 3800+
2.01GHz, 2.00GB RAM
NVIDIA 7800 GT 256 MB
Windows XP Proffesional SP 2

Good work, I especialy like the prinze's cannon. Make us a movie, Sapo!

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!