Shard 0.4/dev
Moderators: hoijui, Moderators
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Thats based on the github discussion. Abma was getting the infinite loop bug still, but the same build on my machine built a small BA base, so I'm not sure what's happening.
I want to know wether we've replaced 'infinite loop bug' with ' infinite loop bug lottery' first
I want to know wether we've replaced 'infinite loop bug' with ' infinite loop bug lottery' first
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
its not a lottery, i get this infinite loop always. i'll do some more tests on different machines, maybe i get an idea whats the cause, why it runs at your machine and not at mine.
i added it to the win32 installer to get more feedback... i currently have no idea why and where it fails and why it does work at your machine.
i added it to the win32 installer to get more feedback... i currently have no idea why and where it fails and why it does work at your machine.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
While I'm thinking about the lua path issue perhaps it's a good time to consider refactoring it away
I'm moving more towards the model used by wordpress with hooks and filters, I'm thinking more that you can create any arbitrary object and then add functions to actions, so they all get fired when said action occurs.
That way you would add a module by simply creating an object and hooking its functions into the appropriate events, avoiding the modules table altogether. Add in a mechanism for autoloading a "<gamename>.lua" and the ability to remove functions from actions or disable the default modules, and there's the lua paths issue resolved too.
For reference:
Where a function attached to an event/action is defined something similar to this:
Which is almost identical syntax to WordPress =p
I just hope we don't swap an infinite loop of modules for an infinite hook firing event loop
On the off chance, did anybody take a look at the AI_Query helper I wrote? Or did I not put it up?
Also someone remind me to integrate Eriks improved task handling code for handling tables
I'm moving more towards the model used by wordpress with hooks and filters, I'm thinking more that you can create any arbitrary object and then add functions to actions, so they all get fired when said action occurs.
That way you would add a module by simply creating an object and hooking its functions into the appropriate events, avoiding the modules table altogether. Add in a mechanism for autoloading a "<gamename>.lua" and the ability to remove functions from actions or disable the default modules, and there's the lua paths issue resolved too.
For reference:
Code: Select all
do_action('event name',{parameters})
value = apply_filters('filter name',value,{parameters})
add_action('event name',function/function+object/string function name)
add_filter('filter name',function/function+object/string function name)
Code: Select all
add_action("test event","myEventFunction")
add_action("test event",{self,self.function})
add_action("test event",function(parameters){
-- doing stuff
})
I just hope we don't swap an infinite loop of modules for an infinite hook firing event loop
On the off chance, did anybody take a look at the AI_Query helper I wrote? Or did I not put it up?
Also someone remind me to integrate Eriks improved task handling code for handling tables
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Also try this code:
I haven't tested it since I'm on a break at work, I'll give it a try when I get home tonight and if it works I'll commit it ( or if it squishes the infinite bug), I'm thinking I should add an addModule function to the ai object anyway, just so I can then add modules to a second modules table which then gets merged afterwards so I'm sure modules never gets modified during an event (and to make the above loop prettier).
You'll also notice its now printing out the iteration of the loop, and the number of modules being loaded so it should be clearer exactly what kind of trickery is at hand if an infinite loop does indeed occur
Code: Select all
for i=1,#modules do
m = modules[i]
newmodule = m()
local internalname = newmodule:internalName()
self[internalname] = newmodule
table.insert(self.modules,newmodule)
newmodule:Init()
game:SendToConsole("added "..newmodule:Name().." module ("..i.." of "..#modules..")")
end
You'll also notice its now printing out the iteration of the loop, and the number of modules being loaded so it should be clearer exactly what kind of trickery is at hand if an infinite loop does indeed occur
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Also, experimental code:
Code: Select all
require "query.lua"
-- grab all solar collectors within a radius of 1000
position = ...
solar_collector_units = query({
"unit_type" = "corsolar",
"within" = {
"position"= position,
"radius" = 1000
}
})
- Attachments
-
- query.lua
- (1.63 KiB) Downloaded 146 times
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Hi there,
I have a short Question, is it possible for Shard to use Lua Widgets like Stockpiler?
I could not find anything about that in the Forum or the Wiki.
Thx
I have a short Question, is it possible for Shard to use Lua Widgets like Stockpiler?
I could not find anything about that in the Forum or the Wiki.
Thx
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
They would need to be modified as the Lua VM in shard and the Lua VM in Spring are not the same, neither are the APIs.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Hi AF,
to bad to hear that. To use existing Lua widgets could solve some problems with my BA config.
For example building of Anti Nuke or use of Nanoturrets.
Thx for the answer and keep up the good Work on Shard.
mfg
SSvO
to bad to hear that. To use existing Lua widgets could solve some problems with my BA config.
For example building of Anti Nuke or use of Nanoturrets.
Thx for the answer and keep up the good Work on Shard.

mfg
SSvO
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Code: Select all
virtual void ExecuteCustomCommand(int cmdId, std::vector<float> params_list, short options, int timeOut);
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
So, is there a working build of shard somewhere?
I find it incredibly annoying that it lies dormant and broken for half a year (this is why I made such a big deal about you turning it into a gadget AI -- I still don't understand how you have anything to lose by doing this).
Is it going to be working in the next version of spring?
(On the idea of gadget ai), take a mutator of Evo and turn it into a gadget ai showcase wet dream (Nice way to demonstrate it's usage and stuff, but whatever works).
Meh anyway. Would be nice to see it working at some point.
I find it incredibly annoying that it lies dormant and broken for half a year (this is why I made such a big deal about you turning it into a gadget AI -- I still don't understand how you have anything to lose by doing this).
Is it going to be working in the next version of spring?
(On the idea of gadget ai), take a mutator of Evo and turn it into a gadget ai showcase wet dream (Nice way to demonstrate it's usage and stuff, but whatever works).
Meh anyway. Would be nice to see it working at some point.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Clearly no attention was paid to by Forb:
- The infinite loop bug only affected mingw32 builds made by buildbot. It never affected the Visual Studio builds I put out.
- Shortly after the engine release with the broken build, I released a VS dll that worked and was a drop in replacement
- The bug that caused the infinite loop issue was found 2 weeks later by Abma
- Azaremoth has already posted in the engine release threads exclaiming his delight that it is all working again
- We've spoken already about gadgetising Shard, the conclusion was that you would start work with my guidance. IIRC you were surprised by how easy the task would be and had expected it to be a lot more complicated
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
And yet, after all this, it was still broken. You haven't even bothered to fix the evo lowenergybehavior bug (getresourcebyname()) in the source, and that's all of a 6 character fix O_o.AF wrote:Clearly no attention was paid to by Forb:
- The infinite loop bug only affected mingw32 builds made by buildbot. It never affected the Visual Studio builds I put out.
- Shortly after the engine release with the broken build, I released a VS dll that worked and was a drop in replacement
- The bug that caused the infinite loop issue was found 2 weeks later by Abma
- Azaremoth has already posted in the engine release threads exclaiming his delight that it is all working again
Actually, you came to that conclusion, and I acquiesced due to the gigantic temper tantrum that you threw and lack of any real choice (other than letting you self-destruct <-> I will not be doing you that favor a second time).AF wrote:
- We've spoken already about gadgetising Shard, the conclusion was that you would start work with my guidance. IIRC you were surprised by how easy the task would be and had expected it to be a lot more complicated
That said, if it's so easy, why don't you get it gadgetized, then let me maintain it (because you obviously don't want to have to deal with it after the fact)?
Wouldn't that make a lot more sense? Instead, you're basically asking me to drop everything and spend several days working on something I don't even understand and somehow magically I'm supposed to understand enough of what I'm doing to move it over.
If by guidance you mean "Explicit instructions", ok I can work with that. But if my guidance you mean "random tidbits of help here and there"...
However on the subject of you gadgetizing it initially then letting me maintain it (I really don't understand what would need to be done as far as maintenance other than changing the code when lua calls and stuff like that gets changed) would make a lot more practical sense wouldn't it?
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Because so far all signs point towards gadgetising being a headache, specifically induced by you, and far from it you're actually better qualified than me to do it, since you have a better knowledge of the Spring gadget APIs. I've already pointed out exactly how you would convert a function to work with both APIs:
That example's been sitting on github for quite a while, it's been linked to from this thread, and it's been sent to you directly. Some functions like 'test' could be ignored.
The other functions I explained what needed to be done and mentioned I was here to help, but it was never requested so it's fair to assume it was never needed.
Pending any major blow ups, the C++ part of Shard is pretty much finalised, there is little to change or add, and it's building and working in mingw32 now, so the chances of a major catastrophe or broken Shard dll/so/dylib are now miniscule at worst. The codebase is small, simple, and easier to maintain than a full blown AI.
Those parts that are likely to need changing are sitting in lua files, readily editable and updateable at any time by any person ( including you ). There's nothing stopping you forking the Shard repo, pullling it down to your local machine in github for windows, editing those 6 characters, typing "changed 6 chars" in the commit box, then clicking 'sync' to send it back to github, then opening a pull request for me to grab your changes.
You don't even have to use github for windows, you can point tortoiseSVN at your fork and use the tools you're already using.
I made it clear a while ago I'd like it if the game specific code was setup as submodules/externals that people like you maintained, so that you could iterate without waiting for me or being delayed by releases, to put you in control.
Code: Select all
function game:Frame() -- returns int/game frame number
if Spring ~= nil then
return Spring.GetGameFrame() -- Spring Gadget API
else
return game_engine:Frame() -- Shard AI API
end
end
The other functions I explained what needed to be done and mentioned I was here to help, but it was never requested so it's fair to assume it was never needed.
Pending any major blow ups, the C++ part of Shard is pretty much finalised, there is little to change or add, and it's building and working in mingw32 now, so the chances of a major catastrophe or broken Shard dll/so/dylib are now miniscule at worst. The codebase is small, simple, and easier to maintain than a full blown AI.
Those parts that are likely to need changing are sitting in lua files, readily editable and updateable at any time by any person ( including you ). There's nothing stopping you forking the Shard repo, pullling it down to your local machine in github for windows, editing those 6 characters, typing "changed 6 chars" in the commit box, then clicking 'sync' to send it back to github, then opening a pull request for me to grab your changes.
You don't even have to use github for windows, you can point tortoiseSVN at your fork and use the tools you're already using.
I made it clear a while ago I'd like it if the game specific code was setup as submodules/externals that people like you maintained, so that you could iterate without waiting for me or being delayed by releases, to put you in control.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
If that is true, then that is disturbing and eye opening.AF wrote:Because so far all signs point towards gadgetising being a headache, specifically induced by you, and far from it you're actually better qualified than me to do it, since you have a better knowledge of the Spring gadget APIs.
How is it that I would have better knowledge of the spring gadget APIs? (yes this is a serious question)
If I had help (IE someone telling me what to do), I'd be happy to do it, but I can't just look at it and poof it into existence based upon sheer willpower.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Simple: Because you actively maintain a game and I don't. While I've delved into those APIs in the past, I haven't continuously maintained a game for as long as you have, nevermind released and exposed it to the public.
So a lot of it gets forgotten, and tbh the wiki is nightmarish, there's no big list of all the functions, and it's all hidden behind 4 or 5 pages with cryptic names like 'Lua_SyncedCtrl' or 'Lua_ConstGame', lets say I want to find out how wide the map is, I have to pull up every single page and search because it's not clear, is it LuaConstGame? The map doesn't change width last I checked, but it might be 'Lua_SyncedRead' because it's synced data and I want to read it.
Whereas it's much easier for me to use the existing C++ API I wrote and the wrappers around it. There's no benefit for me in learning any of the Spring APIs, and real visible costs and headaches both technically ( learning curve ) and socially ( complaining end users ).
So,
As I keep saying, for instructions please refer to above posts, the vast majority of the work is simple and quite easy:
It's all laid out in 1 single file.
I should hope you realise that pestering me like this is doing the opposite of what you want. By persisting you are guaranteeing a gadget free future for Shard by ensuring:
To date Forboding has typed at least 3x as many words arguing for gadgetising Shard, as it would take to actually do the work, most of which can be eliminated by introducing copy paste into the workflow.
We both know the lobbying stick does absolutely nothing to help here, what your doing is a "I'm going to blackmail you into doing stuff for me, and if you don't I'm going to scream and shout in your thread", and I really don't like it, it's incredibly demotivating. I was getting back into the mood of doing things, I had a new terrain based attack system formulated, now I just have this feeling of dread and hassle back again, thanks a lot
So a lot of it gets forgotten, and tbh the wiki is nightmarish, there's no big list of all the functions, and it's all hidden behind 4 or 5 pages with cryptic names like 'Lua_SyncedCtrl' or 'Lua_ConstGame', lets say I want to find out how wide the map is, I have to pull up every single page and search because it's not clear, is it LuaConstGame? The map doesn't change width last I checked, but it might be 'Lua_SyncedRead' because it's synced data and I want to read it.
Whereas it's much easier for me to use the existing C++ API I wrote and the wrappers around it. There's no benefit for me in learning any of the Spring APIs, and real visible costs and headaches both technically ( learning curve ) and socially ( complaining end users ).
So,
As I keep saying, for instructions please refer to above posts, the vast majority of the work is simple and quite easy:
Code: Select all
If 'Spring' isnt nil
use the spring API
else
use the shard API
I should hope you realise that pestering me like this is doing the opposite of what you want. By persisting you are guaranteeing a gadget free future for Shard by ensuring:
- You're too busy pestering me to do it yourself
- You've pissed me off too much to be nice and do it for you
- You've made the idea toxic preventing other people from doing it too
To date Forboding has typed at least 3x as many words arguing for gadgetising Shard, as it would take to actually do the work, most of which can be eliminated by introducing copy paste into the workflow.
We both know the lobbying stick does absolutely nothing to help here, what your doing is a "I'm going to blackmail you into doing stuff for me, and if you don't I'm going to scream and shout in your thread", and I really don't like it, it's incredibly demotivating. I was getting back into the mood of doing things, I had a new terrain based attack system formulated, now I just have this feeling of dread and hassle back again, thanks a lot
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
I asked you several simple questions. Get over it and stop acting like I insulted your grandmother.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
TLDR: Unless you need help making the Shard APIs support gadgets, don't bother me with it, I made my stance crystal clear & no amount of persuasion will make me change my mind
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Hello,
I'm receiving a strange Error message while playing BA with Shard.
I have no idea what this cause, but after the error appears Shard stop building units.
btw. is there a limit how much factories are producing units at the same time? after an Hour, or so, the early build factories stop producing units.
I'm playing a self compiled version of the 0.91 source with small changes to turn off the packet and bandwidth limit. I found these changes in an other Thread.
I compiled with MinGW under Windows 7, with CPU optimization for Core2Duo. (i don't know if that matters)
I have no idea how to post the Error message, so i will attach a Screenshot.
http://ssvo.de/sharderror.jpg
Maybe some one can help me with that?
Thx
SSvO
I'm receiving a strange Error message while playing BA with Shard.
I have no idea what this cause, but after the error appears Shard stop building units.

btw. is there a limit how much factories are producing units at the same time? after an Hour, or so, the early build factories stop producing units.
I'm playing a self compiled version of the 0.91 source with small changes to turn off the packet and bandwidth limit. I found these changes in an other Thread.
I compiled with MinGW under Windows 7, with CPU optimization for Core2Duo. (i don't know if that matters)
I have no idea how to post the Error message, so i will attach a Screenshot.
http://ssvo.de/sharderror.jpg
Maybe some one can help me with that?
Thx
SSvO
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Once an error occurs all further behaviour is undefined, focus on the first error to occur, not the subsequent ones.
Can you get me a copy of infolog.txt?
Shard in BA should just spam factories conbots mexes and a handful of t1 units, I've made no attempt to optimise its gameplay and nobody has stepped forward with improved build lists.
Can you get me a copy of infolog.txt?
Shard in BA should just spam factories conbots mexes and a handful of t1 units, I've made no attempt to optimise its gameplay and nobody has stepped forward with improved build lists.
Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey
Hi AF,
thanks for your relpy, here is my infolog.txt
http://www.ssvo.de/spring/infolog.txt
I hope that will help you, i quit the game short after the first error.
If needed i can do a longer running game.
And here is my BA Taskqueues.lua, pleas don't blame me for my bad coding style...
Its mostly copy&paste thing together, and a work in progress.
http://www.ssvo.de/spring/taskqueues.lua
thanks for your relpy, here is my infolog.txt

http://www.ssvo.de/spring/infolog.txt
I hope that will help you, i quit the game short after the first error.
If needed i can do a longer running game.
And here is my BA Taskqueues.lua, pleas don't blame me for my bad coding style...

Its mostly copy&paste thing together, and a work in progress.
http://www.ssvo.de/spring/taskqueues.lua