Star Honor - A Space Roguelike Adventure


(Wenceslao Villanueva Jr ) #1

Star Honor

Star Honor is a Roguelike space adventure where you are field promoted into the Captain’s chair of the USS Arduino. Your home world has become the victim of the a biological weapon deployed by enemies. You posses the only hope for your world, a cure for the phage. With a skeleton crew, a limping vessel and time running out, you must travel world to world, seeking supplies, upgrades and doing battle to make it home and save your planet.

#Instructions

    Up 		- Forward
    Down 	- Backwards
    Left/Right	- Turn
    A Button	- Status Screen (Map)
    		- Back
    B Button	- Hail (Map)
    		- Confirm
    Up + B	- Warp (When you’ve gathered at least 3 crystal)

The goal is the get home before time runs out. Navigate the sector to visit planets to find upgrades and Crystal. You need 3 Crystals to power your warp drives. Each warp jump gets you to a sector closer to home. Get to Sector 1, save your planet, easy right?

Unfortunately it isn’t that easy, while some species are more than willing to help, those loyal to the Empire will attack you. When that happens you will have to do battle.

  • Attacking reduces a planet’s defense
  • When that reaches zero, you win the battle
  • However a planet retaliates after you attack and they will strike with their attack power
  • Your shields absorb all the damage first
  • After that, various systems may take damage such as your engines, weapons and hull
  • When the hull reaches zero, the USS Arduino will lose containment and well… space is harsh.

During battle you may check the status of your ship and issue emergency repairs. You must have at least 30 crew to issue a repair once per battle. So keep them alive and well! For every 10 crew you find during your voyage, you will have more emergency repairs available.

#Media

#Version 1.0

I started by writing a tool called Image2Arduboy which I used extensively to get assets into the game. It can take an image, down res it to fit on the screen, reduce to 1 bit and output a hex byte array that is suitable for drawBitmap and drawSlowXYBitmap. Using Image2Arduboy I wrote my own font system and a text system so that I could include a lot of text in the game and display it.

This game was a long road of trying and testing several things out and trying to scope the project for the Arduboy. The scope often shifted due to the amount of code I could fit in there. You can browse the code and find code for random encounters, AI Ships, Live weapon firing code. When I started moving in a direction I thought was do-able I still ran out of progmem space. Even strings are expensive! So I began to learn exactly what all my code did. I did so many optimizations and if you look at the code, I left a lot of them in there commented out as examples for myself and maybe others. I will clean up the code at this point but I felt it was important to understand what everything really does when resources are short. I eventually took the core and Arduboy libraries and optimized and removed out of there too. Hey, the Arduboy intro is neat but it’s 1k! That’s a lot of text I could have! The only thing I’d do different is probably eliminate the use of floats, they make function calls and operations cost a lot of space! I eliminated a lot of them but they’re still convenient to use in places.

I had a lot of fun making this game and I think I’ve taken it as far as I can with the resources available. In a time where I use a lot of engines and higher level languages, I’m proud of the game and building it from the ground up. I feel like a crammed a lot of stuff in there and got hit a good spot between gameplay and code footprint. I again have mad respect for those who make games early on in console days with much less.

Please enjoy, comment and post ideas that can fit into exactly 0 bytes

Sketch uses 28,672 bytes (100%) of program storage space. Maximum is 28,672 bytes.

Download

Clone or download zip from: https://github.com/wvillanueva/StarHonor

Please let me know if you have issues compiling, I had some issues with the latest Arduino IDE updates. Plus the project includes a custom version of Arduboy and Core libraries that strip out some features to make room for more game! (Sorry Flashlight!)


New (another) unofficial repo :)
"Semi-Official" Game List for the Arduboy
New (another) unofficial repo :)
(Migz) #2

Woah! This looks pretty cool! Going to check it out later!!


(Michael Gollnick) #3

Awesome work! :joy: The music in the video creates a really nice atmosphere.


(Migz) #4

Error message:

Sketch too big.

Arduino: 1.6.9 (Windows 7), Board: “Arduboy”

Sketch uses 28,714 bytes (100%) of program storage space. Maximum is 28,672 bytes.
Global variables use 1,620 bytes (63%) of dynamic memory, leaving 940 bytes for local variables. Maximum is 2,560 bytes.


Arduino: 1.6.9 (Windows 7), Board: “Arduino Leonardo”

Build options changed, rebuilding all

Sketch uses 28,724 bytes (100%) of program storage space. Maximum is 28,672 bytes.
Global variables use 1,620 bytes (63%) of dynamic memory, leaving 940 bytes for local variables. Maximum is 2,560 bytes.
processing.app.debug.RunnerException: Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.


(Wenceslao Villanueva Jr ) #5

Crud, I somehow thought this might happen. Let me reboot into windows to see if I can build the sketch. I built on OS X on Arduino 1.6.8, Arduino AVR Boards 1.6.10 in Boards Manager


(Wenceslao Villanueva Jr ) #6

Ok, AVR Boards version 1.6.11 makes the sketch too big. Let me attempt to optimize a few things…
In the mean time, you can downgrade to 1.6.10 but I’ll see what I can do.


(Boti Kis) #7

Oh my gosh, this is amazing. man you are my personal rockstar.


(Wenceslao Villanueva Jr ) #8

Ok, give it another try, I just upgrade to Arduino 1.6.9 and Arduino AVR Boards version 1.6.11
I then optimized a function to pass around an int and consolidate the float operation to once instead of four times, saving about 96 bytes.

Sketch uses 28,622 bytes (99%) of program storage space. Maximum is 28,672 bytes.
Global variables use 1,620 bytes (63%) of dynamic memory, leaving 940 bytes for local variables. Maximum is 2,560 bytes.

Thus the EXACT game size is ruined. I was sorta proud of that. What the heck am I going to do with 50 bytes? Oh, more text…


(Migz) #9

Star Honor title animation. Was testing out something , so I thought I’d use your game title.


(Michael Gollnick) #10

:joy: dude! This is so nice.


(Ethan) #11

I get this

In file included from /home/me/Downloads/StarHonor/StarHonor.ino:4:0:
sketch/ArduboyCustom.h:5:24: fatal error: ab_printer.h: No such file or directory
#include “ab_printer.h”
^
compilation terminated.
exit status 1
Error compiling for board Arduino Leonardo.

What should I do???
and by the way, great game!!


(Scott) #12

I took a few minutes and ported Star Honor to my Arduboy2 library. It now compiles even a bit smaller.

I haven’t tested it much so I don’t know if it works exactly the same.

My fork with the changes is on Github. I can make a pull request to the original repository if you wish.


(Scott) #13

You should try to keep at least about 20 bytes free. Selecting a different board type can change the size. My Arduboy2 library version compiles to 28580 bytes for board type Arduboy but compiles to 28590 bytes if you select Leonardo. I use board type Arduino/Genuino Micro for my home made system, which also requires 28590 bytes.


(Wenceslao Villanueva Jr ) #14

Which compiler are you using and platform? Do you have the latest Arduboy library from GitHub? Seems strange it can’t find ab_printer.h


(Wenceslao Villanueva Jr ) #15

That’s very cool looking. Wish the Arduboy had an SD Card slot to have as much code/assets as I want but that’s what I like about the platform. No project can spin out of control.


(Ethan) #16

MLXXXp put up your game that uses the arduboy2 library and that works.


(Wenceslao Villanueva Jr ) #17

I appreciate that but I’d like to get the one in my github working first for my own education before I merge in another lib. I’m interested in why it isn’t compiling because I have it working on my end and if I’m not using ab_printer, the Arduino IDE should basically compile it out. I’m going to be doing a code clean up soon as well so I already have a branch that I need to work on and bring back and I’m not great with Git.


(Scott) #18

You have
#include "ab_printer.h"
on line 5 of ArduboyCustom.h.

The compiler has no idea what the purpose of ab_printer.h is, so it tries to load and compile it, which gives an error because it doesn’t exist.

It’s true that because your sketch doesn’t use it, it won’t be linked in to your sketch, but it still has to be able to compile it. The same goes for all the other errors you get from references to things that have been removed in your custom libraries:

In ArduboyCustom.h:

#include "audio/audio.h"

ArduboyAudio audio;

In ArduboyCustom.cpp:

#include "glcdfont.c"

#include "ab_logo.c"

drawBitmap(20,y, arduboy_logo, 88, 16, WHITE);

line = pgm_read_byte(font+(c*5)+i);


(Wenceslao Villanueva Jr ) #19

Ok, for some odd reason in OS X it compiles fine but the moment you remove #include “ab_printer.h” all of it comes apart. I’ve edited the library and tested compiling and installing it on a vanilla install of the Arduino IDE in Windows.

Is the Arduboy2 something you maintain MLXXXp?


(Scott) #20

For now.

It looks like its functionality is eventually going to be incorporated back into the official Arduboy library but things are proceeding slowly, as usual. As it stands, you should be able to use Arduboy2 and then once the official library is released, to switch to it you would just change Arduboy2 or Arduboy2Base to Arduboy or ArduboyBase in your sketch.

If you’re curious, you can follow along in the develop branch of the Arduboy library: