Friday, August 22, 2008

AI improvements: GO beware!

The evil empire of the teddy incident game ( I'm sorry, the bad guy's faction has no official name yet ) is proud to inform you that enemy IQ is steadily raising among their lines.

Now and again a couple of enemies with lemming complex will appear, and decide they rather wander around and jump off a ledge than patiently patrol their assigned area and wait to be slaughtered by a sociopath kid with an axe. Will have to teach them not to do that!

The ones that don't jump though are quite fun to kill.

Some glitches here and there of course. Mainly when finding obstacles in their way: There's absolutely no pathfinding going on. Might want to address that sometime soon...

Also, when in large numbers they can obstruct each other, but it only affects when many are trying to go to the same place

E.g. When trying to surround a player only the front line of enemies will reach him. The rest will probably get stuck behind the first line.

I'll probably need steering behaviours or something like that. We'll see what I have time to come up with.

All that aside, did I mention that the game is starting to be fun?

Here is a test screenshot of the main character being pursued by a bunch of standard bad guys.


By the way, AI is one of those things I dread the most working on: it's a never-ending stream of little tweaks... and immensely difficult to get juuust right.

And difficult as hell to debug sometimes!

Saturday, August 16, 2008

Busy Busy Busy

I've been working non stop on the masters game: It's due in less than a month, and that's very little time.

Anyway, I'm really glad that at the start of the project I spent a good amount of effort working on tools.

For example, the animation system is proving invaluable time and time again.

Just for fun, two screens of the editor with the animation trees we are using.

This enemy's animation tree is a very simple one, it just has a parameter to change the current animation.
But that's the beauty of it, you can complicate it as much as you want, that it won't affect much your final application code.



The player animation tree is a little bit more complex, but not all that much.

All the animations of the player are controlled by 5 parameters.
There is a main parameter to control the current animation, while the other parameters are for miscellaneous stuff to breathe life into the character ( e.g. Two parameters control the head orientation ).



By the way... somewhere between concept art and animation the main character lost its brows... eerie!

Saturday, August 9, 2008

A Necessary Post

I keep visiting this post to remember the XSI script I wrote to discard the W coordinate in explicit UVW texture projections, so here it is.

Now I hope won't have to search for it again in the Ogre forums.

The projection object must be selected for it to work.

set projection = Selection( 0 )
set objects = projection.parent

TranslateUVW objects, projection, 0, 0, 0, siAbsolute, siW, true
FreezeObj


I almost forgot: A picture to appease my non technical friends...

Wednesday, August 6, 2008

PhotoBot

This is an image I created some time ago for an online photo manipulation contest.

The idea with this type of contests is that you are supplied with some images that you use in any creative way you can come up with to make a new piece of artwork. Lots of fun.



On this page you can see the source images used.

Monday, August 4, 2008

Drawing Lines

Been working on my tools lately. I've added path creation and editing ( add, move and remove points ) capabilities to The Teddy Incident level editor.

It comes from the recent addition of movable platforms to the game. About time some might say, it's a platform game after all...

Using the same path infrastructure, enemies can have an associated path that their AI scripts can use as they see fit.

Being able to visually manipulate path points around is a great time saver.

Here's an image of how it looks in the editor ( Click for a larger image ).

Monday, July 14, 2008

Look At Me

My first post was about the blend tree animation system and editor I'm working on.

Since then, I haven't talked much about that, as I really haven't had the time to seriously work on it.

It's sad, but at the moment it's just a side project.

Nevertheless, its state is advanced enough that we're using it in our game. It's an improvement on using raw Ogre animation states directly, and has many useful features and potential, but that's my very subjective opinion.

Even if it is yet nowhere near what I envision, it's already easy to fake some IK controllers.

Here is an image of our player character looking at some random point in space.


This is done by mixing one-frame animations of the player looking up, down, left and right with the current animations.

The bulk of the work of setting how the animations blend can be done in the editor by an artist, by setting nodes that tell how the animations blend, and he can preview the end result there. This is in my opinion the true strength of the system.

If anyone is interested in checking it out, here it is, open source and all that.

Sorry that the blend-tree editor is not up there, but I'm hoping on being able to work on it once the master is over ( mid September ). In the meantime, I'll gladly share the binaries with anyone who asks.

MaxScript to the Rescue

Here is the Softimage XSI UV editor:


And here is the 3D Studio Max 9 UV editor:


It's just a matter of taste which one you prefer. The artists in my current project use XSI for UVW unwrapping, but I just like the neater user interface in MAX better.

One thing I like very much from the XSI Texture editor and that I haven't been able to find in Max are these fellows here:


They can be used to collapse UV coordinates in the X and Y axis respectively, and not being able to find this feature in Max was haunting me.

So I set out on a journey to my first MaxScript. Here it is, and as dumb as it may seem, I've already found it very useful.



MacroScript CollapseX category:"CustomUVW" buttonText:"Collapse X"
(
sel_vert = $.Unwrap_UVW.getSelectedVertices()
sel_vert_array = sel_vert as array
if ( 0 < sel_vert_array.count ) then
(
v1 = sel_vert_array[1]
sel_pos = $.Unwrap_UVW.getVertexPosition 0 v1
$.Unwrap_UVW.moveX sel_pos.x
)
)

MacroScript CollapseY category:"CustomUVW" buttonText:"Collapse Y"
(
sel_vert = $.Unwrap_UVW.getSelectedVertices()
sel_vert_array = sel_vert as array
if ( 0 < sel_vert_array.count ) then
(
v1 = sel_vert_array[1]
sel_pos = $.Unwrap_UVW.getVertexPosition 0 v1
$.Unwrap_UVW.moveY sel_pos.y
)
)

MacroScript CollapseZ category:"CustomUVW" buttonText:"Collapse Z"
(
$.Unwrap_UVW.moveZ 0
)



I don't even bother with finding the selection centre, as all I really care about is that they share the same value for the coordinate.

The next step: Add it somewhere in the user interface and rejoice.