101 Starships (finished !)

Share your games and programs with the community.

101 Starships (finished !)

Postby Zoglu » Thu Oct 09, 2014 5:33 pm

Hello everyone ! :D
I've ordered a Gamebuino some days ago and I decided to start coding a little shmup while waiting for the actual console !
It's called 101 Starships.
Image

It's quite basic : you control a ship, button A to shoot ! Stop shooting to unleash a huge laser wave !
Enemies have various behaviors, their movements follow curves and they may shoot few or many shots at once.
The game ends once you've destroyed all 101 enemies, including the final boss.

You can download the hex file HERE, the elf file HERE or the source HERE.
I'm experienced in game & level design and I made many games before, but this is the first time I make a game using a low-level language and 101 Starships was only tested using the Simbuino emulator. So it may not work on the actual Gamebuino, and you may think my source files are quite a mess ! (oh by the way... I'm French, so some variables names or comments are in French :oops: )

Feel free to tell me what you think about the game or the source files ! I'm open to all constructive criticism ;)
Last edited by Zoglu on Fri Oct 24, 2014 3:09 pm, edited 5 times in total.
Zoglu
 
Posts: 26
Joined: Thu Oct 09, 2014 5:13 pm

Re: 101 Starships

Postby Myndale » Fri Oct 10, 2014 1:27 pm

Nice work, I like a good shmup :) And it runs fine on the actual hardware:



As you can see though, the Gamebuino's 5110 screen suffers from pretty bad persistence. The enemy bullets are clearly visible but the smaller ones coming from your own ship are currently hard to make out.

Looking forward to seeing a playable game! :)
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: 101 Starships

Postby Zoglu » Fri Oct 10, 2014 4:05 pm

Thank you very much for testing, it looks almost unplayable, as you said it's barely possible to see player's bullets :o
I will try to adapt the game to the console once I get it ;)
Zoglu
 
Posts: 26
Joined: Thu Oct 09, 2014 5:13 pm

Re: 101 Starships

Postby Zoglu » Sat Oct 11, 2014 10:13 am

Just updated the game and the source file (btw what is the ELF file's purpose ?)
I made some changes to take remanence and button position into account : the shots are bigger and the game is overall more "fair" to the player ;)
Also added a background, animations for player ship, and a charged shot ! (stop shooting to charge it + earn some bonus points while charging)
Zoglu
 
Posts: 26
Joined: Thu Oct 09, 2014 5:13 pm

Re: 101 Starships

Postby Myndale » Sat Oct 11, 2014 12:48 pm

The ELF file is the second-to-last step in the build process, it contains a lot of information about the original source code including function and variable names etc and as such is usually needed if you want to run code in a source debugger. As I understand it Deneth based his gbsim emulator on an existing emulator that requires ELF files, which is why his emulator requires them as well.

The last stage of the compilation process is converting the ELF file to a HEX file which is a tect format designed for transmission across an unreliable serial link. HEX files are stripped of all information about the original source (including debugging info) and contains only the raw data needed to be programmed into the device. HEX files are what are stored on the SD card and are also what my Simbuino emulator currently loads; the down side is that my emulator can only display the assembly op codes that have been generated for the sketch instead of the original source code.

With respect to the persistence issues, if you run Simbuino and go to Simulation->Options you'll see a check-box to enable persistence. Turning this option on causes Simbuino to try to emulate the persistence effect of the LCD, at least as accurately as I was able to simulate it. It's not perfect, but it should give you a better idea of what the final image will actually look like on the real device.
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: 101 Starships

Postby Zoglu » Mon Oct 13, 2014 7:50 am

I see, well I'll keep including the ELF files since they might be useful to those who use the other emulator.
The persistence option seems fine, it shows how hard the game can be ! It was a nice idea to include it on your emulator. ;)
Zoglu
 
Posts: 26
Joined: Thu Oct 09, 2014 5:13 pm

Re: 101 Starships (now with in-game music !)

Postby Zoglu » Sun Oct 19, 2014 9:50 pm

I received my Gamebuino some days ago, woo ! :D
So I updated 101 Starships to add : explosions, game over/complete screens, evolved scoring mechanics, and... music ! I still need to improve the sound effects though...
However I won't be able to include a boss, as I'm already running out of space. Developing games for Gamebuino is quite a challenge ;)

You can download the hex file HERE, the elf file HERE or the source HERE.
Zoglu
 
Posts: 26
Joined: Thu Oct 09, 2014 5:13 pm

Re: 101 Starships (now with in-game music !)

Postby Myndale » Mon Oct 20, 2014 10:31 am

Looking great! Can't wait to play it :)

Zoglu wrote:However I won't be able to include a boss, as I'm already running out of space. Developing games for Gamebuino is quite a challenge ;)


Gamebuino is completely different! You really have to throw out some of the good programming habits you may have learned and start breaking rules to get things to fit. After the bootloader, settings page and Arduino/Gamebuino libraries there are 20534 bytes left over for your game code. To get an idea of your program memory usage you can run avr-objdump:

Code: Select all
arduino-1.0.5/hardware/tools/avr/bin/avr-objdump -h -S your_app.cpp.elf


I hope you don't mind but I ran it on your Starships elf to look for any smoking guns and there are a few in there, notably the updatePerso function which is 3106 bytes long and contains multiple calls to drawPixel:

Code: Select all
gb.display.drawPixel(perso.x+1, perso.y-1);


The x and y members of perso are floats, so this arithmetic is done in floats as well before being converted to int for the drawPixel call. End result is that this one line winds up taking 84 bytes; put 20 or so in a function and they start adding up quick. Even if you just store perso.x and perso.y in local integers at the start of that block and use those instead you wind up saving over 1000 bytes. Convert all the members in your Player structure to static (which you can get away with because there's only one of them) and you'll free up another ~500 bytes. Use a bitmap instead of all those setPixels calls and you'll save another 1000 or so. All up that's over 12% of available code space obtained without making any serious code changes at all...more than enough for a boss level! :)
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Re: 101 Starships (now with in-game music !)

Postby rodot » Mon Oct 20, 2014 6:41 pm

Zoglu wrote:I received my Gamebuino some days ago, woo !
So I updated 101 Starships to add : explosions, game over/complete screens, evolved scoring mechanics, and... music !

Good to hear!
Congrats on all the improvements, I can't wait to see the finished game, as it's already looking great and progressing fast!

I know it's too early in the game devlopment to talk about balancing, but I made few friends play it and they complained about the difficulty. They found a way to easily finish the game... stick you vessel in to bottom right corner, you won't get shot!

Keep up the good work :)
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: 101 Starships (now with in-game music !)

Postby Zoglu » Mon Oct 20, 2014 7:28 pm

Myndale wrote:I hope you don't mind but I ran it on your Starships elf to look for any smoking guns and there are a few in there, notably the updatePerso function which is 3106 bytes long and contains multiple calls to drawPixel
Actually I'm glad you told me this ! Your advice allowed me to free about 1500 bytes :) I still don't know if this will be enough to make a boss, I'd like to add sound effects and maybe some sort of scenario before, but there's probably more room for optimization ;)

rodot wrote:Good to hear!
Congrats on all the improvements, I can't wait to see the finished game, as it's already looking great and progressing fast!
I know it's too early in the game devlopment to talk about balancing, but I made few friends play it and they complained about the difficulty. They found a way to easily finish the game... stick you vessel in to bottom right corner, you won't get shot!
Thanks ! I just updated the game files to add more enemies and make the difficulty curve softer but yeah, I need to fix these "safe spots" !
Zoglu
 
Posts: 26
Joined: Thu Oct 09, 2014 5:13 pm

Next

Return to Games Gallery

Who is online

Users browsing this forum: No registered users and 16 guests

cron