Trending Games | World of Warcraft | Black Desert Online | Tree of Savior | Trove

    Facebook Twitter YouTube YouTube.Gaming
Login:  Password:   Remember?  
Show Quick Gamelist Jump to Random Game
Members:3,302,679 Users Online:0

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

Experiments in Teleportation, Part 2

Posted by lynnara Wednesday August 31 2011 at 3:54PM
Login or Register to rate this blog post!

When my trigger finger gets twitchy...

After trying all kinds of things to get a substitute for landscape triggers, I thought to myself "this sucks, there has got to be a better, easier way." Since my only other option was to rewrite the environmental trigger code in the game engine, I really wanted to avoid it. Alas, some things cannot be avoided forever. Luckily I daydreamed up a stupidly simple hack that would work just fine for my purposes.

I wish I had thought of this eons ago. I dug around in the server code for the section that detects when a player enters or leaves any zones drawn in the world editor. Finding the proper spot to add my fix took just a short time. I then coded a little trigger parser, implementing teleport triggers and leaving it open for any other trigger types I might come up with later.

The trick ( or hack, depending on personal opinion ), was to encode the trigger's specs into the trigger name itself. With this, I did not need to add code to the world editor or client or any of the other engine files. All I had to do to make a working landscape trigger is draw a zone poly on the world editor, and name it properly so the parser can use it.

Finally, after eons of messing around, I had working automatic teleporters allowing travel between my landscapes. It took just under 4 hours to get this new system coded and debugged. I really, really wish I had thought of this before.

Experiments in AI, continued...

After dropping the vain attempt at using NPCs for teleporters, I set about trying various experiments that would (hopefully) lead to some working systems that meet some of my gameplay goals. The first of these involved creating a giant mech NPC that could be controlled by a player. Now, my intention was to not physically mount the player character into or on the mech, the concept was to switch the player's controls and vision from the player's character to the NPC. The game engine's AI script system appeared to have such an ability, but unfortunately it turned out that it was broken. After stepping through tons of code, I found where the system was breaking, but figuring out how to get past it took days. After recoding and recompiling, the control transfer code worked.... sort of. Instead of taking control of the NPC, the NPC began following my character around like a puppy. Releasing control would result in the NPC becoming stationary where I released it. Obviously, something is still missing. I decided to try something else and come back to this later.

Although the results were not what I wanted, along the way I learned some really cool stuff about the game server's inter-service messaging system. This opened up the door to creating my own native AI script functions, which of course I had to try. Suddenly the limits imposed by the list of native AI commands were totally blown away. That made me a very happy Zombri.

The next experiment was to build a morphing NPC. Fortunately this worked pretty much right away. I set up an NPC with an AI running a loop that made it progressively grow through 4 states and then start again from the beginning. Now it wasn't actually growing... I was not deforming the skeleton or resizing the NPC at all, instead I was switching out the model, equipment, and stats (actually, all data associated with the NPC except for the AI instance it was attached to). The reason for this is I am simulating a building's construction phases. The end result will also involve animation and particle effects, but for now I just wanted to make sure I could switch out the model and data properly.

Where are the sparkles and blinking lights?

Next, I got a spaceship model and placed it in game. There it sat, hovering over the landscape. It is a stock model, and came with animation files and particle effects. In order to get the animations and effects to work, I had to attach a skeleton (also provided) to the ship. Unfortunately once I attached the skeleton and loaded up the game, the ship was no longer hovering but was instead crashed into the ground. Sources related to this model noted that the animations needed to be attached in order for the ship to fly properly. I tried for eons to get the animations and particle effects to work properly, and then began to wonder if something else was wrong.

Going back to the basics...

After a frustrating period of failures, I realized the asset pipeline build process was not quite doing its job completely. Related to this was the lack of trees on my landscapes. Personally, trees are kind of low priority for me... but because other issues were popping up, I felt that it was time to try to figure out what was going wrong.  

Strangely, the trees were an easy fix. Digging through the logs, I found that the build process was looking for the file that defines where trees are located, but not where the files are that the world editor uses. Simply copying the files from their original location to the location the pipeline wanted them was easy enough... but I have to remember to update them whenever I change them in the world editor. I already know from past experience I'm going to change a bunch of stuff and rebuild like 4 times and wonder every time why nothing is getting updated... and then I'll be like "omg duh!"

While figuring out that issue, I realized some of the other pipeline processes were not operating at all, such as the process that converts all of the character visuals ( faces, eyes, hair, clothes ) and creates color variations of all of these. I had previously only been using models and textures I had manually converted. The last few days have been spent just trying to get this one section of the pipeline to work correctly. Meanwhile, during the lengthy builds ( I have to let the thing run to completion to get the log file ), I am continuing to look into how the system processes the animations and particle effects.

More amazing feats of development (or probably just crazy hacks) to be announced, next time...


the Undead Dev

Experiments in Teleportation

Posted by lynnara Tuesday August 23 2011 at 5:10PM
Login or Register to rate this blog post!

Supersized and downsized...

Well after waiting and waiting for the second (and bigger) landscape to finish, I ended up hitting another architectural limitation. During the process of figuring out the cause of the failure, I learned a few key ( and undocumented ) design elements of the world editor system. This sent me back to the drawing board, literally. From the ashes of the failed landscape, I came back with an adjusted plan and world design.

I would have liked to have one continuous landscape for an entire planet, but that is just not possible. With the new design, the map of the planet I'm creating is broken up into six chunks, two rows of three columns. In order to facilitate a contiguous design, I created a batch of scripts that would take my large landscape and break it into overlapping chunks, with cloned edges for continuity. The work I put into creating the failed landscape was recovered gracefully.

Each of the six sections of land take about a day to run through the pipeline. Because I was rather impatient to start working on other things, I only ran the pipeline on the northwest and northeast sections for now. Why did I choose two totally disconnected sections first? My plan is to make the planet circular.

Connecting the disconnected...

After the landscapes finished building, and the game code was updated to spawn new players in the new area, the next thing that needed to be done was to connect the two lands so that characters could travel between them. In this case, I was connecting the west edge of the northwest section to the east edge of the northeast section.

Getting teleporters to work would seem like a relatively simple thing to do. Yeah right. There are a handful of teleportation techniques built into the engine: using teleport inventory items, clicking on an object to trigger a teleport, NPC AI teleport commands, and landscape teleport triggers. The obvious solution would be to use a landscape trigger. Unfortunately, landscape triggers need to be built into the 3d model of the area and baked into the landscape itself. That is just plain dumb. To get a barely acceptable teleport system to work, I settled for clicking object triggers.

Once those were working, and I was able to move between the landscape sections, I decided to try to figure out a better solution for landscape triggers.

I'm in the zone...

The world editor allows me to create polygon zones that can be named and used for various purposes. When moving a character into or out of continent, region or place zones, a message pops up onscreen letting the player know. My first thought was, ok why on earth did the engine developers *not* use this to create landscape teleport triggers? As I dug around in the source code, I started realizing that it is going to take a fair bit of work, not only in the engine but also in the world editor and build pipeline. I am probably going to have to dig in and do it, but I decided to try something simpler first.

I started experimenting with NPC based AI teleporting scripts. I know its a total hack, but I decided that since NPCs keep lists of players in aggro range, why not try to use that? So I set about creating some aggressive NPCs that are forced to stand their ground, and run an AI loop that teleports any player that comes close enough. Pretty simple concept, or so I thought.

With great power comes... complications...

The AI system in the game engine allows for some fairly complex behaviors. NPCs have hunger and need rest, and can have zones assigned for feeding, hunting, resting, and even migratory patterns can be set. Behaviors can change depending on the time of day, the weather, and the seasons. Aggro radius parameters change depending on states of hunger, and the type of overall AI ( herbivore, omnivore, predator ). On top of all that, there are modulations that allow for a number of variables such as levels of fear, courage, damage taken, and the prospective target's overall strength. Also, the AI determines whether to aggro or not based on player (or other AI bot) race and fame.

In short, it is nearly impossible to just make a simple NPC aggro any player. Because of the complexity of the behavioral system, the simplest thing that any crappy engine can do... create an NPC that attacks any player it sees... is needlessly complex. Normally I would not consider creating such a "dumb" NPC. The work involved in trying to make "smart" NPCs into "dumb" ones is frustrating to say the least. But I am weighing the difference in time between reworking the engine's landscape triggers and getting these NPCs to act as landscape triggers.

I am going to keep working with the NPCs for now. In the process, I am learning all kinds of crazy ways to make NPCs act, so it is not a totally wasted effort.

That is all for now, lets hope I have more interesting developments next time...


the Undead Dev

The land lay bare before me

Posted by lynnara Sunday August 14 2011 at 4:10PM
Login or Register to rate this blog post!

A fresh new land, its simple beauty...

After all of the insanity I endured these last few weeks, and yet more debugging, I was finally able to successfully spawn a character on my new landscape. The sense of relief almost brought me to tears. I floated on my little fluffy cloud while my character ran across the land for the first time.

The land itself is nothing special... its just land. No buildings, no trees, no animals... nothing but soil and grass, hills and valleys, and a few interesting landmarks.  The sky and weather systems, together with the microvegetation bowing to the wind, lent this otherwise barren land a certain serene beauty. It is an undeveloped, unspoiled frontier.

My sense of relief at finally getting this to work was short lived. Feelings of accomplishment are very much like a drug, especially in that it simply does not last very long. I was of course left yearning for more.

This landscape is a quite a bit smaller than I had originally planned. Because exploration, treasure hunting, and player constructed buildings are key concepts in my game, I need vast landscapes to support it. To get a proper sense of the scale of this land, I started at the west edge of the land and set my character auto-runnng to the east edge. I put on some music ( I listen to jpop mostly ), sat back and enjoyed watching the land pass by as a bright sunny day became ever more cloudy, then dark. Rain fell, lightning lit the clouds. Unfazed by being nearly naked and exposed to the elements, my character continued to run at a pace that would make a marathon runner cry. 26 minutes after starting this journey, my character found herself at the east edge of the land. The rain clouds dissipated, and the sun was shining bright once again.

Size does matter...

This landscape was built twice as long as it is tall ( looking at it in 2D ). To me, it seemed a bit small, especially for my specific plans. I decided that I would probably use this area for a tutorial or beginner area, and a playground for gameplay testing. ( The original test landscape has been disabled for new characters, but will remain a place for my own experiments. )

Taking what I learned from building this land, I began construction on the next one. Considering my plans again, I built the next land just over twice the size of the one I recently built. I might have built it larger, but since I don't know the exact upper limits that the build pipeline can handle, I was reluctant to take any big chances. If I calculated it correctly, it should take an hour to cross it from east to west, and a half hour to north to south. This should give plenty of room for the first phase of the game.

Take it slow...

While building this new land, a certain thought kept creeping into my mind. Player character running. After all the time I spent playing games, the thought of a character being able to just run and run, run everywhere, never getting tired... seems ever more stupid. To me its almost as bad ( but not quite ) as people bunny hopping everywhere. Now I understand there is a certain amount of impatience and "need for speed" in mainstream MMOs, but to be perfectly frank all those grindy games where people run and jump their way everywhere really bother me. Its very difficult to become immersed in a game with such absurdities.

There are some good examples of games that were quite immersive, yet dispensed with much of the unreal player movement characteristics. Even though its not an MMO, Grand Theft Auto San Andreas gave me a good example and a lot of inspiration. I really like that the player can walk, jog, or for certain amounts of time, sprint... but the player gets tired. I would like to do something very similar... except even jogging reduces stamina. Eating and resting should be important, after all.

So how will I appease the less patient, zoom zoom type players? That is what vehicles are for! I hope to be able to implement multi-occupant transportation... but that will be a lot of work. I am going to have to limit the use of vehicles in some way, since the game engine is operating with full collisions. There will not be any players walking through each other, or through mobs or NPCs, and vehicles will be no different. This could potentially cause a mess if there are too many vehicles in any specific area. I have considered having a set number public "rental" vehicles, and making personal vehicles a premium item. It is still quite up in the air.

Under construction...

Currently the latest landscape is being processed by the build pipeline. I started the process yesterday at 11:30am, and it appears to be around 70% done. Large landscapes sure are a pain to process. I'm going to have to plan carefully when I test and tweak, since any adjustments to the physical landscape are going to require another run through this process. Waiting 2 days to see the results of some changes is a bit painful.

Well that is all I have to report for now.

Looking forward to next time...


the Undead Dev

Untangling the twisted pipes

Posted by lynnara Tuesday August 9 2011 at 9:47PM
Login or Register to rate this blog post!

Searching for order amid the chaos....

In many respects, last week seemed like a disaster. Perhaps Murphy's Law had recently been amended to include special consideration for indie game development. Or maybe I am just being a bit dramatic.

Last week started as a continuation from the week before. By that I mean the asset pipeline build was still running. The pipeline took nearly 7 very long days to complete. I had expected a relatively long build process since I had created quite a large landscape... but 7 days of continuous processing? I had plans for 7 more similarly sized landscapes, and any 3rd grader can figure out the math on that. But of course that was only the beginning.

The build log was beyond insane. Over 1.7 million lines in the log file. The log file told a tragic tale, one of many sorrows... but failed to properly connect cause and effect. Upon reviewing the error riddled log, I found some gaping holes: some of the processes crashed and failed to write to the log. After a week's time, I had more errors than there are leaves on the tree in my front yard, and nothing to determine the reasons for the bulk of them.

In order to figure out what was going on, I decided I needed to untangle the build pipeline. The only way I was going to find the causes of the errors was to tear down the pipeline into individual projects and run each one separately and watch the console output. This resulted in 26 individual projects with 7 phases each. I ran the first 3 phases for each project, one at a time. I studied the logs and console outputs, and fixed whatever issues I could find, and repeated each process until I was satisfied.

The first 24 projects went relatively fast, taking only a few days to get through. The 25th project, however, was dealing with exporting and converting my new landscape. This process had me extremely frustrated, pulling my hair out, and occasionally screaming like a crazy woman at my computer. Maybe not "like" a crazy woman... more like 'definitely insane, institutionalize me now'. Perhaps even saying "occasionally" is sugar coating things...

First there were a few missing files and some incorrect settings in some config files that caused early processes to crash, thereby causing a chain reaction throughout the rest of the scripts. Then there was a required folder that failed to be created during the process initialization, which resulted in a mass of file write errors ( which of course led to another mass of failures in reading those non-existent files. ) Getting my hopes up, I watched as one of the main output processes - which had never run successfully before - started up. I watched the little line of dots grow longer... and longer... and then boom. I looked at my task manager. The process had eaten 8GB of ram, and then died.

Apparently I hit an architectural ceiling. I started to think about the amount of time spent on this thus far, including the time spent building the landscape. I felt that I was floating above a fork in the road, one leading to pure madness and the other leading to despair. Friday night, I drifted off toward despair.

Saturday was spent with family, and ended with yummy mexican food. Sunday I spent being as lazy as possible, wearing as little as possible, with the AC as cold as possible and I slept as much as I could. Ah the glorious sleep, complete with a buffet of dreams!  

Monday I woke up refreshed. I built a new smaller landscape, one that by my rough calculations should get through the super RAM hungry process. Unfortunately that did not work out. The build process never fully compiled all of the parts of the original landscape ( for some unknown reasons, probably size related also ) and had therefore crashed way later than it should have. This time more pieces of the smaller landscape got compiled correctly, and the output process hit the ceiling and crashed quite a bit earlier.

I wonder what exactly the game engine's developers consider "large" when they say the engine "Supports large open terrains." Actually, I have yet to find a definitive answer to that. I was working with the limits imposed by the world editor, but apparently those limits are beyond the actual capabilities of the pipeline.

Next, I rebuilt the landscape yet again, this time around 1/4 the size of the original. Surely, this system can handle this, right? I very much dislike the idea of iterating in a trial and error fashion to find the largest size the system can cope with, but I do not seem to have much of a choice. This time though, the insane RAM crunch came and went without a glitch. Finally!

Oh but wait, theres a few more processes that never ran successfully before...? Will there be more hair pulling? More screaming? Will I end up mentally beaten, crawling into bed whimpering? Or will I emerge victorious, floating on a fluffy cloud of accomplishment?

I guess we'll all find out, next time...


the Undead Dev



Special Offers