• entries
271
969
• views
189964

Nuclear Cannons are Cool

161 views

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!

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
3GB RAM
Windows XP (Home)

well... i dont think I got above 90 FPS

(laptop)
Intel Pentium IV 3.06Ghz
512MB RAM
Windows XP Pro

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

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

Intel Pentium IV 3Ghz
1024MB RAM
Windows XP Pro

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

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

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

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

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?

Yea, it was still moving pretty smooth.

Yeah, I didn't notice any slowdown.

Back again.

Windowed:
FPS: 30 - 42

Fullscreen:
FPS: 35 - 42

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

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!

i think thats probably my favorite unit graphic in the entire game

Create an account

Register a new account