For those of you who've been wondering...

Discuss the development of other free/open-source games, as well as other games in general.

Moderator: Forum Moderators

User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

For those of you who've been wondering...

Post by Elvish_Pillager »

...why I haven't posted in the last 24 hours :shock: it's because I've been writing a cool little computer game. It's a kind of weird top-scrolling kind of game:

You control a space ship called the "Dastard", which automatically fires a shot every 0.4 seconds. The shots go straight up. Falling from the top of the screen are "Rocks", which accelerate downwards. When a shot hits a rock, the rock and shot are destroyed and two new rocks are created where the old rock was, each with half the radius of the original. When a rock reaches the side of the screen, it bounces, and when it reaches the bottom, it vanishes. Also, there are rocket launchers which move down the screen at a constant speed, firing guided missiles, which chase you for two seconds, after which they fall and the launcher fires a new missile.

Attached is a screenshot, one version with and one without comments. (Yes, I need better graphics. The current ones are temporary, since this started out as an Objective-C exercise.)
Attachments
ScreenShot1-Comments.png
ScreenShot1-Comments.png (23.01 KiB) Viewed 6165 times
ScreenShot1.png
ScreenShot1.png (21.4 KiB) Viewed 6146 times
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
classic_gamer
Posts: 3
Joined: January 10th, 2005, 8:14 am

Post by classic_gamer »

Hey. That looks fun. Are you going to release it?
User avatar
Ankka
Posts: 594
Joined: January 2nd, 2005, 2:40 pm
Location: Finland

Post by Ankka »

That looks cool.

Is it downloadable sometime soon?

The first impression was "is he doing a new version of Asteroids?", but as I read your post it looks like this is a little more... modern.

At least by the screenies, looks fun. :D
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

classic_gamer wrote:Hey. That looks fun. Are you going to release it?
That is a possibility. However, an appearent memory leak which I cannot seem to locate is discouraging me from progressing. Oh well, I can code some more features anyway.

What this game "really needs" right now is:
-a penalty for getting hit beyond an annoying sound, probably including a way to lose the game if it happens too much.
-a fix to the problem (suspected to be a memory leak) that causes the game to build up lag over the course of the game, decreasing the quality of the sounds until they vanish altogether, and if you are really persistent you can keep playing until the game crashes.
-a reward for shooting rocks.

My plans:
-Find and fix the ****ing problem (a low priority, because I have no idea how to proceed)
-Implement a powerup system, where a rock blowing up has a chance of releasing a powerup. (which will fly upwards at a random angle, falling with gravity like the rocks do.) Each powerup will increase a capability of the Dastard, which will be decreased (to a minimum of the default) when the Dastard is hit. (A high priorty because it's an 'improvement', as in it makes the game 'easier', which doesn't hurt testing the way being able to be killed does.)
-Implement a shield system, where whenever you are hit you lose shields, and when your shield is gone, you're dead. You will not have multiple 'lives', but the shield maximum will be high, and there will be plenty of shield-restoring powerups. I want this game to be fairly easy. (Maybe I'll implement this sometime and then comment out the code so it doesn't get in my way.)
-Implement a 'stage' system or something similar, probably to work somewhat like the way Asteroids' does. (Progressive, randomly generated stages, increasing in difficulty.)
-Implement a user-interface better than "Click to begin, CMD-Q to quit, anything else to do nothing" (obviously you can also use the controls in the game, but that's not the same kind of thing)
-Make some more types of enemies. (Two is not a good number for these kind of games, it would be good to be much higher)

So, I have quite a few things left to do. :) None of them are particularly hard (for me at least) (except the first...Image) since I created the underlying engine in a way that makes it fairly easy to implement the kind of things I want to implement. So, I have a bunch more work to do, and I could probably do it in a few more days, but unless the problem reveals itself, when (if) I first release it it may not even work to play for an extended period of time. Oh well, maybe someone who knows stuff I don't will come and tell me what's wrong at that point. :D

EDIT: Also, since I've kind of started discussing the development of the game, perhaps this should be moved to Game Development? :wink:
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
classic_gamer
Posts: 3
Joined: January 10th, 2005, 8:14 am

Post by classic_gamer »

With those new features it sounds even more fun. Too bad about the memory leak. :(
charlieg
Posts: 209
Joined: December 16th, 2003, 8:41 pm
Location: Manchester, UK
Contact:

Post by charlieg »

Elvish Pillager wrote:That is a possibility. However, an appearent memory leak which I cannot seem to locate is discouraging me from progressing. Oh well, I can code some more features anyway.
And thus, there was Valgrind. But it's Linux only. :(

Now if only you made it portable so you could run it on Linux! ;)
Free Gamer - free games compendium & commentary
FreeGameDev - free game development community
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

With C++, Resource Acquisition Is Initialization (RAII), possibly coupled with the use of reference-counted smart pointers, makes resource leaks fairly easy to guard against.

Does anyone know if Objective-C supports a similiar mechanism?

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Post by Jetrel »

Actually, EP, if you post your source files, I can take a look at them.

With regard to dave's comment, yes, I *think* Objective-C has a similar method. We call it "retain/release" - two messages which are supported by all objects.

If you need a reference to an object, you "retain" it. If you don't need it anymore, you "release" it. Once no one is retaining it, the system deallocates it. (there is also a delayed-release method using NSAutorelease, but it's basically the same thing).
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

The sources are here.

Thing is, I release just about everything that it makes sense to. I even tried releasing most of the things it didn't make sense to, but none of that helped. I also checked whether anything else (like the number of enemies) is getting excessive, but nothing worked, so I'm basically stumped.

Also, I've made some 'progress'; I implemented the powerups, and decided they were no good, so that's one thing off my to-do list... :P
Attachments
Fling sources.zip
(13.2 KiB) Downloaded 501 times
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

New update: I implemented shields and score. The Dastard starts with 100 shield which goes down by one every time it gets hit, and gains 1 point (of score) when its shots split a rock and 2 when it kills a Rocket Launcher. (It still doesn't have a way to die yet, and 100 shield lasts longer than the game lasts anyway.)
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Jetryl wrote: With regard to dave's comment, yes, I *think* Objective-C has a similar method. We call it "retain/release" - two messages which are supported by all objects.
But do you have to explicitly call 'release' on the object? If so, then it's not like RAII. With RAII, the resource is automatically released when the owning object falls out of scope.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

Another new feature: "Magnetite" is a kind of rock with an acceleration towards the Dastard proportional to its own radius and inversely proportional to the distance to the Dastard. These things are nasty, because when they hit you, they break, and the broken pieces are attracted towards you again from very close by. One magnetite hit can deal as much as 10 damage, if you're unlucky.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
classic_gamer
Posts: 3
Joined: January 10th, 2005, 8:14 am

Post by classic_gamer »

Does anybody know if I could build this on windows or Linux using the Objective-C gcc compiler?
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Post by Jetrel »

Dave wrote:
Jetryl wrote: With regard to dave's comment, yes, I *think* Objective-C has a similar method. We call it "retain/release" - two messages which are supported by all objects.
But do you have to explicitly call 'release' on the object? If so, then it's not like RAII. With RAII, the resource is automatically released when the owning object falls out of scope.

David
Yes, you do have to explicitly call it, but this is usually called in an object's destructor. Otherwise, if something is done in a function, you just create and retain the thing at the start, and release the thing at the end.

Creation is done with an "alloc" message, which automatically retains the object, and then an "init" message follows to initialize any subclasses. Typically, in the destructor one does the "release" command for any subclasses. (this is basically a lot like C++

a typical initialization message - note that "id" is the generic object type, in objective-c, typed objects are optional - this provides all the benefits of templates, and virtual functions

Code: Select all

id anObject = [[SomeClass alloc] init];
a typical destructor message

Code: Select all

- dealloc {
    [companion release];
    free(privateMemory);
    vm_deallocate(task_self(), sharedMemory, memorySize);
    [super dealloc];
}
I really do like the system. It's simple, and manageable, and I'd say something more but I've had this edit box open on a machine in the computer lab for the past four hours while I've been writing up Cayley tables for non-abelian groups. Frankly, I need to get this homework done so I can get back to my room and work on wesnoth stuff.
Last edited by Jetrel on January 12th, 2005, 7:15 am, edited 1 time in total.
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Post by Jetrel »

classic_gamer wrote:Does anybody know if I could build this on windows or Linux using the Objective-C gcc compiler?
Possibly, but the REAL power of Objective-C lies in Apple's mind-blowing frameworks for the language.

They have been somewhat reconstructed by GNUStep, but it might not work, as apple has leapt ahead in technology over the past year or so.
Post Reply