The Future Is Unity?

After spending a few weeks learning about PBE I’ve decided that even though the devs there are great guys, responsive to questions in both forums and IRC, and doing fantastic engine work (all true!), I think I really need a game platform that’s more mature and ready to work “out of the box” for what I’m trying to do right now, which is producing and publishing a few (relatively small) RPG games quickly to start building community feedback and further developing the Arcanoria mythos and backstory.

So I started looking at other options a week or so ago! What I found was that I had incredibly good timing to start looking for a new engine. Unity 3D have decided to make their base model engine package free. I’ve always been impressed with Unity, and might have used it 3 years ago when I first started getting involved in game development, except for the fact that I’m a PC guy and Unity was only available for Mac at the time. However, they now have a PC version, and with last week’s bombshell announcement about their Indie package becoming free to use, I decided to give it a spin.

In short, I’ve been incredibly impressed with Unity! I can hardly believe how polished it is, including the website, wiki, tutorials and documentation, and engine stability. Furthermore, the Unity community is nothing short of amazingly helpful. The forums are frequented by 300-500 users concurrently at most times, and the IRC almost always has 80-100 people online, chatting up the engine and answering questions in a very friendly and supportive way.

Unfortunately this means there will be a short break in development while I learn more about Unity, but I’m very optimistic that we’ll be able to produce great results quickly, as many other Unity developers have done before me. I’ll put together a revised timeline soon and post about it here.

XML object instantiation including Box2D physics

monsters and trees and buildings, oh my!

monsters and trees and buildings, oh my!

Knocked out a major item today in finishing up the initial implementation of our new way of instantiating world objects, using XML instead of AS3 code. After spending about 3 days trying to understand how to link everything together, some insightful tips from Ben Garney on the PBE forums made sense of it all for me. Thanks Ben!

I’m learning more about the engine every day, taking one more step towards the fluency and transparency that will make PBE a sketch pad for my creative ideas, rather than an interface to be dealt with.

Rockford town and Main Quest lore

Created an initial draft of the game’s background story. Here it is:

Rockford is the main town where the player spends the entire game, both in the town above, and the dungeons below. Rockford is a small mining town in a secluded valley near large mountains. It’s got fertile soil and mountain streams nearby, plus a road leading eastward toward the bigger towns and cities that trade for the raw materials and fine smithed goods that Rockford produces. Rockford has always been a peaceful and prosperous place.

Peaceful, that is, until a few weeks ago, when an evil lich named Vicerius came into town late at night, stole a few things, killed a few people, then disappeared into the mine. He cackled that he had finally found the perfect base from which to build his undead army and control the surrounding lands. Vicerius took up his residency deep within the mine, and since that night the old mine has been transformed into a festering dungeon, filled with dreadful monsters who attack any intruders on sight.

You’ve just arrived in town looking for work after leaving your home village of Kurn, about 3 days walk away to the south. Kurn is a small farming village, but for some reason the crops have not been doing well recently, and you’ve never really wanted to be a farmer anyway, so you figured it was time to go and make a name for yourself as a blacksmith or a trader or an adventurer. Little did you know that you’d find the usually brave folk of Rockford in such dismay. It must be destiny…

Obviously this will continue to evolve. It’s also posted in our wiki at https://trac_dun1.arcanoria.webfactional.com/wiki/Lore.

Diagonal hero movement - harder than it seems!

hero walking at a 45 degree angle

hero walking at a 45 degree angle

The hero now moves diagonally, and faces in the appropriate direction. This took some actual trigonometry to figure out the angle based on the vertical and horizontal displacement. To be honest, it’s overkill right now, as we’re only using keyboard arrows, so there are only 8 possible rotations, all divisible by 45 degrees. However, we may eventually add mouse pointer-based movement to an arbitrary rotation, so our work today should hopefully make that a bit easier. If any of you code geeks out there are interested, here’s the relevant source section, taken from the hero’s frame event handler:

  1. // we derive the rotation and speed based on the angle and length of
  2. //   the hypotenuse given by netX & netY
  3. // handle special cases on the axes first:
  4. if (netY == 0)
  5. {
  6.         if (netX == 1)
  7.                 rotation = 90;
  8.         else if (netX == -1)
  9.                 rotation = 270;
  10. }
  11. else if (netX == 0)
  12. {
  13.         if (netY == 1)
  14.                 rotation = 180;
  15.         else if (netY == -1)
  16.                 rotation = 0;
  17. }
  18. // now handle arbitrary angles:
  19. else
  20. {
  21.         rotation = 90 + Math.atan(netY / netX) * 180 / Math.PI;
  22.         if (netX < 0)
  23.         {
  24.                 rotation += 180;
  25.         }
  26. }
  27.  
  28. // normalize speed by dividing by the length of hypotenuse:
  29. var hypLength:Number = Math.sqrt(netX * netX + netY * netY) || 1;
  30. var speedAdjust:Number = 1 / hypLength;
  31. position.x += runSpeed * netX * speedAdjust;
  32. position.y += runSpeed * netY * speedAdjust;

In addition, I’ve always thought it important to not give a bonus to movement just because you’re moving both horizontally and vertically at the same time. So I used the old standard geometry formula for determining the lengths of each side of a right triangle (a2 + b2 = c2) and the movement displacement is now divided by the correct ratio to make effective speed the same no matter which direction the hero moves. Again, probably not vital at this point, but hey, it’s the little things that make it special. :)

More realistic hero graphic with sound FX


Okay, I knocked out two tickets yesterday.  Firstly, I made some new graphics for the hero (and also a new monster, building, and a tree, as you can see below, but these are not placed in the game yet).  He’s looking a bit more heroic now, with his cape and all.  Plus he’s got hands, a nose, and some eyelashes too.  He doesn’t have any sort of animation yet though, as I’ve not tried creating a sprite sheet (that’s a ticket for a future day).

In addition to his cool new look, he also makes noise now.  When he walks around there’s a sound effect of boots running swiftly on dirt.  If you’d like to see and hear it please hit play on the embedded video.

I had some trouble with this video capture, because I wanted to include the audio, but my current sound card doesn’t support recording from “Stereo Mix”, although most cards do.  So I had to do this on my laptop instead.  I chose to use an open source video capture product called CamStudio, which I definitely recommend!  I downloaded it just today, but it seems great.

I also downloaded the newest version of the K-Lite codec pack from here.  I also recommend that for pretty much unlimited options as to how you encode and decode your video.  Although I have to admit that in the end I wound up just using Uncompressed AVI out of CamStudio, then using the Adobe Media Encoder (which came with my CS4 Master Collection) to convert it to FLV for the web.  I could have used the CamStudio software itself to create the FLV, but I really like the Adobe Media Encoder as it gives lots of control over the output.

New Project Tracking System

As we’ve done for other projects, we’ve chosen to use Trac for project tracking.  Trac is easy to install, not too difficult to configure (although I think it could be easier), and doesn’t get in the way too much.  You can access the project tracker right from the menu on this page, underneath the project name, which is of course Arcanoria: Dungeon of the Dead.

Trac gives us the following features which we’ll take advantage of on this project:

  • Publicly viewable bug and enhancement lists.  I’ve gone ahead and put a few items (known as “tickets”) in from the todo list, and will try to keep it current as we continue to move forward.  Ticket creation can be done by team members (including pre-release testers, once we’re at that point).
  • Trac creates online reports to summarize the tickets and organize them in various ways, such as by project milestone.
  • Tickets can be prioritized, assigned to a team member, and can contain issue-specific discussions or media.
  • Trac also provides an embedded Wiki for public documentation.  There is nothing in there currently, but it may be useful in the future for game meta-information that we don’t want to keep on the main website here.
  • SVN linkage, showing our source code repository for this project (this is not populated yet, but will be soon).  As this is a private project the source code will not be publicly viewable, but team members will have access to this by using their secured login information.

Moving and rotating hero, Improved buttons


As I go along I’m finding things quite easy to understand and implement.  This is a testament both to PBE and to AS3.

Today I’ve done the following:

  • Added a custom colored button class to incorporate all style preferences so they don’t have to be explicitly set for each button instance.
  • Added keyboard input for arrow keys.
  • Figured out the basics of property references and spatial components, along with the new SpriteRenderer class, allowing the arrow keys to control the hero’s position and rotation.  In other words, the hero always points in the direction it’s moving, and it can move in any direction.
  • Added bounding for the hero position so it can’t walk off screen.
  • Added Pause Game logic while the menu is up.

GUI Menu & Buttons Added

The new Main Menu GUI screen

The new Main Menu GUI screen

Things that got done today:

  • Figured out how GUI screens work in PBE
  • added a splash screen (again with temporary placeholder graphic)
  • added a Main Menu screen
  • added a main GUI screen with a couple of simple text output fields, and a Menu button
  • added a Game Over screen, with a button to take you back to the Menu

Push Button Engine basics

background map and hero "arrow"

background map and hero "arrow"

After spending some time doing background research and review, reading books, doing tutorials, etc., I decided to “break ground” on doing some code using Push Button Engine (hereafter called PBE). I now have a map background and a hero icon on screen, and I can position, scale, or rotate their starting creation data. Still can’t move anything or accept any user input, but that’ll be for another day.

Also, the graphics are strictly “placeholder”, with the background map being just a standard background I “borrowed” from one of the PBE tutorial lessons, and the hero being nothing more than a colored/textured green arrow that I whipped up in Fireworks CS4. But at this point I’m not worrying about graphics, I’m just trying to figure out how the engine works, so I think this qualifies as a successful experiment.

Arcanoria: Dungeon of the Dead

More info coming soon about the new Arcanoria single player 2D flash game Arcanoria: Dungeon of the Dead, being developed using Push Button Engine.

A:DD is slated to be released in December 2009.