Author Topic: Adventures of an Erudite AI  (Read 12322 times)

GGLucas

  • Dr. Evil
  • BMS Staff
  • Delusional
  • *
  • Posts: 1877
  • Karma: +300/-6
    • View Profile
Adventures of an Erudite AI
« on: April 17, 2011, 10:04:14 AM »
As some of you might be aware, we are currently working on redoing large portions of the game's AI code. What some of you might not be aware of, however, is a friendly competition going on between ThyReaper and myself. For the past few weeks, we have both been working on our own separate AIs, which we intend to pit together in the deathmatch of the century... once we're both finished.

For fun and profit, I have decided to log some of my findings while testing my new AI, which I have dubbed the "Erudite AI". What follows are the adventures of a humble AI-in-training as it attempts to become a true champion.

Diary 1: Onward, Pioneers
In this test, I decided to pit the expansion logic of the erudite AI against 3 of the hardest difficulty, non-cheating, basic AIs (the basic AI is the current AI that is in Star Ruler).

Starting in a nice 4-planet system, the Tophat Empire uses its newfound capabilities for traversing space to send out a few waves of brave scouts, the first of our great peoples to see the distant universe out in the black.

After two game minutes, a party of settlers is sent to a nearby planet in our glorious solar system. We hope that they may fare well and bring back many riches.




As an industrious race, we complete development of our home system within 11 game minutes. Finally, it is time for our pioneers to set sail for the stars!




After an unfortunate incident involving what we now know to be an Izla decorative spoon, the Tophat have begun preparations to defend against incoming assaults from the filthy purples. Imperial expansion efforts seem to be proceeding without a hitch otherwise, and we have conquered 53 separate planets in a single game hour.




The glory of the headwear shall prevail! The galaxy itself shall be tamed to serve us !

(I may have underestimated just how much of an exponential effect this expansion algorithm has, it almost doubled its empire size in the span of 15 minutes.)




Fly, my countrymen! Onwards to the far reaches of the universe.




After a long two game hours, the galaxy is finally ours! Our great empire controls all but a measly 50 coastal planets. For some mysterious reason they have held out against our legionnaires so far, but they will certainly not last much longer!



Diary 2: The Forever Spam

After implementing routines to construct orbital defenses and defensive strike craft where necessary, I decided to put some of it to the test. I added multiple erudite AIs to a game, waited until two of them colonized planets in the same system, and declared war manually.

At first, both sides started building defenses and strike craft as expected. Neither party able to break through the opposing defenses, fighters were massacred left and right.



The frontline shifts between different planets as waves of fighters and bombers intercept, attack and are shot down by orbital flak.



After a quick bomber strike from the nearby planet, one of the green planets is finally about to fall to the bombardment. The poor fighters are unable to reach their world in time, and can do nothing but watch as millions of their people are mercilessly slaughtered.



The Hewaz autonomous government wastes no time quarrelling and decides to send out a ship with new building supplies and people to establish an outpost on their lost world once more.



In the nick of time, the settlers set up camp on the planet before the enemy does. The planet is secure... for now.



As this is happening, an unexpectedly large strike force attacks green's main two planets in the system. Another planet is lost to the assault, and holding out seems an impossible task for the only remaining developed world. Luckily, the defenses are still standing.





After gaining the upper hand in a long battle, the green empire now sends out its own assault wave against the enemy defense stations.



This attack, too, proves unfruitful. The two empires may well be locked into war... forever.

(Or at least until I implement fleets and they can get help from other systems ;) )
« Last Edit: May 17, 2011, 05:12:17 PM by GGLucas »

mecharm

  • Sentient
  • **
  • Posts: 76
  • Karma: +3/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #1 on: April 17, 2011, 11:05:29 AM »
 :D Awesome!

I hope you guys are going to record the epic fight, or better yet; stream it live...

GGLucas

  • Dr. Evil
  • BMS Staff
  • Delusional
  • *
  • Posts: 1877
  • Karma: +300/-6
    • View Profile
Re: Adventures of an Erudite AI
« Reply #2 on: April 17, 2011, 11:09:24 AM »
Quote
stream it live...

Sounds like fun. We'll consider it if there's people willing to watch it :)

Mephisto

  • Newbie
  • *
  • Posts: 34
  • Karma: +8/-4
    • View Profile
Re: Adventures of an Erudite AI
« Reply #3 on: April 17, 2011, 11:16:02 AM »
I'd be interested in watching it on Youtube at the very least.

ARGH1

  • Newbie
  • *
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #4 on: April 17, 2011, 11:53:00 AM »
I'd would be willing to watch this.

Malorn

  • Sentient
  • **
  • Posts: 53
  • Karma: +2/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #5 on: April 17, 2011, 12:16:43 PM »
Same here, worth watching on youtube or any other way.  With commentary, perhaps?

SpardaSon21

  • Sentient
  • **
  • Posts: 67
  • Karma: +3/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #6 on: April 17, 2011, 12:24:33 PM »
I would watch the massive deathmatch.
Peace is not about having a bigger stick than the other guy.  Peace is about beating the other guy with your bigger stick until he submits to your benevolent rule.

-Frequent forumite and player of both Sword of the Stars and Sins of a Solar Empire.

GGLucas

  • Dr. Evil
  • BMS Staff
  • Delusional
  • *
  • Posts: 1877
  • Karma: +300/-6
    • View Profile
Re: Adventures of an Erudite AI
« Reply #7 on: April 17, 2011, 12:28:52 PM »
Quote
With commentary, perhaps?

Naturally.

mecharm

  • Sentient
  • **
  • Posts: 76
  • Karma: +3/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #8 on: April 17, 2011, 12:34:18 PM »
So, it's a date!

Exa

  • Distracted
  • ***
  • Posts: 201
  • Karma: +12/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #9 on: April 17, 2011, 12:42:29 PM »
we have both been working on our own separate AIs
Will you add both AIs to the game or only the best? Or will you create a frankenstAIn with parts from both?

Anyway, great job!  ;D


Thy Reaper

  • BMS Lead Developer
  • BMS Administrator
  • Hopeless
  • *
  • Posts: 3237
  • Karma: +397/-8
    • View Profile
    • Blind Mind Studios
Re: Adventures of an Erudite AI
« Reply #10 on: April 17, 2011, 12:56:38 PM »
If both are better than the current AI, we'll be adding both with an option to choose which AI is used by which opponent.

Superking

  • Distracted
  • ***
  • Posts: 332
  • Karma: +27/-7
  • Ohhhh Jobi
    • View Profile
Re: Adventures of an Erudite AI
« Reply #11 on: April 17, 2011, 01:27:37 PM »
^ awesome.

I wonder how they will compare to foravens AI? (if it could be reverse engineered to play vanilla..)

I hope they have some sensetivity to map size, since the correct behavior in a 100 system universe is very different to that of a 15 system universe  :)
« Last Edit: April 17, 2011, 01:31:12 PM by Superking »
I Make the Bread

Mephisto

  • Newbie
  • *
  • Posts: 34
  • Karma: +8/-4
    • View Profile
Re: Adventures of an Erudite AI
« Reply #12 on: April 17, 2011, 02:12:52 PM »
If both are better than the current AI, we'll be adding both with an option to choose which AI is used by which opponent.

Do they have distinct philosophies on how they approach the game, or will the differences be more subtle to the average player?

GGLucas

  • Dr. Evil
  • BMS Staff
  • Delusional
  • *
  • Posts: 1877
  • Karma: +300/-6
    • View Profile
Re: Adventures of an Erudite AI
« Reply #13 on: April 17, 2011, 02:17:47 PM »
Since we're working entirely separately, it could turn out either way. No way to tell until we start pitting them against each other ;)

EaglePryde

  • Sentient
  • **
  • Posts: 128
  • Karma: +7/-1
    • View Profile
Re: Adventures of an Erudite AI
« Reply #14 on: April 18, 2011, 01:08:26 AM »
Seems this AI plays well but on the other side...does it need diplomacy?

BigWolf

  • Newbie
  • *
  • Posts: 36
  • Karma: +1/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #15 on: April 18, 2011, 05:15:43 AM »
Will we be getting diaries of both AI's as they are being improved on?  Or just yours?

SpaceBoy6

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #16 on: April 18, 2011, 01:17:54 PM »
Sounds like fun. We'll consider it if there's people willing to watch it :)

I would watch it :)
- Conquerer Of Star's! -
Selling a inno3d 9500gt 30Pound(UK ONLY)

Jinglebombs

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #17 on: April 18, 2011, 02:28:32 PM »
I would watch the AI video as well  ;D

Space Voyager

  • Sentient
  • **
  • Posts: 185
  • Karma: +6/-2
    • View Profile
Re: Adventures of an Erudite AI
« Reply #18 on: April 19, 2011, 02:05:02 AM »
Is there a way to start a game as a spectator, meaning doing exactly what you guys are doing?

If one could simply observe it all, be able to check all the diplomacy and ships of all the AI participants (or just one, good enough), it would be a great way to learn the game in less "tutorialish" way.

DavidwMiller

  • Star Ruler Beta Tester
  • Sentient
  • *
  • Posts: 160
  • Karma: +8/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #19 on: April 19, 2011, 02:56:31 AM »
Is there a way to start a game as a spectator, meaning doing exactly what you guys are doing?

If one could simply observe it all, be able to check all the diplomacy and ships of all the AI participants (or just one, good enough), it would be a great way to learn the game in less "tutorialish" way.

Was wondering that as as well, wouldn't mind watching an ai deathmatch from time to time just for the hell of it ;)

And on topic, I'd watch a video on that, but probably not a live streaming one..

GGLucas

  • Dr. Evil
  • BMS Staff
  • Delusional
  • *
  • Posts: 1877
  • Karma: +300/-6
    • View Profile
Re: Adventures of an Erudite AI
« Reply #20 on: April 19, 2011, 04:26:57 AM »
Not without changing a file. If you go into Game Data/scripts/server/basic_ai.as, then edit the line that says
Code: [Select]
if(emp.isAI()){
to say:
Code: [Select]
if(true){

Then you should start the game with an AI controlling things in the background.

Superking

  • Distracted
  • ***
  • Posts: 332
  • Karma: +27/-7
  • Ohhhh Jobi
    • View Profile
Re: Adventures of an Erudite AI
« Reply #21 on: April 19, 2011, 07:28:17 AM »
how do you manage the AIs offensive/defensive fleets & defence making? or is that a secret so reaper dosnt steal your techniques  ;)

the best way I can think to do it is using weights
eg, enemy systems containing no defences contain a strong weight, but defensive fleets and stations decrease this weight. AI always attacks the strongest weights/least defended systems.

freindly systems request defensive structures up to a value proportional to the value of the offensive fleet, with already defended systems not requesting any and undefended systems placing all priority on building defences. as fleet value goes up, more defence is constructed everywhere. each planets defence quota is also modified by the number of slots the planet has (more slots = more defence)

a friendly system containing enemy forces of greater value than the weight of defensive stations enact a very strong weight on fleets, but fleets that have already been dispatched on offensive missions ignore defensive weights until the target of the offense is dead/they request a new mission.

a proportion, based on a value in the config file and modified by scouting information (eg. percieved strengh/number of systems of enemy) decides what proportion of fleets are allowed to be attacking at any given time

other behaviors that would be nice to see:
  • constructing small groups of fighters and sending them to systems to remove enemy scouts (foravens AI does this iirc)
  • constructing small groups of bombers and sending them at any planet that has little defences
  • constructing drydocks of increasing size as tech level increases
  • the ability to call behaviors in the config file the chance of calling them, and a list of preset behaviors to call.
    eg. tag BomberRush: 0.5  ,<--- where bomber rush is a tag that causes the AI to produce 50 bombers upon reaching tech 4 railgun, and send them at enemy homeworld, and 0.5 is the chance of performing this behavior (50%)
  • a tag that enables the AI to produce any enemy design it aqquires

I Make the Bread

Lazers

  • Newbie
  • *
  • Posts: 35
  • Karma: +2/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #22 on: April 19, 2011, 10:06:59 AM »
I never got how the AI manages to so quickly colonise the entire galaxy. I once, progressing at what I considered a normal rate, ended up with three planets. In the same time, the AI had fully colonised the entire 60 planet galaxy.


Hazzard

  • Distracted
  • ***
  • Posts: 397
  • Karma: +64/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #23 on: April 19, 2011, 10:19:56 AM »
Lazers the key is to secure your assets early on.

Make sure that your home system is fully colonized and fully developed with balanced and economic governors first. Then use scouts to find the next nearest system and fully develop that. Do the same thing another 4 or 5 times until you have a good 6 systems fully developed under your belt all the while focusing on metallurgy, economics and cargo research.

Once you pass a certain economic thresh hold you can then select the entire galaxy, right click and set "Autocolonise" which will make every system in the galaxy available to colonise regardless of a threat and then go to your system tab and select all and just ctrl-build 1000 colony ships and spam them out.

It's all about the threshhold. Once you cross that economic threshhold essentially the game is over. I think this is a balance issue with the singleplayer that might be worth looking into. I couldn't possibly tell you how to solve it... perhaps auto-leveling the AI to maintain pace with the player could be an option... I don't know but it might be worth discussing this further in another thread.

Space Voyager

  • Sentient
  • **
  • Posts: 185
  • Karma: +6/-2
    • View Profile
Re: Adventures of an Erudite AI
« Reply #24 on: April 20, 2011, 01:19:57 AM »
It's all about the threshhold. Once you cross that economic threshhold essentially the game is over. I think this is a balance issue with the singleplayer that might be worth looking into. I couldn't possibly tell you how to solve it...

Well, the developers are solving this problem at the moment, developing the AI... If that is done right, the AI should have its own threshold...

Than again, I would still love it if colonies would really cost you and the step you describe, mass spam of colony ships, would bear a real risk of economy failing for the rest of your game.

EaglePryde

  • Sentient
  • **
  • Posts: 128
  • Karma: +7/-1
    • View Profile
Re: Adventures of an Erudite AI
« Reply #25 on: April 20, 2011, 03:55:59 AM »
Well, the developers are solving this problem at the moment, developing the AI... If that is done right, the AI should have its own threshold...

Than again, I would still love it if colonies would really cost you and the step you describe, mass spam of colony ships, would bear a real risk of economy failing for the rest of your game.

Being able to colonize every planet and that very quickly is a bit of a problem or even exploit imho.

It would be far better to have different planet types and the races only have a certain planet type as usable while you can research colonizing others in the tech tree.

This would slower colonization and expansion a bit.

You could make newer planets "cost" you resources for building buildings until a certian threshold where they start to actually produce something.

Planet population are rather like bunnys than humans and are at max far to fast. The reproduction rate should be slowered.

BigWolf

  • Newbie
  • *
  • Posts: 36
  • Karma: +1/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #26 on: April 20, 2011, 05:45:04 AM »
It would be far better to have different planet types and the races only have a certain planet type as usable while you can research colonizing others in the tech tree.

Or alter this slightly and still have planets colonizable, but the further the planet is from your ideal world, the most a penalty you get
Would require terraforming tech to be part of vanilla (I presume it's not), and the AI changed to not kill itself by colonizing worlds that are too bad for it's race
Of course I suppose that would require having race uniqueness as well... so maybe too much work for the time being lol

RFHolloway

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-1
    • View Profile
Re: Adventures of an Erudite AI
« Reply #27 on: April 20, 2011, 08:12:41 AM »
One really good idea would be to have each race select from one of a list of viable AI's (see Open Tansport Tycoon Deluxe for a similar project) This would give the races real different personality, which may not be immediately apparent - and would stop one of you having to throw away your work.

Superking

  • Distracted
  • ***
  • Posts: 332
  • Karma: +27/-7
  • Ohhhh Jobi
    • View Profile
Re: Adventures of an Erudite AI
« Reply #28 on: April 20, 2011, 08:52:43 AM »
One really good idea would be to have each race select from one of a list of viable AI's (see Open Tansport Tycoon Deluxe for a similar project) This would give the races real different personality, which may not be immediately apparent - and would stop one of you having to throw away your work.

If both are better than the current AI, we'll be adding both with an option to choose which AI is used by which opponent.

...

It's all about the threshhold. Once you cross that economic threshhold essentially the game is over. I think this is a balance issue with the singleplayer that might be worth looking into.

its certainly a good argument for making improvement per level linear instead of exponential.
I Make the Bread

TGS

  • Sentient
  • **
  • Posts: 107
  • Karma: +5/-0
    • View Profile
Re: Adventures of an Erudite AI
« Reply #29 on: April 20, 2011, 03:06:07 PM »
I don't think being able to do that is an exploit or cheat or even really unbalanced. I think how the AI and in some ways the game handles it is really where the problems lay.

It's all well and good to try to colonize every planet out there but unless the AI is quite passive I'm not entirely sure how you would "keep" said planets. Granted I haven't actually utilized this tactic yet which I might give a whirl today at some point. One possible solution to that could lay in the pirates. Pirates after all are suppose to attack weak systems so if you are sending out colony ships EVERYWHERE the game could have pirate attacks balance it out by picking off any system that doesn't get established quickly which means the player would have to micromanage or waste resources.

Another option would be to have the AI take advantage of your economic focus and hit your home systems hard with superior military tech.

Anyway I'll finish in saying that the scaling in this game can very easily lead to very bizare balance situations where for example colonizing the entire galaxy can become trivial. Similarly you could be focusing on economic only to have the enemy send in a few ships that completely rip any of your ships apart because their tech is 5-10 levels higher than you because you focused on econ while they focused on military. That doesn't make the game unbalanced it simply makes the game's handling of it seem that way.

Being able to colonize every planet and that very quickly is a bit of a problem or even exploit imho.

It would be far better to have different planet types and the races only have a certain planet type as usable while you can research colonizing others in the tech tree.

This would slower colonization and expansion a bit.

You could make newer planets "cost" you resources for building buildings until a certian threshold where they start to actually produce something.

Planet population are rather like bunnys than humans and are at max far to fast. The reproduction rate should be slowered.