Author Topic: SupCom 2 AI !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (!!!!!!!)  (Read 7815 times)

Offline Spikey00

  • Lord of just 5 Colony Ships
  • Master Member Mark II
  • *****
  • Posts: 1,704
  • And he sayeth to sea worm, thou shalt wriggle
It's being worked on by both Sorian and a separate mod at the moment (I thought modding tools aren't available)!  ZOMG!

http://soriandev.blogspot.com/

Quote
I didn’t realize how much I missed working on AI until I started working on it again. So far I think I have been able to make a vast improvement in how the AI plays. I want to thank everyone that posted feedback, it was very helpful. I will have to check the list again, but I am fairly certain I have fixed or at least improved upon all of the relevant issues. The change list for the AI so far is longer than any version of the AI I released for SupCom 1 or FA. Before I post highlights there are some things you need to know.

First, you need to realize that some of these fixes may not make it in right away, if at all. They still have to be tested to make sure I am not epically breaking anything. Second, I still do not know when these fixes are going to be patched it, so don’t get upset if they aren’t in the next patch, or even the one after that. There are a lot of fixes spanning many files, so in the interest of keeping patch sizes down it may be delayed until we can include it without killing everyone’s bandwidth.

Probably the biggest bug was the fact that threat conditions were not being used properly. Threat conditions are what we use to tell the AI to do something in reaction to a threat, such as building AA when an enemy has air units. Not only is this fixed, but the AI is using the threat value of its currently targeted enemy to determine how big of a platoon to send and how many experimentals it needs to have built before sending them out.

The AI also takes into account build restrictions when choosing which archetype to use. It also recognizes when it has all research, so it won’t waste mass on research stations when it does not have to. Also, the AI should no longer get stuck if you rush it and destroy something while it was in the middle of its starting build. If you restrict a unit type in the game the AI now acts like that unit doesn’t even exist in the game. Don’t want nukes in the game? The AI won’t even have the option of giving one of its engineers the order to build one.

Most of Thursday, Friday, and Monday the 22nd was spent fixing little bugs like the above. Tuesday and Wednesday were spent balancing and getting the AI focused. The biggest challenge was the AI’s economy.

The AI uses a bucket system for its economy. When the AI gets resources it puts a set percentage in each of its buckets (defense, expansion, experimentals, land units, etc) and it puts any excess resources in a slush bucket. When the AI wants to build something, it checks the appropriate bucket to see if the resources are available. For immediate items (like emergency shields or economy related stuff) we tell the AI to use from all the buckets. The problem with that is the AI ends up taking from the same buckets over and over. Later in the game, when expansion is harder, the expansion buckets ends up getting filled and never used, so the AI ends up in a situation where it has a lot of mass, but can’t build.

My solution was to make the AI take resources from the slush bucket first when taking from all buckets. Then, I sort the buckets from fullest to emptiest and take an amount from each bucket based on how full it is until we have enough or run out of buckets. If the first pass doesn’t get enough we re-sort and take all the resources from each bucket until we have enough. This way, full buckets that aren’t being used much are the first to get resources taken away and the AI has a much smoother economy.

I also worked to get the AI to focus a lot more. The AI would constantly send units, that were doing hefty amounts of damage to an enemy base, across the map to kill and few units that had the audacity to get near of its expansion bases. It also didn’t focus its attacks on its targeted enemy very well either. It took a lot of trial and error, but I think I have it dialed in a lot better.

Another nice upgrade is that the AI will now use the Mass Convertor. Prior to this the AI would never build one. Now, the AI will build one (it only needs one) or, in the case of Cybran, use the ability of one of its power generators.

I am still working out the cheating situation. Some people complain that the Hard AI cheats too much and the Cheating AI cheats way too much. Currently, I have asked a few people in the office of different skill levels to try out the new changes and see what they think.

Now, as with the last post, I have a request. I would like some ideas on research paths. I plan on going over them again and trying to optimize them and wanted ideas on what paths players use. I don’t need an exact path, per se, because I have a function I use in the AI that finds the cheapest path to get to a particular research. What I need is what research item you go for first, second, third, etc. If you are going air, do you get gunships first? Shields? Or, do you go for the experimentals? Let me know.

For those of you who want a tl;dr list of the AI fixes, here you go. Bear in mind, this list is not exhaustive, so don’t get upset if you pet fix is not listed. This is also not a guarantee that they will show up in any patch, let alone a patch that is released soon.

    * Fixed a bug where threat build conditions were not being used.
    * The AI will hold back units until it thinks it has enough to make a push.
    * Fixed an issue where the AI would constantly pull units back to attack an expansion base instead of pushing forward.
    * Added AI response to make a land AI get land unit AA upgrades if the enemy has air units.
    * The AI will no longer get stuck in its startup build sequence if rushed or if there are build restrictions in place.
    * The AI will no longer give every structure blip AA and Land threat; instead it will wait until it has seen the unit first.
    * The AI will no longer give blips on the water Naval threat, it will wait until it sees an actual ship.
    * If Research is disabled the AI will not build research facilities.
    * If a unit type is restricted the AI will act as though the unit does not exist in the game.
    * Platoons will try to only attack areas where they think they can do enough damage before dying.
    * The AI should no longer attempt to send attack platoons to unpathable areas.
    * The AI will choose an appropriate archetype based on unit restrictions.
    * Re-balanced the way the AI chooses an archetype.
    * The AI will react to enemy TML, artillery, or Experimentals by building more shields and placing them closer together.
    * Enemy shields are now given AntiLand and AntiAir threat.
    * AI will build and use Mass Convertors.
    * If the closest enemy to the AI is a lot weaker than the other enemies the AI will focus on the weak enemy.
    * You can now select which AI type you would like to play against from the dropdown in the game lobby (random is still an option).
    * AI will build factory shield upgrades more often, not just when the enemy has air.
    * Factory upgrades now have a threat value.
    * AI will not build research stations if it already has everything researched.
    * AI will now group units based on their target enemy's threat.
    * AI will now group experimentals based on their target enemy's threat.

Edit:
The last few changes are in for this round, unless something pops up in testing.

    * The AI is now aware of the victory condition and will focus attacks on the ACU more in assassination mode.
    * When an AI unit dies it will add threat to the instigator's location to warn other units.
    * AI will respond when an enemy turtles.
    * AI will now recognize when it is being attacked by nukes or artillery and respond.

ZOMG!  HERE'S THE MOD THAT WILL SERVE AS A TEMPORARY BUFFER UNTIL THE REAL AI IS DONE!!

http://forums.gaspowered.com/viewtopic.php?f=30&t=44299

Quote
v004 is out now, two separate downloads, one with cheats enabled and one without.
The cheats enabled one has
+35% mass and +15% build speed
I have finished UEF, Cybran and Illuminate Land AI, so you can play any race you want, just try to keep it to land!

http://ai-machater.googlecode.com/files/Mach_AI_v004_no_cheat.rar

I also now included a mod for increased unit limit up to 5000 units per player! The game can actually handle 4000 units on the screen pretty well, Forged Alliance certainly could not have!

To use this mod you will have to edit your game.prefs.
The same way you were before able to raise the limit from 500 to 1000 this way, now you can manually enter 500, 1000, 1500 or 5000 and the game will use those settings.




This mod will replace current AI in the skirmish lobby. Previously the game would choose which of its many AI to use based on map information unless turtle was picked. Now all AI are individually selectable. HOWEVER, because the UI is not very mod friendly right now(.bdf files) the total # of AIs available can't be changed.

Easy, normal and hard AIs have all been removed. All AI's cheat, but the cheat options are different from the original cheating SC2 AI.
Cheat Ai build speed has been reduced significantly, added in resource cheating.

Included is also theshadowlord's awesome console mod and debug options. The debug options were "created" by me but are nearly identical.


As this is such an early attempt to tweak the AI I won't bother listing off all the changes made because tomorrow I may release something totally different.

--------------------------------------------
IMPORTANT INFORMATION
-Backup your bp.scd and lua.scd
-This is not multiplayer compatible, you will need to put the original files back to go online.
-Replace bp.scd and lua.scd with files of the same name inside the .rar file from download link(at bottom of post).
- AI is being developed using 1000 unit limit for now, I don't suspect any problems using 500 unit limits but you never know.
-Set AI to "Land"
-Non Land AI will also work but I haven't touched them other than general tweaks that affect all AI
-Naval AI is broken...or was never finished
-Currently the AI is best for Land vs Land fights
-It probably has tons of bugs and other things I broke
-Feedback is much appreciated


Further releases will be here(yes I'm copying Sorian, got so used to looking at google code downloading his AIs)

http://code.google.com/p/ai-machater/


I am going to go straight home after school and try out this new AI, even if it's land only.  Suddenly my fanaticism for SC2 is back up to normal levels (unless I'm still left disappointed but I doubt it)!

EEEEKK!
I'd take a sea worm any time over a hundred emotionless spinning carriers.
irc.appliedirc.com / #aiwar
AI War Facebook
AI War Steam Group

Offline Spikey00

  • Lord of just 5 Colony Ships
  • Master Member Mark II
  • *****
  • Posts: 1,704
  • And he sayeth to sea worm, thou shalt wriggle
Now that I have actually seen this new AI mod myself, I can say that it is much improved than in comparison with the stock SC2 AI.  I was impressed when I saw how much Machater [and Sorian] had fixed:  it now expands properly and effectively, it creates some fantastic forces comparable to the wondrous battles of SC and FA, and I believe it techs more appropriately.  Seems like it's doing everything I want it to be, as a satisfactory AI opponent.  Heh, seeing more than three-four factories was wonderful!

Only few problems I noted was that it lags now even with three AIs (understandable with the amount of units it uses), and that it occasionally has some enemy mass guarding issues (ie. one AI just camped at a mass point with at least a hundred units at a time), though that was the only instance I saw it doing that. 


Heck, I'm back into SC2 (at least for a while before X3 tractors me)!
I'd take a sea worm any time over a hundred emotionless spinning carriers.
irc.appliedirc.com / #aiwar
AI War Facebook
AI War Steam Group

Offline eRe4s3r

  • Core Member Mark II
  • *****
  • Posts: 2,825
It's still broken because the maps are too small, unless you give the AI room to play with you can rush and finish any AI within 10 minutes. You only get to see large forces if you let it go unchallenged for some time. Or if you play 2 v 1 you might actually get 1 ai to reach tier 2 units and see "large" battles. In supcom 2 terms that means, small skirmishes of at most 150 units.

If the maps were 5 times as large as they are now, the ai would be dominating. But as it is - even the largest maps can be traversed within 2 minutes or so.

Edit: i am talking about non-cheating ai on hard.
« Last Edit: April 10, 2010, 10:28:42 am by eRe4s3r »
Proud member of the Initiative for Bigger Weapons EV. - Bringer of Additive Blended Doom - Vote for Lore, get free cookie

Offline Spikey00

  • Lord of just 5 Colony Ships
  • Master Member Mark II
  • *****
  • Posts: 1,704
  • And he sayeth to sea worm, thou shalt wriggle
Of course, though I obviously offer it plenty of room for it to become a challenge.  Though it's definitely an improvement that I can see, whereas the original AI can be beat in a few minutes or any time late game, which was the problem.

I can say I'm pleased with the progress being made on the AI by this mod.
I'd take a sea worm any time over a hundred emotionless spinning carriers.
irc.appliedirc.com / #aiwar
AI War Facebook
AI War Steam Group

Offline eRe4s3r

  • Core Member Mark II
  • *****
  • Posts: 2,825
Yeah but, if i play skirmish my goal is not nice battles but to win. And i usually win faster than i want. This is not a problem i USUALLY have with rts games, more like the opposite.

But that said, i've been playing Distant Worlds recently and gotta say, its a butt ugly but awesome 4x game.

It doesn't have ANYWHERE near the graphical quality as AI war though. So this makes me proud ;P
« Last Edit: April 10, 2010, 03:00:08 pm by eRe4s3r »
Proud member of the Initiative for Bigger Weapons EV. - Bringer of Additive Blended Doom - Vote for Lore, get free cookie

Offline Lancefighter

  • Core Member
  • *****
  • Posts: 2,440
Yeah but, if i play skirmish my goal is not nice battles but to win. And i usually win faster than i want. This is not a problem i USUALLY have with rts games, more like the opposite.

But that said, i've been playing Distant Worlds recently and gotta say, its a butt ugly but awesome 4x game.

It doesn't have ANYWHERE near the graphical quality as AI war though. So this makes me proud ;P
Now that was wierd. I come to these forums, figure id read a topic before posting one, and..
Someone else has already mentioned Distant worlds. In the one thread I decided to read even...

Ideas? Suggestions? Concerns? Bugs to be squashed? Report them on the Mantis Bugtracker!

Author of the Dyson Project and the Spire Gambit

Offline Spikey00

  • Lord of just 5 Colony Ships
  • Master Member Mark II
  • *****
  • Posts: 1,704
  • And he sayeth to sea worm, thou shalt wriggle
Let's say I have a switch for playing competitive and playing leisurely (though I do dislike when you're forced into the whole leisure type of "nice battles" all the time).

Obviously if you want to win outright, then just ACU rush the AI, or well, anything.
I'd take a sea worm any time over a hundred emotionless spinning carriers.
irc.appliedirc.com / #aiwar
AI War Facebook
AI War Steam Group

Offline EaglePryde

  • Newbie Mark II
  • *
  • Posts: 17
I'm helping out with a balance mod that is in the works that strongly focuses to make SC2 as fun as it was in SC/FA...Experimentals are tough like in SC/FA. You should visit the GPG Forum and give it a try.

If fully finished we will remodell the AI to put the balance mod to good use. So far it is proceeding very well.

SC2 is moddable in many ways thou it consumes more time to do so because it isn't fully supported like in SC/FA. Most game mechanics can be changed and things added. Only Problem is a bit with map making.