Author Topic: SPACE GIMPS: Procedural Galaga Game  (Read 13556 times)

0 Members and 1 Guest are viewing this topic.

Offline valis

  • C= 64
  • **
  • Posts: 35
  • Karma: -6
    • View Profile
SPACE GIMPS: Procedural Galaga Game
« on: January 18, 2011 »
Game logic not entirely finished, just a one-night coding binge.  Starfield is from bmax code archive, the rest is mine.
Code: [Select]
Source removed; not everyone has blitz installed.  Sorry to be a bother
« Last Edit: January 28, 2011 by valis »

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: Procedural Galaga Game
« Reply #1 on: January 18, 2011 »
any way to get a compiled version for ppl dont own/have blitz installed? ;) thanx
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline valis

  • C= 64
  • **
  • Posts: 35
  • Karma: -6
    • View Profile

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Procedural Galaga Game
« Reply #3 on: January 18, 2011 »
If you add these three lines to the top of the code, you will get an exe that is about 161kb in size, or just over 63kb if upx compressed.

Code: [Select]
Framework BRL.GLMax2D
Import BRL.Random
Import BRL.PolledInput

Cool game by the way. I like the way the objects are made from squares. Very retro.

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: Procedural Galaga Game
« Reply #4 on: January 18, 2011 »
@valis:
very very nice game! I really like the pixelated objects, the pixelbased particle explosion and even the nice details like stars moving to left while player moves to right and the other way! About the procedural generated objects, i saw something simillar somewhere on web long time ago... I am not really sure where is saw it. However its really amazing and thanks for sharing the source, so ppl (like me) can study and learn how to code such a nice galaga like game :) K++ for the really very nice game and its source! :)
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline valis

  • C= 64
  • **
  • Posts: 35
  • Karma: -6
    • View Profile
Re: Procedural Galaga Game
« Reply #5 on: January 18, 2011 »
Zawran:  Thanks, was wondering about that.  Any way to collapse it under 64k?

Va!n: The only game I know of that uses that is Invaders: Corruption, a great game.  I got the idea initially from a Processing project someone did a long time back, maybe the same guy who did Corruption. 

Watch this space, I'm going to get some more behaviors and variations in and finish the game logic.

Anyone have any ideas on writing wav files in memory?

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: Procedural Galaga Game
« Reply #6 on: January 18, 2011 »
@valis:
Writing waves to memory should not be so hard! Just take a look how the WAV fileformat looks like (File-/HeaderFormat)... Its very simple and easy to understand... Just allocate the needed memory, write the header stuff and then begin to caclulate and write your generated audio (wave) to the memory... Just begin with a simple SIN tune ^^ Good luck

Just check the web for the RIFF WAV fileformat...
https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
http://de.wikipedia.org/wiki/RIFF_WAVE

« Last Edit: January 18, 2011 by va!n »
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Procedural Galaga Game
« Reply #7 on: January 18, 2011 »
Blitzmax has a module for creating sounds in memory, which you can then play. It could be used to create sounds for the game. Take a look into the BRL.AudioSample module.

Code: [Select]
Local sample:TAudioSample=CreateAudioSample( 1024,11025,SF_MONO8 )
For Local k=0 Until 1024
        sample.samples[k]=Sin(k*360/32)*127.5+127.5
Next
Local sound:TSound=LoadSound( sample,False )
PlaySound(sound)
Delay 100

Offline valis

  • C= 64
  • **
  • Posts: 35
  • Karma: -6
    • View Profile
Re: Procedural Galaga Game
« Reply #8 on: January 18, 2011 »
Thanks for all the help.  This is only my second largish program with Max so I have a lot of questions.

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Procedural Galaga Game
« Reply #9 on: January 18, 2011 »
No problem, glad that I can help. It looks like you are off to a great start I would say.

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: Procedural Galaga Game
« Reply #10 on: January 19, 2011 »
This is really cool :) Good idea and nice execution!
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Procedural Galaga Game
« Reply #11 on: January 19, 2011 »
This is really excellent, I love the way that the aliens explode.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline valis

  • C= 64
  • **
  • Posts: 35
  • Karma: -6
    • View Profile
Re: SPACE GIMPS: Procedural Galaga Game
« Reply #12 on: January 20, 2011 »
Game logic is finished, scoring added, several new enemy types and behaviors.  Weapon upgrades.  Difficulty scales.  Attract mode added.

Source code above is now updated, as is this:

http://dl.dropbox.com/u/590198/space%20gimps.exe

I would like to release this on TIGSource so anyone who wants to playtest this and comment, I would appreciate it.  Enjoy!

It's Sofa King hard.  It makes DoDonPachi look easy.  This is the way games used to be in 1982 or so...
« Last Edit: January 20, 2011 by valis »

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: SPACE GIMPS: Procedural Galaga Game
« Reply #13 on: January 20, 2011 »
Really great game! Having a lot of fun while playing and hearing music in the background ^^
Btw, probally some tiny things that could be changed/fixed/improved:

- Center "HiScore" display... Atm it seems to be more right instead centered

- FontBackground of "SpaceGimps - Press Space to Start" is black instead transparent background color like you are using for the "HiScore" display.

- When starting the game, the HiScore shows a score of 4850... But everytime when starting to play a new game, the HiScore will reset to 0 inside the game... Here it would be nice, to display the last maximum reached HiScore... (Would be nice to have this value, even when restarting the exe... So just save the HiScore to a file... Maybe you can even add a HiScore for up to 10 or 20 "Best of players" with Names? ;) However, as long as the game runs, it should not reset the HiScore back to 0 for each new round ;)

- While the game will be played by mouse, it would make sence to start a new round not just only by pressing the spacebar... What about something like: "Press space or left mousebutton to play" ^^

- Fullscreen support would be nice... (maybe even switching between windows and screenmode while playing?)

- 8 bit retro sounds would be probaly very cool too
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: SPACE GIMPS: Procedural Galaga Game
« Reply #14 on: January 20, 2011 »
Its indeed a great game. I really like the pixelated style you draw the invaders. Looks
very retro and fits 100% to the game.

I second most of the points va!n already mentioned:

- Retro sound would be really really good

- Fullscreen support would be nice

- In window mode it would be cool if the game recognize when you leave the window with the mouse pointer and automatically pauses the game. When I re-enter the window the spaceships movement seems to be bit laggy/buggy

- Maybe it is because I am just not good enough at the game - but it would be cool if you have something like 3 lives or so...but on the other hand it might be more casual if you only have one life. So I am not sure about this to be honest.

- And I definately second another point va!n does - that switching from keyboard to mouse after you pressed start is not really user friendly.

Nevertheless, this game is really great. It is worth polishing IMHO. Good work!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline valis

  • C= 64
  • **
  • Posts: 35
  • Karma: -6
    • View Profile
Re: SPACE GIMPS: Procedural Galaga Game
« Reply #15 on: January 21, 2011 »
Thanks for the kind words.
Quote
- Retro sound would be really really good
Will do.  I have thought to some extent how I want to do it-- several channels, one for a bass line, one for a melody line, one for chiptune arpeggiated chords of the kind you hear in keygens, and two for game sounds-- one a squarewave channel for shots and explosions and another for divebomb whistles for the aliens.

How does that sound to you?  What would be a good way of handling this, particularly the music?  Perhaps procedural music would be a little much to bite off and I should just concentrate on alien whistles, explosions and a bass thump...

Quote
- Fullscreen support would be nice
I will look into it but then you have to mess with resolutions, widescreen, letterboxing, et cetera.  Ideally the window could just go fullscreen with no titlebar, toggled by "f."  Anyone have any idea how to accomplish that?

Quote
- In window mode it would be cool if the game recognize when you leave the window with the mouse pointer and automatically pauses the game. When I re-enter the window the spaceships movement seems to be bit laggy/buggy
Agreed.

Quote
- Maybe it is because I am just not good enough at the game - but it would be cool if you have something like 3 lives or so...but on the other hand it might be more casual if you only have one life. So I am not sure about this to be honest.
I want the game to be exceedingly difficult.  Like Super Crate Box.  This is how games used to be!  If you want to see difficult, try some Alien Typhoon.  I recommend the emulated Apple II version:
http://strategywiki.org/wiki/Galaxian/Home_version_comparisons

It is probably an insincere impulse I'm having (meaning something I think of but will never do) to load up the Apple II emu, load up a disassembler, and study the code for some of those old games to find out how the sound is done among other things.  There are probably easier ways of going about learning that (like stabbing myself in the eye with a burning, sharp stick and learning that way...)

Quote
- And I definately second another point va!n does - that switching from keyboard to mouse after you pressed start is not really user friendly.
  Agreed and easy to fix.

Quote
Nevertheless, this game is really great. It is worth polishing IMHO. Good work!
Thanks again and I will put in some more time on it.  I think the "procedural critters" thing is the most fruitful part of it and I will very likely expand on that part.  Part of my goal here was to produce a harvestable framework-- stuff I can pull out and reuse.

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: SPACE GIMPS: Procedural Galaga Game
« Reply #16 on: January 21, 2011 »
Yep, your idea with the sound is interesting. However, I wonder if it might become
too complex. But have a go with it. Personally I would think a nice chippy tune in
the background and some sound effects (also 8bit styled) would be enough.

Toggling fullscreen using "f" key sounds good. No idea how to set fullscree in
Blitz though, sorry.

Keep us informed about your progress!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline gwhuntoon

  • ZX 81
  • *
  • Posts: 3
  • Karma: 1
    • View Profile
Re: SPACE GIMPS: Procedural Galaga Game
« Reply #17 on: March 16, 2011 »
Valis, is the source available somewhere?

Thanks,

Greg

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: SPACE GIMPS: Procedural Galaga Game
« Reply #18 on: March 16, 2011 »
Greg, sorry to let you know that Valis deleted all the sources to his posts in a fit of pique when he didn't like some of the advice he was getting, rendering nearly all of the useful topics he was involved in useless.

Having said that, if there's anything in particular about the techniques he used that you want explaining, we can help.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: SPACE GIMPS: Procedural Galaga Game
« Reply #19 on: March 16, 2011 »
Greg, sorry to let you know that Valis deleted all the sources to his posts in a fit of pique when he didn't like some of the advice he was getting, rendering nearly all of the useful topics he was involved in useless.

Having said that, if there's anything in particular about the techniques he used that you want explaining, we can help.

That's a shame :(  Just had a look at the game and it looks really nice.
raizor

Challenge Trophies Won: