Saturday, December 22, 2007

Behavior trees and a certain castaway

I've been playing with various AI problems for [many years now] and for anyone who has tried to do any form of AI, particularly with state machines and heirarchical state machines, you'll have felt that there was something missing.

I got to thinking about doing a small AI testbed for some stuff at work and that got me to thinking about maybe doing a small product in order to test out my AI code. Something casual but fun to create. Something that didnt take a huge amount of time or programming effort (or more importantly, money).

One of the games that really interests me AI wise, is the sims. I like the notion of virtual characters, ever since playing [little computer people] back on the C64.



Little Computer People
I was thinking of a game that I've played relatively recently called [virtual villagers] and thought about how I could maybe throw the two ideas together, but on a very small scale. Basically, how do I create a small scale "sim/god" game?



Virtual Villagers


Let's just backtrack a second actually. At a sort of tangent to this. I recently started thinking about what one would actually identify as a very "british" type of game? One of the things that strikes me, is that a lot of well known british games, particularly from companies like bullfrog, are god games! So I guess there is something in this sim/god thing that works for us brits.

Populous by bullfrog

Anyhow, back on track again. I was thinking, "what makes a nice scenario for testing a tiny god game?".


Well, as it happens, I already had one in the back of my mind. Created, as it happens, by none other than Jeff Tunnell! Yep, the very one that started Garagegames.com!



Back in the heyday of Dynamix, Jeff and a few people had formed a small offshoot and one of the products they created was a nifty little screensaver called "Johnny Castaway". Here's a site dedicated to that little part-game experience.


http://web.onetel.net.uk/~gnudawn/johnny/common.html





It was a screensaver but with a very unusual take, because it actually worked more like a sims style experience. As you can tell from that website link, people really got into the whole "watching life" aspect of it. Which is great from an AI programmers point of view.


So I got to doing some research. Thinking about moving away from state machines into something a bit more designer friendly. So that my designer (me) could have more fun designing the game.


Anyway, after reading various gamasutra articles about the sims AI. I decided against doing the AI the way the sims did it. There are lots of reasons why, but mainly because I think the AI they designed is a bit too complex and a bit too single purpose for me. I want to be able to use this AI tech in other projects as well. Anyway, luck should have it, that after a bit of searching for "Sims AI", I came across my old mate Alex Champandard's page about Behavior Tree's over at AIGameDev.com and thought that might be a useful thing for me to try. If you need more convincing of that, here's Damian Isla from bungie talking about the use of Behavior Tree's in Halo 2

So what next? Well, I've already got a little island scene that Magnus made a while back. I already have an AI framework from a while back. Time to plug in a Behavior Tree implementation and see how it pans out.

The great part about doing a game like this, is that you can just slowly implement more fun features without any real purpose (other than entertainment). So it can have that great tradition of british comedy gaming in it. It doesnt hurt the britishness that the protagonist is in fact a bit hapless but never the less lovable.

So thats christmas done then! :)




Saturday, November 17, 2007

Pure blue

The last time I was in "the industry", I worked with a bunch of artists. We literally sat in a little group and had a load of fun.

One of the things they used to hassle me about, was this notion of programmers not understanding colour. Thier standard joke was that when you ask a programmer what blue is, they say 00:00:FF (i.e. 0,0,255 or whatever the HTML version of that is).

Artists dont really think in pure tones like that. That is a machine way of thinking and I'm only slowly becoming aware of why it is important. The idea of shades of colours where other colours are involved (so for instance, a blue that isnt pure blue, but is blue-green). Its pretty easy to see that whole programmer colour thing on websites, but it really does play a big part in people's perception of an environment in a game. So I'm taking this a bit far, but I feel that getting the colouring right for my game will be a big part of making it work.

Hopefully once I get some of the techy issues sorted out (which will be a far more in-depth and expansive blog post compared to this) I'll be able to explore the theme more. Clearly for my game to have the "Air" theme I want, it will need to place a lot of emphasis on the blues. Maybe I'll pay for an artist to choose it. Or it'll come out of the concepting phase.

Sunday, November 04, 2007

The designer as artist

I'm a game programmer by trade. I know, that means I shouldn't comment on art matters right? Well, what about a programmer/designer? If I'm a designer does that make it ok?

Now I'm absolutely talentless at actually creating visual art, lets be very clear about that. But I definitely know what I like when I see it. What is strange, is that I'm finding myself feeling more and more like I want to create art rather than something derivative. Every time I find myself pondering the nature of games, I come back to the potential that hasnt been explored.

If you look at the current games on gametrailers for any particular day, you're likely to find hundreds of incredibly derivative games. Not just in terms of gameplay, but in terms of presentation, composition and even feel.

What if one were to try and break away from that? What if you COULD strive to create something so unique that it had never been seen? What would it look like? What would it PLAY like?

The abstraction of gameplay is reasonably common. I'm a ludologist by nature, so I understand that for me games are about rules. But somehow I've come to realize that it cant JUST be the rules that makes me play. If that were the case, why would I not just play abstract rule based board games? The difference is the real-time interactivity and presumably the thematic immersion gained from having interactive scenes. Basically, its the "3d world" thing that I like. I like that I could join a game and just look at the sun, even when its not shining brightly in the real world.

Much of what I like about the real world, is an abstraction based on nature. I like a clear sky with millions of stars. I like a remote hill with a stormy sky. Like a brilliant picture of a striking natural place can really make you think about the world around you and your place in it.

So maybe thats what I'm missing in a lot of games. I'm missing that feeling of abstraction, the limitless potential of spaces unknown.

Thats where I want to take my games. Although its a long passage to move towards it. What will its inhabitants look like? What will they do? What will players do with them? How will it all make me feel?

I'll share some thoughts on this once I've had time to sit and think some more.

Monday, August 27, 2007

Boutique MMO's and the next wave.

MMO's.

Those contentious little buggers which SEEM like they would be fun, but inevitably end up with some level grinding template of elves and orcs bashing "mobs" for some token or other.

Why is it that the only alternative to those are either "virtual other life" style things (second life, vSide) or space type games (space cowboy, eve online).

I'm looking at the current generation of MMO's and even the ones coming up and I'm thinking to myself "there has to be another way".

Of course there is the old standby I use when describing the other way of a tale in the desert. That is what one might call a boutique MMO in that it has all of the trappings of an MMO (large player based, persistant world) without the vestiges of the hackneyed old RPG formula to worry about. But, to me.. well, its a bit dull!

So, in order to appease myself, I'm going to take a leaf out of the book of the designer of "Blockland" (who's name escapes me currently) and just go ahead and create my own fairly random experimental world.

Yes, I know. Its not REALLY an MMO. In fact, it wont really be a game at all. It will be a melting pot of ideas. A pandora's box of idiotic game-development rambling. An anti-commerciality rant in MMO-like form!

Yes, starting next month, I'm going to be developing ABSTRACT ONLINE!

Of course, it will never be "finished", but thats the great thing about MMO's. Given my track record of late, thats not a bad thing :)

Anyway, watch this space for more details. I'll post some more info once I figure out what direction the initial phase is heading in. All I know is that I want to make a free online world and then play around with it. Seeing how society can be crafted once you are prepared to step outside traditional norms. It could mean that the whole of the society is built on trade. Or that combat involves doing street dances.

The era of the experimental MMO has come!

Tuesday, May 29, 2007

Object composition and design patterns.

I just finished reading the book Head First Design Patterns which is a really nice read. Even though the content is java oriented, pretty much anyone should be able to take the concepts and patterns explained and apply them in their own language.

So you might ask yourself "what the hell are design patterns and why would I want to know them?".

Design patterns are a way to look at problems and look at solutions and see if there isnt some way to abstract the way you approach a solution so that it applies consistantly to a class of problems.

If you think of it as a way of thinking about design at a higher level, its a good start.

The reason why it interests me, is that I've long been a big advocate of certain ways of architecting game code. Now I've got a name for this architecture! Not only that, but it appears other people think the same way, enough so that they've taken the time to give what I advocate a name and can give examples of how it should be used.

Just out of interest, the most important aspects that I've advocated.

The observer pattern (for decoupling objects)

You use the observer pattern where you want multiple objects to be aware of another objects state, but decoupled from the actual object being observed. The reason I advocate this, is that It helps keep compile times down, but also because it helps modularity, to loosely couple systems via some indirection, means that you can replace subsystems and keep the client (observer) unaltered.


The strategy pattern (erm, I think its that one, I'll have to go look again),

This is where you create object behaviour via composition rather than inheritance. By moving behavior into different classes and having objects incorporate them at runtime, you achieve a level of modularity in behavior and get rid of the problem of inheritance. Essentially, you isolate behavior into seperate classes and then get objects to exhibit that behavior by "composing" objects with those classes. This becomes a huge advantage when you want lots of objects (lets say weapons), but dont want to write thousands of classes, each mostly the same, but with minor tweaks.

These are the two I really am interested in. I'm sure I'll think of more as I go on learning about patterns. But these two I've used out in the wild and really appreciate.

So what has this got to do with the price of beans?

Well, I'm right now working on some little projects while my PC is offline at home. These projects are being prototyped using Torque Game Builder. But not just stock TGB. This is TGB with "behaviors", behaviors being, well, pretty much the behavioral composition pattern I talked about from the strategy pattern!

So, soon enough I should be able to post a blog with some demo's that show you how that actually works. I'm working on a series of video's showing some "rapid game prototype" developments. Only need a few bugfixes and we should be good to go.

Hope you get interested in design patterns, they arent just for coding and can be used in many different areas, for things like business processes etc. Hell, I guess they could be used for personal relationships too.

.Zoom.

Friday, January 12, 2007

Not a dead end

Oooh, I was kind of at a dead end for most of the day, then after sifting through a thousand and one sweep picking (its a guitar technique) videos on youtube, I stumbled into two interesting things in one day! Joy!

First thing, well, actually two things, are from introversions blog.

http://www.introversion.co.uk/blog/index.php

I like these guys. I really have no reason to, other than they are brits and are indies and seem kind of cool, but hey, I'm an old softie.

Anyhoo, the guys seem to be doing well, actually, they seem to be doing well enough that thier lead programmer (if I can call him that, basically theyre all owners as far as I can tell) is actually going fulltime!

Thats so funny really. They've been successful on and off for years now (with the off being the disappointing sales of the excellent darwinia) and ONLY NOW he's going fulltime. That's pretty fun, considering I've seen plenty of people trying to go fulltime with only a match 3 behind them.

So the other interesting Introversion blog thingy that was interesting is thier new game Subversion (check the blog for screenshots). Anyway, whats interesting about subversion for me, is that it is actually exploring techniques I had a great discussion about with Professor Richard Gabriel a good few months back while I was giving a seminar at the "Recent Object Oriented Trends" conference in Norway.

The discussion basically turned to ideas I was having for generating a set of cities from simplistic AI agents using "human population" rules. Essentially, my theory was that europe turned out the way it is, because of the spread of population and subsequent farming methods. I figured that if I could reproduce the spread of human population (i.e. small village, reproduce, spread out, start another small village, iterate, build civilisation a bit more etc) then I could reproduce the landscape procedurally. The whole point of this, was my need for a european looking landscape for Air Ace.

Anyway, I didnt take it any further, but I can definitely see how it would work. Plus I think Chris's work on subversion shows similar signs and definitely seems to point towards my own theories being valid. Interestingly enough, linking to Chris's work on procedural cities. I actually have a book chapter submission in for hardware rendering of procedurally generated 3D cityscapes using the new DX10 hardware geometry shader techniques (this is for the book GPU Gems 3). Lets hope they accept so I have to get off my ass and do the work! :)

Incidentally, on another little side note and link with Mark's stuff and ROOTS. I am quite intrigued by the methods Chris is using and the similarities to the techniques Chaim Gingold demonstrated for his work on SPORE, which was again, presented at the ROOTS conference in Norway last October-ish. I have to tell you Chaim's little opengl hack-together-demo's written using GLUT where FANTASTIC. I mean, he had about a dozen silly little demo's of organisms that ate themselves (i.e. mouth eathing its own stomach), through to procedurally generating curved roads (which is what made me link it with Chris's road generation).

Anyway, wrapping up, the last thing of mucho interest is an analysis of my friend Thomas Buscaglia (the game attourney) and some other attourneys, of a recently available contract between Activision and Spark for Call of Duty (I think its a console version, not the fantastic infinity ward variant). This analysis was posted in an article on Gamasutra and I have to say, its a fantastic insight into the AAA retail sector contracts. It also shows you (if you read the comments), how you can easily get screwed by your publisher if you dont go over your contracts with a microscope. Believe me, I've seen the results of bum contracts and its never pretty.

And now ULTRA finally, I just registered www.gamezuki.com, I figured it'd make a lovely little name for a casual-indie development company. Kind of overtones of games + godzuki (godzilla's little baby I believe).

So, all in all, its been a very interesting night! Hopefully tommorows open day at the Uni will provide similar interest!

TTYL.

.Zoom.