From: Mike B. <com...@ip...> - 2012-04-18 05:28:05
|
While playing a game of 1830 (simple Option) recently, I noticed a pair of subtle bugs in the game system. Log files for these bugs are not available but saved games are, and I have verified that the bugs are reproducible using the specific techniques described below. Bug #1: Problem ending company Op round when president has been forced to sell shares. Details: The B&O president has just been forced to sell shares in order to raise the capital for a diesel. Play then moves to the newly-launched C&O, but the game freezes. C&O never gets to lay track, the map window (top left) reads "lay token" and "no token" and both choices are greyed out, as are the buttons at the bottom of the map window ("Done", "undo", "redo"). However, as soon as "save game" is performed, the problem clears itself. To reproduce this bug: 1. load 1830_20120415_0220_M4.rails. 2. In the game report, locate and click on the entry that reads "B&O does not pay a dividend", then "play from here." 3. In the map window, click on "buy train". Note the relative order of L&N and C&O shares. 4. Sell 2 shares of PRR, 1 share of NYC, and (critical) 1 share of L&N. Note that the relative order of L&N and C&O shares have changed because of the sale of shares. 5. Click "done". Bug #2: Incorrect display of company names when returning to an earlier action and clicking "play from here". Details: shortly thereafter in the same game, the L&O took its op round. Despite the "unlimited tiles option being turned on, the game would not permit a standard yellow city tile (57) to be placed at location H4, the L&O's home base. This appears to be due to an incomplete processing of past actions in the "play from here" function, specifically stock movement resulting from the forced sale of shares. To reproduce this bug: 1. load 1830_20120415_0224_M2.rails 2. In the game report, locate and click on "M2 sells 1 10% certificate of NYC to pool for $50", then "play from here". 3. In the Map window, note that the relative order of L&N and C&O shares is the same as before the B&O president sold a share of the L&N even though the game report shows this event as having occurred. 4. In the Map Window, click "done". 5. Game will not permit L&N to lay a tile in it's home base. The game is highlighting valid tile lays for the C&O (which SHOULD operate now) and will permit either of those tiles to be layed. 6. If you lay a tile, click "no token", and buy a diesel, it is the C&O who gains the train. Click "done". 7. Play then moves to the C&O according to the (incorrect) map window display, and all actions appropriate to the L&N's turn (tile lay at H4, purchase of a diesel etc). Mike Bourke Campaign Mastery http://www.campaignmastery.com Co-author, Assassin's Amulet http://www.legaciescampaignsetting.com |
From: Stefan F. <ste...@we...> - 2012-05-02 05:12:10
|
Mike: thanks for the (detailed) bug reports. I can confirm both bugs. Both are related to the fact the undo mechanism of Rails still has a few bugs remaining. As going back in game history is based on the undo mechanism it shares the issues. This is one of the issues which will be addressed in Rails2.x and will be (hopefully) easier to identifier and fix. As I focus on the core of the rails2.x now (and this is harder work or better more tedious work as I hoped it to be), I abstain from looking into the precise nature of the bugs (though I have some ideas where to start). Maybe Erik will have a look into it? Usually the effects will not survive reload (as it replays the game from the beginning and thus does not use undo). So either the game is loaded in a correct state (most cases) or it is broken and unloadable (only a few cases). A general workaround would be a menu item that allows an automatic replay which simulates the sequence of a save and reload and will get the game back into a reasonable state automatically? Stefan On 04/18/2012 07:26 AM, Mike Bourke wrote: > While playing a game of 1830 (simple Option) recently, I noticed a pair of > subtle bugs in the game system. Log files for these bugs are not available > but saved games are, and I have verified that the bugs are reproducible > using the specific techniques described below. > > Bug #1: Problem ending company Op round when president has been forced to > sell shares. > > Details: The B&O president has just been forced to sell shares in order to > raise the capital for a diesel. Play then moves to the newly-launched C&O, > but the game freezes. C&O never gets to lay track, the map window (top left) > reads "lay token" and "no token" and both choices are greyed out, as are the > buttons at the bottom of the map window ("Done", "undo", "redo"). However, > as soon as "save game" is performed, the problem clears itself. > > To reproduce this bug: > > 1. load 1830_20120415_0220_M4.rails. > 2. In the game report, locate and click on the entry that reads "B&O does > not pay a dividend", then "play from here." > 3. In the map window, click on "buy train". Note the relative order of L&N > and C&O shares. > 4. Sell 2 shares of PRR, 1 share of NYC, and (critical) 1 share of L&N. Note > that the relative order of L&N and C&O shares have changed because of the > sale of shares. > 5. Click "done". > > Bug #2: Incorrect display of company names when returning to an earlier > action and clicking "play from here". > > Details: shortly thereafter in the same game, the L&O took its op round. > Despite the "unlimited tiles option being turned on, the game would not > permit a standard yellow city tile (57) to be placed at location H4, the > L&O's home base. This appears to be due to an incomplete processing of past > actions in the "play from here" function, specifically stock movement > resulting from the forced sale of shares. > > To reproduce this bug: > > 1. load 1830_20120415_0224_M2.rails > 2. In the game report, locate and click on "M2 sells 1 10% certificate of > NYC to pool for $50", then "play from here". > 3. In the Map window, note that the relative order of L&N and C&O shares is > the same as before the B&O president sold a share of the L&N even though the > game report shows this event as having occurred. > 4. In the Map Window, click "done". > 5. Game will not permit L&N to lay a tile in it's home base. The game is > highlighting valid tile lays for the C&O (which SHOULD operate now) and will > permit either of those tiles to be layed. > 6. If you lay a tile, click "no token", and buy a diesel, it is the C&O who > gains the train. Click "done". > 7. Play then moves to the C&O according to the (incorrect) map window > display, and all actions appropriate to the L&N's turn (tile lay at H4, > purchase of a diesel etc). > > Mike Bourke > Campaign Mastery http://www.campaignmastery.com > Co-author, Assassin's Amulet http://www.legaciescampaignsetting.com > > > > > > > --- > avast! Antivirus: Outbound message clean. > Virus Database (VPS): 120417-0, 17/04/2012 > Tested on: 18/04/2012 3:26:57 PM > avast! - copyright (c) 1988-2012 AVAST Software. > http://www.avast.com > > > > > > > > ------------------------------------------------------------------------------ > Better than sec? Nothing is better than sec when it comes to > monitoring Big Data applications. Try Boundary one-second > resolution app monitoring today. Free. > http://p.sf.net/sfu/Boundary-dev2dev > > > > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |
From: Mike B. <com...@ip...> - 2012-05-02 09:42:43
|
I think that the proposed solution probably doesn't go far enough - when "undoing" an action, the game should retreat to the step before the action from which play is to continue, the game should be saved and automatically reloaded, and then that final step repeated, so that play always continues in a "clean" environment. Repeating that final action rather than saving and reloading at that point would ensure that the entry into the action to be repeated always took place in as "game natural" an environment as possible, bypassing any complications from the save/reload process. That might not be necessary, and it would almost certainly be a more complicated implementation, but it has other advantages. Another possibility is to automatically save the current game and BEFORE implementing an "undo" action so that a "redo" is possible. Mike Bourke Campaign Mastery http://www.campaignmastery.com Co-author, Assassin's Amulet http://www.legaciescampaignsetting.com --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 120501-0, 01/05/2012 Tested on: 2/05/2012 7:41:49 PM avast! - copyright (c) 1988-2012 AVAST Software. http://www.avast.com |
From: Erik V. <eri...@xs...> - 2012-05-02 12:07:42
|
> I can confirm both bugs. Both are related to the fact the undo mechanism of > Rails still has a few bugs remaining. > > As going back in game history is based on the undo mechanism it shares the > issues. > > This is one of the issues which will be addressed in Rails2.x and will be > (hopefully) easier to identifier and fix. > As I focus on the core of the rails2.x now (and this is harder work or better > more tedious work as I hoped it to be), I abstain from looking into the precise > nature of the bugs (though I have some ideas where to start). Maybe Erik will > have a look into it? I will try. Hints are welcome. > Usually the effects will not survive reload (as it replays the game from the > beginning and thus does not use undo). So either the game is loaded in a > correct state (most cases) or it is broken and unloadable (only a few cases). A > general workaround would be a menu item that allows an automatic replay > which simulates the sequence of a save and reload and will get the game > back into a reasonable state automatically? Reload does not actually reprocess previous actions, it only checks if all saved game actions are either identical to the actions currently in memory, or new (i.e. later than the last action currently in memory). The problem is that we don't yet have a good way to clear a whole game other than by exiting and restarting Rails. Perhaps it would work, but I'm afraid the hard part is cleaning up memory. There are thousands of (old and current) objects holding references to each other, and I expect a thorough cleanup will require a lot of extra code. Erik |
From: Stefan F. <ste...@we...> - 2012-05-02 12:31:32
|
Erik & Mike: sorry I confused both of you (but each in a different way ;-)) by using the words "save" and "reload". What I meant by simulating "save and reload" this is basically the replaying the game as Erik suggested below. From the back-end side of Rails starting a new game inside the existing Rails instance is not an issue anymore (as I fixed the few showstoppers for the automated testing where all games are replayed sequentially in one instance of a java vm), so it is possible to start a new game without having troubles with the other. There might still be problems arise from the UI side, but it should be not that difficult as I cannot remember any "global" state used in the UI, but I am not the expert there. Stefan On 05/02/2012 02:07 PM, Erik Vos wrote: >> I can confirm both bugs. Both are related to the fact the undo mechanism > of >> Rails still has a few bugs remaining. >> >> As going back in game history is based on the undo mechanism it shares the >> issues. >> >> This is one of the issues which will be addressed in Rails2.x and will be >> (hopefully) easier to identifier and fix. >> As I focus on the core of the rails2.x now (and this is harder work or > better >> more tedious work as I hoped it to be), I abstain from looking into the > precise >> nature of the bugs (though I have some ideas where to start). Maybe Erik > will >> have a look into it? > > I will try. Hints are welcome. > >> Usually the effects will not survive reload (as it replays the game from > the >> beginning and thus does not use undo). So either the game is loaded in a >> correct state (most cases) or it is broken and unloadable (only a few > cases). A >> general workaround would be a menu item that allows an automatic replay >> which simulates the sequence of a save and reload and will get the game >> back into a reasonable state automatically? > > Reload does not actually reprocess previous actions, it only checks if all > saved game actions are either identical to the actions currently in memory, > or new (i.e. later than the last action currently in memory). The problem > is that we don't yet have a good way to clear a whole game other than by > exiting and restarting Rails. Perhaps it would work, but I'm afraid the > hard part is cleaning up memory. There are thousands of (old and current) > objects holding references to each other, and I expect a thorough cleanup > will require a lot of extra code. > > Erik > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |
From: Erik V. <eri...@xs...> - 2012-05-03 15:14:38
|
Stefan, below I'm returning one sub-issue back to you... > -----Original Message----- > From: Mike Bourke [mailto:com...@ip...] > Sent: Wednesday, April 18, 2012 7:27 AM > To: Development list for Rails: an 18xx game > Subject: [Rails-devel] Bug Report 1830 Rails1.7.2 > > While playing a game of 1830 (simple Option) recently, I noticed a pair of > subtle bugs in the game system. Log files for these bugs are not available but > saved games are, and I have verified that the bugs are reproducible using the > specific techniques described below. > > Bug #1: Problem ending company Op round when president has been forced > to sell shares. > > Details: The B&O president has just been forced to sell shares in order to > raise the capital for a diesel. Play then moves to the newly-launched C&O, > but the game freezes. C&O never gets to lay track, the map window (top > left) reads "lay token" and "no token" and both choices are greyed out, as > are the buttons at the bottom of the map window ("Done", "undo", "redo"). This kind of behaviour is typical of an uncatched exception. > However, as soon as "save game" is performed, the problem clears itself. > > To reproduce this bug: > > 1. load 1830_20120415_0220_M4.rails. > 2. In the game report, locate and click on the entry that reads "B&O does not > pay a dividend", then "play from here." > 3. In the map window, click on "buy train". Note the relative order of L&N > and C&O shares. > 4. Sell 2 shares of PRR, 1 share of NYC, and (critical) 1 share of L&N. Note that > the relative order of L&N and C&O shares have changed because of the sale > of shares. But this is not (yet) reflected in the OR window. See below. > 5. Click "done". And indeed an exception appears on the console: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at rails.ui.swing.MapPanel.scrollPaneShowRectangle(MapPanel.java:113) at rails.ui.swing.ORUIManager.setMapRelatedActions(ORUIManager.java:238) at rails.ui.swing.ORUIManager.updateStatus(ORUIManager.java:1677) at rails.ui.swing.ORUIManager.updateStatus(ORUIManager.java:1520) at rails.ui.swing.GameUIManager.updateUI(GameUIManager.java:562) at rails.ui.swing.GameUIManager.processAction(GameUIManager.java:329) at rails.ui.swing.ORWindow.process(ORWindow.java:229) at rails.ui.swing.ORUIManager.processAction(ORUIManager.java:434) at rails.ui.swing.ORPanel.actionPerformed(ORPanel.java:912) ORUIManager line 238 has: mapPanel.scrollPaneShowRectangle( NetworkVertex.getVertexMapCoverage(map, companyGraph.vertexSet())); and the rectangle passed is null, which causes the exception. As a quick fix I'm now checking the rectangle in MapPanel.scrollPaneShowRectangle, and do nothing if it is null. This fixes the immediate problem. I don't know if NetworkVertex.getVertexMapCoverage() returning a null rectangle should be considered a bug. I must leave that to Stefan. There still is the underlying issue that the game engine does not change the OR order immediately. In the game engine, the OR order is only checked at the point that a new company turn is about to start. Independently, the UI checks after every OR action if another company has got the turn, and if so, it checks the current operating order and recreates the OR panel grid if it has changed. So there is no direct link between engine and UI on the OR order. I wouldn't be surprised if this disconnect would turn out not to be fully undo-proof. > Bug #2: Incorrect display of company names when returning to an earlier > action and clicking "play from here". > > Details: shortly thereafter in the same game, the L&O took its op round. > Despite the "unlimited tiles option being turned on, the game would not > permit a standard yellow city tile (57) to be placed at location H4, the L&O's > home base. This appears to be due to an incomplete processing of past > actions in the "play from here" function, specifically stock movement > resulting from the forced sale of shares. > > To reproduce this bug: > > 1. load 1830_20120415_0224_M2.rails > 2. In the game report, locate and click on "M2 sells 1 10% certificate of NYC to > pool for $50", then "play from here". > 3. In the Map window, note that the relative order of L&N and C&O shares is > the same as before the B&O president sold a share of the L&N even though > the game report shows this event as having occurred. That must also have been the case the first time that this action has been performed. At this point, the operating order has not yet been checked, so it is reset to the old one, both in the game engine and in the UI. > 4. In the Map Window, click "done". And now the game engine (correctly) thinks that C&O has the turn, but the UI does not reflect that, and appears confused in the following steps. It is not clear to me why the UI order does not change in this case. Perhaps it is related to the fact that game playing has stepped back to a point in the middle of emergency money raising, rather than before that process, as in the first problem. > 5. Game will not permit L&N to lay a tile in it's home base. The game is > highlighting valid tile lays for the C&O (which SHOULD operate now) and will > permit either of those tiles to be layed. > 6. If you lay a tile, click "no token", and buy a diesel, it is the C&O who gains > the train. Click "done". > 7. Play then moves to the C&O according to the (incorrect) map window > display, and all actions appropriate to the L&N's turn (tile lay at H4, purchase > of a diesel etc). One possible approach could be to make the OR order an independent state variable in the game engine, and have any change immediately trigger an UI order update. That's a similar approach as I have recently used to address player order changes in start and stock rounds. As emergency money raising is handled in a sub-round of the StockRound type, I don't think that it is feasible to change the OR order immediately in the UI. But the current approach to check the order at the start of a new turn should remain sufficient. I'll continue sorting it all out later. Erik. |
From: Mike B. <com...@ip...> - 2012-05-03 21:22:31
|
For clarification, I should mention that both of these bugs requires the use of undo/"play from here" to replicate, but both occurred in direct play the first time around. Mike Bourke Campaign Mastery http://www.campaignmastery.com Co-author, Assassin's Amulet http://www.legaciescampaignsetting.com --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 120503-0, 03/05/2012 Tested on: 4/05/2012 3:03:12 AM avast! - copyright (c) 1988-2012 AVAST Software. http://www.avast.com |
From: Erik V. <eri...@xs...> - 2012-05-08 10:06:50
|
Absent any further comments, I have now committed and pushed this fix into master. Erik. > -----Original Message----- > From: Erik Vos [mailto:eri...@xs...] > Sent: Thursday, May 03, 2012 5:14 PM > To: 'Development list for Rails: an 18xx game' > Subject: Re: [Rails-devel] Bug Report 1830 Rails1.7.2 > > Stefan, below I'm returning one sub-issue back to you... > > 5. Click "done". > > And indeed an exception appears on the console: > Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException > at > rails.ui.swing.MapPanel.scrollPaneShowRectangle(MapPanel.java:113) > at > rails.ui.swing.ORUIManager.setMapRelatedActions(ORUIManager.java:238) > at > rails.ui.swing.ORUIManager.updateStatus(ORUIManager.java:1677) > at > rails.ui.swing.ORUIManager.updateStatus(ORUIManager.java:1520) > at > rails.ui.swing.GameUIManager.updateUI(GameUIManager.java:562) > at > rails.ui.swing.GameUIManager.processAction(GameUIManager.java:329) > at rails.ui.swing.ORWindow.process(ORWindow.java:229) > at > rails.ui.swing.ORUIManager.processAction(ORUIManager.java:434) > at rails.ui.swing.ORPanel.actionPerformed(ORPanel.java:912) > > ORUIManager line 238 has: > > mapPanel.scrollPaneShowRectangle( > NetworkVertex.getVertexMapCoverage(map, > companyGraph.vertexSet())); > > and the rectangle passed is null, which causes the exception. > As a quick fix I'm now checking the rectangle in > MapPanel.scrollPaneShowRectangle, and do nothing if it is null. > This fixes the immediate problem. > > I don't know if NetworkVertex.getVertexMapCoverage() returning a null > rectangle should be considered a bug. I must leave that to Stefan. > |
From: Stefan F. <ste...@we...> - 2012-05-08 10:43:50
|
Erik, sorry have not seen your comment. Was that embedded in a previous mail from you? Can you forward me the test case to avoid for me going back as I am pretty busy currently. I want to check why there is no rectangle returned. I guess that it occurs if the company has no route. Was that a hidden (thus having no impact on gameplay) error? Thanks, Stefan On 05/08/2012 12:06 PM, Erik Vos wrote: > Absent any further comments, I have now committed and pushed this fix into > master. > Erik. > >> -----Original Message----- >> From: Erik Vos [mailto:eri...@xs...] >> Sent: Thursday, May 03, 2012 5:14 PM >> To: 'Development list for Rails: an 18xx game' >> Subject: Re: [Rails-devel] Bug Report 1830 Rails1.7.2 >> >> Stefan, below I'm returning one sub-issue back to you... > >>> 5. Click "done". >> >> And indeed an exception appears on the console: >> Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException >> at >> rails.ui.swing.MapPanel.scrollPaneShowRectangle(MapPanel.java:113) >> at >> rails.ui.swing.ORUIManager.setMapRelatedActions(ORUIManager.java:238) >> at >> rails.ui.swing.ORUIManager.updateStatus(ORUIManager.java:1677) >> at >> rails.ui.swing.ORUIManager.updateStatus(ORUIManager.java:1520) >> at >> rails.ui.swing.GameUIManager.updateUI(GameUIManager.java:562) >> at >> rails.ui.swing.GameUIManager.processAction(GameUIManager.java:329) >> at rails.ui.swing.ORWindow.process(ORWindow.java:229) >> at >> rails.ui.swing.ORUIManager.processAction(ORUIManager.java:434) >> at rails.ui.swing.ORPanel.actionPerformed(ORPanel.java:912) >> >> ORUIManager line 238 has: >> >> mapPanel.scrollPaneShowRectangle( >> NetworkVertex.getVertexMapCoverage(map, >> companyGraph.vertexSet())); >> >> and the rectangle passed is null, which causes the exception. >> As a quick fix I'm now checking the rectangle in >> MapPanel.scrollPaneShowRectangle, and do nothing if it is null. >> This fixes the immediate problem. >> >> I don't know if NetworkVertex.getVertexMapCoverage() returning a null >> rectangle should be considered a bug. I must leave that to Stefan. >> > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |
From: Erik V. <eri...@xs...> - 2012-05-08 12:13:22
Attachments:
1830_20120415_0220_M4.rails
|
Stefan, It was bug #1 in Mike Bourke's report a while ago. You did confirm the problem before I entered the stage, but you may not have seen the exception, which I reported later. Erik. > -----Original Message----- > From: Mike Bourke [mailto:com...@ip...] > Sent: Wednesday, April 18, 2012 7:27 AM > To: Development list for Rails: an 18xx game > Subject: [Rails-devel] Bug Report 1830 Rails1.7.2 > > While playing a game of 1830 (simple Option) recently, I noticed a pair of > subtle bugs in the game system. Log files for these bugs are not available but > saved games are, and I have verified that the bugs are reproducible using the > specific techniques described below. > > Bug #1: Problem ending company Op round when president has been forced > to sell shares. > > Details: The B&O president has just been forced to sell shares in order to > raise the capital for a diesel. Play then moves to the newly-launched C&O, > but the game freezes. C&O never gets to lay track, the map window (top > left) reads "lay token" and "no token" and both choices are greyed out, as > are the buttons at the bottom of the map window ("Done", "undo", "redo"). > However, as soon as "save game" is performed, the problem clears itself. > > To reproduce this bug: > > 1. load 1830_20120415_0220_M4.rails. > 2. In the game report, locate and click on the entry that reads "B&O does not > pay a dividend", then "play from here." > 3. In the map window, click on "buy train". Note the relative order of L&N > and C&O shares. > 4. Sell 2 shares of PRR, 1 share of NYC, and (critical) 1 share of L&N. Note that > the relative order of L&N and C&O shares have changed because of the sale > of shares. > 5. Click "done". |