Nuclear Cannons are Cool

Published July 15, 2006
Advertisement
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)

-------------------Controls------------------------
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!
Previous Entry A Glimpse.....
Next Entry ............
0 likes 11 comments

Comments

Programmer16
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
3GB RAM
Windows XP (Home)
July 15, 2006 04:04 AM
Silvo
well... i dont think I got above 90 FPS

(laptop)
Intel Pentium IV 3.06Ghz
64MB Mobility Radeon 9000
512MB RAM
Windows XP Pro
July 15, 2006 04:38 AM
Manaxter
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 :)

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

Cheers
Jacob
July 15, 2006 08:14 AM
Rob Loach
That's pretty awesome! The lack of graphics card in my machine made it a constant FPS of 2. [sad]
July 15, 2006 09:16 AM
Gaheris
Intel Pentium IV 3Ghz
128MB NVidia Quadro XGL 980
1024MB RAM
Windows XP Pro

Fullscreen:
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

Windowed:
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
July 15, 2006 09:31 AM
Sir Sapo
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?
July 15, 2006 10:57 AM
Programmer16
Yea, it was still moving pretty smooth.
July 15, 2006 11:12 AM
Gaheris
Yeah, I didn't notice any slowdown.
July 15, 2006 12:41 PM
ildave1
Back again.

Windowed:
FPS: 30 - 42
Quads: 4500

Fullscreen:
FPS: 35 - 42
Quads: 4500 - 4900

Intel P-M 2.13Ghz
2GB RAM
Nvidia 6800 Go
[xps laptop]
July 15, 2006 01:11 PM
Samsonite
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!
July 15, 2006 07:24 PM
mindrot
i think thats probably my favorite unit graphic in the entire game
July 18, 2006 09:19 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

!

1181 views

'Roids

1483 views

Post Dva

1265 views

Untitled

1100 views

I'm a sad panda...

2106 views

Untitled

1003 views

Progress

1048 views

Angels 2X!!!!!

1470 views

T3H Progress!

1294 views

ZOMG!!!!

1174 views
Advertisement