You humans…

image

I’m an AI guy. And that means I’m often a lonely guy. Like right now here at 2am. That’s because when I’m in the zone on AI coding, I just can’t take interruptions. Unfortunately, during the day, that’s largely unavoidable since I run a software company whose primary business isn’t making computer games.

But AI is my passion.  I just wish I had more time to dedicate it.

I won’t kid you. There’s a reason why AI in these fantasy games are usually terrible (or cheat like mad).  It’s hard. Really hard to get them to intelligently use magic.

You humans don’t help. Sometimes, my AI advocacy hat gets in the way of my game designer hat.  This was somewhat notorious in the old Galactic Civilizations builds years ago because I’d intentionally make things “harder” for the human to give the AI a leg up.

It snuck into Elemental too but these bloody public betas with so many people now scrutinizing that I can’t get away with my AI cheese.

Case in point: Learning spells.  The way it worked in Beta 2 was wonderful for the AI but awful for humans. If you had enough spell points, you would open up the spell book, find a spell, and “learn it”.  The AI, of course, is endlessly vigilant and would check, every turn, to see if he had enough spell points to learn a spell. Humans, by contrast, are lazy. Wonderfully lazy. So they’d let their spell points max out and be wasted.

Sadly, humans complained and so in Beta 3 you can queue up the spells you want to learn and as long as the spell doesn’t require more spell points (aka Arcane Knowledge) that you are capable of storing, you can put it into your queue.

(this is the part where people on various external forums condemn me for being a weasel).  But weaseling is what separates us from the animals. Well, except the weasel.

Magical pain for the computer AI

So here’s my Sovereign raising land.  I can create a land bridge (or make an instant beach). Getting the AI to do this intelligently? Very hard.

Here’s me raising land to make a pass through the mountains.

Of course, it being hard is what makes it worth it. :)

NPC Fun

Another fun thing is having the NPCs starting to get more aggressive.

79,837 views 39 replies
Reply #1 Top

YAY for lazy :D

I've modded Ai before but never created one for a game from the base up. And my little mind could barely do that. I don't mind if you let that AI cheat a little to give me a challenge. I don't think that the AI will ever be as creative with it's magic use as a player would, but i'd love to see it try. Thanks for working so hard.

How does the AI choose which spell to learn? is there a list on importance? or will it take how the game is playing into account and then get whichever spell best helps for the situation?

Reply #2 Top

The AI still has an advantage - whenever the current spell queue is finished it won't forget to check for something else to learn. Humans still will!

It also won't get bored casting enchantments on every unit it produces, or throwing volcanoes around or what have you. But I'm not sure infinite patience counts as cheese.

(And Simpsons quotes ftw. :D )

Reply #3 Top

Nice try, i will be very happy to see an inteligent oponent that dont cheat, or looks like it :) Problem in that kinda of games is very simple, You can always find a trick to defeat your oponent . . . usualy the silly one.

Cheer up and get the work done. I want AI to be more then just a pack of hacks, cheats and localizators ;p

Reply #4 Top

This is one of the things in Elemental that's going to maybe curb modding a bit. You're an awesome AI dev, but just cause us plebs can come up with cool new spells to put in the game doesn't mean we can write AI to back it up. How generalized do you think you'll be able to get it? Will it be able to recognize a damage over time spell and be able to use it effectively, for instance? If I made a spell that turns a shard into farmland and put it into the game, would the AI be able to use that? Not that I'm expecting it to be able to, I'm just trying to get a feel for what's possible.

Happy coding! 

Reply #5 Top

By the way you should also take a look into the fact that trees magically appear from under a mountain when you lower it :P

Reply #6 Top

This is one of the things in Elemental that's going to maybe curb modding a bit. You're an awesome AI dev, but just cause us plebs can come up with cool new spells to put in the game doesn't mean we can write AI to back it up. How generalized do you think you'll be able to get it? Will it be able to recognize a damage over time spell and be able to use it effectively, for instance? If I made a spell that turns a shard into farmland and put it into the game, would the AI be able to use that? Not that I'm expecting it to be able to, I'm just trying to get a feel for what's possible.

As a practical matter, I'm going to have to categorize the spells into areas and then put an AI value on them. The AI will then make use of the spells reasonably intelligently.

The only thing that scares me more than spells are boats.

Reply #7 Top

Quoting Frogboy, reply 6

As a practical matter, I'm going to have to categorize the spells into areas and then put an AI value on them. The AI will then make use of the spells reasonably intelligently.

The only thing that scares me more than spells are boats.

Ok that's what I expected. Sounds awesome!

And boats definitely suck. Look at Empire: Total War. Jeez, you don't want to go the way of that game. AI couldn't even invade across the sea without breaking completely. Biggest disappointment of my gaming life. 

Reply #8 Top

woops! double post. wish these forums were as good as the AI :P

Reply #9 Top

so this is slightly off topic, but the pictures of the soverign 'carving the land' made me think of it again....

 

I KNOW B3 is getting rid of essence cost of most spells, and I KNOW that essence cost makes things less fun.  However,

these spells are really strategically incredibly powerful, especially if you make use of choke points.  Suddenly opening a back door to a previously uninvadable territory... OR walling your empire off from any possible invaders....just seems incredibly powerful.  These kind of spells probably SHOULD have a minor essence cost.  This makes these 'opening back door' strategies viable.....but more costly

Reply #10 Top

Looking at the spellbook an idea came to me. Will there be any section in the spellbook for quotes? I'm referring to something similar to Heroes of Might and Magic 4, where every spell had a short quote. For example, this is for the Cancellation spell

"The knights spent a full day preparing for their attack, praying, casting spells, and polishing their armor. Pointless! But at least they died in shiny armor."

I fell it would add to the atmosphere of the game if Elemental had something similar. It would go well with the artwork.

Reply #11 Top

Intelligent use of  spells for the AI is important. In Age of Wonders II, there was an air spell (high level) that would freeze the caster's land, useful for the frostlings but a real plague to others. Yet non frostlings players would cast it too just because it was a high level spell, and then starve to death ! Worse, your land too was affected if you were allied with them, making you unwilling to ally with wind magic AI players xD I have higher expectations on your AI ;)

Reply #12 Top

Quoting SavageBananaMan34, reply 7



Quoting Frogboy,
reply 6

As a practical matter, I'm going to have to categorize the spells into areas and then put an AI value on them. The AI will then make use of the spells reasonably intelligently.

The only thing that scares me more than spells are boats.


Ok that's what I expected. Sounds awesome!

And boats definitely suck. Look at Empire: Total War. Jeez, you don't want to go the way of that game. AI couldn't even invade across the sea without breaking completely. Biggest disappointment of my gaming life. 

the whole game? or the AI? lol.

could you give us a glimpse of how you plan to go about making the AI use a navy?

Reply #13 Top

So here’s my Sovereign raising land. I can create a land bridge (or make an instant beach). Getting the AI to do this intelligently? Very hard.

Yep, this won't be easy. Hopefully you will be able to create a smart AI, which will use spells like these very intelligently, because....

AI Sovs running around raising land bridges and "nuking" mountains all over the map / clueless about how to use the raise & lower land spells properly = NOT FUN! :D

 

Reply #14 Top

I was wondering how the AI would handle players making islands of their lands or raising a chain of mountains as a natural wall of defense. I'm Very Glad the AI will be able to counter act this. Well Done Frogboy!!

3 Cheers for the AI Boss!! Hip Hip...Horaaay!!

Reply #15 Top

Quoting SavageBananaMan34, reply 7
The only thing that scares me more than spells are boats.
Ok that's what I expected. Sounds awesome!

And boats definitely suck. Look at Empire: Total War. Jeez, you don't want to go the way of that game. AI couldn't even invade across the sea without breaking completely. Biggest disappointment of my gaming life. 

It also made Great Britain hilariously overpowered. Begin a continental war in Europe ( a few ways to do it, the best one is to use your protectorates to attack someone ), and then build up your forces whilst they all duke it out. Even better if you rule the rest of the world, too.

Empire: Total War sucked a bit, though, simply because Europe had way too many provinces. Damn Russia.

Reply #16 Top

As someone who once attempted to make a simple basic A vs B decision system in a text based RPQ as an "AI" I must say it seems to be a monumental undertaking. Anyone who can really make that stuff work is amazing imo.

Something else that always annoyed me is that players expect a fair AI that beats them on higher levels. What they are almost asking for in that case is a computer program that is more intelligent than a human being... Which has been said to be one of the possible causes for the singularity. Or Skynet. Point being its nearly impossible. Give me a cheating but fun AI and I'll look for fairness in MP I say!

Reply #17 Top

Quoting endofdayz, reply 16

Something else that always annoyed me is that players expect a fair AI that beats them on higher levels. What they are almost asking for in that case is a computer program that is more intelligent than a human being... Which has been said to be one of the possible causes for the singularity. Or Skynet. Point being its nearly impossible. Give me a cheating but fun AI and I'll look for fairness in MP I say!

A few things can reduce the need to cheat though.  Random AI personalities who focus on different things and try different strategies can significantly shake things up (rarely does a player playing against multiple AI's track what each one is doing except in a general way)... especially if that AI can switch based on changing conditions.  Second, having a fairly hostile environment with relatively simple AI like that goblin camp that sends out raiders, the Mercenary NPC who wanders around looking for contracts, or the Pirate NPC who seeks to loot ships and coastal cities can make things much more interesting.  Having difficulties maintaining the integrity of your own empire as it continues to get larger (a la the "Revolutions" mod for Civ4) and having to play your own little political games within your empire helps (or rather hurts, which is the point).  And finally an AI that tracks various measurements of power, and forms balancing coalitions aginst those (AI or human) who are becoming too strong (which disband/turn on one another once your power has been brought back down to a more manageable level) can significantly improve the way AI performance appears to a player in the game, even if the individual AI actually has some fairly serious weaknesses.

Reply #18 Top

I like everything...heh the games coming along wonderfully.

Reply #19 Top

Does the raise mountains/land have a cooldown or can you box in a city/landlock them in one turn? That would be kinda sweet if I was the one doing the the magic, less so otherwise.

Can the land be torn apart if you raise and lower it often enough? For when you and an enemy share a pass that you open, they close etc.

Reply #20 Top

I just gave a try at a path finding algorithm, havent tested it, but i think it works.. I havent taken as a factor the speed of the algorithm.. which should be a factor in such situations....

the game knows all the tiles which can be traversed. those are your input plus your starting and ending position.

for every tile, you check the 3x3 neiborhood of it and if by removing the tile you dont brake in the neiborhood the possible paths* or create a hole then you remove the tile as a possible path tile. This way you do not increase the distance between the starting and ending position but you simplify things...

http://en.wikipedia.org/wiki/Simply_connected_space --> The neighborhood should remain simply connected (In Math terms)

When this algorithm finishes you ll have just lines which could create some holes or rectanges. The good with this graph would be that whenever a computer sees a tile with 3 or more neighboors it will know that this is a place where you can choose 2 or more different paths.

 

By checking all those different paths and their length, it can choose the fastest destination...

The End

*after the removal 2 different tiles in the neighborhood should continue to be able to reach each other if it was possible before..

Reply #21 Top

Awesome!!

 

The Tundra spell has the word Tundar in it... =) 

 

Hopefully we get to start testing today or tomorrow?

Reply #22 Top

 "...where people on various external forums...", don't give into hate, it leads to the dark side! :cylon:

stay true to you, don't give into peer pressure, you got a good thing going...

Reply #23 Top

Hey I don't mind if the AI cheats and has tons of level settings to cheat at like in GCII (I want that again). So long as the AI is stronger at Tough level (or whatever you call it before AI starts to cheat) then I am happy. Honestly I'm not worried at all.

Reply #24 Top

Quoting Hawawaa, reply 23
Hey I don't mind if the AI cheats and has tons of level settings to cheat at like in GCII (I want that again). So long as the AI is stronger at Tough level (or whatever you call it before AI starts to cheat) then I am happy. Honestly I'm not worried at all.

 

Agreed,  I have complete faith in you as far as AI goes.  I just want to make sure the gameplay is super fun so i will want to replay the game again and again.

Reply #25 Top

Make water AI work correctly for once, Brad, and I will trust you forever. From Age of Empires to Empire: Total War, my faith in the ability of AI to use water correctly was lost a long time ago.