AI scripting: debug() output file

For AI and campaign script related discussions and questions

AI scripting: debug() output file

Postby DylanDog » 16 Dec 2009, 22:23

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).
User avatar
DylanDog
Code contributor
Code contributor
 
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany

Re: AI scripting: debug() output file

Postby Ai_Tak » 26 Dec 2009, 07:25

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.
Ai_Tak
Rookie
Rookie
 
Posts: 26
Joined: 23 Dec 2009, 05:06

Re: AI scripting: debug() output file

Postby DylanDog » 31 Dec 2009, 13:42

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).
User avatar
DylanDog
Code contributor
Code contributor
 
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany

Re: AI scripting: debug() output file

Postby Per » 31 Dec 2009, 14:12

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.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3627
Joined: 03 Aug 2006, 19:39

Re: AI scripting: debug() output file

Postby DylanDog » 02 Jan 2010, 17:03

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).
User avatar
DylanDog
Code contributor
Code contributor
 
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany

Re: AI scripting: debug() output file

Postby Per » 02 Jan 2010, 18:33

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?
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3627
Joined: 03 Aug 2006, 19:39

Re: AI scripting: debug() output file

Postby Ai_Tak » 03 Jan 2010, 04:41

So what is actually outputting to stdout.txt? I find random stuff in stdout.txt from time to time, such as:
(-)[]()(-)[]()(-)[]()(-)[]()(-)[]()#()#()#()''''''''#####()''''#()''''#####()#####()#()#()#()#()#####()#()#()#()#()''''#()#####()#()#()#()#()#()#()#()#####()#()#()#()''''#########()#()#()#####()#()#()#()#()#()#####()#()#####()#########()#()#()#()#()#()#()#()#####()#()#()#()''''#()#####()#()#()#()#()#()#####()#()#()#()#()#()#()#()''''''''#####()#()#()#()#()#()#####()#()#()#()#####()(-)[]()(-)[]()(-)[]()#()''''###()''''####''''#()''''##''''###()''''#()#()''''#####()###()#()''''###()''''#()###()''''#####()#()###()''''#()#()''''###()''''#()###()#####()###()###()#()#()###()###()''''###()###()###()#()###()###()###()#()''''#####()#()###()#()###()#######()#()###()(-)[]()(-)[]()(-)[]()#####()###()#()#####()#()`
Ai_Tak
Rookie
Rookie
 
Posts: 26
Joined: 23 Dec 2009, 05:06

Re: AI scripting: debug() output file

Postby DylanDog » 03 Jan 2010, 16:26

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).
User avatar
DylanDog
Code contributor
Code contributor
 
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany

Re: AI scripting: debug() output file

Postby Per » 03 Jan 2010, 16:37

Me neither. I am just beginning to look at the AI now (the default one) because nobody else is.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3627
Joined: 03 Aug 2006, 19:39

Re: AI scripting: debug() output file

Postby DylanDog » 03 Jan 2010, 16:46

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

Re: AI scripting: debug() output file

Postby DylanDog » 03 Jan 2010, 16:50

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).
User avatar
DylanDog
Code contributor
Code contributor
 
Posts: 347
Joined: 08 Apr 2009, 15:15
Location: Germany


Return to Scripting