svinepalsen

A place for people with an interest in developing new shmups.
Post Reply
User avatar
Inkvisitor
Posts: 96
Joined: Thu May 18, 2006 6:36 pm

svinepalsen

Post by Inkvisitor »

This game has been my sandbox for some time now. It's made only with help from C++ and SDL. Automake is nicely set up so you should be able to try it out on any platform. You can get it here (contains both linux binary and source): http://brn.ath.cx/pub/upload/svinepalsen.070304.tar.bz2

Image
User avatar
Inkvisitor
Posts: 96
Joined: Thu May 18, 2006 6:36 pm

Post by Inkvisitor »

So I finally figured out why my game is so slow. As it uses alphablending there are ways in SDL to speed up the blitting. It's mostly the scrolling background image that slows it down. With these changes my fps went from 25 to 100. New version here: http://brn.ath.cx/pub/upload/svinepalsen.070305.tar.bz2
User avatar
Teasy
Posts: 15
Joined: Wed Feb 28, 2007 2:28 pm
Contact:

Post by Teasy »

How can this be run in Windows?
hmn
Posts: 3
Joined: Tue Mar 06, 2007 3:35 pm
Contact:

Post by hmn »

Hurray for more Linux shmups :-)

Gameplay-wise there is not much there yet to talk about, so I'll share some thoughts on the technical side.

The timing system seems to have some problems:

- Crash: Division by zero when dt becomes 0.
- Extreme slowdown when explosions are going on
- Slowdown should not even happen when delta-time approach is used
- FPS counter still shows 100FPS

This is a good article on the subject:
http://www.gaffer.org/game-physics/fix-your-timestep/

- Segfaults when getting hit at the bottom of the screen:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215686976 (LWP 32387)]
0x0804d986 in CBigBoom::draw_bang_dots (this=0xbfaeed98, s=0x818e3e8, speed=0.100000001) at CBigBoom.cc:152
152         rawpixel[(int)((int)(s->pitch/4)*(int)(tempNod->getNext()->y))+(int)(tempNod->getNext()->x)] = tempNod->getNext()->c;
(gdb) bt
#0  0x0804d986 in CBigBoom::draw_bang_dots (this=0xbfaeed98, s=0x818e3e8, speed=0.100000001) at CBigBoom.cc:152
#1  0x0804d642 in CEnemyBase::drawOnScene (this=0xbfaee484) at CEnemyBase.cc:59
#2  0x0804a8d2 in Svinepalsen::DrawScene (this=0xbfaee25c) at svinepalsen.cc:278
#3  0x0804b8c0 in Svinepalsen::mainGame (this=0xbfaee25c, argc=3, argv=0xbfb512f4) at svinepalsen.cc:475
#4  0x0804bf00 in main (argc=3, argv=0xbfb512f4) at svinepalsen.cc:493
User avatar
Inkvisitor
Posts: 96
Joined: Thu May 18, 2006 6:36 pm

Post by Inkvisitor »

Thanks for taking the time and trying it out :)

The game is actually based on Cone3Ds tutorials so that's where I picked up the deltatime stuff. Explosions chew up resources because every pixel is calculated and drawn.

In an attempt to make the game faster I switched from 800x600 to 480x640 and I also changed it into a vertical shooter. The segfault when you are at bottom of screen is probably an error when it checks those bounds. I will ofcourse fix this.

I plan to add more enemies and time them to different sections of the level so it doesn't become one endless stream of the same :) And at the end have some sort of boss. I'm not even aiming for a fullblown game at this point.

What are your system specs hmn ? I can't really notice any slowdown on explosions when I run it on my AMD XP 2200+.
User avatar
Inkvisitor
Posts: 96
Joined: Thu May 18, 2006 6:36 pm

Post by Inkvisitor »

Teasy wrote:How can this be run in Windows?
Since the game uses SDL it can be ported to many different platforms. It was even ported to Darwin at one point :)

I spent some time myself figuring out how to compile it in windows. I used minigw (GNU for windows) and installed all the necessary headers that the game depends on. And from there you just do the regular ./configure ; make procedure.

I did this some time ago and compiled a zip that have everything needed to run the game. So until I have time to compile the new sources I guess you can try that. You can get it here: http://brn.ath.cx/pub/software/svinepal ... 2.dist.zip
hmn
Posts: 3
Joined: Tue Mar 06, 2007 3:35 pm
Contact:

Post by hmn »

Inkvisitor wrote:Thanks for taking the time and trying it out :)

The game is actually based on Cone3Ds tutorials so that's where I picked up the deltatime stuff. Explosions chew up resources because every pixel is calculated and drawn.
As I said before, delta-time is usually used to hide the variance in the framerate.
Inkvisitor wrote:In an attempt to make the game faster I switched from 800x600 to 480x640 and I also changed it into a vertical shooter. The segfault when you are at bottom of screen is probably an error when it checks those bounds. I will ofcourse fix this.
You should probably stick with 800x600, and only draw in the middle, the 480x640 resolution feels awkward, since no monitor can display that fullscreen, unless you have "tated" your desktop :-)
Inkvisitor wrote:What are your system specs hmn ? I can't really notice any slowdown on explosions when I run it on my AMD XP 2200+.
Intel Core 2 @ 1.86MHz, integrated graphics (i965).
User avatar
Teasy
Posts: 15
Joined: Wed Feb 28, 2007 2:28 pm
Contact:

Post by Teasy »

Inkvisitor wrote:I spent some time myself figuring out how to compile it in windows. I used minigw (GNU for windows) and installed all the necessary headers that the game depends on. And from there you just do the regular ./configure ; make procedure.
Eek! Image
Inkvisitor wrote:I did this some time ago and compiled a zip that have everything needed to run the game. So until I have time to compile the new sources I guess you can try that.
Then I guess I'll wait until you have time Image
Post Reply