Shard 0.4/dev
Moderators: hoijui, Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Then why isn't it fixed in the sauce?
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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)
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)
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Thanks for that. Apparently you told me what to do to fix things, and I just didn't understand it. Sorry about that.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Here's a DLL I'll package the rest up tomorrow
- Attachments
-
- SkirmishAI.7z
- (398.88 KiB) Downloaded 196 times
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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?
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?
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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)
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)
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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
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
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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).
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).
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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?
Also how exactly does the recruits table work? How would i get the position of a recruit by calling the respective funciton?
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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:
I'd have to look up the code to give you something that would work verifiably
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: Select all
ai.radarhandler:whateverfunctionofthatmodulesinstance()
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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?
How would i get an object out of the table that i can call ".GetPosition()" for?
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
To get the recruits table:
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':
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.
Code: Select all
ai.attackhandler.recruits
So given a recruit 'r':
Code: Select all
id = r.unit.engineID
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.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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.
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.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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?
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
You should be able to garner everything you need from those posts, as I mentioned, to access the recruits table: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.
Code: Select all
ai.attackhandler.recruits
Code: Select all
AIunit = r.unit
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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).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?
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.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
I'll compile some of those somewhere today, probably thenI 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.
Alternatively... is there no way currently for Shard to be provided its configs somewhere inside the game archive itself or otherwise in VFS?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.
(think of it: map-specific, map-provided shard modules? )
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
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?Anarchid wrote:I'll compile some of those somewhere today, probably thenI 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.
Alternatively... is there no way currently for Shard to be provided its configs somewhere inside the game archive itself or otherwise in VFS?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.
(think of it: map-specific, map-provided shard modules? )
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)