Jump to content

  • Log In with Google      Sign In   
  • Create Account

comfy chair

Member Since 05 Jan 2011
Offline Last Active Today, 10:55 AM

Topics I've Started


08 October 2014 - 08:53 PM

I am about to start working on the planning layer of my simulation game. Originally I thought I was going to use a GOAP design. I believe I understand this approach fairly well. But now that MCTS is becoming more popular, I am wondering if I should look into it more... 

Here is my original thread that describes my thoughts on using GOAP to design this part of my game:



Do you think MCTS is a valid design choice? The game also has a complex crafting/production layer that I did not mention in the post.

I wonder which would require the least work? Both right now and after the game gets expanded with more and more features...

Saving AI evaluator state

25 January 2014 - 03:04 PM

I have a rather large project that I now want to add save game functionality to.

One of the most complex parts is the AI.

Its evaluators (decision makers) run for each agent in a framesliced fashion, and store pointers to entities and other data while they are evaluating. They also have utility maps that are cached and updated...

I am thinking it will be both hard to serialize data like this, and also that maintaining backwards compatibility with save games will be hard.

What strategies are there?

One idea I had was to just not serialize the evaluators' states at all. The evaluators would run from scratch after reloading. This would mean that after reloading, the behaviour of agents would be different than they were right after saving. Most likely, the agents would react a bit slower for the first few seconds because their calculations had to start over.

What do you think?


GOAP and modeling world state

15 January 2014 - 05:46 PM

I am almost ready to launch my sim game, and am already thinking ahead of ways to improve it. 

One thing I have in mind is giving my agents planning ability - the current AI is utility based and cannot form complex plans.

In a future version, I would like to see a group of very intelligent animals formulate a plan to get food by first breaking down the player's defences, then fighting off his units and then stealing his food.

I think a planner such as GOAP could be useful. But I am not clear on how to model the world state so the planner can do its work.


I have the following idea: I already have the map divided into connected regions of a certain maximum size. If I take these regions and add extra data to them, such as resources and enemy strength within the region, and any obstacles between them, will GOAP then be able to create plans like the one described above?

Optimizing top-down terrain

06 October 2013 - 12:05 PM

I am trying to optimize the terrain render part of my real time game, which uses a top-down perspective.

Currently, I create all vertices in the visible area each frame and send them to the GPU (dynamic buffer).


This is costly, so I wanted to try and use a static buffer instead, where all the vertices are allocated on the GPU on startup.

However, I got an out of memory exception on my larger maps. Apparently, there were too many vertices to fit in the video memory.
Any ideas for how to move on?

I also have an idea about rendering the terrain into bitmaps and displaying them as one or more big quads.
Is this a method that is commonly used? What is the best way to go about it?

Turning head and spine

01 October 2013 - 03:20 AM

What is the correct way to make a character turn his head and spine via code?

I use code like this to set a new transformation matrix on a bone:

bonePose.DefaultTransform = twist * Matrix.CreateTranslation(bonePose.DefaultTransform.Translation); 

I only want to affect rotation about one axis (yaw). But the problem with this code is that it only preserves the translation of the bone. It overwrites any pitch (head up/down) rotation.

To compensate, I try to re-create the original pitch rotation:

Vector3 rollAxis = new Vector3(0, 1, 0);//positive is dip right wing
Vector3 yawAxis = new Vector3(1, 0, 0);//positive is bearing left
Vector3 pitchAxis = new Vector3(0, 0, 1);//positive is dive

twist = Matrix.Identity; 
twist *= Matrix.CreateFromAxisAngle(yawAxis, boneAngle);                        
twist *= Matrix.CreateFromAxisAngle(pitchAxis, pitchForward);


But this distorts the character spine somewhat, because my approximation is not close enough to the original model pose.
Is there a better way?