#2755 closed defect (fixed)
Allow bots to quit game for testing
Reported by: | agentx | Owned by: | ben |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 17 |
Component: | AI | Keywords: | |
Cc: | Patch: |
Description
http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/gui/session/messages.js
90 "quit": function(notification, player) 91 { 92 exit(); // TODO this doesn't work anymore 93 },
Would be very useful to launch multiple games one after the other for overnight testing.
Change History (22)
comment:1 by , 10 years ago
Keywords: | AI Testing removed |
---|---|
Milestone: | Alpha 17 → Alpha 18 |
comment:2 by , 10 years ago
Made some research it's broken since : http://trac.wildfiregames.com/changeset/15394/
It's because of the cleanup the way argument are passed changed, and that maybe broke quickstart too.
comment:3 by , 10 years ago
You could restore it as a temporary hack but I'm not sure that's a good idea :)
follow-up: 5 comment:4 by , 10 years ago
Milestone: | Alpha 18 → Alpha 17 |
---|
Looks like there is unfinished and untested work, doesn't look complex at all.
comment:5 by , 10 years ago
Replying to agentx:
Looks like there is unfinished and untested work, doesn't look complex at all.
What I meant is that it's not a trivial fix (otherwise a TODO wouldn't have been added), and nobody is taking care of that, so I guess this won't be fixed before release. I may be wrong though, if you think it's easily fixable you can submit a patch and prove I am :)
comment:6 by , 10 years ago
if you think it's easily fixable you can submit a patch and prove I am
Interesting logic. We can make a deal: You finish Hannibal and I commit the fix. So it is shown work is done faster if swapped mid term. Has some potential, think about!
comment:7 by , 10 years ago
Hmm, I probably lacked some diplomacy here and I'm sorry about it, but you have to understand that if we postpone the feature to a18 it's because we don't think we are capable to do it in time, so the only other alternative is that someone else does it...
comment:8 by , 10 years ago
Well, I'm not asking for a _new_ feature, I'm asking for a functionality that already worked and got lost recently as indicated by the word: 'anymore' in the comment. Whether code work for releases should be finished or not is not part of my responsibility. What I can offer is to check whether the other ~50 commands are still accepted by the engine.
comment:9 by , 10 years ago
Milestone: | Alpha 17 → Alpha 18 |
---|
If someone fixes this for A17, they can move the milestone back.
comment:10 by , 10 years ago
It would help to know if there is/ever was any documentation or useful comments. I'm quite sure exit did work once, at least as I started to dev with A15. What has to be taken care of while closing the game properly and is there an option to close it a la "don't care"? Is there an entry point for the latter?
Fixing a feature without any words on how it was meant to work is not realistic to happen.
follow-up: 16 comment:11 by , 10 years ago
Try changing exit()
to Engine.Exit()
. I don't even know how this would be used - without a simple test case, I can't easily know if it's fixed or not.
follow-up: 13 comment:12 by , 10 years ago
I'd build a quick test bot, but autostart doesn't work, so choose Petra as bot and copy these lines into _petrabot.js
m.PetraBot.prototype.OnUpdate = function(sharedScript) { // test start if (this.playedTurn > 5) { Engine.PostCommand(PlayerID, { type: "quit"}); } else { Engine.PostCommand(PlayerID, {type: "chat", message: this.playedTurn}); } // test end if (this.gameFinished)
Expected behaviour is some chat messages and no trace of pyrogenesis left in task manager or htop.
comment:13 by , 10 years ago
Replying to agentx:
I'd build a quick test bot, but autostart doesn't work, so choose Petra as bot and copy these lines into _petrabot.js
m.PetraBot.prototype.OnUpdate = function(sharedScript) { // test start if (this.playedTurn > 5) { Engine.PostCommand(PlayerID, { type: "quit"}); } else { Engine.PostCommand(PlayerID, {type: "chat", message: this.playedTurn}); } // test end if (this.gameFinished)Expected behaviour is some chat messages and no trace of pyrogenesis left in task manager or htop.
When did autostart stop working? It worked fine for me just a couple months ago.
comment:14 by , 10 years ago
It did ;) now I ´m getting errors and can use agentx python script see yesterdays conv for the link
follow-up: 18 comment:15 by , 10 years ago
When did autostart stop working?
forum: http://www.wildfiregames.com/forum/index.php?showtopic=19105 ticket: #2798
comment:16 by , 10 years ago
Replying to historic_bruno:
Try changing
exit()
toEngine.Exit()
. I don't even know how this would be used - without a simple test case, I can't easily know if it's fixed or not.
agentx: Have you tried that?
comment:17 by , 10 years ago
TIMER| common/global.xml: 4.51868 ms GAME STARTED, ALL INIT COMPLETE ERROR: notification without players found. ({type:"quit"})
That's all. Let me know if you have a fix.
comment:18 by , 10 years ago
Replying to agentx:
When did autostart stop working?
forum: http://www.wildfiregames.com/forum/index.php?showtopic=19105 ticket: #2798
Mixing everything is not the best way to solve problems. The problem you quote here is that civs are not properly transmitted when running on scenarios. I don't see how this would prevent you from testing the exit function (for which you don't care about civs, and anyway you could always test it in skirmishes where autostart do work as expected).
comment:20 by , 10 years ago
Milestone: | Alpha 18 → Alpha 17 |
---|
This is a bit too complex to be fixed before release IMO.