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

Beta testing, plus SaGa tech

Hey all, another design post here. On the development front things are going fine, just polishing off some bugs, making balance changes based on playtesting, and setting up a good release. Although if you have a controller that you usually use for PC games, hit me up with a PM -- we’re trying to get controller support but I don’t have anything to test with. Anyway, I’m covering our tech and dev tools this post. Hopefully it’s at least interesting to other people like me who are way too into editors/engines/makers.

Boring technical stuff first: most of SaGa4’s core code is written in Java. The low-level GL stuff is handled mostly by libGDX but the bulk of the code is a custom engine dubbed MGNE. This same code powers SaGa4, Blockbound, several of the roguelikes I’ve posted on this site, and even the action/exploration game divergence. It’s been pretty useful over the years, even if the only thing the games have in common really is that they all use overhead tile-based maps. There’s a bunch of game-specific code built on mgne that deals with RPG battles, UI, etc. It’s actually all public for the interested: https://github.com/psywombats/mgne. (side note: version control is great and if you’re not using at least dropbox for your games, you should consider it)

For those used to RPGmaker, here’s the slightly more interesting part. MGNE has a database editor to go along with it. All of the games built with it are also data-driven, in that you don’t need to mess with code to make changes to the game. The MGNE database is basically just a fancy JSON editor, but it’s pretty cool that you can screw around with pretty much the entire game with it. I’ll probably bundle it along with a release version of the game in case anyway else wants to make a cheap FFL clone. (...or cheat, w/e)

Probably the feature I miss most about RPGmaker is the map editor. Luckily, there’s a freeware equivalent called Tiled that we’re using to make SaGa4’s maps. It doesn’t have support for easy eventing the way RM does, and chipsets are a little hard to manage, but there are a lot of upsides as well. For instance, there are as many layers as needed, polygonal events are possible, and most importantly, it’s extensible and can export maps in a format the game engine can read.

Also, fun thing about how we have teleports set up. Remember in RM how much of a pain it was to change maps after setting up teleport events? If you shifting the map a few squares or moved a town on the world map or whatever, it’d all be off. We have a target system attached to our teleports instead, so that even when maps shuffle around the teleport targets are still set up right. It’s also a hell of a lot easier than entering coordinates. Here’s a bit of how it looks:

Another note about how that’s set up… That teleport command is lua script, which is what powers SaGa4’s eventing and all of its cutscenes. It’s supported in Tiled maps plus can be played out of separate files, which is where we have all our cutscenes stored. There’s also a debug console where a dev can execute any arbitrary lua command (for easy teleporting, item granting, turn encounters on/off, etc). I’ve also set up some data binding and a bunch of utility functions to make cutscene scripting as painless as possible:

The other fun piece of tech we’ve got is the audio system. For those that played the demo, you’ll notice everything’s just rips from the original SaGa games at the moment. But those aren’t MP3s sitting in there. We’re actually using data dumps from the original game cartridges played back via a built-in Gameboy APU emulator. Based on Blargg’s C++ APU emulator (see here), we have a Java implementation that plays back and renders the original sound data on the fly. So we get 30 tracks for 30kb of memory, and it’s all as authentic as possible. Maybe one day we’ll find a composer that knows how to use a Gameboy tracker. I kinda doubt it though. Oh well.


Pages: 1
All of your work is very impressive. The Gameboy APU emulator is a great achievement.

It should be easy to use a Gameboy tracker like Little Sound DJ... they're the same as other trackers.
This is neat. This is very neat. I am intrigued.
I am tired of Earth. These people. I am tired of being caught in the tangle of their lives.
This is neat. This is very neat. I am intrigued.
wowwwwwwwwwwwwww this makes it look doable
i'm very glad you're sharing this uncanny knowledge with us
Yeah, Tiled is pretty great and I use it for everything. Even some dungeon generator I wrote exports to tmx just because. Like you, I use cell properties to do some basic event and entity scripting. Old example:

To elaborate, the behavior property is basically the entity's movement loop. It tells the engine which properties to look in to determine which functions need to be called with that data. Such that Conan the Example Entity will pathfind to a random tile near his spawn point, wait for up to 360 frames, pathfind to any random tile on the map, wait up to 360 frames, then restart the whole loop by pathfinding back to a random tile near his origin/spawn point. Properties can be named arbitrarily when they're just pointers, but a few have explicit names like clicked, behavior, touched, etc, since the engine needs a starting trigger. Also conditionals for the entity to even exist, like flag or item.

I also use it to set what happens when interacted with, under the clicked property--separated by pipe with the last entry being the highest priority (like RPG Maker event pages). All of my basic stuff can call functions pretty directly for opening chat boxes or shop menus or moving an entity somewhere or setting a flag/switch, but I put the detailed stuff in separate scripts just for readability's sake and to make direct function calls. If a value says something like "script, cutscene_001" then it'll read the cutscene_001 script and execute those function calls more directly, which look similar-ish to your example. I'm a heretic and use XML instead of JSON for my data, though.

My teleport events don't look too different from yours. I still use a property pointer because it helps me avoid redundancy though (like if I want to execute the value of the teleport property when the object is touched, clicked, or any other condition):

Ha. You can tell I updated my Tiled version between those two images.
Nice, looks like we do something similar for behavior haha

I actually regret not using XML for our game data -- even though we're using JSON there's still an explicit schema defined for everything, in this case a .java file. I think the whole database editor could be mostly replaced with a generic XML editor, seeing as how we'd need well-defined schema anyway.

Interesting solution for multi-page events. That's one of the things I couldn't come up with a good Tiled equivalent for, and instead I have multiple events stacked on top of each other, each one with its own appearance, behavior, and show/hide conditions.
This is a blog entry I must observe and study thoroughly.

I really thank you for your insight. I always stutter when trying to think how to implement, say, npcs, on a map using tiled. The database editor looks splendid too.
Just downloaded LittleSoundDJ (needs donation, but it accepts pretty much anything other than zero). It looks like fun, I just understood how to do basic stuff. But I dunno how to dump the songs into a file. What extension are your music files?
We have everything in a .gbs. It's not an actual memory dump from that game, I mean the memory dump is there, but there's also some annotations about where tracks start/end and I'm not so knowledgable to know how that's handled in a real game. I should get a tracker going and figure out how to hook it up to the emu. (one of my other hobbies is retro sound even if I'm a terrible composer)
Pages: 1