Has anyone been able to implement some feedback onscreen while testing the ai?
I noticed the topic abobout aitrace, but that just left me with a nice "ai fatal error" and crashed the game....
I've been working a bit on the ai, and it's going quite well, but I would really need some way to debug it. So that I can se what the ai does.
Iv'e noticed there's a print() function several places in the ai code but I can't seem to "activate" it.
Any help on the matter would be greatly appreciated.
Regards,
kreative
print(), aitrace() and what not...
Started by kreative, Jan 28 2005 03:46 PM
3 replies to this topic
#2
Posted 28 January 2005 - 06:48 PM
Kreative! Wow.. man.. nice seeing ya drop by! Hows the AI total re-code going? How far are you through it?
Btw, you've seen this thread right?
http://forums.revora...showtopic=16053
Further, are you talking about getting an aidebug.log dump of the AI's functions as your playing a game?
Essentially it looks like this:
File: cpu_manager.ai
File: cpu_manager.ai
Finally, add this too to utility.ai:
As mentioned in the above link, Larkin is able to take it a step further and get to record a timeline so one can tweak based on a time reference.
Btw, you've seen this thread right?
http://forums.revora...showtopic=16053
Further, are you talking about getting an aidebug.log dump of the AI's functions as your playing a game?
Essentially it looks like this:
File: cpu_manager.ai
self.debug = falseSet this to True
File: cpu_manager.ai
function CpuManager:Print( x, y, text ) -- the selected color of the text: local colour = {255,255,192} dr_text2d( "aidebug"..self.player_id, x, y, text, colour[1], colour[2], colour[3] ) -- log debug output to file (turn self.debug=true to activate!) ailog("e:\\aidebug.log", text) endAdd the above near the same location. Change the "e:\\" to whatever location you want to save the .log file as it writes to the drive.
Finally, add this too to utility.ai:
--AI log dump to text file (activate in cpu_manager.ai when self.debug = true) function ailog( logfile, msg ) local log log = io.open( logfile , "a+" ) if player_id == nil then log:write("AI"," ", tostring(msg) , "\n") else log:write("AI"..player_id," ", tostring(msg) , "\n") end log:close() end
As mentioned in the above link, Larkin is able to take it a step further and get to record a timeline so one can tweak based on a time reference.
Edited by thudo, 28 January 2005 - 06:49 PM.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
#3
Posted 29 January 2005 - 08:42 AM
I tried the steps provided with aitrace, but I just get a fatal error.
What I do now is just play with an ally and keep an eye on his moves.
The project is going quite well now though, but I still need to set some new rules since I'm basing my AI on my mod.
However, I hope to create it in such a way that others will test it aswell.
What I do now is just play with an ally and keep an eye on his moves.
The project is going quite well now though, but I still need to set some new rules since I'm basing my AI on my mod.
However, I hope to create it in such a way that others will test it aswell.
#4
Posted 29 January 2005 - 10:49 PM
Please keep us informed, kreative. Since early Jan I've been totally entralled by your work to fully and completely re-write DoW's LUA AI structure. Looking so forward to seeing how you can make it far more readable than what it currently is.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
Dawn of War Advanced AI Headquarters
Latest DoW Advanced AI Download!
Reply to this topic
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users