gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Announcements And Comments > Basic 2D Engine

#11455 - Burton Radons - Tue Oct 07, 2003 7:20 pm

I've put up an archive of the code I've been working on, a 2D engine. Features are:


  • Game state saving and loading.
  • Map rendering; scrolling routines, only visible entities are drawn, on-demand sprite loading, collision detection.
  • Font renderer for Mode 4, Mode 0 with tiles, or Mode 0 with pixel rendering. With optional drop shadow or outline.
  • Slow mixer, song player. No song.
  • Converter utility that takes configuration files and produces ELF object files directly. Processes .wav, .mod, .med (Nessie's MapEd, with a similar compiler that can extract entities information), .spr (Pro Motion), .bmp. Does project-wide asset processing, so it produces only necessary palettes/sprites. In the future it could merge overlapping tilesets, reuse song samples, animate tilesets, and so on.


The demo itself just has you run around shooting at a bunch of shotgun-wielding guys who will respawn randomly throughout Nessie's sample map. The mechanics aren't great for instant-hit projectiles; there needs to be crouch and forward roll. However, what I've drawn stretches the limits of my artistic capability, 8x16 sprites and all.

#11491 - zazery - Wed Oct 08, 2003 3:55 pm

I'd really like to take a look at it. The engine sounds good and i'm just starting to learn how more advanced concepts on the GBA work. Only problem is I can't download the file, it keeps refreshing that page and thats all, when I right click Save As it won't let me download a zip file but a html file.

#11492 - Burton Radons - Wed Oct 08, 2003 4:21 pm

I get that happening in Mozilla but not Internet Explorer. What appears to be happening is that when you click it gives a proper Referer field in the HTTP header, so that ProHosting knows you're coming from its own site and allows the download through. When you use Save As..., however, it doesn't provide the Referer field, so ProHosting returns the redirection file again. You'll have to just click on it.

Oh, and I forgot to mention. I've tested this on VisualBoy Advance and Mappy but not on actual hardware. It cold crashes Boycott Advance, so there's reason to suspect it might not work so great on hardware.

#11506 - zazery - Wed Oct 08, 2003 11:26 pm

I clicked on the link, went to the page, clicked on the zip file and it didn't work. For anyone who has Zone Alarm disable it, I got it working. I have yet to take a look at the code, and test it on the hardware. Thanks for sharing the code!

#11662 - Burton Radons - Wed Oct 15, 2003 2:21 pm

Okay, that's been updated and can be downloaded here, which is hosted in a better place that I'd forgotten about.

Big changes are:


  • Start menu; status, help, save/load, inventory.
  • Player inventory. You can bind items to be used with hot-keys in-game.
  • Player animation decoupling to allow shooting and reloading while running around. Duck and roll, visible projectiles.


There's more, but mostly in the category of "if you didn't have the older version for comparison you wouldn't know of the change"; font tweaks, better text rendering, things like that.

As with before, all source and a binary are included.

#11744 - Burton Radons - Fri Oct 17, 2003 6:56 pm

[Images not permitted - Click here to view it]

Updated again, archive here. An update in the .med (Nessie' MapEd) importer for his latest version.

The only other change is that I'm not ripping Nessie's sample map off anymore and forced myself to work through my own cringes at my artistry. So now instead of the desert temple, it's a forest/cave system level.

[Edit: Grammar, screenshot.]

#11824 - Burton Radons - Mon Oct 20, 2003 4:51 pm

Updated again, archive here. Let's see.


  • Pixel-exact collision detection; the flags data is still used but the collision data is ignored. There is currently no way to override how the collision map is generated, so for example Nessie's sample map wouldn't work because the columns are in the front layer, so the player would run into them. It does some map preprocessing to make it impossible to climb jagged walls.

  • Eggs, which like entities are drawn on the main layer. Eggs allow "scripted" interaction; you put the egg in the map with a number written above it and then give it a block in the export script. The interaction functions are written in C. Eggs can be activated based on player distance or can be used (by pressing shoulder right), in which case they put an icon up on the HUD describing their action; there's an example transport tube in the training mission.

  • A training mission that runs through game interactions and uses eggs heavily.

  • Grenades that look like pickled green olives stuffed with pimientos. They fly, they bounce, they explode noiselessly.



Documentation is getting muchly behind and big chunks of the engine need re-factoring.

#11838 - TheBlackFrog - Tue Oct 21, 2003 4:57 am

hey this is quite the game so far, nice job.

this coule be made into a very cool soldat clone - soldat is a multiplayer game that uses very similar graphics and such (ie 2d, side view like your engine) but it has more of a 'first person shooter' type feel to it - oh and its multiplayer (i havent been keeping up with gba multiplayer - did anyone release any libs or info on multiplay yet?)

its a really good game, you should at least check it out it might give you some more ideas for your game or something. its site is at soldat.prv.pl and heres a screenshot
http://www.soldat.pl/screens/screenshot15.jpg
SOLDAT - a similar windows game

but again, looks like a really nice engine and good game coming along to boot.

EDIT by mod: please do not "hotlink" (large) images like that. thanks

#12516 - Burton Radons - Sun Nov 16, 2003 3:39 pm

I spent a little time isolating the converter and putting parametric binary export definition in the paged exporter so that it could be used by other people, exporting to the binary format of their choice. This allows you to take true-colour images, dither them to 16-palette 15-colours-each paged format, and then use that data. It also does compression/decompression.

I've put an example, with GBA binary, at:

http://members.shaw.ca/burton-radons/armistice-convert.zip

The sample's images can be switched between by pressing A. I'd appreciate it if someone could try it out on hardware, which it should work on; I'd like to know how the (sometimes very heavy) dithering plays on the LCD screen.

#12519 - Lord Graga - Sun Nov 16, 2003 5:09 pm

Oh my!

Now that's what I call a extremely wellmade platform engine... it's hilarious and fun! :D

I would like it a lot more if the enemies did not detect you when you came from behind them... I could be a cool ninja style stealth warrior ;)