View topic - Shard 0.35RC2 & 0.31.1 Not So Ballsey



All times are UTC + 1 hour


Post new topic Reply to topic  [ 563 posts ]  Go to page Previous  1 ... 19, 20, 21, 22, 23, 24, 25 ... 29  Next
Author Message
PostPosted: 01 Jan 2012, 03:20 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
Then why isn't it fixed in the sauce?


Top
 Offline Profile  
 
PostPosted: 01 Jan 2012, 04:50 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Because no fixed code was received. I assumed you had fixed it since you had done tests since then prior to your most recent report, so I expected you'd be sending me the fixed behaviours.


Top
 Offline Profile  
 
PostPosted: 18 Jan 2012, 11:05 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
There will be a v0.4 this Sunday (possibly monday). It will include all the changes of the test versions, a fixed version of the evo file, and a fix for a crash reported by abma.

If there are any other small changes needed or questions before them let it be known now as it will be unlikely that there will be another Shard release for spring v85 or v86 unless there are bugfixes, most likely a v87/88 thing. I'd like to formalise my releases better on a reasonable timescale of months rather than the days or weeks I always aspired to (but never achieved)


Top
 Offline Profile  
 
PostPosted: 20 Jan 2012, 04:00 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
Thanks for that. Apparently you told me what to do to fix things, and I just didn't understand it. Sorry about that.


Top
 Offline Profile  
 
PostPosted: 20 Jan 2012, 17:43 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Not to worry, there was a function with 2 versions of it, so that you could pass data 2 different ways and it would handle both. It didn't work as expected for some people though so I separated one out into a new version with a new name, and your code needed to use the new name not the old one.


Top
 Offline Profile  
 
PostPosted: 23 Jan 2012, 01:07 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Here's a DLL I'll package the rest up tomorrow


Attachments:
SkirmishAI.7z [398.88 KiB]
Downloaded 117 times
Top
 Offline Profile  
 
PostPosted: 23 Jan 2012, 23:16 
User avatar

Joined: 20 Aug 2009, 19:49
Few questions:
1) Is there a command that takes any commandID and makes a unit perform the respective action?

2) If i create a random number in a module i.e.
ai.xzy=math.random(1,10) i always get the same for all AIs but if i do so within taskques i get different ones. Why?


Top
 Offline Profile  
 
PostPosted: 24 Jan 2012, 11:18 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Can you clarify 2) further, I'm not quite sure what you mean, are you comparing Shard to other AIs? Or modules to task queues?

1) No, at the moment there isn't. Such an API would be spring specific and would have been very, very hard to justify in my thesis. It also forces me to write a generic command API, which is not a 5 minute job, and it would encourage things that break on releases. This is why the only commands I've added other than stock commands are jumpjets and morphing as their implementations are consistent and widespread. (That and for quite a while nobody asked for them)


Top
 Offline Profile  
 
PostPosted: 24 Jan 2012, 14:41 
User avatar

Joined: 20 Aug 2009, 19:49
In 2) i compare two shards. Basically i wrote a module that does expensive calculations once in while to store the results.
In order to avoid multiple (Shard)AIs doing these computations in one frame (causes stutter with multiple AIs doing them at once) i create a random number as an offset.
The problem is that this number is random but its the same for every AI so they still do all their updates in one frame.

In taskques i randomize an AIs playstile giving each one a different favourite factory etc. in this case every AI player gets random results independant fro other AIs


Top
 Offline Profile  
 
PostPosted: 24 Jan 2012, 15:25 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Clearly the seed is the same, if all Shard instances seed in the same frame, and the value of the seed is only on the scale of seconds then they could all well have the same random numbers.

I'd suggest modifying whatever seed you use to be some function of the team/ally number.

It would be different in taskqueues because taskqueues aren't created and executed at the same time (as some units take longer to build than others, and some taskqueues are shorter than others).


Top
 Offline Profile  
 
PostPosted: 24 Jan 2012, 18:29 
User avatar

Joined: 20 Aug 2009, 19:49
ah i see, i guess to fix it i would add the teams number or so. How would i get it?


Also how exactly does the recruits table work? How would i get the position of a recruit by calling the respective funciton?


Top
 Offline Profile  
 
PostPosted: 24 Jan 2012, 18:50 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Recruits are just stored in a table, if I had to guess the order, FIFO, although as soon as recruits is equal to the number of attackers needed to form the next group, an attack group is launched, so the positioning is unlikely to be of consequence. I suppose you could cherry pick the best recruits in a custom attack handler.

Of note, when modules are added, their module name is used to add it as a variable of the ai table. so a module called radarhandler would be accessible by doing something like:

Code:
ai.radarhandler:whateverfunctionofthatmodulesinstance()


I'd have to look up the code to give you something that would work verifiably


Top
 Offline Profile  
 
PostPosted: 24 Jan 2012, 19:15 
User avatar

Joined: 20 Aug 2009, 19:49
I need the position of each recruit because i place warning labels on positions i.e. "base is under attack at 2000,500" in order to divert idle recruits to defending locations.

How would i get an object out of the table that i can call ".GetPosition()" for?


Top
 Offline Profile  
 
PostPosted: 25 Jan 2012, 18:10 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
To get the recruits table:

Code:
ai.attackhandler.recruits


A recruit in that table is an instance of the AttackBehaviour. Each object has an internal named unit which is the AI unit ( as defined in unit.lua )

So given a recruit 'r':

Code:
id = r.unit.engineID


I would say though that ALL recruits would be idle. As soon as the number of recruits X is equal or greater than the threshold, it's assumed that all recruits will be sent off to attack the enemy. A recruit is no longer a recruit when it is sent off to attack. Units are removed from the list when this happens, and remain off the list until they are idle again.

So you don't need to determine which recruits are idle, all recruits are idle, if they weren't they wouldn't be in the list. If I had to pick a name, I'd say they would be attackers, recruits become attackers when sent off to attack. When an attacker is idle, it enlists as a recruit and repeats the process.

edit: On checking again

It is indeed correct, recruits are idle attackers. When the threshold is reached, the attack handler sends all the recruits, not half, not however many is needed, but every single one of them. Then the recruits table is emptied, as there are no longer idle attackers waiting.

So if the threshold for an attack is 9, and there are 12 recruits, 12, not 9, will be sent to attack.


Top
 Offline Profile  
 
PostPosted: 25 Jan 2012, 18:49 
User avatar

Joined: 20 Aug 2009, 19:49
That was not the question, i know how the attackhandler works.
The thing is that the AI might need to take a few of the waiting units in order to defend itself (in some games this might be necessary...) and for that i want to check the distance each defender has from the attacked spot in order to only send the ones that can reach it in reasonable time.


Top
 Offline Profile  
 
PostPosted: 26 Jan 2012, 10:02 
User avatar

Joined: 30 Nov 2008, 04:31
Location: the flow
Is there any decent manual on how to teach Shard to do stuff in a mod with severely weird econ rules dependant on custom orders?


Top
 Offline Profile  
 
PostPosted: 26 Jan 2012, 14:42 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Erik wrote:
That was not the question, i know how the attackhandler works.
The thing is that the AI might need to take a few of the waiting units in order to defend itself (in some games this might be necessary...) and for that i want to check the distance each defender has from the attacked spot in order to only send the ones that can reach it in reasonable time.


You should be able to garner everything you need from those posts, as I mentioned, to access the recruits table:

Code:
ai.attackhandler.recruits


For each recruit in that table:

Code:
AIunit = r.unit


Where AIunit is a unit object as defined in unit.lua


Top
 Offline Profile  
 
PostPosted: 26 Jan 2012, 15:07 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Anarchid wrote:
Is there any decent manual on how to teach Shard to do stuff in a mod with severely weird econ rules dependant on custom orders?


hmmm the problem here is your analogy is based on the other AIs, they are fixed and you teach them how to use something. Think of Shard as a skeleton, what you want is not to add the flesh. So you would create the behaviours and modules that do the work. You can make modified versions of what's already there in a subfolder (e.g. stuff in the evoRTS folder will be used instead of the AI folder when playing evorts, so evoRTS can override the default behaviour).

I can answer any questions you have if you want to PM me or ask here, and I really need to compile everything together into a more coherent document. The nearest I have is the original project report, but I never released it, and Shard has seen refactors since then.


For custom commands, at the moment you'll have to do them via a gadget, and send that gadget commands via the API, e.g. game:sendtocontent("hello mr gadget, I have a message for you")

----------------------

I'd ask from now on if possible that people maintaining their own Shard modifications e.g. the stuff in the AI folder that's game specific, create git repositories. That way I can us git submodules and you have full control to edit and update as you please. It also means I don't have to perpetually bug people for the latest versions of things.


Top
 Offline Profile  
 
PostPosted: 26 Jan 2012, 15:34 
User avatar

Joined: 30 Nov 2008, 04:31
Location: the flow
Quote:
I can answer any questions you have if you want to PM me or ask here, and I really need to compile everything together into a more coherent document. The nearest I have is the original project report, but I never released it, and Shard has seen refactors since then.

I'll compile some of those somewhere today, probably then :P

Quote:
I'd ask from now on if possible that people maintaining their own Shard modifications e.g. the stuff in the AI folder that's game specific, create git repositories. That way I can us git submodules and you have full control to edit and update as you please. It also means I don't have to perpetually bug people for the latest versions of things.

Alternatively... is there no way currently for Shard to be provided its configs somewhere inside the game archive itself or otherwise in VFS?

(think of it: map-specific, map-provided shard modules? :P )


Top
 Offline Profile  
 
PostPosted: 26 Jan 2012, 16:12 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Anarchid wrote:
Quote:
I can answer any questions you have if you want to PM me or ask here, and I really need to compile everything together into a more coherent document. The nearest I have is the original project report, but I never released it, and Shard has seen refactors since then.

I'll compile some of those somewhere today, probably then :P

Quote:
I'd ask from now on if possible that people maintaining their own Shard modifications e.g. the stuff in the AI folder that's game specific, create git repositories. That way I can us git submodules and you have full control to edit and update as you please. It also means I don't have to perpetually bug people for the latest versions of things.

Alternatively... is there no way currently for Shard to be provided its configs somewhere inside the game archive itself or otherwise in VFS?

(think of it: map-specific, map-provided shard modules? :P )


Or modules that are crippled making the map unplayable when a new Shard release with refactors is made? Or me having to release multiple versions of Shard?

History has taught us that once a map gains traction, subsequent versions of the map with fixes are only adopted if the original map becomes totally and utterly unplayable. e.g. Metal Heck vs Metal Heck v2. Most people had v1, despite horrible issues that forced v2, and people continue to play on v1 to this day.

The original reasoning was that I had zero documentation for the VFS APIs in the OO C++ AI API. That's why NTai supported reading from the VFS and Shard didn't.

Still, it's perfectly possible to load different code for different maps, you can query the map name in Shard, or you could ask a gadget via the API call I mentioned earlier (where your game may have a listed of maps categorised, or code to automatically figure it out, etc)


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 563 posts ]  Go to page Previous  1 ... 19, 20, 21, 22, 23, 24, 25 ... 29  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.