I found the ultimate build queue!

I found the ultimate build queue!

Classic game design, maintained to please you...

Moderator: Content Developer

Post Reply
msafwan
Posts: 38
Joined: 16 Dec 2010, 14:44

I found the ultimate build queue!

Post by msafwan »

Because of a constant defeat in DSD, I programmed an AI to search for the best move. Amazingly the best move is similar to what the Pros had adviced me to do (when I was newbie). It was 3-solar + 2-mex (or 3), and 1-vehicle factory.

Fortunately I was unable to obtain the complete ultimate build queue. Because I need a supercomputer to complete the search. The search-space is soo big: it took minutesss to search for just 2 minute of simulated 'gameplay'.

I only simulate T1 economy (solar, wind, metal maker, Janus, and constructor vehicle) and make some assumption.

Please share findings if you try it.

:)
Attachments
SpringAITest(fixed).zip
Java source-code for a simple economic AI (fixed)
(7.12 KiB) Downloaded 39 times
Last edited by msafwan on 22 May 2011, 21:29, edited 1 time in total.
gonpost
Posts: 77
Joined: 22 Oct 2008, 00:43

Re: I found the ultimate build queue!

Post by gonpost »

Awesome!

Just a few weeks ago I was considering trying to "solve" spring's economy through simulation. I quickly found out that the number of variables was huge and that it was really a very complex problem, so I didn't pursue the idea at all.

But yeah, soooo many variables. It's crazy. And yes, on DSD the best queue seems to be 3 mex, then 2 solar (1 if you get enough E shared to you), factory, then your 3rd solar.

By the way, I think the best solution to this problem would be numerical. That is, try a bunch of different possibilities through simulation, and then see which one gives you the most M/E by X minutes (where you only specificy X in the simulation).
msafwan
Posts: 38
Joined: 16 Dec 2010, 14:44

Re: I found the ultimate build queue!

Post by msafwan »

Thanks. I like that you like it. :)

Currently this simulation select build-queue that produce the most Janus. Janus is the most expensive unit I think, so if you can build Janus: then you can build others too. -Here's a sample output:

Front position start with
2 mex,
2 solar, and
1 veh factory.

Next build:
1 Wind
8 Janus
1 Wind
7 Janus
1 MetalMaker
4 Janus
1 Wind
4 Janus
1 Wind
16 Janus...

I will try your method next.
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: I found the ultimate build queue!

Post by KaiserJ »

ideally you want to be able to react and change your strategy according to what happens in the battle; not that theres anything bad about what you've put, but it won't work every time against every opponent

the real success here doesn't lie with your queue... it lies in the fact that you were able to listen to a teammate and coordinate, something that too many BA players sadly don't seem to grasp ;)

also : make some scouts first.

also : wind is not very strong on DSD
User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: I found the ultimate build queue!

Post by Gota »

Cant oyu insert some stuff before the calculation?like a situation where you already played the first 2 minutes...
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I found the ultimate build queue!

Post by knorke »

That is a very interessting problem to fiddle with.
Currently this simulation select build-queue that produce the most Janus.
The most Janus after what time?
I think that is most important, if you want the most Janus after 5 minutes you need a different buildorder then if you go for most Janus after 10 minutes.
msafwan
Posts: 38
Joined: 16 Dec 2010, 14:44

Re: I found the ultimate build queue!

Post by msafwan »

Cant oyu insert some stuff before the calculation?like a situation where you already played the first 2 minutes...
Yes you can. You can copy all the important variable from the present moment and paste it into the source-code. -The simulation will only depend on these following value:

energyLevel=561;
energyIncome=65-6;
energyMaxCapacity= 1200;
metalLevel=166;
metalIncome=5.6;
metalMaxCapacity=1200;

(total)buildSpeed=300;
hasBuildConscructor?=false;
solarCount=2;
advSolarCount=0;
windCount=0;
metalMakerCount=0;
conscVehCount=0;
janusCount=0;

But note: that the simulation didn't simulate tech 2. The reason why is because it would take too long to simulate (it check all possible combination), hence tech2 is excluded. -Imagine the possiblity of building tech2 at start, later, and in the end with the given combination of building solar, or adv solar, or/and metal maker or adv metal maker.... it would take hours...
The most Janus after what time?
I think that is most important, if you want the most Janus after 5 minutes you need a different buildorder then if you go for most Janus after 10 minutes.
This is true. We could build eco first and then spam Janus (meaning: we sacrifice immediate reward for future bounty). But the AI is inefficient for long term planning; it can do it, but it will take tremendous amount of CPU time (if it succeed then it would be the ultimate PERFECT move).

Currently the look-ahead is at 2 minute. I found it has tolerable waiting time. It can be set here:
depthCutOff=120; (120 second)
User avatar
Wombat
Posts: 3379
Joined: 15 Dec 2008, 15:53

Re: I found the ultimate build queue!

Post by Wombat »

remember that janus alone are completely useless. it usually means pushing with com. by the way u make mexes that cost 'something'. also wind give totally random E income, so... that and u forgot to include e storage which is obligatory when spamming wind.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: I found the ultimate build queue!

Post by Cheesecan »

You don't need a supercomputer you just need multi-threading.
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Re: I found the ultimate build queue!

Post by Satirik »

Cheesecan wrote:You don't need a supercomputer you just need multi-threading.
genius spoted
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: I found the ultimate build queue!

Post by knorke »

somebody go make a mission with highscore depending on built flash.
or fastet nuke tech or something.

below&above this post: bitch, please.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: I found the ultimate build queue!

Post by Cheesecan »

Satirik wrote:
Cheesecan wrote:You don't need a supercomputer you just need multi-threading.
genius spoted
Get your spelling right next time you want to call someone a fool.
msafwan
Posts: 38
Joined: 16 Dec 2010, 14:44

Re: I found the ultimate build queue!

Post by msafwan »

You don't need a supercomputer you just need multi-threading.
Okay, I did it, it boosted the speed, but still it isn't fast enough. Firstly: because I'm a newbie in multi-thread, but anyway I did it by splitting the search-tree into 2; 1 for each core and combined the result in the end of the search, but it is still not enough to completely search a 40 minutes game. -2 thread reduce the search-time by half, but the search time is too big: half isn't enough.

And I made more bug...
somebody go make a mission with highscore depending on built flash.
or fastet nuke tech or something.
This is amazing. It is like using humans to find the best move (it's like copying move from the Pros). It's like "crowdsourcing"; where you use the 'crowd' to solve a problem.



____
Attachments
SpringAITest(2thread).zip
Just in case someone wanted to use the code for other stuff.
(7.85 KiB) Downloaded 18 times
User avatar
scifi
Posts: 848
Joined: 10 May 2009, 12:27

Re: I found the ultimate build queue!

Post by scifi »

NOW these are all hacky ideas of a crazy programer, but here they are XD.

if we could have variables with the number of the human amount of scouts, or flash.

For each human flash built increment variable.

counters would be easy to make :wink:
XD
if (human_is_queingunits== 1 && repeat_on ==1)
{
if (human_scout_level > 12)
{
make_scout = 20;
attack_order = 1;
}
something like this XD

if (human_flash_level > 3)
{
make_flash = 7;
attack_order = 1;
}
}
OFC - this would have to depend on a timer that would analise how mutch time the enemy has been building flash.

OFC - this depends on a ligth cheating AI.

Now if we could have a variable that counts the number of enemy units that pass the middle of the map, reaction could be made, like simple commands, (send all units to attack ), or divide total_amount_units in half and send trou top or south to attack.

This would be interesting at best.

Also ERRORS AI sends a scout to each mex a human makes, its a very interesting practice ai to play with.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: I found the ultimate build queue!

Post by PicassoCT »

crowds are only right if they hit a problem for the first time and the agents involved dont get a chance to copy from each other.
Post Reply

Return to “Balanced Annihilation”