Shard 0.4/dev
Moderators: hoijui, Moderators
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
How reproducible is this? Everytime? Multithreaded only?
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Upps, the error above was an error from my own Taskqueue... Sorry for that.Did a test game with self compiled Single Core .exe
same result.
http://www.ssvo.de/spring/infolog-Single.txt
Now i'm downloading the official Release and then i do a test game again.
In Games with 1 Shard this error occur in 3 of 5 games.
I watched a lot of games with 4 Shard playing against each other, and in every game i watched, 2 or 3 AI's get this error.
edit:
Test game with official release resulting in errors and finaly crash to Desktop.
http://www.ssvo.de/spring/infolog-official.txt
Now i do some test games with the official releas to reproduce the first error.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Hi there,
I'm still running test games with official release.
No more Errors so far, but is hard to watch a 2 hour game (the error mostly occur around two hours with my version) with a non-multithreaded version.
Game got horrible slow after 1 Hour of game time and 4 Shards.
Btw. is there a way to get a bit more space between the Buildings that Shard builds? I think i read about that somewhere in this tread, but can't find it...
Some of the heavy bots have problem to find their way trough an larger Base, or get stuck in a factory.
And what about anit-Nuke? How can i get shard to build and use these?
Is there a description of the API and commands that can be used with Shard? (I only knew the resource.income and resource.usage stuff)
So much Questions sorry for that, but i like Shard much, and it plays relay good at the moment, just a few things to fix... :)
I'm still running test games with official release.
No more Errors so far, but is hard to watch a 2 hour game (the error mostly occur around two hours with my version) with a non-multithreaded version.
Game got horrible slow after 1 Hour of game time and 4 Shards.
Btw. is there a way to get a bit more space between the Buildings that Shard builds? I think i read about that somewhere in this tread, but can't find it...
Some of the heavy bots have problem to find their way trough an larger Base, or get stuck in a factory.
And what about anit-Nuke? How can i get shard to build and use these?
Is there a description of the API and commands that can be used with Shard? (I only knew the resource.income and resource.usage stuff)
So much Questions sorry for that, but i like Shard much, and it plays relay good at the moment, just a few things to fix... :)
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Is there a way to get a unit's build distance from within Shard?
I need that to prevent it giving out-of-range build orders to immobile units.
I need that to prevent it giving out-of-range build orders to immobile units.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
For stockpiling you'd need to do a custom command, here's the C++ Interface exposed:
This can be executed on an engine unit object.
The cmdId is the same internal values as the engine, std::vector<float> you'll need to reference SWIG docs, options can just be 0, and timeOut is self explanatory.
For building we have:
Again an engine unit object is needed, all behaviours should have one. The taskqueuebehaviour currently uses :
Which is:
For what you want regarding building separation, you need to pass in a location to build at, which means getting a position from this:
e.g.:
Of note, the minimum build distance appears to be the same units as the search radius but this is not actually true, IIRC 1 is 1 footprint, not 1 space along or 1 elmo, so 1 means different things depending on the units footprint. Experiment, and report back what works for you so I can ammend the internal heuristic.
For build distance i'll need to make some ammendments and release an update. It may also be necessary for handling std::vector<float> objects in lua correvtly, I'll report back after I've done some more research into it
Code: Select all
ExecuteCustomCommand(int cmdId, std::vector<float> params_list, short options = 0, int timeOut = INT_MAX)
The cmdId is the same internal values as the engine, std::vector<float> you'll need to reference SWIG docs, options can just be 0, and timeOut is self explanatory.
For building we have:
Code: Select all
bool Build(IUnitType* t)
bool Build(std::string typeName)
bool Build(std::string typeName, Position p)
bool Build(IUnitType* t, Position p)
Code: Select all
self.progress = not self.unit:Internal():Build(utype)
Code: Select all
bool Build(std::string typeName)
Code: Select all
function map:FindClosestBuildSite(unittype,builderpos, searchradius, minimumdistance) -- returns Position
Code: Select all
unit = self.unit:Internal()
local builderpos = p = unit:GetPosition()
local p = map:FindClosestBuildSite(utype,builderpost, 1000,2)
For build distance i'll need to make some ammendments and release an update. It may also be necessary for handling std::vector<float> objects in lua correvtly, I'll report back after I've done some more research into it
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Hi AF,
Thx for your Reply.
I must say i understand nothing from that what you have written.
Because i not a Programmer oder coder, mostly i do some Copy & paste.
Ive got some C++ lessons 12 years back in school, but all that i can remember is simple if loops and such easy stuff.
I don't know what an 'engine object' is, and
tells me nothing.
For the Build spacing my hope was, that i only have to change a numer like
in a lua file of Shard.
But its ok, i don't want to waste more of your time with my problems.
I will try to understand what you have written, and read some websites like 'LUA for beginners' maybe with some time i can get the point.
thx
SSvO
Thx for your Reply.
I must say i understand nothing from that what you have written.
Because i not a Programmer oder coder, mostly i do some Copy & paste.
Ive got some C++ lessons 12 years back in school, but all that i can remember is simple if loops and such easy stuff.
I don't know what an 'engine object' is, and
Code: Select all
ExecuteCustomCommand(int cmdId, std::vector<float> params_list, short options = 0, int timeOut = INT_MAX)
For the Build spacing my hope was, that i only have to change a numer like
Code: Select all
Buildspacing = 2
But its ok, i don't want to waste more of your time with my problems.
I will try to understand what you have written, and read some websites like 'LUA for beginners' maybe with some time i can get the point.
thx
SSvO
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Oh I'm happy to help, see in the Shard C++ bit the engine AI APIs are abstracted out into more generic versions that make no assumption which engine is being used.
Warning: I dont remember the capitalisation of these functions, I'm always forever double checking, so do double check it's Internal and not internal or vice versa
This super generic API is then passed into SWIG which generate lua bindings ( eurgh I don't want to have to write all the glue code myself ).
So we have a Shard Unit object, that represents the unit in the engine. From hence forth these shall be called 'engine units'. These objects are what we call 'move' or 'build' on, and what we manipulate to issue commands or get information.
Then we have AI units, the pure lua wrappers around engine units that implement the decision making.
This is why in unit code we have the Internal() function and you end up seeing things like:
This is because in C++ there's a method called IUnit::Move, and SWIG has generated glue code so we can just call it straight from lua.
So this means that we must be able to do something like this:
The main obstacles at the moment are that I need to make it possible to instantiate an std::vector<float> so that it's possible to pass in parameters, and you need to figure out what number the stockpile command is.
For the map position
You'd call it like this:
Which will return the closest available build position of a core solar in BA within 1000 pixels of the builders current position, that is at least 2 corsolars away from any other building. Ofc you'll need to get the builders position, but if you look at the taskqueuebehaviour.lua you can see it doing that in the metal extractor placement bit, just above where you need to edit
Warning: I dont remember the capitalisation of these functions, I'm always forever double checking, so do double check it's Internal and not internal or vice versa
This super generic API is then passed into SWIG which generate lua bindings ( eurgh I don't want to have to write all the glue code myself ).
So we have a Shard Unit object, that represents the unit in the engine. From hence forth these shall be called 'engine units'. These objects are what we call 'move' or 'build' on, and what we manipulate to issue commands or get information.
Then we have AI units, the pure lua wrappers around engine units that implement the decision making.
This is why in unit code we have the Internal() function and you end up seeing things like:
Code: Select all
self:Internal():Move(somewhere)
So this means that we must be able to do something like this:
Code: Select all
local engine_unit = self:internal()
engine_unit:ExecuteCustomCommand(cmdId, parameters, 0, 500)
For the map position
Code: Select all
map:FindClosestBuildSite(unittype,builderpos, searchradius, minimumdistance)
Code: Select all
position = map:FindClosestBuildSite("corsolar",builderposition, 1000, 2)
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
ok, i will try to get these Stockpiling thing to work.
I looked into the Stockpiling Widget from BA, and compared it with your post. That helped me a bit to understand how this things work.
I will report back if i get it to work.
An other small problem is, that some factories stop producing units.
in this Screenshot you can see blue market buildings, that do nothing.
They Spam units in the beginning, but suddenly stopped, without any reason.
HTTP://ssvo.de/spring/fab.jpg
No Errors where reported and the unit limit is at 5000, so i think that is not the problem.
Any idea why this happen?
I looked into the Stockpiling Widget from BA, and compared it with your post. That helped me a bit to understand how this things work.
I will report back if i get it to work.
An other small problem is, that some factories stop producing units.
in this Screenshot you can see blue market buildings, that do nothing.
They Spam units in the beginning, but suddenly stopped, without any reason.
HTTP://ssvo.de/spring/fab.jpg
No Errors where reported and the unit limit is at 5000, so i think that is not the problem.
Any idea why this happen?
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Another request: is there a way to check that a unit is complete (as in 100% built)? GetHealth() can probably be used for that, but engine has health and build progress separate and some games may do odd things with the health of units under construction.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
That's a good question, and its something no AI has ever dealt with before
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
To deal with it like no AI has ever done dealt with before, the AIs in zero-K, Kernel Panic and Conflict Terra deal with it.AF wrote:That's a good question, and its something no AI has ever dealt with before
iirc shard can talk with gadgets, so you could make a gadget to tell shard about buildprogress...treat it like it was some custom unit parameter. Seems slightly strange though and requires changes to the game but should work?
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Incorrect. AIs (including the ZK AI ) have been known to track build power and request assistance from conbots and estimate total build time.
But no AI has tracked build progress as something different from health.
But no AI has tracked build progress as something different from health.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
it checks if a unit is 100% complete, ie when a new unit is shared to it. (or w/e didnt really look at it)
and somewhere else again:
Code: Select all
local _,_,_,_,build = spGetUnitHealth(unitID)
if build == 1 then
Code: Select all
local _,_,_,_,build = spGetUnitHealth(unitID)
local built = (build == 1)
...
if not built then
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Next question: is it possible to issue a Wait order from Shard? api.lua does not list Wait() as a possible method of Unit class.
I need that to attempt a resource management system where less important build projects are put on wait when resources are needed for defense. I can use Stop() order and prevent that unit from starting new projects for some time, but that will lose any build progress there already is, which is not desirable.
I need that to attempt a resource management system where less important build projects are put on wait when resources are needed for defense. I can use Stop() order and prevent that unit from starting new projects for some time, but that will lose any build progress there already is, which is not desirable.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
There's the sleep behaviour? A wait command is just making a unit not do anything, you don't necessarily need to issue a command to make a unit not do something
Try implementing a behaviour that controls a unit and issues no commands, but yields when certain economic conditions are met
Try implementing a behaviour that controls a unit and issues no commands, but yields when certain economic conditions are met
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Wait command also pauses any current construction project without canceling it. Sleep behaviour doesn't do that.
Standard taskque behaviour already allows to implement economic conditions for starting new units, like so:
BuildWindSolarIfNeeded is added to task que and makes the builder build energy only when it's needed.
CoreWindSolar is a function that returns whichever energy building is most appropriate per map, DummyUnitName is a unit name which is valid but absolutely cannot be built (commander in most *A games is good for that) so there is no error generated.
What I want is not to choose when to start new buildings based on economy (the above code already does this), but to pause buildings under construction when resources are needed elsewhere. And that's why Wait order is needed (if it can be given from AI interface, which it probably is, since E323 for example uses it a lot).
Standard taskque behaviour already allows to implement economic conditions for starting new units, like so:
Code: Select all
function BuildWindSolarIfNeeded()
res = game:GetResourceByName("Energy")
if res.income < res.usage then
retVal = CoreWindSolar
else
retVal = DummyUnitName
end
return retVal
end
CoreWindSolar is a function that returns whichever energy building is most appropriate per map, DummyUnitName is a unit name which is valid but absolutely cannot be built (commander in most *A games is good for that) so there is no error generated.
What I want is not to choose when to start new buildings based on economy (the above code already does this), but to pause buildings under construction when resources are needed elsewhere. And that's why Wait order is needed (if it can be given from AI interface, which it probably is, since E323 for example uses it a lot).
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Then some variation of a ExecuteCustomCommand will be needed, you'll need to figure out the command ID used for CMD_WAIT
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Shard has issues on SSMF maps. It's pretty inconsistent, however. I have been able to get it more often than not on EvoRTS Eye of horus: http://springfiles.com/spring/spring-ma ... -eye-horus
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Any issues Shard has on SSMF maps would be an engine issue. Shard isn't even aware of SSMF, it doesn't even analyse the terrain.
Shards interactions with the map are as follows:
As of yet I have still recieved no data on the starting units Shard is given as requested, such as what their current command is, if giving them a stop command is enough to poke them back into movement or not.
I would also add to that list, changing the taskqueues of the starting units to produce something small and easily placeable to see if that makes a difference.
Otherwise without further information beyond simply stating "Shard is broken sometimes and not others on map XYZ )" is just not enough data to work with =/
Shards interactions with the map are as follows:
- Building placement ( provided by the engine )
- Metal extractor placement ( based on spot locations provided by the engine )
- Pathfinding ( purely Engine based, Shard makes no calls to the path finder )
As of yet I have still recieved no data on the starting units Shard is given as requested, such as what their current command is, if giving them a stop command is enough to poke them back into movement or not.
I would also add to that list, changing the taskqueues of the starting units to produce something small and easily placeable to see if that makes a difference.
Otherwise without further information beyond simply stating "Shard is broken sometimes and not others on map XYZ )" is just not enough data to work with =/
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
A cheat, join other team, issue stop order seems to do the trick. I can test it again.
Sidenote, is there anyway that taskqueues could be made to be read form the game file? That would be... convenient.
Edit: Stop order causes it to spring into motion. Seems to have issues building metal extractors on this map. Not sure why, because it's the same on this map as any other. Mex spots are compiled into the map, just like old style maps.
Sidenote, is there anyway that taskqueues could be made to be read form the game file? That would be... convenient.
Edit: Stop order causes it to spring into motion. Seems to have issues building metal extractors on this map. Not sure why, because it's the same on this map as any other. Mex spots are compiled into the map, just like old style maps.