WIP - Arduminer


#1

Arduminer Progress Thread

So, this will be my little corner of the board as my game Arduminer nears completion. I’ve reached a point now where I am just spending the last 15% of the my program memory (well, not that drastic) on saving games and on pre-built dungeons to supplement the random cave generation.

I am well within my RAM budget, so I’m going to increase the number of baddies per level as you go deeper underground :smiley:

You can follow the progress I have made and see some demo’s of the game in the following tweets

this is me doing Art



I haven’t found a finalised discussion on how we are meant to do save games in order to play nicely. FWIW I think having a seperate management sketch and splitting the EEPROM up into say, 8 ‘save game slots’ makes the most sense. You work within a slot or you split your save over multiple and label it as such, then leave it up to the user to keep your saves around or not. That feels kinda like the old PS1 save carts, and I imagine we are all good at working within set boundaries. I am going to work with this for all my games (probably write the manager too) unless a concrete solution is presented.

If you have any questions about the game or for me leave them here. I anticipate finishing up in the next couple days or so, so hopefully you can all try it out and let me know what you think.


#2

For EEPROM use, make sure you start at address 16 (0-15 are reserved). If you’re going to provide an .arduboy file, you can add in your start and end address this game uses.


(Holmes) #3

I have been waiting to hear from you on the forum! I keep seeing your posts on Twitter! Very cool game concept!

When do you plan on releasing it?


#4

Yeah I saw the discussion on the .arduboy file, so I will set things up to work within that framework then.


#5

Thanks!

I plan on releasing it this weekend, actually, hopefully around Sunday as I get Thursday off for Australia day so I can tidy up things.

I will probably then see some feedback from people and make another release after tidying that up. Then it’s onto the next game :smiley:


(Holmes) #6

Lemme know when you do and I can add it to the Arduboy Manager repository. :smiley:


#7

OK, Got the save file stuff done. 21 bytes to store the 16 slot inventory, current depth (level), current health, sound preference and current level of boots, helmet, chestplate, pants and sword.

not too shabby, I think i’ll be a little cheeky and use 24, just in case i can cram a few more features in.


#8

Alrighty, here is the first playable. I exported the sketch as a hex file, both with and without the bootloader are included in the zip, I’m not sure exactly what people need and if this is sufficient.

Anyway, let me know

If it doesn’t work, also let me know.

I don’t have time right now (midnight, 3 week old and 3 year old in house) to write up detailed instructions, suffice to say that the box in the top right shows what your guy is doing right now, and the b button is always attack. left right to move, up to jump, down to change action. Actions are place, craft, eat and mine.

Place only works if you have mined stone blocks. Eat only works if you have apples or gapples. View these things in the crafting window (hold action key A for a second or so with the craft action).

See if you can figure out some recipes in the craft window. You can save your progress after each stage (complete stage by walking through the door in the bottom right of the level).

Eat restores hearts by using gapples first if you are below 8 hearts (gapples restore 2 hearts) and regular apples after that (half heart). Mobs will do more damage the further through the game you go, and armour will protect you better the higher its level. Every 8 levels is a ‘challenge dungeon’ with a star block at the end. Collect 7 stars to be awesome. Every room has a 50% chance of a regular dungeon as well. Break the dungeon block for more awesome loot.

I think thats it, I sure hope someone is able to get it to work. If not let me know how to trouble shoot and i will fix tomorrow. Enjoy


(Scott) #9

To use the Arduino IDE we need the source code.


#10

Is there no way to distribute the game without the source code? I’m most definitely not ready to release that and I don’t know If i have the ambition to clean it up to do so at the moment.


(Scott) #11

I believe only the Team A.R.G. loader is capable of uploading a .hex file, and it’s only available for Windows. So MAC and Linux users won’t be able to play it, except for the very few who are skilled enough to use avrdude from the command line.

The source code doesn’t have to be clean and readable. You just need to be able to compile it using the Arduino IDE.

Personally, I wouldn’t go near a game that didn’t make the source available for examination. I wouldn’t want to risk it having flaws or intentional code that could damage my Arduboy.

http://community.arduboy.com/t/downloading-from-git-hub/2349/4


#12

Fair enough, I have put together a .arduboy file, but I guess if that precludes *nix users I will just stick the source code up.

Seems like it would be pretty dumb to release a malicious .hex file. It’s not like you would be able to affect more than a couple users at most before it was flagged and I presume the mods would remove it and ban you from the community.

Bleh, the only way to get around that would be an App review process, and as someone who develops iPhone Apps for a living I have enough of that for a lifetime at work.

Is the .ino file and the .h file i used to put assets into sufficient? That is all I can find in the directory.

This is the arduboy file
This is the source, as a zip


#13

I just re-uploaded the source by replacing EEPROM.write with EEPROM.update. It shouldn’t matter in the slightest as the load/save code should not be something that can be stuck in a loop, but best practices I guess.


(Scott) #14

Your Arduminer.arduboy file is incorrect. It contains an Ardubminer folder with the required files in it. The required files should be in the root of the .arduboy file.

Is the game called Arduminer or Ardumine? The .hex file is Arduminer but the .ino source file is Ardumine.

Otherwise, the source is fine. It compiles properly in the Arduino IDE. You may wish to put the source files in a folder named Ardumine or Arduminer (whatever matches the name of the .ino file) in the .zip file. This way, after unzipping, the folder and its contents could be copied into the IDE sketchbook instead of having to manually create a folder.

For the game itself, I suggest you switch from using the Arduboy library to the Arduboy2 and ArduboyTones libraries. The original Arduboy library is no longer being developed.

To do this:
Change:

#include "Arduboy.h"

to:

#include <Arduboy2.h>
#include <ArduboyTones.h>

Change:

Arduboy arduboy;

to:

Arduboy2 arduboy;
ArduboyTones sound(arduboy.audio.enabled);

Change all instances of arduboy.tunes.tone to sound.tone

There’s no beginNoLogo() function in Arduboy2. You can use begin(), or if you really don’t want the boot logo, use boot() followed by feature function calls, as described in the documentation.

The ArduboyTones library handles sound muting itself, so you can get rid of all the if (playsound()) tests then control muting using arduboy.audio.off() and arduboy.audio.on()


(Scott) #15

Well, it still might help ever so slightly. If an EEPROM location that you’re writing, to save the game state, already contains the value you want to write, using EEPROM.update() will save an EEPROM write cycle.


#16

Cheers, I will make the relevant fixes :smiley: