Author Topic: AI/Balancing Strategies and Debate  (Read 3428 times)

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
AI/Balancing Strategies and Debate
« on: 10 April 2011, 08:15:36 »
What we really need is a tool that does a simple "if you have 2 factions, and this much time, who wins?" Doing a monte carlo sim.  Useful for balance within existing mods, useful for the idea of a scifi tree for all.

(Simple as in inexact, not simple as in trivial to implement.  I imagine it actually being easiest accomplished by a headless ai-only game played as fast as possible and recording the results of a few gazillion such games.  This is as inexact as the ai is bad.  Hmm, bonus is helpful in developing more human-feeling ai?)

To my mind, different resource structures are compatible.  It is all about hp at any particular part of a timeline.
« Last Edit: 10 April 2011, 08:21:54 by will »

Mr War

  • Guest
AI/Balancing Strategies and Debate
« Reply #1 on: 10 April 2011, 08:20:50 »
monte carlo? I'm not building that sir, that's a lot of effort

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
AI/Balancing Strategies and Debate
« Reply #2 on: 12 April 2011, 04:07:34 »
Just do a few random games with different settings each time. That's basically the Glest equivalent.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Psychedelic_hands

  • Guest
AI/Balancing Strategies and Debate
« Reply #3 on: 12 April 2011, 05:59:15 »
What we really need is a tool that does a simple "if you have 2 factions, and this much time, who wins?" Doing a monte carlo sim.  Useful for balance within existing mods, useful for the idea of a scifi tree for all.

(Simple as in inexact, not simple as in trivial to implement.  I imagine it actually being easiest accomplished by a headless ai-only game played as fast as possible and recording the results of a few gazillion such games.  This is as inexact as the ai is bad.  Hmm, bonus is helpful in developing more human-feeling ai?)

To my mind, different resource structures are compatible.  It is all about hp at any particular part of a timeline.

That would all be pointless in a multiplayer match, the AI could play the faction in a terrible way when really with a Human playing it could be far over powered. The best thing is just play test, play test, play test.

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
AI/Balancing Strategies and Debate
« Reply #4 on: 12 April 2011, 06:04:53 »
That would all be pointless in a multiplayer match

What we really need is a tool that does a simple "if you have 2 factions, and this much time, who wins?" Doing a monte carlo sim.
...
This is as inexact as the ai is bad.

1) players are not balanced either.  You winning 100% against me does not mean your choice of side is more powerful than mine, it means you are cleverer than me.

2) we want to improve AI and this is both a quantitative and qualitative help with that too.

Psychedelic_hands

  • Guest
AI/Balancing Strategies and Debate
« Reply #5 on: 12 April 2011, 06:12:55 »
That's why you play test with lots of different people. It's usually obvious when something needs to be toned down.
But opinions from a playtester will be more valuable than a computerised test.
Really, balance is quite subjectiveas long as the game is still fun I consider it balanced!  :thumbup:

Something maybe that could be useful is a program the pits X amount of  YZ units together in a fight, and you get to watch what happens.
« Last Edit: 12 April 2011, 06:28:09 by Psychedelic_hands »

Zoythrus

  • Guest
AI/Balancing Strategies and Debate
« Reply #6 on: 12 April 2011, 06:18:12 »
Something maybe that could be useful is a program the pits X amount of  Y units together in a fight, and you get to watch what happens.
have you heard of this? https://forum.megaglest.org/index.php?topic=6254.0

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: AI/Balancing Strategies and Debate
« Reply #7 on: 12 April 2011, 07:04:39 »
For now, the best and technically the only way to balance techtrees or mods well would be to just play/test multiplayer, it's usually very effective. Besides, both of the teams have enough on their hands...

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: AI/Balancing Strategies and Debate
« Reply #8 on: 12 April 2011, 07:20:01 »
Test in multiplayer for loopholes, then in AI vs AI to make sure the AI can handle it.
Egypt Remastered!

Proof: Owner of glest@mail.com

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: AI/Balancing Strategies and Debate
« Reply #9 on: 12 April 2011, 07:26:53 »
Well, that's somewhat true,although I think it would be somewhat boring in observer mode. Usually during multiplayer, if there are any obvious issues it's seen, but I guess for more specific/thorough testing observer mode would be better.

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: AI/Balancing Strategies and Debate
« Reply #10 on: 12 April 2011, 07:34:18 »
Making the game headless (and running as fast as possible) would make it possible to run the "AI-only arena" much faster and more often, with results recorded for study.  A timeline of unit births and deaths would help too.

Yes player games are the very best way to decide balance.  But players are a rare commodity and we have as few of them as we do developers ;)

AI-only games will give valuable quantity to any attempt at balancing.

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: AI/Balancing Strategies and Debate
« Reply #11 on: 12 April 2011, 08:31:25 »
Those of us who have made mods, or are mod developers, know that the AI testing determines the main balance, while the player testing(even if it's not multiplayer) is to make sure the mod isn't too hard for a person to play or too easy(loopholes), such as the battle-machine spam in tech.

You need a mod to be playable by people and AI, you need it to be balanced AI vs AI, AI vs Human, and Human vs Human. The AI uses mathematics, while the Human player uses intelligence. You have to have mathematical balance, and you have to make sure that you seal up loopholes, so that Human players don't exploit them and ruin the mathematical balance. Some one person may think that a unit is too weak, but that's generally meaningless unless a group agrees, because their problem could be a result of their play-style.

Anyway, I sound like a doctor(Dr.Arch)....and I'm gonna head to bed.
Egypt Remastered!

Proof: Owner of glest@mail.com

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: AI/Balancing Strategies and Debate
« Reply #12 on: 12 April 2011, 08:34:17 »
Is the idea to have something automated to test or a half automated way?

When I start to balance things I do the following:
1) Set speedloops in glestuser.ini to something high :)
2) Setup a 1 on 1 game in map conflict for the cpus techs to test and add you as a observer
 ( It turned out that the map conflict is very good to do this )
3) Watch them play and speedup things if needed ( which will be very fast if you set speedloops to 10 for example )

After this kind of balance its like Archmage says: You have to play with humans ....

Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: AI/Balancing Strategies and Debate
« Reply #13 on: 12 April 2011, 08:39:27 »
So titi, if it ran in a loop - after one side wins, it starts a new game with the same settings - and it wrote the scores (and perhaps unit birth and death timelines) to a log file...

sure its nice if its 'headless', but if its manual to run but you don't have to watch it, then you can leave it running all night...

Mr War

  • Guest
Re: AI/Balancing Strategies and Debate
« Reply #14 on: 12 April 2011, 09:10:40 »
I have been working on balancing maths based on comparing two units

I could build a lightweight Monte Carlo macro in excel but would have to install open office or something

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: AI/Balancing Strategies and Debate
« Reply #15 on: 12 April 2011, 11:35:14 »
@will: If you let it play one game, the next game will be played exactly the same way( at least in MG ) because the randoms are calculated....
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: AI/Balancing Strategies and Debate
« Reply #16 on: 12 April 2011, 11:37:02 »
so who ever adds the code to record the outcome and restart will have to generate a new seed.  Seems insurmountable ;)

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: AI/Balancing Strategies and Debate
« Reply #17 on: 12 April 2011, 13:12:03 »
@will: If you let it play one game, the next game will be played exactly the same way( at least in MG ) because the randoms are calculated....

I've seen this its quite strange. IS there any better way to calculate random like using system clock?
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: AI/Balancing Strategies and Debate
« Reply #18 on: 12 April 2011, 15:26:44 »
@will: If you let it play one game, the next game will be played exactly the same way( at least in MG ) because the randoms are calculated....

I've seen this its quite strange. IS there any better way to calculate random like using system clock?
It could easily be changed to use a different seed every game. As it is, though, it keeps the same seed through the session.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: AI/Balancing Strategies and Debate
« Reply #19 on: 12 April 2011, 21:56:58 »
Those of us who have made mods, or are mod developers, know that the AI testing determines the main balance, while the player testing(even if it's not multiplayer) is to make sure the mod isn't too hard for a person to play or too easy(loopholes), such as the battle-machine spam in tech.
Yep, that's mostly true...although most of the time, as I said,  for obvious/semi-obvious player testing is fine too. This comes from a tester of engines, games, and mods. :P
(click to show/hide)

On a related note, it seems if you have a pack of factions which all have an air unit, and one doesn't...it's hard to balance. Just is currently how it is with the Romans faction...  :-X


-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: AI/Balancing Strategies and Debate
« Reply #20 on: 13 April 2011, 01:44:48 »
Those of us who have made mods, or are mod developers, know that the AI testing determines the main balance, while the player testing(even if it's not multiplayer) is to make sure the mod isn't too hard for a person to play or too easy(loopholes), such as the battle-machine spam in tech.
Yep, that's mostly true...although most of the time, as I said,  for obvious/semi-obvious player testing is fine too. This comes from a tester of engines, games, and mods. :P
Without some AI to AI testing you can't really lock down mathematical balance.

Quote
Good analysis, doctor. (Well, archmage=magician=somewhat of a doctor)
>:(
Egypt Remastered!

Proof: Owner of glest@mail.com

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: AI/Balancing Strategies and Debate
« Reply #21 on: 13 April 2011, 04:17:55 »
The fault of AI to AI testing is that Humans have the ability to plan and understand things such as exploits while AI just does what its programed to do. For example you have a Tank unit that can spawn infantry that carry C-4 explosives. The AI will simply follow whats its coded to do for example to drive near enemy units and unload. A human player could try to bring apc right next to hq and spawn anti structure units constantly from the heart of another player base, or constantly spawn infantry right next to a resource patch, and player would know that this is so effective that he would only need to build just 3 of these tanks and nothing more. The ai will build in glest case based on random. So player has many benefits as well.
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

ultifd

  • Airship
  • ********
  • Posts: 4,443
  • The Glest Video Guy :) The one and only. :P
    • View Profile
    • My Youtube Channel
Re: AI/Balancing Strategies and Debate
« Reply #22 on: 13 April 2011, 04:39:26 »
Without some AI to AI testing you can't really lock down mathematical balance.
For "advanced" units, yes, but for normal or simple units it's usually it's not to hard to balance it out.

The fault of AI to AI testing is that Humans have the ability to plan and understand things such as exploits while AI just does what its programed to do. For example you have a Tank unit that can spawn infantry that carry C-4 explosives. The AI will simply follow whats its coded to do for example to drive near enemy units and unload. A human player could try to bring apc right next to hq and spawn anti structure units constantly from the heart of another player base, or constantly spawn infantry right next to a resource patch, and player would know that this is so effective that he would only need to build just 3 of these tanks and nothing more. The ai will build in glest case based on random. So player has many benefits as well.
Yep, both have it's own benefits. Though with player testing you can have fun too.

Gabbe

  • Guest
Re: AI/Balancing Strategies and Debate
« Reply #23 on: 15 April 2011, 20:07:28 »
Something like AI vs AI, speed up and let it use the whole processor. Then when it has completed about 100 matches, it gives you a log file wich contains win loss ratio for the factions?

Mr War

  • Guest
Re: AI/Balancing Strategies and Debate
« Reply #24 on: 16 April 2011, 18:20:45 »
If people want to do this type of modeling as a separate tool, like in excel, Olaus has some cool tools to extract info from xmls