Brad Wardell's site for talking about the customization of Windows.

I haven’t got to design an AI since…well 2006.  It’s been a long time and the Stardock games team of 2013 is insanely awesome and the tech is just amazing too.

Now, I programmed the AI in Legendary Heroes and helped on the AI in Fallen Enchantress (I wrote worker functions for War of Magic).  But I haven’t got to sit down and make something from scratch since GalCiv II.

And wow, things are so much better now.  Virtualization, lots of cores to handle threads (GalCiv II was written for a single core with 1 hyperthread).  The things I can do now are, well they’re just plain sick.

While I am quite proud of the AI in Fallen Enchantress: Legendary Heroes, it was something I had to retrofit onto Elemental: War of Magic. It was a miracle to get it to work as well as it does because War of Magic was single threaded.  I had to make it multithreaded after the fact (if there are any programmers here, please feel free to comment to explain how nasty that is).

In GalCiv III, the AI is able to operate on a virtual machine version of the game state. So I can monkey around in real-time without it affecting other players. I can not only have every computer player have its own thread, I can have different components of the AI have their own threads and in multiplayer, I can distribute the work up across the different players.

There’s a lot more too. From crowd sourcing ship designs, tech tree strategies, planetary improvement strategies, etc. to throwing raw number crunching stuff onto the player’s video card.  We’ve come a long way from 2006.


Comments (Page 2)
3 Pages1 2 3 
on Dec 06, 2013

Brad- Can you confirm if the AI has to actually search for planets, or if they will have knowledge of, and will bee-line towards the good worlds from the outset, as in GC2?  This is one thing that always bugged me.

on Dec 06, 2013

Lucky Jack

Even so, I wouldn't be surprised if the devs found some of the newer programming languages lacking in some instances, simply because it takes time for any programming language to "mature". I am sure Brad & co are quite busy, but maybe they can give us a simple  and approximate count of the number of work/arounds they have had to create to solve deficiencies in the programming language(s) ability to handle asynchronicity?

 

Heh, .NET ain't that new any more and you missed it only by couple years (initial release 2002). Although you are right, it has matured since then. In some cases a lot, and in some others not so much. Anonymous delegates, the async programming and the linq queries are some of the newer aspects I feel handy. I would worry more about the DirectX or what ever they are using for, because those tend to make your life very painful. 

on Dec 09, 2013

Mature or not .NET threading can be messy especially if you rely on it to handle all of your allocations. For goodness sake it has a hard time cleaning up when you have multiple dbs connected to it asynchronously so I would think they are relying on some manually handling this stuff to be efficient.  Especially in a game of this nature a couple of errands threads could cause memory leaks.  And since they are running on seperate threads that is going do be no easy task to properly manage even with some assistance from the language.

I too am interested in knowing about workarounds if they are using .net.

 

Still sounds like a roaring start and I cannot wait to taste the fruits of this labor.

on Dec 09, 2013

charon2112

Brad- Can you confirm if the AI has to actually search for planets, or if they will have knowledge of, and will bee-line towards the good worlds from the outset, as in GC2?  This is one thing that always bugged me.

In GalCiv II, the AI didn't know where the good planets were, it just knew where the stars were. It had (and did) scout them out.

One of the things that I have not considered cheating in the past is the AI making use of undocumented patterns.  I'm not going to go into this here as even mentioning this will mean some players are going to figure this out but I have tended to make sure the galaxy seeds things in a non-random way so that if you have N stars in a particular pattern, you know that a particular star will be yellow and therefore probably have a good planet around it.

If you load up GalCiv II and look very carefully at the "random" stars you'll discover there are patterns.

Now, you could argue that's not "fair" but we also don't explicitly say that yellow stars will likely have good planets. That's just a pattern that many players came to recognize. But there are lots and lots of other patterns in the game from the way asteroids are done to the positions of anomalies to the positions of resources. There are relationships between everything. The more sophisticated the player, the better they get.

I'm going to regret giving this away as some of the more clever players will likely put up a guide (or if they're smart, they'll keep it to themselves).

on Dec 09, 2013

OMG, the stars, the stars!!

on Dec 09, 2013

Frogboy
In GalCiv II, the AI didn't know where the good planets were, it just knew where the stars were. It had (and did) scout them out.

One of the things that I have not considered cheating in the past is the AI making use of undocumented patterns.  I'm not going to go into this here as even mentioning this will mean some players are going to figure this out but I have tended to make sure the galaxy seeds things in a non-random way so that if you have N stars in a particular pattern, you know that a particular star will be yellow and therefore probably have a good planet around it.

If you load up GalCiv II and look very carefully at the "random" stars you'll discover there are patterns.

Now, you could argue that's not "fair" but we also don't explicitly say that yellow stars will likely have good planets. That's just a pattern that many players came to recognize. But there are lots and lots of other patterns in the game from the way asteroids are done to the positions of anomalies to the positions of resources. There are relationships between everything. The more sophisticated the player, the better they get.

I'm going to regret giving this away as some of the more clever players will likely put up a guide (or if they're smart, they'll keep it to themselves).

 

 

Listen, I don't mean to sound like a jerk or anything, but what's the point of these patterns?  Are "good" players supposed to memorize these patterns in order to game the system?  What is this, Super Mario Brothers?

on Dec 09, 2013

Wetballs

Listen, I don't mean to sound like a jerk or anything, but what's the point of these patterns?  Are "good" players supposed to memorize these patterns in order to game the system?  What is this, Super Mario Brothers?

No, they help program a more efficient AI without explicitly giving the AI benefits like extra resources or beneficial modifiers.  Basically, they are extra data points that the AI has access to when making its decisions that the player may or may not have access to (depending upon how much they look for and/or already know the patterns). 

on Dec 09, 2013

Kantok

Quoting Wetballs, reply 21
Listen, I don't mean to sound like a jerk or anything, but what's the point of these patterns?  Are "good" players supposed to memorize these patterns in order to game the system?  What is this, Super Mario Brothers?

No, they help program a more efficient AI without explicitly giving the AI benefits like extra resources or beneficial modifiers.  Basically, they are extra data points that the AI has access to when making its decisions that the player may or may not have access to (depending upon how much they look for and/or already know the patterns). 

 

 

Yeah well, I don't think I'll ever look at yellow stars the same again.  Did everyone know they had better planets?  I never realized that.

 

on Dec 09, 2013

[quote who="Wetballs" Listen, I don't mean to sound like a jerk or anything, but what's the point of these patterns?  Are "good" players supposed to memorize these patterns in order to game the system?  What is this, Super Mario Brothers?[/quote]

On the other hand, these patterns ensure a reasonably fair distribution of resources (But not planets, GRRR) which is something you will definitely need with multilayer.

With regard to the AI knowing where the good planets are,,, i use that against them! What i do is, i send out colony ships and park them near planets but don't colonize them (especially lone planets in isolated systems). I then wait for AI colony ship to turn up then i colonize the planet under its nose (but doesn't work against the Yor, obviously). Because it cheated and new where the planet was, it has now wasted all those turns on a wild goose chase, sucked in!!

If i was to have colonized the planet straight away, then the AI colony ships would have magically known and turned towards other planets and gotten there much faster, possibly faster than me!

on Dec 10, 2013

Wetballs
Yeah well, I don't think I'll ever look at yellow stars the same again.  Did everyone know they had better planets?  I never realized that.

He didn't say "better planets", but "good planets", which is accurate. The best planets are around purple stars.

on Dec 10, 2013

Achronous

OMG, the stars, the stars!!

Joking aside, I thought yellow star habitability was common knowledge, as Brad said. Searching in the forums (Galciv2) for it brings up a number of threads that I remember. I think it wad mentioned in the manual as well, but I can't vouch for it.

The single most annoying thing wasn't the AI knowing where the stars were, it was knowing where all the resources were as it claimed all of them if you were lax.

Now, I'm starting to suspect something about those as well... 

 

EDIT: Ok, Brad, maybe you shouldn't have said anything....

on Dec 10, 2013

Wetballs

Yeah well, I don't think I'll ever look at yellow stars the same again.  Did everyone know they had better planets?  I never realized that.
 

 

I didn't know about the patters or intentions, but my gut feeling always has said that programmers make the yellow sun look like Earth's solar system (I realise that in truth the Earth is not on all yellow suns, and that the gut feeling is stupid at best).

on Dec 10, 2013

Gaunathor

Quoting Wetballs, reply 23Yeah well, I don't think I'll ever look at yellow stars the same again.  Did everyone know they had better planets?  I never realized that.

He didn't say "better planets", but "good planets", which is accurate. The best planets are around purple stars.

 

Gah!  Don't tell me that!  Now it'll be impossible for me to forget!

on Dec 10, 2013

I remember the Dread Lords spawned in my galaxy, and after I stopped their reign of terror I found out that their planet "Amalda" was a native class 60. After I took control of it, my planet quality abilities and PQ improvements made every single tile available. I was beside myself with joy; I seriously have never seen anything like it since, maybe it was a bug?

Then there was a time I found a planet with a PQ of 1, or a blue star with five "Purple water" habitable planets or that time my game glitched out and spawned a solitary planet without a star.

Hopefully the the planet-generation system in Galactic Civilizations 3 is more random and less deterministic than its predecessors; the outliers and the exceptions make the game more fun in my opinion. Things like rogue planets, binary stars, more varied planet environments and the like would really add a lot of personality to the game.

Here' hoping Stardock can make it happen

on Dec 10, 2013

DarkSide73

 Especially in a game of this nature a couple of errands threads could cause memory leaks.  And since they are running on seperate threads that is going do be no easy task to properly manage even with some assistance from the language.

 

Wait, what memory leaks? Are you talking about some unmanaged libraries used in the threads that cause the leaks, or can you provide a example code where such thing happens? By memory leak I assume you mean memory that is allocated but never released, but such thing shouldn't happen in the C#. On the other hand, if you are talking about accessing indexes not existing any more.. Now there is a real dilemma, but not without known solutions for most cases (and it depends on the data and requirements). 

3 Pages1 2 3