Shard 0.4/dev - Page 21

Shard 0.4/dev

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

Moderators: hoijui, Moderators

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF »

I tested with BA last night and it worked, use the lua from the git repo
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by abma »

works fine here too.

what i did:

grabbed http://springrts.com/dl/buildbot/defaul ... 0_Shard.7z and extracted to spring dir and then replaced with AF's dll.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF »

Of note there's a 0.36RC1 I was passing around yesterday for testing, it appears to be working within optimum parameters:

http://www.darkstars.co.uk/downloads/vi ... .36RC1.zip

It should work fine with 85.0 ( I don't think there have been any major changes to the AI interface and this was built from git master/develop sources several days ago anyway )
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by knorke »

After the match with that void game yesterday I thought it would be nice if ai-configs could be included with the mod? iirc currently they have to be in engine folder\ai\shard etc. Not sure if that is already possible/possible at all but it seemed like a good idea or something.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by abma »

@AF:

about the endless loop: i found that:

http://www.lua.org/manual/5.1/manual.html#pdf-next

"The behavior of next is undefined if, during the traversal, you assign any value to a non-existent field in the table. You may however modify existing fields. In particular, you may clear existing fields. "

are the values changed in the modules loop?

can the loop be rewritten without the use of ipairs?

like

Code: Select all

function AI:Init()
for i=1,#modules do

end
end
(i'm not so good in lua, this is why i ask...)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF »

during the loop it shouldn't unless forebodings copy has some modules that attempt it ( in which case why would you want to =s )

As of yet Ive been unable to reproduce his issue, and since he used an unsupported build Id need confirmation it persists in a clean install of .36RC1
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by abma »

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF »

I have no reason to trust that build though I'm not even sure if it's compiled and linked with the correct parameters.

Also, even if you were correct with your theory, this would lead to the issue being present in shard regardless of which compiler built the binary. So the issue would be replicated on the visual studio build as it would be a lua problem not a C++ one
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by hoijui »

Lua is implemented in native code, and undefined behavior could mean, it works one way when compiled with compiler X, and an other way when compiled with compiler Y.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by abma »

I have no reason to trust that build though I'm not even sure if it's compiled and linked with the correct parameters.
i hope you trust me ;-)

how can the function be rewritten this style? (without ipairs?)

Code: Select all

function AI:Init()
for i=1,#modules do

end
end
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF »

You could try it but since v85 was released and the VS build was put out by myself, I've seen no reports or feedback of the issue.

So far all problems Ive encountered except this since I put out the VS build have been caused by misconfigured Shard installs that weren't set up correctly.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by abma »

the mingw build from the buildbot still causes the endless-loop... i thought this is clear.

and i would try it with the rewritten function when i would knew how to write it, that it does the same.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Forboding Angel »

Code: Select all

[f=0000000]  -> Version: 85.0
[f=0000000]  -> Connection established (given id 0)
[f=0000000] Player TehNewGuy finished loading and is now ingame
[f=0000000] Switching to Overhead (TA) style camera
[f=0000000] Switching to Free style camera
[f=0000000] GameID: 796ff54e6e15fba5e764005e1cdf4421
[f=0000000] SkirmishAI (ID = 0, team ID = 1) is using cheats!
[f=0000000] ResourceMapAnalyzer by Krogothe, initialized for resource 0(Metal)
[f=0000000] <SkirmishAI: Shard 0.36rc1 (team 1)>: Shard by AF - playing:EvoRTS on:EvoRTS-RiverGlade-v02
[f=0000000] <SkirmishAI: Shard 0.36rc1 (team 1)>: added UnitHandler module
[f=0000000] <SkirmishAI: Shard 0.36rc1 (team 1)>: added AttackHandler module
[f=0000000] <SkirmishAI: Shard 0.36rc1 (team 1)>: added MetalSpotHandler module
[f=0000000] <SkirmishAI: Shard 0.36rc1 (team 1)>: added Sleep module
[f=0000000] STATS:plist,TehNewGuy
[f=0000004] Skirmish AI "Enemy" (ID:0, Short-Name:"Shard", Version:"0.36rc1") took over control of team 1
[f=0000160] <SkirmishAI: Shard 0.36rc1 (team 1)>: Error in IGame::GetResource (arg 2), expected 'int' got 'string'
stack traceback:
	[C]: ?
	[C]: ?
	[C]: in function 'GetResource'
	...ring 85\AI\Skirmish\Shard\0.36rc1\ai\preload\api.lua:114: in function 'GetResource'
	...rmish\Shard\0.36rc1\ai\EvoRTS\lowenergybehaviour.lua:16: in function 'UnitIdle'
	D:\Spring 85\AI\Skirmish\Shard\0.36rc1\ai\unit.lua:72: in function 'UnitIdle'
	...ring 85\AI\Skirmish\Shard\0.36rc1\ai\unithandler.lua:97: in function 'UnitIdle'
	D:\Spring 85\AI\Skirmish\Shard\0.36rc1\ai\ai.lua:85: in function <D:\Spring 85\AI\Skirmish\Shard\0.36rc1\ai\ai.lua:75>
[f=0000320] <SkirmishAI: Shard 0.36rc1 (team 1)>: Error in IGame::GetResource (arg 2), expected 'int' got 'string'
stack traceback:
	[C]: ?
	[C]: ?
	[C]: in function 'GetResource'
	...ring 85\AI\Skirmish\Shard\0.36rc1\ai\preload\api.lua:114: in function 'GetResource'
	...rmish\Shard\0.36rc1\ai\EvoRTS\lowenergybehaviour.lua:16: in function 'UnitIdle'
	D:\Spring 85\AI\Skirmish\Shard\0.36rc1\ai\unit.lua:72: in function 'UnitIdle'
	...ring 85\AI\Skirmish\Shard\0.36rc1\ai\unithandler.lua:97: in function 'UnitIdle'
	D:\Spring 85\AI\Skirmish\Shard\0.36rc1\ai\ai.lua:85: in function <D:\Spring 85\AI\Skirmish\Shard\0.36rc1\ai\ai.lua:75>
[f=0000547] User exited
[f=0000547] Statistics for RectangleOptimizer: 34%
[f=0000547] Path cache hits 0 0%
[f=0000547] Path cache hits 0 0%
[f=0000547] Statistics for local connection:
Received: 1916 bytes
Sent: 6403 bytes
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF »

That issue is an old one, see ~1 month back when I changed the function names so that the two functions sharing that name were separated.
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Erik »

Wait-function in buildques is broken, often does not resume producing after expired.

Edit:
also in default attackhandler you have a line

Code: Select all

pz = pos.x - math.fmod(pos.z,600)
where it should read

Code: Select all

pz = pos.z - math.fmod(pos.z,600)
one letter changed suddenly Shards attacks make sense...
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by abma »

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Forboding Angel »

AF wrote:That issue is an old one, see ~1 month back when I changed the function names so that the two functions sharing that name were separated.

That was a direct unzip of 36rc1.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF »

IIRC you were told of the issue quite a while ago, but no fixes were ever contributed, as such the evorts behaviour in question was never updated.

Thankyou for the fix to attacking, and I will look at the wait issue when I next get a chance.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Forboding Angel »

I don't understand what you just said. Should I? Or was that @ abma?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF »

You've already reported the bug and been given the fix, its further back in the thread.
Post Reply

Return to “AI”