Saturday, April 27, 2013

A little bit of Thunder Moon gameplay

Here's a short clip showing some gameplay near one of the early mission encounters. It shows off the new messaging system which is now integrated with the mission progress and the item wear systems.

Friday, April 26, 2013

Thunder Moon - Message display test

The game really needed a way to present general messages to the player, and this is what I came up with:

The speed of movement and the fade times are going to get tweaked, and possibly the whole thing will get shifted to the side of the screen but the general push of messages upward seems to work pretty well.

Edit: Tweaks complete! Here's how it looks now:

Item Durability & Powerups

The latest update now has a feature that's been in the works for a while: Item durability. The game now tracks a health value for each item that can wear out, which is essentially everything that provides a functional benefit to the player. Weapons, packs, powerups - they all fit into that group.

Pistol with a heat exchanger to increase weapon fire rate, the jet pack with two types of energy generators, and a fusion reactor in the aux slot provides enough power to keep the jets running almost non stop.
Here are the highlights of this update:

  • Items that are activated or which have passive effects now have finite durability and take wear when used. This is shown with a horizontal health bar over each item that has durability. 
  • Items with effects have durability reduced when their effect is providing a benefit to the player. For triggered items, such as the heat exchanger or beam focus, this will trigger wear when the player shoots a weapon that has the item equipped in the socket. For passive items, such as the transformer, auto repair kit or fusion reactor, it will only take wear when the stat these generators are boosting is not at max value. This was a pretty complicated system to implement so I look forward to any feedback on this now that I've finally enabled it.
  • Items now have their backdrops color coded to indicate when they are active. This is important for items in sockets shown on the side of the hosting item so you can see when they are getting worn, possibly deciding to remove the powerup and save it's durability for another time. They are green when ready to activate, yellow when active, and red when the item has worn out indicating it's time to install a replacement. Worn out items currently have no value but I may add recipes or a repair mechanism in the future.
  • Deployable items (currently, the Turret) now keep track of their health when recovered, saving it as item durability.
  • New powerup items: Power Supply, Fusion Reactor. Both boost energy generation, allowing for more jetpack time or other energy consuming activities.

The item wear features is the big thing with this update. Most items take quite a while to wear down. I plan to adjust these after more testing to make them last a reasonable amount of time; too long defeats the purpose and too short is not fun. Please let me know if you have any opinions on this or anything else in the game, thanks!

Thursday, April 25, 2013

Video: 5 minutes to the top, and the challenges of making a voxel world

This is a long video clip showing an ascent from deep in the caves up into the sky. I made this video to help show the scale of the game world.
Getting a voxel engine to do this has been no small challenge. I will never forget how when I started on this engine how I thought, essentially, "How hard could it possibly be? Cubes are about as simple as it gets!". I was sure it would be a quick thing to do and get a game out. I couldn't have been more wrong. While it is in fact relatively trivial to get a basic voxel renderer with hidden face elimination up on the screen, that's just a tiny fraction of the work involved with making it a full feature of a game with decent performance on the XBox using XNA. Here's a short list of some of the surprisingly complicated tasks that go along with it:

Physics: Just cubes, you say? Sure, but you have to have an optimized system for dealing with all the physics because you sure can't add & remove hundreds of thousands of blocks to a physics engine and expect it to work well. Solving this means having a deep understanding of whatever physics engine you are using. Why not go simple, and roll my own physics and just keep it basic? Because, frankly, I wanted more physics than simple block collision and I know from experience that reinventing the wheel when it comes to physics engines is just not smart for a sole developer. Thanks to Bepu, which is awesome, this game has proper physics and it enables a lot of interesting dynamics. But it comes at a pretty big cost, especially with the voxels both in terms of runtime and dev time.

Rendering performance & quality: Managing all the blocks so they don't kill the framerate just by being on screen was an enormous task in itself. Almost as important is that because of all the competition in the indie game space, it's essential the visual quality is competitive in order to minimize how many people will dismiss the game out of hand for just not looking good enough during the first impression. This engine has some nice rendering features that I think help it stand out, but it wasn't easy or quick to come up with these solutions. Voxel spanning textures was hard to get right both from performance and content pipeline/management standpoints. Getting decent lighting has been probably 10x the effort I thought it would be, and it's still not where I want it to be. A big part of the time invested in this area was that I needed to refresh my graphics skills which hadn't been seriously used in a long time. It's been great to be up to speed on shaders though!

Procedural worlds: Fractals are the ultimate rabbit hole task, where you can find yourself endlessly tweaking parameters trying to get it to look good. Performance wise, the XBox has terrible floating point performance under XNA which doesn't help one bit. Getting this to work well has been a very time consuming task, but it's been worth it; I'm pretty happy with how the world looks these days. I do wish the caves weren't so vertical near the ground, but I've already spent more than enough time tweaking it.

Memory: The XBox 360 has 512MB of ram. You can use most of it, but there is no virtual memory. Voxels are pretty cheap, but any 3D array starts adding up quick when you want to see at any reasonably entertaining distance.

Serialization: Moving around the world, offloading and loading chunks, and stitching them to the existing geometry doesn't sound too bad until you start thinking about the light system and how the radiosity and vertex lighting has to propagate changes to neighbor chunks. The fact that this game is unlimited in all directions only complicates things further. And that's not even touching the general issue of how much data is generated and stored or keeping the IO work from messing up the main game thread which is another whole area of complexity. To top it off, the XBox file system is hideously slow. Wow, just, wow. It's no wonder most voxel games are fixed arenas.

Content management: Depending on how it is configured, each face of a voxel will have several textures that have to be authored and integrated into the game data. Creating the assets, using them in game, and generally keeping these organized is an ongoing and increasingly time consuming task as the number of voxel types has grown. I have put serious time into creating custom tools which alleviate this problem, but again it's another level of cost that is easy to overlook when making an engine for rendering cubes.

The challenges of making a voxel world game are not to be underestimated. I could have extended the above list quite a lot but I think I've made my point. As someone who likes complicated problems, the more I realized the real scope of complexity here the more I found myself compelled to solve them. To all the other voxel world devs out there I just have to say kudos for pulling it off. For me this has been a very interesting process and it is a great feeling to be nearly done with the first release of Thunder Moon. Hopefully players will enjoy it.

Wednesday, April 24, 2013

Thunder Moon XBLIG update

It's been a busy week so far, and I just finished putting a new build up on XBLIG for testers to check out the recent changes. One change I'm especially happy about is that all the craftable items in the game can finally be made using resources found in the world. No more debug features required! 
New sand & clay block textures

Here's a more complete list of changes for anyone interested: 

* All blocks that need to drop items now have a "loot table" which will spawn the creation of one or more 
pickup items when a block is destroyed. 
* It is possible to create all blueprints using items found in the world.
* Some tweaks to voxel textures. Please let me know if any voxel textures look like they need to be improved. Clay and Sand have been completely redone.
* Some block types can now emit light, including a few types found in the caves.
* Caves are much more interesting to explore now as a result of generally improved lighting.
* Player movement has had more tuning and should feel better.
* Gravity has been reduced a fair amount.
* NPCs are pursuing and attacking the player more reliably.
* Jetpack particles tuned up a bit, and now has a light that is always on while wearing it.
* Fog settings now transition to an underground state when down in the caves, helping with a problem where it would seem you were near the surface since you could see the sun & stars sometimes because chunks that should be blocking the sky weren't ready yet.
* Renamed the game type "Explore" to "Survival".
* Added game type "Explore" which is the same as Survival, without any aggressive NPCs. Kind of nice if you just want to wander about freely.
* Targeting info for voxels now has proper names shown now, except for one rock type which I will be fixing.
* The planet now has a molten core very, very deep underground. There is still no practical limit to how far down you can go if you want, but there isn't really a good reason to make it infinitely deep and reaching the core is a pretty fun accomplishment. If it seems too close to the surface, let me know I can put it at any depth.
* Hoverbike is 50% faster.

I will be making some changes to the main menus to better explain the differences between the different game types.

I recommend checking out the socket system, in particular the Heat Exchanger and the Transformer items, both of which can be put into the pistol or atomizer. The transformer can be put in the Jetpack to increase energy recovery for longer flight times which makes cave navigation a lot more fun. It takes me about 10 minutes to harvest the necessary materials to craft these items.

Tuesday, April 23, 2013

Natural Cave Lighting

Thunder Moon has a radiosity lighting system for the voxels which until today was only being used by the environmental skylight. Today I added code to allow individual voxels to emit light, which I think turned out pretty well.
New lights and a bit of action

Here's a video showing a few minutes of simple exploration in the caves. Towards the end you can see a bit of the Time Warp pack in action, which I'm liking more the more I use it. Check it out:

The main thing this does for the game from a design standpoint is it solves the problem of being so easy to get turned around in the caves. If you haven't noticed by now, caves in Thunder Moon are HUGE and go down further than anyone is likely to ever want to go. The lights give a much needed sense of direction and cues for orientation. It's always been my intention for cave exploration to be as fun as the surface of the world and the new lights really help push it in that direction.

A while back I created a tool for preparing voxel data which streamlines the process of getting new textures into the game. Today I just added controls for tagging voxels as emitting light, and then tagged all the voxels that look like they should be lit up. And just like that, the content pipeline took the changes and the voxels are lit up in game when placed. There are a number of lit blocks the player can create, generally they look like concrete and steel with embedded lights in keeping with the sci-fi theme.

Sunday, April 21, 2013

Voxels, Items & Icons

An inventory filled with stuff, mostly the new concrete & metal plate/grate voxels.

Thunder Moon has a pretty capable item system. I think of it as a "light RPG" item system in the sense that you have to manage your inventory a little bit. There are three slots which can hold items that are tagged for them, which is closer to Team Fortress in terms of the number of slots to manage than a typical RPGs which often have a dozen or more slots for head, hands, chest, feet, wrists, ears, etc.

There are 8 held slots which can be quickly selected between in game without going to the inventory using the D-Pad, unlike the worn and aux slots which require going into the inventory and manually equipping new items. The items that go into the held and worn slots are assigned two of the controller buttons each so these items can have a primary and secondary action. Aux slots only get one action, mainly due to limited number of buttons on the controller.

Equippable items have the ability to load and manage assets of any kind, but so far this is used mainly by the packs and weapons to load a 3D model with animations (using the same pipeline described in earlier posts) and sound effects. These are attached to the character and can use any number of models which are managed as a unit, allowing attached items to incorporate lights or separate items that need to use different shaders. The assets loaded for an item can include animations to apply to the main character, which is how the weapon firing action works. The items that are in game now are just the tip of the iceberg in terms of what the item system can do.

Most of the items have icons that were made in the traditional way which is to just render them out and put them in the sprite sheet resource. Voxels are unique however; the voxels are actually created by a custom tool which assembles the textures used for each face so creating icons manually would be a tremendous hassle. The voxel icons are instead procedurally generated, which took some dev time but now that I've had time to make more voxels it's been a great time saver to have their icons just automatically appear in the game. Automation is great.

Saturday, April 20, 2013

Turret Test and a brief overview of content creation

The turrets in Thunder Moon can be destroyed by NPCs and blow into pieces that bounce around before disappearing. This video shows reliability tests being run on that system which I think people might find interesting to see. The transition from an animated skinned model to a collection of rigid body parts that is synchronized with the animation at the moment of destruction is a pretty complicated thing and I'm pretty happy with how it turned out.

Seeing this kind of functionality in game is the end result of a lot of parts that all have to work together perfectly. I created the model in Softimage, and constrained groups of rigid body shapes to the various bones. Each group of shapes corresponds to physics primitives such as spheres, boxes, etc and are combined into a single rigid body. When the asset is exported, it combines this information with everything else (geometry, skeletons, animations, textures, shaders, etc) which is processed by the content pipeline tools into something the game code can load. Once loaded, the game code does the work of setting up the binding all the physics data with the animated model data.

While the turret is in it's healthy state (before being destroyed) it is animated using an "animation tree" system which provides fairly high level control of the visual. For this model, that means the tree has a node which is set up to aim the gun, another to spin the barrel when it shoots, and another to enable a light and secondary flash mesh attached to the end of the barrel when it actually fires a projectile.
The turret model in wireframe, with the rigid body parts as solids.

All of the assets for the turret are assembled in Softimage and the pipeline takes care of the rest. This content creation system is used for everything in the game and while it was a pretty big time investment to make it work, it was well worth the effort. There is a lot to be said for automation and I am expecting this and all subsequent projects will benefit from streamlining the creation and use of assets. It's pretty handy to be able to just hit export, include the asset in the package and in the game code just load it up and use it without messing around with manually hooking up shaders, textures, animations and all the rest. The simplest use case is literally a few lines of code to load, initialize and add to the scene which lets me get right on to making the actor do something interesting for the gameplay.

Friday, April 19, 2013

Voxel texture & systems progress

The past few days have been spent largely working on voxel texture systems and tools. The engine now supports partially transparent (alpha tested) voxels. Well, the engine has actually "supported" them for over a year now but there were a few important bugs that I never got around to fixing until today and I never had any game quality textures until very recently anyway. Another feature that has been in there a long time but I haven't made much use of is the ability for textures to span multiple voxels, which I think really helps the overall look. This is most visible on the ground texture. The tools I've been working on have been very helpful in organizing and preparing the content which has a surprising number of details to keep in under control.

Here's a couple new shots where you can see the metal grates and the voxel-spanning metal girder looking textures. There's a turret sitting there next to me just in case some bugs decide to show up.

While this game doesn't generally rely on building voxel structures, I know a lot of people just like to build things just for fun so I plan to support it as best I can. I'm planning on including a number of sci-fi themed textures for people to build with, in addition to the raw materials found in the world. Various metals, concretes, etc. Most will be craftable from the raw materials found in the world.

Tuesday, April 16, 2013

Texture experiments

Here's a clip of some new texture work in Thunder Moon, along with some flying around with the jetpack. I finally fixed a few lingering bugs related to normal mapping on the voxels, and the end result is I'm starting to like how they look now especially with dynamic lighting. The screenshot doesn't really do it justice, the video shows it off much more nicely.

Unfortunately I had been using Fraps for something else recently and didn't reconfigure the settings to the usual, so there isn't sound and it was recorded at only 15FPS. For anyone wondering, on my mid-grade PC the game generally runs at about 80FPS and on the XBox 360 around 30FPS. There is still room for improvement but there's only so much that can be done with the XBox/XNA pushing around about a half million triangles every frame on average (not to mention the heavy number crunching of the animation blending system). The large caverns expose a lot of faces, many (most?) of them obscured by closer voxels, but it's worth it to be able to fly through the caves with the jetpack and vehicles.

Saturday, April 13, 2013

Late yesterday I posted the latest build to XBLIG playtest. There have been a number of changes since the last version people were able to play:

  • Backpacks - The Jetpack allows you to fly around and is designed to help you get around the sometimes deep and vertical caves. The Time Warp pack is intended to be used during combat as an offensive device, allowing you to move and attack at regular speed while the rest of the world is slowed down. The Shield pack makes you invulnerable for as long as you have energy to keep it active. All of them have unique models and animations. They also support two upgradable sockets each.
  • Powerup items - These are modules that can go into the sockets on the weapons and backpacks. There are a number of them in the blueprint table. I need to make them more accessible for testing however since right now it's pretty hard to get the necessary items to craft them. The powerups currently in game include weapon damage boost, weapon speed boost, max shield boost, improved shield recovery speed, max energy capacity, energy generation speed, weapon stabilization and a few others. Any item with sockets can have powerups put into them. While designed from the start to support sockets+powerups, this system is just now starting to get some real use. The next update will have the powerups much more accessible. If you want to check them out now, run the game using the profiler and the command line argument "testcraft" - this will allow you to make any item without consuming or requiring the parts that would normally be required.
  • Powerup items show on the HUD next to the icon for each of the held, worn and aux icons.
  • New NPC - Xeno Flyer - This is a flying bug that shoots at you.
  • A few garbage generators have been discovered and eliminated. The game should once again run with only occasional garbage collection related stalls.
  • In the inventory, "Drop" has been renamed to "Discard". Discarding an item now creates a pickup item in the world which you can walk over to pick up later if you wish.
  • The currently held item can now be set in the inventory panel by simply moving the cursor to that item and exiting the inventory. You can still use the DPad during gameplay to switch.
  • The walking bug now has taunt & pursue sounds. No more sneaking up on you without any warning.
  • Time of day is now saved & restored on load.
  • Pistol and Atomizer now use weapon accuracy, energy weapon boost, and weapon speed modifiers defined by any powerups.
  • Added sound for picking up items.

Monday, April 8, 2013

Thunder Moon - Jetpack

I've been working more on the backpacks. There have been a few design changes with them, mainly because it eventually became clear there wasn't a good reason to have more than one pack that helps with movement. If you're only going to have one kind of flight pack, it has to be a jet pack, that's just one of those things that is always fun to have in a game.

Here's a video of the jet pack in action.

Thursday, April 4, 2013


I've just added the first two visible backpacks to Thunder Moon - the Anti Gravity Pack and the Tractor Pack. They are designed to help you move around the world a little easier.
After seeing the character by itself for so long I have to say it's a nice change to start seeing backpack attachments. I'm looking forward to adding more once the assets are ready.

I kind of wish there was a design reason to add a few hats. Might have to put a little thought into that!