Ardulem - The Lemmings arrive on Arduboy!

(Alban Nanty) #1

Ardulem.arduboy

Ardulem: Lemmings on Arduboy!

Hello Arduboy community! I’m a new member of this community, and I got my Arduboy last christmass. Since then I worked in and off on my first game attempt, which is to brings the legendary “Lemmings” game to Arduboy.

You can find the game here https://bitbucket.org/banban/ardulem

I’ve also created a Ardulem.arduboy file that you will find in the Release folder, if you want to launch it with the ArduboyManager.

Demo Video

And before more blah blah, here is a video:

Level Editor

Because I love the open source and modding spirit, I’ve also developed an Editor in C#, for anyone (even the non-programmers one) to create their own levels.

The Editor use the clipboard to import/export the level, since anyway you will have to copy the code inside the MapData.cpp file. So if you want to modify a map, just copy the data from the MapData.cpp and paste with CTRL+V in the editor. Similarly, if you want to export your modification CTRL+C in the Editor (or CTRL+SHIFT+C for exporting the meta data) and CTRL+V in the MapData.cpp file.

You will also find the Editor (compiled for Windows, but launchable with mono on Linux or Mac) in the Release folder.

This is just the beggining

Although I’m quite happy with where I arrived now, and even if I think the game is enjoyable as it is, I think I can still try to optimize more, and I will probably try to fix all the bugs you may find. Anyway, I think today I can call it a version 1.0, thus this is why I let you know it here.

The game was very challenging on the progmem size, so there’s only space left for I guess around 10 levels. Each level takes around 100 bytes of progmem. Right now, I’ve only put 5 levels in game, and maybe level 2 is not finishable :slight_smile: (you may encounter a bug in the lem counters).

I will continue to try to save some more bytes in the progmem, and release new levels. In the meantime if you created some great levels, don’t hesitate to share (you can just paste the data in the forum) for every one to enjoy.

Happy Ardulem!

19 Likes
(Boti Kis) #2

Wow beautiful job! Gonna try this asap.

#3

This is shockingly amazing, great job and thank you very much. I’m loading it right now

(Scott R) #4

Lemmings is one of my all time favourites it’s certainly amazing to see a functional version on such a tiny platform.

(Alban Nanty) #5

Yes, me too!

When I first think of which game I would make on my Arduboy, I looked at the screen resolution, and those tiny pixels, remember me those pixels I was fighting in my Lemmings gaming session during the last century… Then I thought, yeah Lemmings might be a good choice :slight_smile:

2 Likes
(Scott) #6

What is the reason that you created a custom local version of the Arduboy library?

Switching to the Arduboy2 and ArduboyPlaytune libraries would probably free up a fair amount of progmem space.

(Walter Lauer) #7

hi
is there a hex file,so that i can upload it with Arduboy Manager?

(Alban Nanty) #8

Well, I guess there’s no real reason. I started with the Arduboy 1 library, then complete most of the game when I started to do optimization.

However, I distorded quite a lot of original function of the library to make it more specific to my project. For example in the drawBitmap() function, I removed the vertical iteration because all the bitmaps that I need to draw are only 8 pixels high.

However, there’s still some valid optimization that I’ve done in that function, that could still be applied in the Arduboy2 lib (I’ve just checked and the drawBitmap function didn’t changed between version 1 and 2).

For example caching the variable instead of copy/pasting for the 3 colors, or computing a start and end value for the for loop instead of testing and break the loop both increase the speed and decrease the progmem size (according to my test).

Also I’ve added a mirror flag (on X) to that drawBitmap() function, which is quite free I guess on the performance side, and could be very handy to many developpers, because you often want to play a character walking to the right of the screen, then mirror the animation to make it walk to the left. This would be a cool and legid parameter to add to the lib, I guess.

The mask parameter that I added, is too specific to my game, and I think should not go in the lib.

A mirror on Y would be also a nice addition, even if it would be more costy, as you would have to write the bits in reverse order.

Anyway, I think I will start my next game from Arduboy2 (and hopefully won’t need to change it).

3 Likes
(Alban Nanty) #9

Hi gambler172,

Sorry, no I don’t know how to do it, since I didn’t dig into how to do it. However, I’ve heard of the Arduboy Manager, as an easy tool to download game in your Arduboy.

I can certainly add this. Does anyone know which doc I should read to learn how to do it?

(Scott) #10

But you would be better to include the .hex file in a .arduboy file.

(Alban Nanty) #11

Thanks a lot!! That’s really an extensive answer.

I think, I will then create a release folder in my repo, to put that file + a compile version of the Editor some time to time.

Stay tuned! :slight_smile:

1 Like
(Scott) #12

If you’re only modifying a few library functions, in many cases it’s better to just make local versions of these functions instead of copying the entire library. This way you can easily take advantage of any optimisations, enhancements or additions made in areas that you haven’t customised.

(Scott) #13

If you have any optimisations that are backwards compatible, you can submit them and I’ll consider them for inclusion in the library.

(Scott) #14

@lswbanban,
You’re saving game data at offset 10 in EEPROM. The first 16 bytes of EEPROM is reserved for system use. Your sketch should only use EEPROM from defined offset EEPROM_STORAGE_SPACE_START and above.

Also, it’s better to use EEPROM.update() instead of EEPROM.write() to prevent unnecessary writes to EEPROM.

#15

Awesome. This brings back some memories
.

(Erwin) #16

Oh wow! so polished, amazing :smiley:

I uploaded your game to my repo http://arduboy.ried.cl

Yes, in the upper link :slight_smile:

1 Like
(Alban Nanty) #17

Alright, I will update that ASAP.

(Alban Nanty) #18

Ok, I’ve made the two changes regarding the EEPROM.

I’m now building the .arduboy file. It should be available in a coupe of hours.

(Alban Nanty) #19

Hey Scott,

Are you maintaining the Arduboy library ?

Yes, I think I can come with a clean and backward compatible, optimized version of that function. Please give me some time.

Yours.

(Scott) #20

Yes but only for bug fixes, since it’s now a legacy library and not recommended for new sketches.

All new development is being done for the Arduboy2 library, for which I will consider any submitted fixes and enhancements.