AI scripting: debug() output file

For AI and campaign script related discussions and questions
Post Reply
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

AI scripting: debug() output file

Post by DylanDog »

I have not been able to find out where the h*ll are put all messaged printed using the debug() function in the AIscript. Any idea where it can be or which is at least the file name? I thought it should be the stdout.txt but it is not.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
Ai_Tak
Rookie
Rookie
Posts: 26
Joined: 23 Dec 2009, 05:06

Re: AI scripting: debug() output file

Post by Ai_Tak »

How many parameters can/does debug(...) take?
What is the significance traceOn() and traceOff()?

I've seen output to stdout.txt, but it's only symbols, no letters or numbers or anything that makes sense.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: AI scripting: debug() output file

Post by DylanDog »

Ai_Tak wrote:How many parameters can/does debug(...) take?
What is the significance traceOn() and traceOff()?
It takes only one parameter...the text to be printed. I think I am going to issue a bug ticket for this.

...ticket opened
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: AI scripting: debug() output file

Post by Per »

Ticket closed ;)

I looked into it. It dumps information into stderr (or stderr.txt) if the warzone executable is started with the '--debug script' command line parameter. Otherwise the output is ignored.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: AI scripting: debug() output file

Post by DylanDog »

Per wrote:Ticket closed ;)

I looked into it. It dumps information into stderr (or stderr.txt) if the warzone executable is started with the '--debug script' command line parameter. Otherwise the output is ignored.
Ok, thanks a lot Per for checking this! Is there any way I can force this output into the AI script?
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: AI scripting: debug() output file

Post by Per »

DylanDog wrote:Is there any way I can force this output into the AI script?
No. Perhaps you could explain what you want or need, then I can see if I can code it? Why is the current approach not good enough?
Ai_Tak
Rookie
Rookie
Posts: 26
Joined: 23 Dec 2009, 05:06

Re: AI scripting: debug() output file

Post by Ai_Tak »

So what is actually outputting to stdout.txt? I find random stuff in stdout.txt from time to time, such as:
(-)[]()(-)[]()(-)[]()(-)[]()(-)[]()#()#()#()''''''''#####()''''#()''''#####()#####()#()#()#()#()#####()#()#()#()#()''''#()#####()#()#()#()#()#()#()#()#####()#()#()#()''''#########()#()#()#####()#()#()#()#()#()#####()#()#####()#########()#()#()#()#()#()#()#()#####()#()#()#()''''#()#####()#()#()#()#()#()#####()#()#()#()#()#()#()#()''''''''#####()#()#()#()#()#()#####()#()#()#()#####()(-)[]()(-)[]()(-)[]()#()''''###()''''####''''#()''''##''''###()''''#()#()''''#####()###()#()''''###()''''#()###()''''#####()#()###()''''#()#()''''###()''''#()###()#####()###()###()#()#()###()###()''''###()###()###()#()###()###()###()#()''''#####()#()###()#()###()#######()#()###()(-)[]()(-)[]()(-)[]()#####()###()#()#####()#()`
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: AI scripting: debug() output file

Post by DylanDog »

I have no idea.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: AI scripting: debug() output file

Post by Per »

Me neither. I am just beginning to look at the AI now (the default one) because nobody else is.
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: AI scripting: debug() output file

Post by DylanDog »

Per wrote:
DylanDog wrote:Is there any way I can force this output into the AI script?
No. Perhaps you could explain what you want or need, then I can see if I can code it? Why is the current approach not good enough?
My idea is to use the debug only for bug reporting in the stable releses while in the test ones I would print off also some statistics concerning the AI and what the human player is doing (researches, units built, defences built and so on...). Players could then send me the log file to show me the tactic used to beat the AI.

This is what I would like to have:

1) Ideally the output file should be a different one then stderr.txt (debug.log as file name could be ok)
2) If I can activate the outpt via the AI vscript I could activate it as default in AI "test" versions, while in the stable releases it will be used for bug reporting purposes only. This to avoid to ask people who plays with the test version to use the command line parameter.

But if this is too much work just leave it.

DD
Last edited by DylanDog on 03 Jan 2010, 16:50, edited 1 time in total.
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
User avatar
DylanDog
Code contributor
Code contributor
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany
Contact:

Re: AI scripting: debug() output file

Post by DylanDog »

Per wrote:Me neither. I am just beginning to look at the AI now (the default one) because nobody else is.
I saw you are currently developing an improved version of the standard AI, maybe you could implement some pieces of code I used for DyDo, like the one to assign the best ranges to the droids: when a droid is built, you check for the weapon type and then you assign the range (short or long) for that droid. If you use the piece of codes I used in DyDo this will save you some boring "data enter" to create the arrays to store the weapons...this is just an idea...
My Warzone 2100 mods:
Download DyDo-AI for Warzone skirmish/multiplayer games.
Download A2C-HM (Alpha 2 Campaign - Hard Mode).
Download A3C-HM (Alpha 3 Campaign - Hard Mode).
Post Reply