Brad Wardell's site for talking about the customization of Windows.
Published on September 23, 2009 By Frogboy In Elemental Dev Journals

The AI in Galactic Civilizations I and II has tended to get a lot of praise over the years.  But it could have been better. Much better. 

A big reason that kept it from being better was sheer laziness on my part.  A lot of the best strategies involve algorithms that just are tedious to write.

For example, I submitted feedback to GPG for Demigod’s AI based on algorithms I knew would be effective but that I didn’t actually use in GalCiv because they were a pain to write.

My favorite example is a pretty straight forward algorithm: What is the strength of an enemy in a given area compared to mine? You provide the unit in question and a radius and it returns a value based on the relative damage potential of other things in the area and from that you can decide whether to move forward or not. 

It’s a great way to mobilize units together as a cohesive mass. In Demigod, it would tend to make the AI less likely to go into harm’s way.  This is one tiny example and each tiny example on its own is easy to write but taken together, they mean a lot of work that I wasn’t able to get to (or didn’t want to get to) in Galactic Civilizations.

In Elemental things are different.  Oh, I’m still lazy. Dangerously lazy.  But now I have Charles to work with who helps split the work on this stuff.  On our previous games, I wrote the AI myself – The Politial Machine, GalCiv, Entrepreneur, etc.  This time, I have a small team to help me with it.

Part of that is because the AI in Elemental is a very big deal. People are excited about the features of Elemental but to me, those features are meaningless unless there are computer players that make good use of those features. Or more to the point, intelligent use of them.  While Elemental will have multiplayer (up to 32 people for starters), the focus of the game is single player. That’s the part of the game I want to make sure we absolutely nail and for that, it absolutely must have intelligent computer players.

Over the past 15 years I’ve built up an increasing library of algorithms I’ve doodled together for how computer players could play more like expert humans. Elemental will be my first real chance to see them come to life. I’m very excited.


Comments (Page 3)
4 Pages1 2 3 4 
on Sep 24, 2009

Oy! Programmers are not lazy!

The term is 'constructively idle'.

on Sep 24, 2009

Well, I guess I don't need Frogboy to respond.   Enough other people are indicating similar experiences that I will just take it for granted that the AI had a major overhaul between GC2 and GC2:ToTA.

 

And sorry for referring to it as TWoTA - I normally acronym things properly, LaOL.

on Sep 24, 2009

Nights Edge
Oy! Programmers are not lazy!

The term is 'constructively idle'.

I thought being lazy was a job requirement...)

on Sep 24, 2009

lazy ya ya... but in that time your thinking up all the good stuff! Can I bug ya whens next patch? or Beta 1a?

on Sep 24, 2009

Not so much lazy as needing motivation

on Sep 24, 2009

Over the past 15 years I’ve built up an increasing library of algorithms I’ve doodled together for how computer players could play more like expert humans. Elemental will be my first real chance to see them come to life. I’m very excited.

As someone who plays 4x games almost exclusively single player, with the occasional hot-seat game with 1 or 2 friends and a load of AI players, I also am excited.

on Sep 24, 2009

AI programming is one of my favorite things. It is fun to see computer players doing all the work for you after you have tweaked stuff.

And imo it is really not the most important thing to have the AI play very well but instead the most important thing is that it plays interesting and varied. Back when Warcraft 3 came out I started AI modding because the AI was so boring, always doing the same thing. But the problem was that a lot of the AI was hidden in hardcode instead of in accessible script and the tools to alter the AI script were nonexistant in the start which resulted in a lot of extra work to get a system you could properly use. Ever tried programming when all you get as feedback is if it runs or not and no information about if it is a syntax error or a runtime error and no idea about where in the code?

So I hope that for Elemental most of the AI will be in the script and in an architecture that makes extending and tweaking easy

on Sep 24, 2009

ckessel
Not so much lazy as needing motivation

But isn't a certain laziness part of a good dev's motivation, at least when it comes to automating un-fun repetitive tasks?

on Sep 24, 2009

Frogboy, how are you going to have time for great AI when you're working on that book? 

on Sep 24, 2009

In college I became very disillusioned with AI. I had all these ideas about computer learning and dynamic code and neural networks and really none of that amounted to much of anything.

You basically had expert systems (bleh prolog!) that only work in very abstract controlled environments and (tree)search. When I learned that the best chess AI was nothing more than look up tables with opening/closing plays combined with just brute force game tree traversal I became saddened. To me such "AI" was identical to just pre-programming in an answer to a problem. Having a computer just explore a game tree is beyond dull and nothing at all like intelligence or emergent behavior.

The most exciting stuff I read about came from Rodney Brooks and the subsumption architecture. The idea that complex actions are the result of many trivial responses is fascinating to me. Implementing some basic forms of it in lego robots and getting inscet like behavior was very cool. It was not enough to keep my interest in the field as a career but AI remains as something I keep wanting to see done "right".

I am looking forward to seeing the AI in Elemental evolve from the ground up. I would also like to strongly second the call for modding hooks when possible. I doubt it would work well but it would still be fun to build an AI based on some of Brooks' ideas.

on Sep 25, 2009

SnallTrippin
...question: Aren't all programmers lazy?  Answer: ye

 

Heh, one of the quotes I use at work:

Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.
-- Robert A. Heinlein

Which I typically follow with "So they don't have to get up as early"

 

I never cease to amaze myself with how much effort I will spend to save a couple of minutes off of a tedious project.

on Sep 25, 2009

Haha, that's a good point actually - I spent hours programming maths appliations on my graphical calculator at school that would basically do my work for me to save myself the trouble. The hard part is, of course, getting it show the workings out, but I managed. I think it probably took more time and effort to do that then it would have taken to actually do the work, but it saved countless other kids hours of hard work... and probably destroyed their maths education in the process.

on Sep 25, 2009

By premise the AI can´t be smarter than the analysts/programmers that developed it, can it?.

Well, I only hope the AI will be also less lazy than Brad.

 

 

on Sep 25, 2009


My favorite example is a pretty straight forward algorithm: What is the strength of an enemy in a given area compared to mine? You provide the unit in question and a radius and it returns a value based on the relative damage potential of other things in the area and from that you can decide whether to move forward or not. 

In my opinion the issue is not so much the complexity to code the algorithms but the amount of time they require and then how to handle fuzzy/incomplete information.

I did something like the above example in my own game a while ago, where I computed power projections and had a map of power projections that could be used to decide whether or not it was safe/useful to go into a certain area. The data was incomplete because there were some factors that couldn't be easily evaluated, but the real issue was what happened when fog of war hid a unit. You have to somehow remember that a unit has been seen there and thus the threat is higher than expected, until you actually see the same unit the other side of the map, (but how can you be sure it's the same unit)...

Keeping in memory all the relevant data and checking it for each player tends to be computationally expensive when there are many units, which calls for astute coding if you want the game not to slow down too much as number of units grows.

on Sep 25, 2009

In Elemental things are different. Oh, I’m still lazy. Dangerously lazy. But now I have Charles to work with who helps split the work on this stuff.

Sweet, I got an honorable mention. 

4 Pages1 2 3 4