Trending Games | Star Citizen | Guild Wars 2 | Warhammer 40K: Eternal Crusade | Final Fantasy XIV: A Realm Reborn

  Network:  FPSguru RTSguru
Login:  Password:   Remember?  
Show Quick Gamelist Jump to Random Game
Members:2,920,468 Users Online:0
Games:760  Posts:6,311,672

Show Blog

Link to this blogs RSS feed

Mythaka Development

This blog is dedicated to reporting the ongoing developments of the Mythaka indie MMO project. Comments are encouraged, and will help shape the evolution of the project!

Author: lynnara

Awash in Waves of Sound

Posted by lynnara Sunday September 25 2011 at 8:23PM
Login or Register to rate this blog post!

Beep Beep... make way!

Daily life is filled with a cacophony of noises and melodies. We are constantly bombarded with invisible waves that tickle our ears. Sometimes those waves create or amplify powerful emotions within us...

Obviously I can't make a game without sound right?

So of course I needed to deal with all manor of sound issues. My entire week was consumed by the quest for sound. The sound system is rather complicated, having internal designations and special structures for different types of sound, and also having a number of transforms and effects processing (reverb, doppler, etc). The main complication, however, was the nearly completely missing pipeline tools to build the sound assets into a useable package for the client.

Putting the wind in the pipes...

Before sound assets could be put through the nearly non-existent pipeline system, I had to deal with a more fundamental issue. I needed sound assets. My brother, being a musician and having his own studio would be a logical source, but he is busy with various things and what I really needed was a way to thoroughly test whatever pipeline systems I fixed up. The perfect test would be to have all of the original sound assets that I could then compile and then compare with the precompiled sound pack, at the byte level and also in game. If I can take a bunch of .wav files and stuff em through whatever pipeline i managed to put together, and the end result was functionally equivalent to the precompiled sound pack, I would know my pipeline is working and could then proceed to fill it with original sounds. So my first job was to reverse engineer the precompiled sound pack and reconstruct the original .wav files from the packed data.

Reconstructing a ton of little .wav files meant absorbing all of the code that read and used the stuff, and also researching all of the metadata (.sound and .sound_anim files). All of the sounds used in the game are first organized into sample banks, which are basically files that contain serialized sound buffers containing raw data in 2 formats ( 16bit mono PCM and ADPCM ). Probably the most difficult thing about extracting and recreating the individual .wav files was that there was no standard sample rate. A large portion of the sounds were recorded at 22,050Hz but many were at 16KHz and there were a whole range of things at every odd frequency you would never think of using normally, like 13KHz or 5KHz. I suppose for pure efficiency, low frequency sounds do not really need high frequency sample rates, so the original sound designers figured out the lowest most efficient sample rate for each sound that still kept as much fidelity as possible. In total, there were 11 different sample rates in use.

After a lot of trial and error (which resulted in very loud static noises), I had 1043 .wav files organized into 71 sample bank folders. Yay. My eardrums were quite happy to be done with all of that.

When, where, and how many times?

The sounds are not going to play themselves, so it was obviously required that I either create the metadata files from scratch or reconstruct them from the packed data. I wanted the closest I could get to the original stuff, so I chose to reverse engineer the metadata too. This was an entirely different challenge. Turning serialized binary data back into the original XML it all came from is kind of insane. But I like insane stuff so I dove right in.

There are five different fundamental sound types that the sound engine uses for various purposes. All of them share a base data format for things like gain, transposition, 3d sound projection, and distance. Beyond those basics, everything changes depending on the sound type. Most of the sounds were "simple" sounds... one shot sounds played in connection with animations such as sword swings, animal grunts, combat impacts, etc. "Music" sounds were pretty easy also, the main feature on these sounds are crossfading, minimum play time and minimum delay before replaying. The oddest sound type was the "background" sound type... each was an array of individual sounds, each sound having a bank of 32 possible filters attached to it.

After another round of trial and error, I had 2599 .sound files. Apparently a lot of the .wav files were reused for a number of purposes, most likely using the transpose and possibly also filters to make them sound different. It took eons ( days ) to get these files right. Luckily, I did not need to recreate the .sound_anim files... these were conveniently left as intact XML files inside the sound asset pack.

Now I had the prerequisite assets... I just needed the pipeline tools and scripts to compile it all again.

Digging the trench, laying the pipe...

As I mentioned at the beginning, the asset build pipeline had nearly no concept of audio. There was a single folder with a sound process script, but it was never called by any other script, the directories and configuration variables were not set anywhere, and the binary tool itself was missing. There was definitely not a lot to work with, but this little bit was way better than nothing.

Digging through the cmake project for the entire game engine ( client / server / drivers / tools ), I had hoped to find the sound compiler tools, but there were no sound tool projects at all. There were some sample projects that used compiled sound assets, so there had to be something somewhere to compile the sounds. Searching the source tree, I found three source files for the tools, but there were no project files. It was seriously just three .cpp files, not even any headers, and each .cpp file was in its own folder with a readme file with the command line to use the tool. Wow. So I fumbled around trying to build project files for these things, and after a ridiculous amount of time (hours) I finally managed to get the dumb things to compile. A trip to the command prompt confirmed the resulting tool actually operated (at least enough to tell me I'm doing it wrong, and by the way, here is the proper command line sequence....)

Ok I have the audio converter tool, I have the assets, I just need to figure out some python scripting for the pipeline. Oh yeah, I love python. Except I've only messed with it in passing ( adjusting the pipeline scripts ). I'm pretty sure I never wrote a python script from scratch. Well there is a first for everything.

Ok I hate python. Or it hates me. Or I'm retarded. It seemed to take me longer to make a working python script (which looks like it should be stupidly easy) than it did to figure out and compile the binary tool. Anyway after what seemed like a battle to the death (to my poor fingers at least), I got the new script working with the rest of the pipeline. Directly after the most basic test, I set the pipeline to rebuild all those assets back into the compiled package I extracted them from. I crossed my fingers and waited.

I must be hearing things... or is it selective?

So I took the resulting sound pack and added it to my test client, and started it up. My loading background music was working, but that wasn't really part of the challenge. Once I got in the game world, I heard sound. I was like woohoo and then I was like wait.... I can hear the background sounds like wind and bird chirps and odd frog noises and such (totally out of place on a nearly barren moon of course) but I did not hear any noises coming from the little test animals. I tried a few actions that would normally produce a sound effect but none of them made sound. It seemed that the sounds that were not working were all the ones designated "simple" sounds. With probably the deepest sigh I have ever produced to date, I turned to my trusty hex editor for another session of retina-burning research.

It did not take me long ( and my retinas were most thankful ) to find the issue, or at least the right direction. About 1/3 the way through any one of the "simple" sounds compiled by the binary tool I found a great big gaping hole of zeros. I got the notion to take my recompiled assets and put them through the decompiler I made, and it showed me quite clearly what was missing... every single compiled audio asset was missing the data designating the number of 16 bit samples each sound was made of. Without knowing how many samples to make a buffer for, the game engine was simply rejecting those sounds as unusable. The problem of course came from the audio converter tool I had earlier compiled.

Debugging the audio converter tool did not take terribly long, but the issue was probably one of the most ridiculous ones I have seen in the whole codebase. Right there in the source of the sound system, the code was seriously resetting the variable that held the number of samples, just before calling the next function that needed that very information. Really. So I added a little bit of code and a few snarky comments, and recompiled the tool.

After moving the newly recompiled tool to its proper location and running the pipeline process again, and copying the resulting asset pack to my test client... I held my breath and started up my client again. I wasn't able to hold my breath terribly long but I made it at least until the loading background music started playing... but anyway, when I got in game and I heard the weird animal barks and such I knew that I had pretty much conquered the sound system. Once again I was a happy Zombri.

The end of the beginning is on the horizon...

With the sound system fixed up, I am ever closer to being able to concentrate all of my time and talent (assuming I have any, I think I do!)  on world building and game design. Of course I can't just use all of these audio assets I have decompiled and recompiled, I will definitely be replacing it all with stuff I'm legally licensed to use. The experiment is over, my tools work and I have all of the formats and information I need to compile a completely original audio asset pack. But before I start doing all of that, and all of the other game design stuff I have put on hold, I need to finish my build pipeline and completely free my client from all precompiled assets.

I only have 6 more files to deal with. I am hoping I can finish off these last few files this next week. After that, the game will begin to really take shape!

Wish me luck, and look forward to next week's developments...

~Zombri

the Undead Dev

The sky is the limit

Posted by lynnara Sunday September 18 2011 at 7:08PM
Login or Register to rate this blog post!

We came down from the heavens...

This week was spent working on getting some of the last of the pipeline systems to function correctly. Unfortunately there is not much of interest to speak of in that regard, except perhaps the sky and weather systems. So I thought I would write a bit about some of my gameplay plans along with some of the interesting aspects of the sky.

The game begins with players colonizing and terraforming a moon of a ringed planet. This moon is barely capable of sustaining life. As far as vegetation goes what is growing there is rather limited, just grasses and weeds and wildflowers. The fauna inhabiting the moon is likewise rather primitive and limited. This moon was chosen for colonization because of the limited ecology... it was the best option for reviving the ecology of the players' original homeworld.

The sky from the moon's surface is somewhat alien looking. Ever present is the ringed planet, and orbiting the moon is an even smaller moon. The sky goes through quite a lot of changes as the day cycle progresses, showing hues of oranges and blues and purples. Cloud cover varies over time, and weather functions add a lot of variety between hazy fogs, crystal clear skies, drizzles, torrential rains and thunderstorms. In the winter it also snows.

That all sounds pretty good, and its actually kind of pretty to see it all ( I guess I should post some screenshots on my forums? ) but there are some funky weasels I need to work out to make the best of it.

The system operates on an array of transparent layers. The farthest back is opaque but everything in front has transparency. Currently, the back layer is the starfield / daytime sky layer, the next layers are the planet and moons, and then on top of all of that are the various weather layers. As it is now, it is kind of "ok", but because of the transparency rules some odd things happen. The worst of the issues is stars showing through the planet and the moons, which should obviously be opaque. I have some ideas to fix that but I am going to wait until the rest of my pipeline systems are working before trying to mess with that.

We made this moon our home...

While the game begins with basic colonization and terraforming, it is ultimately a game of survival and evolution. This is not going to operate the way most MMOs do. Surviving is not going to happen by ignoring the story and game events taking place. This is survival of the fittest. No magical potions will save you. There is no such thing as resurrection. You may get knocked out, yes. You may be bleeding to death though. And if you are unconscious... how do you expect to call your friends to help? Why that is just purely impossible no matter how you look at it. It might be a good idea to stick close with some friends, whenever you go about potentially dangerous activities. You might also simply think twice before doing something that has a high probability of ending in death.

Death is of course not the end. Well... it is for that character, but that is what other characters are for. The population needs to rise, skills and technology need to be handed down, and survival of the species must be ensured. Nature and other sentient entities are going to make life difficult.  At least one alien species is going to try rather hard to make survival of all life ( including the fauna bred by the players ) impossible. Its going to take the player population working together to survive the machinations of these aliens.

I'm sure at this point someone is wondering "what about solo players?" Technically speaking, solo play will be possible but it is going to be a very different experience. Solo players will have to make tough choices, as the difficulty of surviving without backup is rather high. There are going to be things that really need more than one player to accomplish... but if a solo player manages to do so, everyone is going to bow to the greatness of such player. This is the stuff of true legends.

Now I suppose I should also point out something else important. I am not trying to make the next WoW, or the next Rift, or the next [name of mmo] with hundreds of thousands or millions of subscribers. I am not trying to build a game of mass appeal. There are plenty of games out there that cater to the pure fantasy types. There are more games suited to lazy brainless gameplay than I can shake a stick at. I'm aiming for more of a social game with a smaller, tight-knit community of people who want to play out an epic story, use their brains to solve puzzles, and generally take on an epic challenge. A challenge with the real possibility of complete and utter failure.   

It is not enough just to survive...

Over the course of the game, player built cities will rise and fall, players and animals will evolve, and even the society as a whole will grow and become more than the sum of its parts. There will be a significant reward for those who survive to the end, and have evolved to a certain degree. What that reward is, will most likely stay secret for quite a while ( its revelation is actually part of the gameplay ).  But aside from the core survival strategies, I intend to give players a number of recreational activities to engage in and compete in. Also, I hope to stay flexible enough to implement goodies suggested by the players. 

Well that is probably enough for now. I wish i had more to say ( and in not such a chaotic way ) but alas my work lately has been mostly of the boring variety. I am going to upload a bunch of screenshots to my forum, and then I will update this post with the link. I haven't gotten many comments on my earlier posts here... but perhaps this post will get a few? We shall see...

[EDIT] Ok here is the link to the screenshots: http://www.mythaka.com/forums/viewtopic.php?f=13&t=32 

More details, and hopefully more progress to be reported, next time....

~Zombri

The Undead Dev

Animate or Die

Posted by lynnara Sunday September 11 2011 at 12:49AM
Login or Register to rate this blog post!

Sticks and stones make up my bones...

Getting the character graphics to come out of the pipeline took a lot of hair pulling, but nothing compared to getting the animations to rebuild correctly. In fact, I barely remember the issues with the character graphics.

Maybe that is because I haven't written in 10 days. Of course, I don't remember what I ate yesterday either, so much of my poor brain has been filled with all things related to animations that there is scarcely room for much else.

Lack of progress is awful depressing, but when the breakthrough finally.... breaks through, it almost feels like all of the insanity was worth it. Almost. The problem is, none of this should have been an issue in the first place.

Your code cannot break me...

All I wanted to do was put a spaceship in my game. A spaceship that flies, and maybe makes some noise and has some cool blinking lights and glowing engines. I didn't think it was too much to ask. Of course it was no big deal to drop an entity into the world editor. If I used the precompiled asset packs that came with the game engine ( compiled between 2005 and 2006... ancient stuff ), the animations and particle effects would work, and my spaceship would fly. The problems began, however, when rebuilding the assets with the pipeline.

I had noticed a while back that the animations seemed a bit jerky, and some animations didn't work at all while many core animations did. I did not think much of it at the time, but now it was obviously a symptom of the broken animation syndrome I was experiencing. So I set myself to testing everything, stepping through code, comparing compiled outputs in a hex editor... and this went on for over a week. Nearly 90 hours were spent trying to figure out why animations that should be working, were not. And then the revelation happened.

The hip bone's connected to the... wait, its not?

As I had been absorbing the source of the server, tracing through the client, and reverse engineering the data written by the tools and read by the client, a sneaky suspicion began building. Finally that suspicion quit sneaking around and finally bopped me in the head. As it turns out, there was a major disconnection between what the server and client were expecting, and what the tools were producing. In fact, it appeared as if the source regarding the animation system was in the middle of an overhaul, and never finished. The server code was aware of around 130 animation states, but the tools were set to build around 280. Not only that, but the server was capable of playing back the animations above what it had enumerated... as long as they were serialized in the proper order. The tools did not serialize in the order that the engine expected. Thus, most of the "base" animations ( the 130 that were enumerated in the server code ) worked, but anything outside that was broken unless the animations just happened to fall into the right place somehow. Even some of the base animations were written out of order.

At that point I was somewhat relieved that I had finally figured out the problem. I decided it was not worth getting upset about, or shaking my little fists at the sky and cursing fictional deities. Although I did in fact do just that, for a little while... but it was time to fix the broken machine!

It took me two days to fix and test the changes, and I am happy to report that after these last 10 days of insanity, my build pipeline successfully compiles properly working character graphics, particle effects, and animations. Considering all things ( including the lack of working files in the code repository ), its a fair bet that I am one of very few who use this engine that can say that.

The operation is far from over, doc...

I am getting ever closer to the point where I can concentrate completely on world building, but I am not quite there yet. I am weaning my client off of the precompiled assets, one system at a time. At this rate it would seem like it will be at least 2 more weeks to have my client running completely on assets built from the pipeline, but I am not going to make any bets on that.

This weekend I am taking a break from the insanity, and instead working on a little card game my sister came up with, to be included as a casino game inside Mythaka. She told me some rules she dreamed up, and I made a little simulation of 4 players playing it. Tonight and tomorrow I will be turning it into a single player vs NPCs game, and from there fix it up so that it can be played multiplayer as it will be inside my MMO. It is a nice little distraction to give my brain a little cool down until I am ready to get back into the pipeline systems.

Hopefully it does not take me eons to get around to writing again.

Looking forward to having another round of progress to report,

~Zombri

the Undead Dev

Special Offers