C++ 2D Shooter project (Htbaa's Worklog)

Build on C++ with SDL and KrasEngine! RSS Feed
Worklogs > Htbaa's Worklogs > C++ 2D Shooter project > Testing on different hardware + binary

Testing on different hardware + binary

I have got my laptop back and reinstalled Windows XP and Ubuntu 7.10 on it. Because I am developing under Ubuntu it is easier to test it on Ubuntu then under Windows XP. I still have to set up the compiler and libraries under Windows XP. So you have to wait for a Windows binary.

Currently I am developing KrasEngine and my little shooter on a PC with a Intel Core 2 Duo 2,2ghz with 2gb of ram and a 256mb nVidia 8400 GS. It is a new machine and a fast one (HP Pavilion m9060).

The laptop I have been testing on is a P4 2,8ghz with 1gb of ram and a Intel Extreme Graphics II 64mb video card. Which is a simple and not too powerful video card. So, good enough to test with :-)

The results are better than I expected. I expected it to be slow but all in all I am not disappointed at all. While on my test machine the frame rate is between 240-320fps, on my laptop it is a steady 56fps. And on 56fps the game is running very smoothly.

Although I was a bit surprised about the movement of the player space ship. If it moves and you let go of the d-pad the space ship will slow down until it is stopped. The only thing is, is that it is not frame rate independent. So I have to fix that.

Another improvement today is pixel perfect collision. I used the routines from SDL_Collide but that did not seem to work, especially not when using 1 surface with different clips. So yesterday I had rewritten the pixel perfect collision routine to work with my engine. But real time pixel checking turned out to be slow because the surface needed to be locked and unlocked every single time.

So instead I am now using my own image object which contains a vector with the pixeldata that can quickly tell me if a pixel is solid or transparent. Due to a stupid bug of mine I spend some hours debugging, but now it is working and it is working like a charm. And fast! No slowdowns are being noticed. Which is great :-).

For those running Linux (it has been compiled under Ubuntu 7.10) can try the binary from the link below.

The following dependencies should be installed (I think):

libsdl
libsdl-image
libsdl-gfx
libsdl-ttf (although it is not being used)

Controls: arrow keys. Use A to shoot, S to destroy all enemies and R to increase fire rate. Furthermore, this is only a technical demo :-).

Ubuntu 7.10 binairy
(Posted on January, 1st 2008, 23:52)

Comments


Rincewind said:
Alright cool. I also made my own pixel perfect collision detection for my current project, but I first shade 2 maps to the color grey, put them over eachother and then check for black. I hadn't really thought of using transparency alone! But that's an idea I would want to take over for a newer version of my collision detection.
(Posted on November, 26th 2020, 16:51)

Post New Comment

You must log in or register to post comments.

Worklogs > Htbaa's Worklogs > C++ 2D Shooter project > Testing on different hardware + binary
Copyright © 2005 Booleansoup.com
Questions? Comments? Bug reports? Contact us!