• Add Review
  • Subscribe
  • Nominate
  • Submit Media
  • RSS

Miscellaneous

Tech Demo

I've got a demo working where you can walk around as Sofia and.. that's basically it. At least it works on the real hardware.



Download: https://rpgmaker.net/media/content/users/4965/locker/wcgb.gb
(You will need something like BGB to play this ROM)

One of the problems more unique to the Gameboy at the time is its very short vblank period. You can't access the video memory while the system is using it to draw the current picture, so any changes have to be made when its not being used. The picture is not being drawn during the vblank period and this is all the time you have to do things. These include loading new graphics, changing tiles on the background map, etc. The short time we get makes even the simplest things a challenge.

I've mentioned before how you need to place new pattern cells down as the screen moves to handle a tile map. There's barely enough time to update a column or row of new cells during vblank. This would be alright except there's more I want to do like animated tiles and sprites with many frames.



This is Sofia's character sprite sheet. There's 12 frames here for a total of 48 pattern cells needed. The Gameboy supports sprite mirror so we could get a bit more out of it, but there's not really that much VRAM and we'll want to leave room for all the other objects in the game. The solution is to stream animations into a specific location and just use that.



But there's no time to update new map cells AND Sofia's new frames as she walks in one vblank period. What we need is more vblank periods, but those only happen once a frame. Sofia changes her frames as she walks, and there's 16 frames of movement with only 2 being spent updating map cells. New frames can be scheduled to update on the frames the map isn't being updated, and if it was, the new frame can wait until a frame is available. This makes animating some of the map tiles a bit easier.



The engine simply loads one of these four sets of patterns into a specific spot in memory. The effect is that these tiles on the map get animated. Palette animations can't be done in dual mode games since the older Gameboy models had a single background "palette" that affects everything. These are done as the lowest priority update since you would have problems telling if there was 30 frames between a step of the animation or 32.


There's still props and other types of objects (like enemies) to handle in the engine. Enemies can have 2 frames of animation and have their sprites entirely loaded at once (for 8 patterns cells per enemy type) so there can be a lot at once. This is actually how they mostly looked in the game jam demo.. this sort of video game aesthetic was based on developers overcoming limitations.

Miscellaneous

Old School Scrolling

One of the things that can easily bring a Gameboy to its knees is having a tile map. Just having one. You're used to just making maps of any size you want and it'll work. Just make an array of bytes and use that to draw the tile map. On the Gameboy this becomes an impressive feat.

You get two sheets of 128x64 pixels you can combine for a maximum of 256 patterns. That doesn't sound as bad until you realize the upper sheet is shared with sprites and you have to also leave some for the system (windows, text, information, etc.). A lot of games would put the environment-specific patterns in one of these sheets, like Pokemon Red/Blue or Links Awakening:




So I drew some patterns that look like they're from Ruby Wolf. Each cell is a 4-color image and the colors here are just for reference. These colors are either just the 4 shades of grey or are actual colors from one of 8 palettes on the color system. I'm doing a dual mode game which is in color, but will work in the older system without it.



I've called these patterns instead of tiles. You cant just fit a sheet of tiles on an image like you're used to, there's no room. If we did that here, we'd only have 32 tiles. What we do is combine these patterns to make tiles, 4 patterns to a tile (some of the tiles aren't used yet, I marked them with purple to remind me). I've also made it so the tileset editor displays things closer to what an actual Gameboy Color system would actually show, it mixes colors oddly.



Games on many of the old console systems would go up to 256 tiles, I'm splitting mine into two groups of 128 tiles with the second set being tiles common for the entire game (item boxes, etc.). Tilesets also encode the collision and other flags with the patterns. The encoding I came up with uses 6 bytes per tile. This means it occupies 1536 bytes when unpacked so I've used up a little more than 1KB already. The Gameboy only has 8KB of RAM for you to use. If you made every tile on the screen a 1 byte reference, a 32x32 map takes up another 1KB and even larger maps like a 64x64 one would take up 4KB. You still need to leave room for your algorithms, objects, and the rest of the game engine!



There is video RAM. You can fit 16x16 tiles on the background map there which is even smaller. Some games simply do this, most notably Links Awakening where the action always takes place on one screen and it scrolls new ones in when you change areas.



If I don't want to waste the rest of my RAM and I don't want to squish maps onto single screens, then some sort of streaming system has to be made.

I found a good answer from a NES game, the original Final Fantasy. It encoded its large map as 256 tile stripes and would decode them into rows to look them up.

https://datacrystal.romhacking.net/wiki/Final_Fantasy:World_map_data

The scrolling window wraps around the background map if you go over the edge, so all you have to do is place new tiles as you move.



To test everything, I drew a quick amateurish hallway-room-hallway map that's 32x32 big (twice as big as what fits on the background) and encoded it as 32 stripes of 32 tiles each.



We're not done yet! I had to actually program this using LR35902 (Z80 like) machine code instructions. It runs at about 4.19Mhz and the fastest instructions take 4 cycles so at best you're getting a million cycles a second. The system runs at (basically) 60hz (close enough) so this means you get about 17 thousand fast instructions. You will run out of time easily if you're not efficient.

In an RPG like this, you move on tiles. This means there's only 2 of the 16 frames you're walking where new map cells & tiles have to be loaded. Every time this happens, the system loads either 1 row from the map (if moving up or down) or 10 rows from the map (if moving left or right). It has to decode 10 strips and grab a single tile out of each one for left and right movement. You can't just encode the map in columns and add it to the data because then the result is larger than uncompressed, defeating the purpose.

I've somehow managed to make left and right movement fit in time with half the remaining frame to spare (BGB has a handy load indicator if you use low power CPU waits at the end of each frame). This means limits the width of the map to about 64 tiles because the decoding algorithm scales linearly with time. If you run out of time it makes everything jitter noticeably as you walk. I might have to do better in the future if I find 64 tiles wide isn't big enough, but for now I've got maps working. The answer will always be to get more creative..




Or you can open RPG Maker, scribble tiles on a map and hit play.

Progress Report

Narrative

Yes, I am indeed still working on this every now and then. The first thing to do is to plan an actual narrative and give Sofia more character than being a fox girl version of Wario. I'll also have to replace a lot of things to make it take place in the same setting as LandTraveller. It'll be pretty simple; character goes through a trial (the mountain ruins in this example) and is changed forever for it. I'll find a way to mess it up anyways I'm sure, but at least I know the gameplay will be solid thanks to the feedback from the game jam demo.

Whenever I get enough content is when I'll create the game page for the new game, so keep subscribed to this one for updates in the meantime.

Announcement

Gameboy Color

Its been a while, I've been plenty busy, but I haven't forgotten about this little game. After some consideration, I've decided the return of this game should be developed for the Gameboy. After all, its the kind of style I went for when I wrote this game demo. The game will continue to be a simple treasure-hunting dungeon-crawling RPG, a task fit for the system.

I'm creating a dual mode ROM which means it will work in the original Gameboy, but also work and use colors on the Gameboy Color. Link's Awakening DX and Pokemon Gold are good examples of dual mode Gameboy games. They typically came in the black cartridges instead of the clear ones. Its impressive that there could exist a handheld game that would play in the 1989 Gameboy but also work in a 2003 Gameboy Advance SP. Even beyond that, there exist emulators for mobile devices, perfect for playing non-action games.

I've just finished a Sharp LR35902 assembler and have had successful tests getting things to work. There may even be a few tricks I can do with the sprites to increase the number of colors per character, but we'll see if they actually work. I can't really say when I'll get a chance to work on this again, I do have a more important game to finish, but I'll definitely look forward to it sometime.

Announcement

Platforms

I've still got plans for this game, as slowly realized as they are. I've decided to write the game to be played on a nostalgic platform. I have the capability to develop either a NES or GBA game, and I can obtain the means to test against the real hardware (in the case of the GBA I've always been able to test on the real hardware). Graphics and sound don't make a game, but the GBA is an easier system to develop for.

NES ROMs themselves do not contain anything other than the game itself, but GBA ROMs must include a copy of the Nintendo logo for a real GBA to boot them. Most of you will probably play this in an emulator, so a Nintendo logo will be unnecessary (most emulator authors let their software boot any ROM). Hardware tests will still be necessary to prove the ROM works agnostic to any emulator. This is important because I'll be able to own the copyrights to the ROM I produce (and be able to legally distribute) if it lacks the logo header.

This was going to be more of a free community game anyways. I think a lot of the charm of the game came from the event I participated in where I used random graphics and sounds contributed by others. I might do that again, although it would lack artistic consistency. On the GBA, you have to programmatically make sound (its possible to play/mix raw WAV samples but you only get 16MB tops for the entire ROM and you'll waste tons of space) so I would have to create those anyways.

Announcement

Will Continue

DarkFox and I will continue this game as a new game entirely (with the same kind of gameplay). It will be GBA-themed instead of GameGear. Stay tuned for updates.

Announcement

Edit Project

I've uploaded Ruby Wolf's .2xp file (RPG20XX project) here: http://rpgmaker.net/users/WolfCoder/locker/rubywolfproj2.zip

I've released a new version of RPG20XX which can edit this project.

It's pretty messy and I've written functions that haven't been implemented yet to make the demo release on time. Most of the actual battles occur in the derived statistics, and the common events. The derived statistics are highly specialized for this particular game, so they're a little odd when compared to typical RPG Maker stats.

It's an example of how to make something with RPG20XX although don't assume it is a good one. Even I don't know how to best use RPG20XX yet, the only way to find out is to use it more for actual game projects.

Game Design

How to Play

The game (demo) is missing lots of things, title screen, introduction, instructions, etc.

Here's a quick guide.

Enemies are always visible on the map and move when you do. If you keep moving and don't stop, you'll move faster than most enemies. Once you defeat an enemy, it is gone for good, it will never respawn if you leave and come back. You should avoid fights with enemies you don't know you can easily defeat. Once you can, you should hunt them all down to gain EXP. Even a single level gained can make a difference.

Avoid fights even if you feel you're on equal ground. You cannot heal during battle, ever, you don't regenerate health or energy, and if you escape, the enemy is fully restored. You really should only ever escape if you didn't mean to start a battle. You're faster than most enemies in the game, it will almost always work.. But if you're not, there's only a 10% or 30% chance it will.

You don't regenerate health or energy, you cannot grind, and there are no shops. You have to save and use what you can find inside. This requires some strategy, especially when you reach the area where almost everything keeps poisoning you. In that case, you should only use a remedy when you don't think you won't just get poisoned again, but you can't hold off too much since it never goes away and damages you per step.

You'll keep finding yellow item boxes full of treasure. This will increase your score. You don't have to get any of them to complete the game, but you won't get a good ending if Sofia leaves the ruins empty-handed. Strike a balance between how much risk you want to take. Getting 100% completion will be an accomplishment.

The blue item boxes always have equipment inside. You probably need many of these to complete the game or you'll be too weak. As you collect a lot of equipment, you'll notice you can sort of customize Sofia's stats with different combinations of equipment. Try to always go for these.

Every boss in the game will be optional (except for one). You can just walk right by them. Of course, you really want to power up and then take them on. Each boss is loaded up with gear that they'll fight you with. They also have five times the amount of health and energy they normally would. Remembering that you cannot heal during battle, be sure you can last that long. If you can defeat a boss, you get to take all their stuff. There's always going to be at least one piece of exotic or better equipment on them. So with every boss you defeat, the game gets easier for a bit. There's only one to fight in the demo so far.

This game is really tough on you and throws away all the JRPG tropes that made these kinds of games too easy (grinding weak enemies, buying 99 potions, etc.), but I do let you save anywhere from the menu. Do it. Save often. Don't save yourself into a corner though. If you like to save too often, try using up the other save slots. They'll get descriptive names, statues, etc. later. Since there is no game over sequence written yet, the engine suddenly closes after you die. Game over. You're dead. You'll have to load a previous save to continue.

Progress Report

Base Complete

The basic systems have now just been completed, so that leaves only a day or two to make the actual game part.

The basic systems are:

Combat
Enemies on the map will move when you take a step, but if you move continuously, enemies won't be moving as fast than if you carefully took steps. Enemies will all move differently, and sometimes will stay still to guard something. Once you touch an enemy, you start a 1v1 battle against them. You'll get to use your weapon, a skill, or escape. Fast characters and enemies may move multiple times in a row. The battles are simple, but can wear down on you if you rush into everything. Your health and energy won't regenerate, so you'll have to be careful with the resources. It's not quite a survival game as you're encouraged to figure out how to clear every enemy in the game without dying, but only after you've explored and upgraded enough.

Exploration
You'll want to try and grab all the items you can. There are no shops in the game. This means fighting your way past enemies and solving puzzles. Don't forget Sofie's primary goal, the finding of shiny rare things. You do find treasure which gets added up as money. As I've said, there are no shops, this is actually your score. You'll want to go out of your way to find these, leaving the dungeon almost empty-handed defeats the purpose. The score will effect the ending.

Let's see how much I can finish before the deadline.
Pages: 1