Page 6 of 42
Re: Shard
Posted: 02 May 2010, 20:46
by Satirik
KaiserJ wrote:time spent developing EVOrts : thousands of hours
time spent developing shard : thousands of hours
time spent watching my drunken friend get beaten by shard over and over again after talking shit about how good he was going to be at a game he hadn't yet played and AI opponents in general : priceless
i doubt that
Re: Shard
Posted: 02 May 2010, 20:50
by KaiserJ
i can see why you'd doubt it, but i really DO have a friend IRL
Re: Shard
Posted: 02 May 2010, 20:52
by AF
Hes right, I count shard dev time < 100 hours!
But yes, Satirik, go away, shooo !!!
Re: Shard
Posted: 02 May 2010, 23:51
by AF
- Added a new api.lua with a proxy object implementing game
- Added a preload folder, and moved api.lua, class.lua, and aibase.lua into it
- game:GetEnemies() now returns the enemy units in a normal lua table
Re: Shard
Posted: 10 May 2010, 13:16
by animusmontus
AF is there a source code download so I can compile on a linux system.
Re: Shard
Posted: 10 May 2010, 13:19
by slogic
AF wrote:note: No source available till post July ( academic restrictions ), currently only x86 windows builds available
Re: Shard
Posted: 13 May 2010, 08:31
by Forboding Angel
Shard makes me hard.
hurr hurr ;p
Re: Shard
Posted: 13 May 2010, 22:00
by Neddie
http://springrts.com/phpbb/viewtopic.php?f=15&t=19583
Please modify your entry or add a new one to this thread to keep track of your current AI development.
Re: Shard
Posted: 16 May 2010, 04:08
by AF
Added to game:
Code: Select all
function GetResource(idx) -- returns a Resource object
function GetResourceCount() -- return the number of resources
function GetResource(name) -- returns a Resource object, takes the name of the resource
And the resource object in question:
Code: Select all
Resource {
name,
income,
usage,
capacity, -- how much we can store (-1 for unlimited)
reserves, -- how much is stored
gameframe, -- the game frame these stats were recorded at
},
Re: Shard
Posted: 16 May 2010, 04:57
by AF
http://darkstars.co.uk/2010/shard-0-25/
Ill push out 0.26 after I've gotten feedback that it works for everyone and update the first post
Re: Shard
Posted: 16 May 2010, 11:40
by Sgt Doom
Tried out 0.25 on Battlecity V1, it played very well on BA, except for near the end where it sent it's commander straight at a pack of 30 AKs i had protecting the centre right mexes. It had radar coverage, and had encountered that little pack before, so i'm confident it knew they were there. The opposing team had the upper hand, they were slowly pushing me and my ally back, yet it decided to do something rather silly like that.
Might this have something to do with me running the multithreaded exe? I've heard a lot of things behave oddly with it, which is a shame because I need the extra core for the game to run smoother with larger numbers of AIs.
EDIT: On CorePrime_revision1, the opposing team of Shard AIs at the bottom of the map simply built one solar collector, then sent their commanders straight towards me and my allies.
Probably not the AI's fault entirely, every AI i've tried behaves oddly on that map, which is a damn shame.
Re: Shard
Posted: 16 May 2010, 19:41
by AF
coreprime revision1 is a metal map no? There is a horrible flaw in krogothes metal spot detection algorithm. When I pointed it out it was ignored. Instead every single AI in this community has inherited that algorithm, and thus, that flaw.
The flaw involves scales of values. Krogothes algorithm looks and see 255 as max metal, and 0 as minimum metal. It then filters out everything below a threshold. The problem with this is that on some metal maps, areas have been added with extra metal. As a result, only these areas show up as extraction spots, and normal areas are ignored.
The fix for this, is not to base the minimum value on a value between 0-255, but on a minimum amount of actual metal extracted, in order to figure out the correct threshold to filter out. e.g. any spot which yields more than 0.6 metal.
Also Shard at the moment has no code to identify threats to the commander and retreat. Nobody has written any code for that yet.
Re: Shard
Posted: 16 May 2010, 20:18
by Sgt Doom
Most of that went right over my head but ok D:
'tis a fun AI nonetheless
Re: Shard
Posted: 17 May 2010, 15:32
by slogic
How Lua coder is supposed to make CanAttack(unit) function? Is it possible to introduce basic tags common for all mods like: mobile, static, military (has weapons), air, land, naval, underwater, amphibious etc. and use them as filters in extended versions of GetEnemies(), GetFriendlies()? That would greatly simplify coding behaviours. Hm, also unit.CanReach(position) is important function which is absent.
Is it normal in Lua?
Code: Select all
function IsAttacker(unit)
for i,name in ipairs(attackerlist) do
if name == unit:Internal():Name() then
return true
end
end
return false
end
attackerlist is a hash table. Why not to access a reversed table (keys <=> values) or specify another standard of describing attackerlist.lua, so unit names are keys? Searching would be much faster and as i understand IsAttacker() can be called too often. Also you will automatically kill unnecessary duplicates in attackerlist.
Re: Shard
Posted: 18 May 2010, 15:14
by SkyStar
Each time I play this with CA or Evo I crash. So i picked this out of the infolog:
Code: Select all
[ 0] <SkirmishAI: Shard (team 1)>: ...ring\AI\Skirmish\Shard\0.25\ai\EvoRTS\behaviours.lua:1: attempt to index global 'ai' (a nil value)
stack traceback:
[C]: ?
[C]: ?
...ring\AI\Skirmish\Shard\0.25\ai\EvoRTS\behaviours.lua:1: in main chunk
[C]: in function 'require'
...pring\AI\Skirmish\Shard\0.25\ai\behaviourfactory.lua:3: in main chunk
[C]: in function 'require'
D:\Spring\AI\Skirmish\Shard\0.25\ai\ai.lua:4: in main chunk
[ 0] SkirmishAI (with team ID = 1): Cheating enabled!
[ 0] ResourceMapAnalyzer by Krogothe, initialized for resource 0(Metal)
Re: Shard
Posted: 18 May 2010, 23:21
by AF
I dont have much time on here.
Because attackers.lua is obsoleted by not bothering and instead defining AttackerBehaviour in the behaviours.lua, a change I will be enforcing sooner rather than later, and a far more optimal and consistent mechanism if I do say.
I'll also look into the CA/Evo problems when I get back home later this week.
Also, Im aware there are things that could be useful in the API but havent been added yet, I'm adding things as I go along, and there are things I plan to add soon I just haven't gotten around to, such as changing retrieval of spots to use the tables like I did with enemies, and adding support for retrieving a units resource usage/generation, for which the code in the binary is half written, hence why the callbacks where not added or documented in the 0.25 release in the ResourceUsage object.
Re: Shard
Posted: 19 May 2010, 12:45
by Lagg
SkyStar wrote:Each time I play this with CA or Evo I crash. So i picked this out of the infolog:
Code: Select all
[ 0] <SkirmishAI: Shard (team 1)>: ...ring\AI\Skirmish\Shard\0.25\ai\EvoRTS\behaviours.lua:1: attempt to index global 'ai' (a nil value)
stack traceback:
[C]: ?
[C]: ?
...ring\AI\Skirmish\Shard\0.25\ai\EvoRTS\behaviours.lua:1: in main chunk
[C]: in function 'require'
...pring\AI\Skirmish\Shard\0.25\ai\behaviourfactory.lua:3: in main chunk
[C]: in function 'require'
D:\Spring\AI\Skirmish\Shard\0.25\ai\ai.lua:4: in main chunk
[ 0] SkirmishAI (with team ID = 1): Cheating enabled!
[ 0] ResourceMapAnalyzer by Krogothe, initialized for resource 0(Metal)
I have the same problem when trying to run it on EvoRTS 440. And I wan't to run Shard against Al Ice and see how it goes! :D
Re: Shard
Posted: 23 May 2010, 10:19
by Forboding Angel
Same issues here
Re: Shard
Posted: 23 May 2010, 14:08
by AF
It is fixed in my personal builds. Overrides in CA and EvoRTS still used the old mechanism of ai:ExecuteGameFile() to load other lua files, which didn't work because they were themselves loaded using the lua 'require' method.
Replacing the lines fixed it.
Re: Shard
Posted: 24 May 2010, 02:40
by AF
Considering the dev meeting minutes thread, whatever happens, future updates can always be found at my site
http://www.darkstars.co.uk either in the Shard category or on the frontpage
http://darkstars.co.uk/blog/category/ai/shard/
Blogposts about Shard are also redistributed on
http://www.evolutionrts.info and
http://www.springinfo.info