First, a little history... (be patient there are videos and stuff coming further down)
Recent HistoryMythruna uses an architecture based on an "entity system" (also sometimes called "Entity Component System"). ES for short. This has become very popular lately as a way of organizing game data and game code. It's a data model that leads the architecture and forces thinking about problems in different ways... it's also very flexible.
The Mythruna engine has been using an ES for over two years now as I shoehorned one in over a weekend when Mythruna was only 5 or 6 months old. It saved me lots of time and pain over the years. Over the course of time, I'd slowly factored the ES out into something pretty general that any game might use. Back in March, I finally opened source this as project Zay-ES (as in Dr. Zaius... google it). It's currently an add-on project under the jMonkeyEngine umbrella. You can find more info here if you are a developer-type and/or just curious:
http://hub.jmonkeyengine.org/forum/board/projects/zay-es/The new Mythruna engine has been built on Zay-ES (or the code that would become it) almost from the beginning. I started the rewrite a year ago November and Zay-ES was released first in March.
One thing that Zay-ES has been missing was networking support. This is a pretty critical component and one of the major reasons that the new Mythruna engine still doesn't have multiplayer added (there are two other reasons but this was the biggest). Zay-ES users were really struggling with trying to network their games so I finally got motivated to knock this out and check a few bullets off of several to-do lists.
I didn't want to use Mythruna as the test bed for this because:
a) it makes a bulky test bed. I wanted something I could start and restart quickly.
b) there are still two other issues to deal with before Mythruna can get proper networking
c) The big one: it's close-sourced and so make a poor example on how to use the Zay-ES networking. It's also way too big of a project to be good for illustration purposes in this case.
A Side ProjectSome of you may remember that a while back I made an "Asteroid Panic" game. This was a simple game project I wrote over a few days (music and art took longer than the code) to illustrate how to use Zay-ES in general and how to integrate it in a JME game. It's a simple game but still fun to play... and small and straight forward. I wanted to do something similar for a networked game.
A simple RPG immediately sprung to mind. "Dice" based combat (like most RPGs) meant that I didn't have to deal with the twitch factor (like in an FPS) and it also meant that nearly 100% of the networking would be handled by the ES itself. A simple maze with some characters running around beating on each other would be pretty simple.
The game: Monkey Trap
The original goal was to code the core game in one week and then spend the next week adding the networking. I would use only off-the-shelf models that were already publicly available. I would also try to leverage as many of the existing jMonkeyEngine features as possible (in Mythruna I write a lot of my own stuff). JME already has some test-data models that include an animated monkey and an animated ogre. So those would be my models.
The project had taken on a life of its own within the first few days. I kind of should have known when by the second day I'd already had a logo designed and written some nice ambient them music.
The thing is, I started to see a lot of areas to explore that would directly or mostly directly apply to later Mythruna development. For example, I'd never really used JME's animation system that much before. In Mythruna, I plan to write my own that takes advantage of physics a bit and some other features that JME's doesn't have, but a lot of the core problems are the same with respect to using the bone animation key frames and synching them with sounds and other particle effects. Particle effects was another area that I hadn't really explored.
I also got to prototype some ideas related to integrating an AI with an entity system. I've had lots of design stuff written up for some time but having an actual project to apply ideas to was a great way to hone them down. While Monkey Trap's AI is simpler than Mythruna's will be, the core principles are the same. The underlying state machine is likely reusable and I finally got to play with some ideas I had about "npc sensor areas"... in other words, trying to efficiently keep track of what an NPC knows about its local environment. Really the side benefits are almost too many to remember.
So all of that took me a couple more weeks than I'd originally anticipated. On the plus side, the networking part took almost exactly a week... so I was right on about that.
...but I finally have something ready to show.
(A slightly older pic but I felt a picture was warranted here...)
Monkey TrapHere is the link to the releases if you want to skip right to trying it out:
https://jmonkeyplatform-contributions.googlecode.com/svn/trunk/zay-es/examples/MonkeyTrap/release/The game is in no way complete but it was complete enough to implement networking. There is no real "game" yet as the ogres will never attack you. In multiplayer you can attack other players but I think it crashes their client when they die. (cool!)
So basically, you can just run around beating on things and collecting buffs. The buffs don't even really affect you right now since the real combat system was never added.
And the ogres' AI is really simple. They just use a simple maze traversing algorithm (drag left hand) to try to explore the maze.
Also, I will point out that right now there is some kind of timing bug that is super-visible in the multiplayer version.
Videos and EvolutionFirst is a video of the maze generator doing it's job. I thought it looked kind of cool and you can see the main menu, logo, and hear the ambient dungeon-crawl music. (I will probably reuse the music in Mythruna too somewhere):
http://www.youtube.com/watch?v=35dwik5zkuoIn these videos, I was trying to sync the monkey walk animation to his movement speed. Apparently, many models are not created with this in mind so I ran it in slow motion just so I could get it as close as possible. It bugs me when feet slip but the gait of most of these models varies in speed... best I can do is get close.
Slow motion close up:
http://www.youtube.com/watch?v=blhiSjZSZ9sProper speed:
http://www.youtube.com/watch?v=Nl-fI5UNKTMNext was "fog of war" style darkening to show both what you can see and where you've already been. Every proper dungeon crawler needs this:
http://www.youtube.com/watch?v=eV5IO0EnwyEFor the ogre, I went through a similar process of timing the animations and stuff but finally had the basic AI system working to have them drunkenly random-walk the maze. Here is a total infestation of ogres:
http://www.youtube.com/watch?v=G0doovbXId8Next was to start adding some objects for the monkey to smash. Also, the ogres are a little smarter now:
http://www.youtube.com/watch?v=Ezif8I8YLhsNext was trying to get the positional sounds right for footsteps and stuff:
http://www.youtube.com/watch?v=0-gqev-Z-BMI did a little test app to test some particle effects + explosion sounds for the wood objects:
http://www.youtube.com/watch?v=9VTFbZH9X-QNext I'm starting to put it all together. Sound effects for punching and particle effects for picking up objects... still no explosions:
http://www.youtube.com/watch?v=XRZoxrB-KlQA little test app to test and synchronize the character animations. (The latest version of the test app also has exploding barrels and chests.) Eventually, the combat system will take advantage of these animations to show how the battle is going visually:
http://www.youtube.com/watch?v=7BefBUzBdbcAnd finally, a video with all of it put together:
http://www.youtube.com/watch?v=7PUYgXQfl_EBack to RealitySo, that's all I may do with it for the time being. It serves it's main purpose and then some even if the game itself isn't finished. I do want to swing back and finish it at some point but by now I really really really miss working on Mythruna. I'm very excited to get back to it.
...and that's also something I kind of needed, too. Hopefully more on that front in the next couple of days.