Ramblings

You are currently browsing articles tagged Ramblings.

Security questions, my number one most hated thing online.  I can see the logic behind these questions, the web site verifies personal information with your answers in case you misplace your password, username, etc.  So what is my problem with these very nosy fields?  Well first off who would want to tell random-shopping-place.net her maiden name, or his favorite pets name?  I’ll admit most of the information is not worth much to most people, but I recently logged onto a site where they wanted five different security questions.  Questions to choose from ranged from favorite band to favorite elementary school teacher.  One question guys, that is my limit.

Ignoring the personal information and the question addicts, what else do I have against these questions?  Well first rewind a bit and think about why they use these questions.  Typically these questions are used to restore account access after you have been compromised or forget your information.  Occasionally some people want answers just to change your log in info.  Why do web sites feel the need to verify that the one with valid credentials can also answer a bunch of personal questions?  Its just another useless security layer that might prevent <1% of unauthorized accesses for the retards using ‘password’ as their password.  Security questions are nothing more than a retard test, and having to pass a retard test each time a user wants to log in is insulting to everyone; or at least it should be.

Read the rest of this entry »

Tags: , ,

DollarsSalary is a big deal for a lot of people. In fact its such a big deal for some people that they will sacrifice themselves or their coworkers to squeeze just a little more $/hour. In general I think its safe to say that most people work for money. Right? Generally, people work to make money, and by that what I really mean is that people work to make enough money so that hopefully someday they will not have to work anymore; at that point they hope to enjoy living off the interest accrued from whatever retirement package they choose to use when they started working.

Well, what is money? What are those greenishCreative Commons License photo credit: hickoryhollow113 pieces of paper or numbers on a bank statement? They are just a means to achieve an end; in other words, retirement. Sure you go on vacations, buy big houses, marry someone, but if you take a step back and look at the purpose of these little bills to any civilized human being on the planet you will see that it all leads up to the point where all of a sudden there is no reason to continue working anymore because you have enough invested that even 4% return will pay your salary each year.

Ultimately these pieces of paper are your retirement, nothing more. They certainly do not represent any real wealth, as millions found out last November. Do not get me wrong I am not going to discuss what some call “The Federal Bank Conspiracy.” Which includes theories explaining the devaluation of the dollar, global government, criminals in fancy suits (although you would do yourself a favor by learning a little bit about the origin and meaning of those green bits of paper). I am just going to explain some of my own reasons for not defining my life by my eventual retirement.

Read the rest of this entry »

Tags: , ,

Pax 2009

pax10So a few things happened and it appears that I will be attending Pax West 2009.  Being someone who did not know the convention existed until about a week ago I like to consider my position at PAX as ‘complete noob.’

Anyway why I am I posting this?  Well I have nothing to say about Pax in particular, like I said I have never been there and my general understanding is its like an E3 only good and open to the public.  I was roped into taking this trip by a friend and we plan to spend a week along the west coast.  That being said Pax started out as only a minor side attraction for us, as we had already planned on traveling out there.  It was not until I started reading about community events and enthusiasm that a lot of people seem to have that I started to seriously look forward to attending the conference.

Read the rest of this entry »

Tags: , , ,

The true cornerstone of a project such as this will be dynamic and human like actions. I have spent the last two weeks thinking of a system that would allow the development and evolution of dynamic actions, searching the internet, writing down ideas, and finally come up with a design I feel confident enough to post about. I am writing this down for my benefit as well as anyone who is curious, so the train of thought it going to be random and probably hard to understand. For that I apologize, I will have more solid implementation details ready when I have a working system written.

I started by defining what I would be given, and what I would need to produce, and I decided to start with nothing but basic preprogrammed controllers attached to the actor’s to control everything about it. Rotation, position, scale, etc. For an npc, he would have controllers on all his bone joints, for an example. These controllers will have a predefined range of accepted values and know how to move around those ranges. What I wanted to end up with was a high level action, something that will ultimately be composed of hundreds of controller movements over time. And I needed a nice system to wrap up all this data into a structure the npc can store and build off of.

To start off, picture a flat plain of controllers. Each controller knows what it can do, but there are no existing actions yet so this npc is stupid as a brick. During training, actions will start simple, something along the lines of, ‘bend index finger’ works. The npc would look at its action graph and see only the flat plain of controllers, so then its asks each controller if it can accomplish the task of moving the finger’s x position by 1. The controller(s) that respond will have already been defined as able to do this so the npc builds a new action that connects directly with the controllers found previously. Now if the game asks to bend a finger, this action will say ‘I can do that’ and use the correct controller to chance the finger’s position. Its worth noting how the action knows it can do this, so I will explain that a bit. Each action has a function that reads the actor’s current state and determines if it has actions or controllers in its collection to handle that state in any way. If it does, it says yes.

So as the npc adds more and more actions it builds it’s web of linked actions, the process looks a lot like building a neural network. Actions have many actions linked to it, and many actions linked to. I cannot go to much farther without showing you the action class definition so here you go:

class Action
{
Action();
Action( Action* next );

bool validStart( Actor* );
bool validEnd( Actor* );

void AddNext( Action* );
void RemoveNext( Action* );

private:

std::set<Action*> actionList;  // Each entry in this action array represents a start state.
// What about actions that have many independant start actions?
};

When designing this class I thought it was going to be some monster from hell, but after I thought about it, added some recursion, and trimmed it down I think it ended up rather nice. Its simple and works well. Each action will hold links to one or more actions. Each action link represents a valid start state, so when validStart is called the class should call each of it’s start states validState functions and return the OR of their return. This design is very recursive, a next link could be another action or a controller at the very basic level. Therefore chains of actions will form in neural network fashion with proper training. When the npc wants to change his state (execute an action) he simple needs to figure out what state he wants to be in, call validEnd( endState ) on each of his higher level actions that match his start state and if one matches, execute the action.

Only problem here is the tremendous overhead of using the brain. Take an example actor with just three levels of actions, when the game asks to do an action on the third level that action asks for valid start on all level 2 actions linked to it, and in turn those level 2 actions call valid state for all level 1 actions linked to it, which in turn call validstart for all controllers that are linked with it. We could be looking at thosands of function calls with a simple 4 or 5 level npc. And the growth is
exponential.
For now we will just have to deal with it since I believe this to be the best way to describe dynamic actions however in the future tremendous effort will be required to optimize this code.

I will be working on integrating this design into my demo project so if my explanation is way off I will have sample code sometime soon.

Tags: , , , ,

So heres the deal, every game needs some sort of script compiler. Regardless of how its designed, there will always be a time when the ability to edit the game without recompiling is key. But thats not the only reason, scripts allow us extra layers of abstraction so we can do complex things such as ‘pickup( itemid )’ with ease. But I am getting distracted.

I have been working on this component AI idea and have come to the point where I need to start defining actor actions through scripts. How I have it setup now is the npcActor’s state will slowly degrade over time (think the sims) and when it reaches a threshold they go and search for an object that can alleviate their problems. Its a pretty simple design for a simple test. As mentioned in previous posts, I want these npc’s to learn from interacting with the environment. This combined with the mbti structure and other things should produce reasonably agile AI (see previous posts for specifics).

I thought of making this post to stress a key factor in my decision making process as it pertains to this project. And that is abstraction. The abstract is key to this project. In an ideal world, nothing here should be hard coded, unfortunately that is a little hard to do, especially right from the get go. So what I decided to do was to brute force my way to a reasonable demo app and work backwards from there. Removing static code as needed to perfect the design. For instance, I have pretty much decided on a syntax for my scripting language, but I have left much of the interpretation to genetic algorithms in the compiler. Here is a sample script


using actions
using health

_actions::sit $this
$sitting = true
callback -actions::stand _stoodup
{ $health::comfort +1 / 5 } while $sitting

_stoodup:
$sitting = false
::
I am not going to explain the syntax because to any programmer the intentions should be clear. The problem I have been facing is how to keep the intentions abstract enough to allow multiple interpretations. I want Bob’s sitting to look different from Kim’s. I have currently setup a system where the compiler creates these jobs for each script and at the appropriate times sends messages to actors to handle actions. It is then completely up to the actor as to how to handle the action. For instance, when the compiler runs over ‘_actions::sit $this’ it will send a message to the host actor to sit on the target object. In this case the message will not be as simple as

msg.id = ACTION_SIT;
msg.target = 0x01234567h;
msg.brainless = 1;

Instead the message will contain a number of input to be inserted into a designate neural network, which would have been trained earlier to sit when given those inputs (exactly how they sit is up to the GA).

So then how to handle direct variable access like the ‘$health::comfort +1/5′ line above. Well some messages will have to be specially constructed to be brainless. I figure I will have a range of message id’s designated for variable access, neural network input, etc. So a msgID of 1 would be to set a variable, and 2 would send the incoming data into the NN.

This is not the final system, just what I am currently using for testing. However this is the current framework for future applications. The goal of this first program is to weed out any bugs and get a clear understanding of how I want this thing to run.

You can notice how this solution offers a direct line to the actor’s state of mind without hard coding everything, which is exactly what we want.

Tags: , , ,

Short Post

I am going to sum up the past month or so of inactivity here. I have been working on a concept design of my component ai idea. Once I finish it to my liking I will post it here. I have not had much time to work on it with my job and home projects so it will be a little while longer. Just wanted to say that I will still be posting stuff here.

Also, I am going to write more about the cof plugin soon, most likely I will pick it back up after I finish the tech demo. I was writing it as a reference for when team fortress 2 comes out, I can already tell through the various promo videos I have seen that the cone of fire is going to be as broken as dods. I should have the whole series done before Valve finishes hacking together 2 years of what they call work.

Tags: ,

In a continuation of my last article, I would like to record the process I have been taking to creating and designing the component AI I described in my last post. Component AI is my term for this idea right now, I really have no idea if it has been done before so for right now its what I call it. Now, for those of you who might be familiar with component based object systems (Game Programming Gems 5), this concept will not be to hard to understand.

Basically, we want the npcs to operate off of components they learn about through their training. I know I did not mention training in my last post, but it is necessary for the npcs to not look like mindless zombies through half the game. Each npc will have to be fed through a virtual school where they will learn, through various tests and challenges, how to operate in their world. But I am getting distracted here, back to the design.

Component based objects can be summed up as imaginary containers that are filled with components that operate the object. For example, one component might be a renderer, another holds a model, and one more holds animations. These three together form a solid object that will be displayed in game. They are attached to each other solely through the object manager, but nonetheless are able to effectively communicate with each other through interfaces and a messaging system. I wish I had GPG5 around me so I could yank their example, but I think you get the general idea.

Anyway, objects communicate with themselves through messages, and each of the components that make up an object can subscribe themselves to different messages. A render component would subscribe itself to a ‘draw’ message, that way when the game sends a ‘draw’ broadcast, all objects that have the render component will draw themselves.

That is how component object systems work, when we introduce the ability to pick up new components during run time through actions, we have component AI. The npcs will be equiped with the simple components, model, render, animate, physics, ai, etc, and they will be able to pick up new components from the world to plug into their brain for future use. These types of components can subscribe themselves to messages, and even communicate with each other to achieve the best results. Some form of genetic training will have to be used to teach these components how to effectively communicate. When the npc comes across something new that it doe not know how to handle, picking up a chair for example, it will need to know things about weight, body position, what limbs to use, how to grip it, pretty much everything, and the only way he will know is if the components in his head know how to communicate effectively.

Yes I did mention body position and dynamic animation. I already mentioned the fact that objects themselves will hold data on how to handle them, generally. Then after the npc does that action he will gain a new component for handling that object. This system does not conform very well to static animations like most games keep. So animation will be dynamic and learned by the npc over time. This allows npcs to gain their own style of movement and actions.

Yes yes, I know I am going a bit over board again, running 8 or so npcs each tugging about 10,000 or so AI components will probably be a big load. That is why I need to write a demo application one of these days to see how much this will cost. For right now I am planning to go all out, screw the cpu, but most likely for slower computers we can introduce a system to merge and combine components to save processing time. However the more components you combine the more hard coded the npc becomes.

Tags: , , ,

I had a thought today while walking outside about human-like ai. This is of course, in relation to the game idea I posted a few days ago, but the gist of my goal is to have npc’s that can successfully animate and control characters designed from popular animes.

The idea is pretty simple, the npc’s will derive their actions off objects, not off of themselves. In other words, they will look at the object to determine how to handle it, not depend on preprogrammed responses to objects that are a chair. The objects will store data that the npc can use to lets say, pick it up, throw it, eat it, ect. And the npc will use their MBTI to determine what should be done in the given circumstance.

Part two of the idea is that these objects will also hold ‘experience’ data that the ai will pick up and remember for certain lengths of time. This data can be pugged into their design making structure and called on during other circumstances to determine what to do or how to interact.

Heres a live example,

The npc walks up to a wooden chair
He sees that the chair can be picked up, sat on, broken, and burnt

Along with these verbs are tags that help the npc with the decision.
Example, ‘sit down’ is tagged for resting
‘burn’ is tagged for warmth

He thinks about it and determines that he needs a rest so he sits down
His fatigue goes down and the chair teaches him that sitting down makes him rested
After that he thinks again and determines that he is really cold, so he finds an object that will light the chair (oil and matches) and does so

This demonstrates another part of the idea, in which objects must interact with each other using the npc as a medium. The matches will be tagged as ‘makes fire’ the oil would be ‘spreads fire’ and the chair’s ‘burn’ tag will say that it needs something to start and spread the fire, in order to be used. Sort of like, requirements for an action. To discover the tools, the npc must be able to scan local tags.

The chair is lit and the chair teaches the npc that burning things will make him warmer
However this chair exists in a hay barn, and now that there is a giant fire in the room, all the hay ignites

This is can be accomplished by state broadcasting. In which objects changing state ( eg. Stable to ablaze ) will broadcast the change to all other objects and and objects listening to such a change will decide what to do. ( eg. burst into flames )

So now our npc is to hot and the hay teaches him that hay + fire is not good.
He leaves the barn because the environment outside is not on fire

This action causes a conflict in his code.
On one hand he learned that fire is warm and thus good when cold
On the other hand he learned that hay on fire is bad and makes him to hot
This is not exactly what should be learned here, but I never said this design was perfect

And so our npc lives to see another day, only slightly smarter then he was before. But he gained some valuable survival skills.

This design still needs some tweaking, but at least now we have a working model that I can start writing and testing.
One other thing I should mention though, as these npc’s collect environment data from these objects, certain ideas and concepts are going to collide and others will become useless. We should also account for the human’s ability to forget ideas as well. Some form of garbage collecting will have to be done to clear out bad data. Just keep that in mind.

Tags: , , ,

A little while ago I sat down with Ogre and started work on a game idea I had. The game started off as a simple harvest moon clone with a more dynamic, evolving AI. I had plans to include a growing city, very dynamic and alive npcs, and of course lots of farming fun. I worked on the game about 2 months, starting over at least two times during that time period while I got used to using Ogre. I finally hit a road block last month, after creating a basic framework to wrap Ogre I set out to write an object system. Which is where I am still sitting at.

During this lull of programming I stumbled across a new idea while thinking of character designs. I watch several different animes, some of my favorites are Bleach, Azumanga Daioh, Shakugan no Shana, and The Melancholy of Haruhi Suzumiya. It was while watching the last anime on that list that I had an idea, I really like Haruhi because she is such a character. Like Midna in Zelda, Haruhi just emanates personality. So the idea I had was to model the characters in the game after these anime characters, equipped with the same personality and actions.

Obviously this idea once again only added to my work load, making npc’s that can act on their own, maybe even talk on their own, according to nothing but personality data is no small feat. It has probably never been fully realized yet in any game. However after some research I found an interesting article about MBTI and I thought that a good way to accomplish this would be to program npc’s with functions that govern how they think about the world. Most games program reactions to simulate personalities. What I want to do is program npc’s to form personalities based on how they perceive the world.

For instance, if an npc is introverted, most of the time he will look to the introverted module for his next move. Npc’s will have a load out of percentages they are for each of the four types. The program will run both modules to figure out what to do, but weigh the options against their percentage for that type.

I will write more about this later when the idea is more developed, right now I want to also mention a video I saw talking about a special neural network.

This network operated as a pair of connected networks, one network is full of noise (random inputs), and the other network takes that noise as input and judges the good from the bad. The idea here is that in a real human brain we are subject to noise, random thoughts or just subliminal noise, which we then judge to be a good idea or not. I no longer have any link to this video, but I still remember how it was designed and implemented. I thought maybe this would be a good way to use the MBTI, have a global brain that produces ideas and have the MBTI modules think about how to handle them.

Of course I also worry about the playability of this game, and if I am expecting about a dozen or so npc’s on the screen at once, running 12 brains this way might be a bit over burdening. But of course I want to make a demo application some time in the future to see.

It is these two systems (objects and AI) that will be the main design goals in my project.

More on this later.

Tags: , , ,

I have long been wanting to create a system where I can freely express my trials and errors while working on a variety of projects. This is the result. In this blog, once I get it going, will feature many open source programs I write along with my ideas, thoughts, and general how-to’s.

I am a computer programmer, so expect most posts to involve code in some way, but some days I might feel like just writing about a story or idea I had. Sometimes when I am trying to think of a solution I type myself long paragraphs to record my thoughts. I promise to not post them all, but if at a later time I think my ramblings blog worthy there will probably be a new post.

First thing I am going to do is post up some open source projects I had been working on, one being an auto updater for steam mods, as well as a tutorial for changing shot distribution in half life source, day of defeat source, and team fortress 2.

For those who might know my work, I wrote the cof plugin for day of defeat source, the same version CAL uses in their Sentential plugin. I also was the programmer behind Prodod, a competition mod for day of defeat source which ended up going nowhere.

Most of my experience is dealing with C or C++ and assembly systems, however I do mingle in network systems and pretty much anything that ends up in my way. For instance, the source mod auto updater was written in VB .net, a language I hardly knew until my second rewrite of the program.

I want to write more but this post is getting kind of long so I will stop here, soon this web site will be filled with tutorials for doing this or that, basically, whatever ends up causing me some trouble.

One last note, if you came here looking for the golden sun project, you are in the right spot, I am currently moving all my source and work here. I decided to not have a single dedicated web site because I am the only developer and its more of a hobby project of mine. But fear not, there will be quite a lot of posts here about that.

Tags: ,

Charles Solar is Stephen Fry proof thanks to caching by WP Super Cache