Shard 0.4/dev - Page 14

Shard 0.4/dev

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

Moderators: hoijui, Moderators

User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Shard

Post by hoijui »

yeah... it means that linux (and mac) packagers will include this AI, if they do not take special messures not to. it still will not be in the windows installer. that would need some (small) changes still, but is not planned, and not wanted by AF.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF »

Abma made a special request, in the past I've been horribly burnt by the decision to include NTai in the engine installer, which I don't wish to repeat.

That issue however does not apply to OSX and Linux, so I gave permission and Abma set to work.

*Hands a cookie to Abma*
asdf
Posts: 11
Joined: 05 Apr 2011, 01:51

Re: Shard

Post by asdf »

hoijui wrote:there is no independent build file for Shard on linux, so you have to compile it through/with spring.

for the current release version of spring:
get the spring sources, unpack them, then:

Code: Select all

wget http://sourceforge.net/projects/springrts/files/springrts/spring-0.82.7.1/spring_0.82.7.1_src.tar.gz/download
tar xfvz spring_0.82.7.1_src.tar.gz
cd spring_0.82.7.1
cd AI/Skirmish
git clone git://github.com/Tarendai/Shard.git
cd ../..
cmake .
for the last part onwards (cmake .), see:
http://springrts.com/wiki/Building_Spring_on_Linux
After "cmake ." I went to the Shard folder and ran "make", and put the Skirmish folder into spring's AI folder.
I then used Shard with Zero-k and a KP map(so it would load faster)
, but it crashed.
The end of the logfile says

Code: Select all


<SkirmishAI: Shard dev (team 0)>: error loading module 'taskqueues' from file '/home/luca/.spring/AI/Skirmish/Shard/data/ai/taskqueues.lua':
	/home/luca/.spring/AI/Skirmish/Shard/data/ai/taskqueues.lua:46: unexpected symbol near '{'
stack traceback:
	[C]: ?
	[C]: ?
	[C]: ?
	[C]: in function 'require'
	...uca/.spring/AI/Skirmish/Shard/data/ai/behaviours.lua:2: in main chunk
	[C]: in function 'require'
	...pring/AI/Skirmish/Shard/data/ai/behaviourfactory.lua:4: in main chunk
	[C]: in function 'require'
	/home/luca/.spring/AI/Skirmish/Shard/data/ai/ai.lua:2: in main chunk
[f=0000000] SkirmishAI (teamID 0) is using cheat callbacks
[f=0000000] ResourceMapAnalyzer by Krogothe, initialized for resource 0(Metal)
I'm using LMDE 64-bit.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF »

Hmmm are you using the pure int branch? There's a syntax error in some lua files abma made me aware of in that branch, but because hoijui created that branch I've kind of left it alone until such a day as the pure int API is in the release version of the engine

Anyways, double check that all the lua files shard has are copied over correctly, I can't vouch for the accuracy/completeness of cmake since I use visual studio
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Shard

Post by hoijui »

if he did use the commands i showed him (and i would guess he did) he is using master branch.
asdf
Posts: 11
Joined: 05 Apr 2011, 01:51

Re: Shard

Post by asdf »

I deleted the Shard folder which was used and copied the original Shard folder. And yes, I did use those commands.
If it matters, I only compiled Shard, not Spring.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Shard

Post by hoijui »

i never heard of anyone doing that, and i dont know if that is supposed to work even. try using the root makefile maybe.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF »

typos were corrected recently in the git repo, try checking shard out again and tell us if it fixes the issue.

What your logs suggest is that its not a problem with Shards C++ component, it's the lua component, the problem abma prodded me about that got fixed would be a prime candidate for causing this kind of error
asdf
Posts: 11
Joined: 05 Apr 2011, 01:51

Re: Shard

Post by asdf »

It works now.
Although the Spring I compiled was very slow compared to the one installed through Synaptic. Even after reinstalling the Spring from the repository, it was still slow, so now I'm trying to completely remove all spring/springlobby files, so I can install the package.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Shard

Post by hoijui »

the slowness comes from it being compiled as DEBUG by default. future releases will be using RELEASEWITHDEBUGINFO (or something like that).
you could use cmake -DCMAKE_BUILD_TYPE=RELEASE . to get it faster.
asdf
Posts: 11
Joined: 05 Apr 2011, 01:51

Re: Shard

Post by asdf »

Thank you for all your help.
I tried again with my old kernel, and it was playable again.
It was slow only when I used the custom kernel which(ironically) I built so spring would be faster. :P
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF »

I've fixed an issue raised by abma, and updated the VS project to support VS2010.

I've had ideas about building placement, and I've pulled back on my gadget<->AI code so that I can test it further and reintroduce it in a future release using what was discussed in the other thread about standards.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Shard

Post by knorke »

downloaded this:
http://www.darkstars.co.uk/downloads/vi ... allsey.rar

Tested Shard with BA on Brazilian Battlefield.
Worked, but did not play that good. Builds way too many solars and kbot labs but only few mex and some peewees. The NullAIs commanders lasered lots of small scoutings/attacks by shard that all consisted of 5-6 peewees before they eventually exploded.


Then tried NOTA, which did not work: (crashes Spring)

[f=0000000] GameID: 46fe4b4e976e822c4f72cec996904c5c
[f=0000000] <SkirmishAI: Shard 0.31-Ballsey (team 0)>: error loading module 'taskqueues' from file 'C:\Spiele\spring-0.82.7.1\AI\Skirmish\Shard\0.31-Ballsey\ai\taskqueues.lua':
...\Spiele\spring-0.82.7.1\AI\Skirmish\Shard\0.31-Ballsey\ai\taskqueues.lua:46: unexpected symbol near '{'
stack traceback:
[C]: ?
[C]: ?
[C]: ?
[C]: in function 'require'
...7.1\AI\Skirmish\Shard\0.31-Ballsey\ai\behaviours.lua:2: in main chunk
[C]: in function 'require'
...\Skirmish\Shard\0.31-Ballsey\ai\behaviourfactory.lua:4: in main chunk
[C]: in function 'require'
...ng-0.82.7.1\AI\Skirmish\Shard\0.31-Ballsey\ai\ai.lua:2: in main chunk
[f=0000000] SkirmishAI (teamID 0) is using cheat callbacks
[f=0000000] ResourceMapAnalyzer by Krogothe, initialized for resource 0(Metal)

I think there is a = missing:

Code: Select all

local coreconstructionkbot {
	CoreWindSolar,
Same in line 91

Code: Select all

local armconstructionkbot  {
Added both = signs, this time no crash but AI did nothing.

[f=0000000] GameID: d4004c4eab88834b4f72cec996904c5c
[f=0000000] SkirmishAI (teamID 0) is using cheat callbacks
[f=0000000] ResourceMapAnalyzer by Krogothe, initialized for resource 0(Metal)
[f=0000000] <SkirmishAI: Shard 0.31-Ballsey (team 0)>: OHAI DER
[f=0000000] <SkirmishAI: Shard 0.31-Ballsey (team 0)>: Shard by AF - playing:NOTA on:Brazillian_Battlefield
[f=0000000] <SkirmishAI: Shard 0.31-Ballsey (team 0)>: added UnitHandler module
[f=0000000] <SkirmishAI: Shard 0.31-Ballsey (team 0)>: added AttackHandler module
[f=0000000] <SkirmishAI: Shard 0.31-Ballsey (team 0)>: added MetalSpotHandler module
[f=0000001] Skirmish AI "Bot1" took over control of team 0
[f=0000001] Skirmish AI "Bot2" took over control of team 1
[f=0000119] Title Missing By: Artist Missing
[f=0000978] User exited
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF »

BA support

A test config was made, no attempt at a playable build beyond the most basic was made. This task queue setup is proof of concept, and is not intended to provide an effective playable opponent.

Having said that, this is not because Shard is incapable, but because I decided I was better spent improving the build queues for EvoRTS. Anyone with even the remotest skill could make dramatic improvements to the BA support using a text editor.

Afterall there are other AIs, improving BA support would have gotten me nothing but "It still doesn't beat RAI" or "It builds this and this why cant it build that and that" or "Why do you always focus on the TA games", though it turns out everybody made a big deal of that anyway even though little or no effort was made to make sure that Shard played well at those games, I only did what was necessary to make it work. Gameplay optimisation can be left to other people if they want it ( and Ive made it easy for them to do so ).

NOTA support

My last game of NOTA predates the newest NTai, or even NTai XE9. Even if I was to sit down and add NOTA support, I would have no idea what the AI should build etc. Having said that, there's nothing stopping someone with knowledge of NOTA gameplay adding support.

Missing =

Fixed in master, but I haven't released it because there are other changes that are still unstable.


General Development slowdown of late

Im moving flats at the moment, but I'm still here. In general I've slowed down development for the time being to focus on other things, and since there are no pressing concerns ( that have been raised ), I've chosen to keep a slower pace for the moment.

If there are any pressing issues I'm happy to sit down and fix them, but so far the only things that come to mind aside from the missing equals sign, are the problems in master regarding the design change I made to unit object memory. Current release appears stable and what minor trivial issues there are I already have fixes.

If anything urgent arises or there is demand for a quickening of the pace, do let it be known.

Although I will add, there is a minor hiccup in that my machine won't boot windows and hasn't for the last 2 or 3 days so I can't modify the C++ component until I fix the bootloader. I have a lua environment working fine, and can probably set up Shard on my macbook in the windows partition. The only things that need doing there though are changes to the APIs to add more sanity checks for abmas pureint tests, and a play about I'm wanting with luaparser
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Shard

Post by knorke »

hm ok.
Are there better (player-made) configs available?
Don't have to be perfect but from random solar & mex spam it is a bit hard to judge what is going on.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF »

Look at taskqueues.lua in the BA folder for what there is.

Any better configs Im aware of were included in Shard when I became aware of them
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Shard

Post by Forboding Angel »

Turn it into a lua ai. This is why you should: Mon Oct 25, 2010 3:48 pm
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF »

  • There was nothing stopping you porting shard in the meantime
  • Progress was made, it was just not in a releasable state
  • The major improvements to be made require game developer time not my time ( other than explaining things which I have spent plenty of time and still do ). It appears that we have the technical means and the onus is on the content devs to quite whining about native AIs, they themselves are the ones blocking, not AI devs, and the blocking components are all in gadget land, in their code, that they wrote ( lack of AI APIs and gadget callins. AI can talk to you now, Y U NO ANSWER?! )
  • There has been no demand for updates
  • Testing has been done in pureint/dev builds of spring and I would rather not work in that environment until its made public.
  • Shards C++ component is trivial, simple, easy to maintain, and robust. What holes and patches it has are fixed in Git Master and do not have any bearing on the lua code. The engine developers are more than capable of keeping it compiling ( Abma has surprised me with fixes for pureint, giving me fixes at the same time as reporting issues in the next version of spring. )
  • No problems have been raised for which I have a satisfactory explanation of which. The only exception being a missing '=' in the nonsupported BA taskqueues.
  • I know you have raised some but I requested more information, specifically screenshots, and recieved absolutely nothing. Your issue is with the behaviour that Shard uses when it hasn't enough information to fall back on, so it uses a native AI API helper function. There was nothing stopping you writing your own building placement algorithm, and there was nothing stopping you adding in a helping hand in the existing one by letting yourself define custom spacing values to tweak ( a trivial exercise in lua tables, all you need to do it is the units type name and the location of the unit, all trivial things to acquire, and if I you had asked me or looked further up the file taskqueuebehaviour.lua you'd have found them )
  • Shards lua component is hardly complex or hard to understand. Compared to the likes of AAI or NTai its design is simplistic, deliberately made to be extended tweaked and hacked.
So as you can see, no brand new release needed, no new codebase was qualified for a release, no new release was necessary, nor was one desired. It seems people are perfectly happy with Shard as it is.

Although I thought I sorted the '='; sign quite a while ago and will be making a very minor trivial re-release 0.31.1 soon to ammend that.

While you may think I have abandoned the project or done a runner, I am not the other AI devs. I still have a presence here, and thanks to Shards design, I don't need a full setup to continue development. All I need is a text editor.

It saddens me that other people haven't taken shard anywhere, as it should be easy to hack, it was designed that way, and what Shard actually does is not complex or hard to understand at all.

But if you want a version of Shard that runs as a native gadget AI, go ahead, its open source, and for someone like you who has a much better knowledge of the APIs in gadgets, it should be a trivial task. Shards APIs are hardly expansive, you just need to make wrappers for events, the game object, and the unit object.

The game object is already a wrapper of the 'engine' object so you already have a skeleton wrapper object written for you! I only ask that you not put spring specific callouts in the shard code you port, and instead implement the wrapper so that the AI code you write can be moved back and forth, keeping the intended design.


So to summarize regarding lua AI port:
  • Its not necessary
  • I am not needed for it to happen
  • The reasons you want it will not automagically be fixed by a move to gadget land
  • The problems you cite are null and void.
  • Your trying to gain access to the razor thin layer of C++, that has zero behavioural logic, is 95% autogenerated, and using that as an excuse to ignore the uber accessible mountain of gold sitting on top.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF »

With regards to when the next release will actually arrive ( not counting minor '=' fix ).

I was hoping to wait for the new AI Interface ( pureint ) which is coming with the next spring release. I have a bug regarding Shard Master that needs correcting before then. When this is sorted, and spring finally makes its next release, I'll update Shard ( as it will be necessary ).
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Shard

Post by knorke »

It saddens me that other people haven't taken shard anywhere, as it should be easy to hack, it was designed that way, and what Shard actually does is not complex or hard to understand at all.
who would be these 'other people'?
If you want players to use shard the only thing that matters is how well it works out of the box.
The average player will not make a config, it is too comlicated.

For dev people the problem is, it is not clear what is the advantage of using shard over making a Lua gadget AI like in s44, zK, etc.
All the sample configs consist of buildlists with a bit of math.random() being the only 'decision'. That is not that impressive if you look at ie zK's AI that only builds stuff when it makes sense (ie needs energy) and also where it makes sense. (ie radar towers)
If you want others to use your stuff you have to advertise and show its features. shards biggest feature seems to be 'can potentially play all games' but atm it looks more like 'can not play anything.'
Post Reply

Return to “AI”