Show HN: I'm building a game for the Nintendo GameBoy
bonsaiden.github.io
bonsaiden.github.io
(emphasis mine) IANAL, but my understanding is that at least in the US, it is the expression of the idea (the software and code, the graphics, and the other things mentioned on that line) that are subject to copyright, not the idea. See https://en.wikipedia.org/wiki/Idea-expression_divide.
The successful suit was due to the playing field having the exact same dimensions as well as very similar visual expressions as regular Tetris outside of the just the game mechanic.
[1] http://www.wired.co.uk/news/archive/2012-06/20/tetris-clone-...
http://i.imgur.com/pkZhTCJ.jpg
The screens are positioned correctly next to each other.
----
Are you writing this in assembly?!
- https://dl.dropboxusercontent.com/u/2332843/tuff.cartridge.j... - https://www.youtube.com/watch?v=yXNEeld8Lq8
http://krikzz.com/index.php?route=product/product&product_id...
Would seem painful enough as soon as speed or size became limited. C then was not as optimized as today. Old games used to be written in assembler, now the eeproms are bigger, the compilers are faster and portable.
I'd love to hear more about this if anybody knows and feels like telling about it...
For comparison: http://pastraiser.com/cpu/gameboy/gameboy_opcodes.html http://pastraiser.com/cpu/i8080/i8080_opcodes.html
https://github.com/BonsaiDen/Tuff.gb/blob/master/src/core/co...
Nice.
Only slowly after the 32bit became mainstream, did professional game developers started adopting C.
In the 8 and 16 bit days, C (and Pascal dialects) were viewed as C# and Java are nowadays for game development.
[0]Using my 80's developer hat.
I'd say c or c++ is only really standard in the AAA world, most casual/mobile/indie devs use higher level languages & engines (c#/unity, haxe, as3/flash, lua/corona, etc.)
As I am old enough to have lived through a few programming language generations accused of the same performance issues for game development, C included.
But the reason it is not always performance. Sometimes it is reusing already existing, battlefield tested proven code.
However, I can rephrase your question by replacing C with inline Assembly and we are back to the discussions I was having around 25 years ago.
You need to do a lot of low level programming to target the custom sound and graphics chips those machines had available.
Not to mention that with 512 KB, every byte counted.
I cannot speak much for the Atari ST, as I was on the Amiga side of the bench.
The operating system was originally coded in Assembly and BCPL, with later versions having some C code as well(mostly K&R still).
Assembly and special game programming languages like AMOS, were the main programming languages for game developers on Amiga.
C was just another business programming language like C#, Java, Ruby and many others are today.
Mostly used for standard desktop software, or for doing the UNIX university projects at home.
Young developers take C's ubiquity for granted nowadays, but there was a time, when it was just yet another programming language.
It was considered a high-level programming language.
High-level was already reserved for the likes of Lisp and Smalltalk.
For example, in the GB, some memory space is only adressable during a few cycles, and so you have to optimize your code when you wish to update the video ram. If you miss the window, too bad.
I've got some rough sketches for the final world as well as the powerup placement, since there are no text boxes in the game, everything will be explained through level design or other hints like enemies or neutral creatures performing certain maneuvers for the player to imitate.
[1] - http://nifflas.ni2.se/
In addition to that, getting the compiler up to speed (takes < 90ms on my old core i5) was a nice exercise in getting more familiar with v8's performance analysis tools :)
Ah, a feeling many of us know too well.
Here's a picture of the whole world for reference: https://dl.dropboxusercontent.com/u/2332843/tuff.map.png
I am very interested in this type of work and have been hacking at trying to build a game for the SNES. All I've been able to do so far is to collect all relevant documentation for developing it: https://github.com/bttf/snes_dev
I'll start with the graphics part, since that's the easier part of the two.
Since the original GameBoy has only 4 shades of gray, all "bitmaps" are 2 bits per pixel so you can squeeze a total of 4 pixels into 1 byte, the graphics are converted from PNG files via some JavaScript routines which can be found in the convert.js file in the repository.
The GameBoy uses 8x8 pixel hardware tiles on a scrollable "background" and supports up to 40 sprites which can be either 8x8 or 8x16 pixels in size.
There are 2 tile buffers in VRAM which partly overlap and only the lower one can be used for sprites, which gives you 128, 8x8 tiles for use with sprites and 256 for use with backgrounds.
Sprites can be mirrored, so this somewhat reduces the amount of graphics needed for the player character.
In order to reduce the map data, each room uses 80 16x16 blocks which are served from a meta table in memory, where each index maps to 4 8x8 tile definitions of the block. When drawing the screen the code resolves the individual 8x8 tiles and sets their value into the current VRAM buffer for the screen (there are two, which are swapped, to minimize draw artefacts).
Since the meta table is limited to 256 16x16 blocks too (due to the fact that the map format only uses 1 byte per block tile) there is some additional pre-computation magic going on when creating the map data. Basically, the block tiles are split into 4 x 8 rows, each screen then maps onto 4 of these "rows". By then packing often uses block tiles together, you can have more details for certain rooms since they don't need to use all of the different rows available and can basically swap some of them out.
Also, all graphics and map data are additionally compressed with a custom LT Type compression routing and are decompressed on the fly. Except for player graphics, which are stored into a RAM buffer at start in order to avoid graphic glichtes when switching out the sprite tile reference indexes and the graphics at the same time.
Overall, the timing is really important since you don't have too much time during the VBlank period (yes, it emulates a vblank!)
Now as for the sound, right now I'm really just setting the sound channel register values pretty much "Per hand", meaning, that I pick some decent values (tested in some GBA sound test ROM for gameboy sound channels I found somehwere - yes the GBA still has the original GameBoys 4 channels, since it's backwards compatible).
The sound data is stored in some kind of JSON format for easier editing, all the bit field stuff is than generated at compile time and baked into the ROM.
I've also gotten a prototype of a music engine running (not yet in the repository) where you'd play pre-defined sound "patterns" on virtual channels and "mix" them down. The sound / music stuff really is a whole story of its own, especially since there are nearly no references to find, except for some old, undocumented ASM sources of some Rare Ware GameBoy ports of Banjo / Jet Force Gemini which apparently got uploaded by one of the Sound Engineers at Rare.
When the bunny dies , there is a sound for its micro-explosion. I remember "Dangerous Dave" died with the same sound :) Are a lot of these interchangeably used ? Are these just system sounds ? How do these work ?
That's true, but I'm really trying to shake it off! And looking for contributors, should you be interested :)
I really like your project page as well, very concise, extremely informative, and covers exactly the things that someone wanting to make their own would need. Bookmarked!
The GBA actually has a 32 bit ARM CPU, although a very slow one (16 Mhz) so perhaps it would be possible to build a very minimal Ruby VM for that. I wonder if it would be possible to optimize by building a JIT compiler and JITing on an emulator before installing on the cartridge?
The people who might be able to and the people who would want to do so are mutually exclusive groups.
if the latter three, why not write in those languages and use an API to interface to the drivers for those peripherals?
-----
really cool and impressive that you developed an published a game on such a platform, that's still easily playable via a browser
- http://gameboy.mongenel.com/dmg/gbspec.txt (html version http://problemkaputt.de/pandocs.htm#soundcontroller ) - http://www.otakunozoku.com/nintendo-gameboy-cribsheet/ - http://realboyemulator.files.wordpress.com/2013/01/gbcpuman.... - http://students.washington.edu/fidelp/galp/megaguides/GameBo... (The original Manual)
There are more, but I can't seem to find the links right now :O
You can also grab the RGASM project from the OtakuNoZoku website. I think Carsten (Surfsmurf) may have revived it on his github. I think I also pushed my source trees to github too. There is a GBC emulator that is both a COM component, and works inside of Visual Studio (at least, VS from around year 2000). Bunch of docs too kicking around. I have copies of most of them still.
I wrote programmer docs, assembler (before switching to extending RGBASM), linker, patcher, emulators, games, visual studio plugins, debugger, cartridge downloader, serial port driver, bunch of libraries, etc. Ah... the good old days.
I got stuck really early on, oops: http://i.imgur.com/pqAblgU.png
I submit this bug: https://code.google.com/p/chromium/issues/detail?id=403907&t...
Funny, the sound became all 8-bit like, so it fitted the game quite nicely. :)
I'll also submit the above as a comment on the bug report.