So apparently I'm supposed to be doing more blog posts OOOPS.
I figured it was time to write about something then. How about Waifu Quest? Yea that sounds good.
What is it? Well it's pretty much the best game that's not out yet.
For my Game Design & Development 2 class (GDD2) we have to make a game every 5 weeks. We started with an analog game that we called Jailbreak which turned out pretty okay, and now we've concocted something weird. Waifu Quest is a working title for a JRPG + Visual Novel hybrid. It's so strange we don't even know what to call it yet. I don't want to talk about the game design just yet because it's still in the fledgling stage but I can talk about what I've been programming for it so far.
We decided to use Unity 2D for this because we were all somewhat familiar with Unity and it seemed like it would streamline the process of making this game. The only thing that Unity 2D doesn't have that would have helped though, is a tile editor. This was a problem considering that our top down maps would need to be done somehow and it's not nice to do tile based work in Photoshop exclusively. So I set about trying to write a simple tile based map editor before we started really had the whole game design ironed out.
My first idea was to have an editor script generate Quads in Unity in a grid. I thought this would be awesome, I just change the associated tile and I can save the whole map as a prefab; Perfect, right? No not really... Turns out that having 10,000+ game objects in a scene is a bad idea even with 2D. The engine could take a while to generate a big map and trying to move a big map after making it would be hell. Also I never even tried to consider what would happen if the user moved a tile off the grid. So that was a bad idea.
What I've done now is create a texture based system that allows a user to paint textures from tile sets found in their Resources/Textures/ folder. Creating maps is simple and painting them is even easier. I got smart and just implemented a way for tiles to be saved into a map object that can be serialized out. This way we don't have to actually *save* the texture that we're painting, just the metadata about where the tiles are on the map. This makes saving collider data also really easy because we can just save it all as metadata in the JSON file.
Loading maps is going to be kind of challenging but WyrmTale Game's MiniJSON fork makes it pretty easy. It's MIT Licensed too which is pretty handy. Just using MiniJSON wasn't enough because I have custom Tile and Map objects that I want to serialize out, but MiniJSON doesn't take care of custom data structures very well. WyrmTale's JSON script lets me define how my objects get read and written as JSON object. It makes my life super easy now that I know how it works.
That's it for now, I'll probably post more about WaifuQuest later seeing as it will be a cool, open source and ongoing project. Maybe next time I'll talk about the completed tile editor!
No comments:
Post a Comment