genetic algorithm on shard - Page 2

genetic algorithm on shard

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

User avatar
prandipadaro
Posts: 98
Joined: 19 Oct 2011, 22:38

Re: genetic algorithm on shard

Post by prandipadaro »

sorry i have 2 engine installed 96 and 98 but if i launch with:
spring-headless /home/p/.spring/engine/98.0/script.txt
the problem is the same,

it is as if spring would use only the version 96, how can I tell it to use the 98?
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: genetic algorithm on shard

Post by abma »

start with
/home/p/.spring/engine/98.0/spring-headless /home/p/.spring/engine/98.0/script.txt
and maybe uninstall the system installed spring to avoid confusion. (sth. like apt-get remove spring). you can't do that if springlobby gets uninstalled, too. this dependency was hopefully removed in newer versions of springlobby by package maintainers.
User avatar
prandipadaro
Posts: 98
Joined: 19 Oct 2011, 22:38

Re: genetic algorithm on shard

Post by prandipadaro »

just reinstalled all, so spring and spring-headless works fine!!!!! thanks.
only some trouble with springlobby 217 but maibe is not very important.
abma great
I will continue tomorrow
User avatar
prandipadaro
Posts: 98
Joined: 19 Oct 2011, 22:38

Re: genetic algorithm on shard

Post by prandipadaro »

Even if I did not say anything, the work continued.
An unstable and sloppy versionof a script that looks like a genetic algorithm is almost ready.
At this point I would need a pair of little help:

The thing that interests me most now is the chance to re-start a battle through
spring-headles path/to/script.txt
soon as the previous battle has ended. This is essential to be able to simulate an indefinite number of generations.
i need suggestion and help to make this.

Another point, a bit 'less essential:
I started to pull constants most interesting from files in Shard/dev/ai/BA in order to start working on it. If someone with a little knowledge about shard is able to give accurate information about what are the constants that have greater sense optimizing it could be me to help mainsails
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: genetic algorithm on shard

Post by AF »

To which constants are you referring?
User avatar
prandipadaro
Posts: 98
Joined: 19 Oct 2011, 22:38

Re: genetic algorithm on shard

Post by prandipadaro »

for now i have used some constants in AI/Skirmish/Shard/dev/ai/BA/
in the file file: taskqueuebehaviour.lua for example
in the formula at line 19:

Code: Select all

local enoughMetalReserves = math.min(ai.Metal.income, ai.Metal.capacity * var._enoughMetalReserves_)
the variable

Code: Select all

var._enoughMetalReserves_
is in another file and i go to optimize it

in the file: unitlists.lua

Code: Select all

-- for calculating what factories to build
-- higher values mean more effecient
mobilityEffeciencyMultiplier = {
	veh = var.q_veh,
	shp = var.q_shp,
	bot = var.q_bot,
	sub = var.q_sub,
	hov = var.q_hov,
	amp = var.q_amp,
	air = var.q_air,
}

-- for calculating what factories to build
-- higher values mean slower
mobilitySlowMultiplier = {
	veh = var.w_veh,
	shp = var.w_shp,
	sub = var.w_sub,
	bot = var.w_bot,
	hov = var.w_hov,
	amp = var.w_amp,
	air = var.w_air,
}


and i can show you other example
to start my project can do these few things.
To obtain a good result would need to work on significant constants and in a good number.
Post Reply

Return to “AI”