From: Erik V. <eri...@xs...> - 2012-01-26 13:45:19
|
Martin, OK, let's work on these issues together. 1. The simple way out would be to change highlighting only, but I would immediately concede that actually changing the visible player order is much better. So let's aim for that. However, before making plans, we should have a solution to the next problem as well. 2. Apparently, the player order change has not yet been fully worked out. Can you send me a saved file that doesn't reload, so I can check out why it fails? 3. This is a different matter that we can deal with separately. In any case, it's OK to start with using modal popups, which is much easier. Once that works, it's not a big deal to refactor to use non-modal popups. I can pick up the second part, or all of it if you still don't feel happy about it. Erik. From: Dr....@t-... [mailto:Dr....@t-...] Sent: Wednesday, January 25, 2012 10:02 PM To: Erik Vos Subject: Re: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Hi Erik, a number jump to my mind :) Problem 1: Based on the Fact that the PlayerOrder can change afte the outcome of the StartRound we need to have a flag to switch that order around and let the UI know that it needs to be aware of a new playerorder: Subsequently. 1. The upperPlayerCaption and lowerPlayerCaption need to be updated with the new player order. 2. the player related fields need to be updated also in new order. Currently the player order gets changed, the wrong player is shown as acting but the right player credited with the action. I.e. Player order in Display is A B C D, player c has fewest money after start is now starting player for stock round. Player A is highlighted performs an action and result of action is credited to player c in display. (this is right but confusing as player c should have moved in display to first colomn been highlighted and shown as performing the action :)) Problem 2: The reordering of players causes the game to reject any save game after the initial Startround. Player x cant perform that action... Problem 3: The StartCompany-mechanismn is now for StartroundWindow two actions subsequently (Because the share size of the BCR president share is fixed..) For each other company its three actions in order: a) Determine the startprice/startingorderposition b) Determine the size of the presidents share -20/30/40% c) Determine the BuildingRight based on restrictions from the presidents share (40& Shares can only have Phase A or B or C or D, 30% can have 2 Phases and 20% can have 3 Phases (A+B+C, B+C+D) This in connection with the radiobuttoncode is beyond my skills yet :) Those are my most urgent problems where the wall is to stubborn to give way to my head ! Regards, Martin P.s. your comments where helpful and the right way to show me the way around, i can take positive criticismn :) |
From: Erik V. <eri...@xs...> - 2012-01-27 20:56:36
|
OK, I have committed code that does the job of reordering player names in the GUI, as far as I have been able to test. The adaptability of player names is generic, but it is enabled on a per-game basis. This enabling is currently hardcoded (see below), but could be turned into an XML game property. Player reordering is now undoable as well. The UI name updates follow the standard Observer-based Model/ViewObject mechanism that is used for all UI updates. The commit text: Player captions made variable to reflect player reordering. Capability is game-dependent. Setting it is currently hardcoded in GameManager[_1880].setGuiParameters(). The list of players in GameManager is now an ArrayListState. As ArrayListState does not inherit from ModelObject, a separate StringState[] array had to be created to hold the player names for use in the GUI. A new Cell superclass for Caption and Field allows Field to get a caption background and also centralises highlighting. Erik. --------------------- From: Dr....@t-... [mailto:Dr....@t-...] Sent: Wednesday, January 25, 2012 10:02 PM To: Erik Vos Subject: Re: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Hi Erik, a number jump to my mind :) Problem 1: Based on the Fact that the PlayerOrder can change afte the outcome of the StartRound we need to have a flag to switch that order around and let the UI know that it needs to be aware of a new playerorder: Subsequently. 1. The upperPlayerCaption and lowerPlayerCaption need to be updated with the new player order. 2. the player related fields need to be updated also in new order. |
From: <Dr....@t-...> - 2012-01-27 21:23:20
|
Hi Eric, thanks for your help! That takes of course care of the caption, what i doesnt solve is the second part, Now the player order is shown in the right order but the fields associated with the players remain in the old order. I'll have a look at that now. Regards, Martin |
From: Erik V. <eri...@xs...> - 2012-01-27 21:51:14
|
Ah, I must have been under the false impression that only the captions were wrong. I didn’t really look at the numbers. Perhaps you can take the captions as an example. All cells are already variable, so it’s only the view-model relations that somehow need to be reordered. Erik. From: Dr....@t-... [mailto:Dr....@t-...] Sent: Friday, January 27, 2012 10:23 PM To: Erik Vos; Rails Development Subject: Re: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Hi Eric, thanks for your help! That takes of course care of the caption, what i doesnt solve is the second part, Now the player order is shown in the right order but the fields associated with the players remain in the old order. I'll have a look at that now. Regards, Martin |
From: <Dr....@t-...> - 2012-01-27 22:30:40
|
Hm, as far as i can decipher the code :). You are using addField to set the information in the gridpanel and then add an Observer to the datamodel linking it to that information field. Would a possible way to deregister the observer and refill the field/fields once after the playerorder has been changed and add the observers again ? (a "replaceField" method perhaps ?) Sorry but i have the feeling that this is beyond my current understanding :( Nevertheless i'll give it a try :) Regards, Martin Von: "Erik Vos" <eri...@xs...> An: <Dr....@t-...>, "'Rails Development'" <rai...@li...> Betreff: RE: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Datum: Fri, 27 Jan 2012 22:51:11 +0100 Ah, I must have been under the false impression that only the captions were wrong. I didn’t really look at the numbers. Perhaps you can take the captions as an example. All cells are already variable, so it’s only the view-model relations that somehow need to be reordered. Erik. From: Dr....@t-... [mailto:Dr....@t-...] Sent: Friday, January 27, 2012 10:23 PM To: Erik Vos; Rails Development Subject: Re: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Hi Eric, thanks for your help! That takes of course care of the caption, what i doesnt solve is the second part, Now the player order is shown in the right order but the fields associated with the players remain in the old order. I'll have a look at that now. Regards, Martin |
From: Erik V. <eri...@xs...> - 2012-01-27 22:56:23
|
The point is that we don’t have a trigger except through the Observer interface itself. Perhaps I can set up something that does not just handle the captions but the whole columns. Another way would be to add indirection in the game engine in a similar way as I have done for the captions: putting the Model objects in arrays and reorder these arrays. But there the problem is that the models are not kept somewhere centrally. It seems I’ll have to rethink my solution for the captions as well, and generalise it somehow to cover whole columns. Stay tuned. Erik. From: Dr....@t-... [mailto:Dr....@t-...] Sent: Friday, January 27, 2012 11:30 PM To: Rails Development Subject: [Rails-devel] GameStatus PlayerReordering consequences.. Hm, as far as i can decipher the code :). You are using addField to set the information in the gridpanel and then add an Observer to the datamodel linking it to that information field. Would a possible way to deregister the observer and refill the field/fields once after the playerorder has been changed and add the observers again ? (a "replaceField" method perhaps ?) Sorry but i have the feeling that this is beyond my current understanding :( Nevertheless i'll give it a try :) Regards, Martin Von: "Erik Vos" <eri...@xs...> An: <Dr....@t-...>, "'Rails Development'" <rai...@li...> Betreff: RE: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Datum: Fri, 27 Jan 2012 22:51:11 +0100 Ah, I must have been under the false impression that only the captions were wrong. I didn’t really look at the numbers. Perhaps you can take the captions as an example. All cells are already variable, so it’s only the view-model relations that somehow need to be reordered. Erik. From: Dr....@t-... [mailto:Dr....@t-...] Sent: Friday, January 27, 2012 10:23 PM To: Erik Vos; Rails Development Subject: Re: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Hi Eric, thanks for your help! That takes of course care of the caption, what i doesnt solve is the second part, Now the player order is shown in the right order but the fields associated with the players remain in the old order. I'll have a look at that now. Regards, Martin |
From: Erik V. <eri...@xs...> - 2012-01-26 20:56:03
|
Indeed the problem seems to be that the *current* player sequence is saved, instead of the *original* sequence. When reloading, the game engine replays the game from the start, so the original player names list must be saved. That should be easy to fix. Another problem, is that the player list is not a state variable and so reordering is not undoable. But I’ll leave that as is for a while, as Stefan will turn it upside down anyway. Erik. From: Dr....@t-... [mailto:Dr....@t-...] Sent: Thursday, January 26, 2012 8:12 PM To: Erik Vos; Rails Development Subject: Re: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Hi Erik, please find enclosed the savegame. The problem arises fro the fact that in 1880 i "artificially" reorder the players based on the outcome of Startround. The game of course only saves actions and some variables and the load mechanismn cant determine the changed player order. This leads to the fact that the playername array will have the original player as actionstarter "A" while getcurrentplayer() of course returns the new playerorder (in this case "C") as the players-array has been reordered after the startinground and C ist the player with the fewest money thus the first player in the new seat order. How do we want to go here ? If we add the original seat order as additional data to be saved we still have the problem to be solved that the actions up to a specific point in game time (end of Startround) which we currently cant pinpoint (as only actions get saved and restored), are connected to the wrong player. Should we perhaps create a special action that then can be saved ? and of course must be run automatically ? or manually ? Regards, Martin Von: "Erik Vos" <eri...@xs...> An: <Dr....@t-...> Cc: "Development list for Rails: an 18xx game" <rai...@li...> Betreff: RE: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Datum: Thu, 26 Jan 2012 14:45:07 +0100 Martin, OK, let's work on these issues together. 1. The simple way out would be to change highlighting only, but I would immediately concede that actually changing the visible player order is much better. So let's aim for that. However, before making plans, we should have a solution to the next problem as well. 2. Apparently, the player order change has not yet been fully worked out. Can you send me a saved file that doesn't reload, so I can check out why it fails? 3. This is a different matter that we can deal with separately. In any case, it's OK to start with using modal popups, which is much easier. Once that works, it's not a big deal to refactor to use non-modal popups. I can pick up the second part, or all of it if you still don't feel happy about it. Erik. From: Dr....@t-... [mailto:Dr....@t-...] Sent: Wednesday, January 25, 2012 10:02 PM To: Erik Vos Subject: Re: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Hi Erik, a number jump to my mind :) Problem 1: Based on the Fact that the PlayerOrder can change afte the outcome of the StartRound we need to have a flag to switch that order around and let the UI know that it needs to be aware of a new playerorder: Subsequently. 1. The upperPlayerCaption and lowerPlayerCaption need to be updated with the new player order. 2. the player related fields need to be updated also in new order. Currently the player order gets changed, the wrong player is shown as acting but the right player credited with the action. I.e. Player order in Display is A B C D, player c has fewest money after start is now starting player for stock round. Player A is highlighted performs an action and result of action is credited to player c in display. (this is right but confusing as player c should have moved in display to first colomn been highlighted and shown as performing the action :)) Problem 2: The reordering of players causes the game to reject any save game after the initial Startround. Player x cant perform that action... Problem 3: The StartCompany-mechanismn is now for StartroundWindow two actions subsequently (Because the share size of the BCR president share is fixed..) For each other company its three actions in order: a) Determine the startprice/startingorderposition b) Determine the size of the presidents share -20/30/40% c) Determine the BuildingRight based on restrictions from the presidents share (40& Shares can only have Phase A or B or C or D, 30% can have 2 Phases and 20% can have 3 Phases (A+B+C, B+C+D) This in connection with the radiobuttoncode is beyond my skills yet :) Those are my most urgent problems where the wall is to stubborn to give way to my head ! Regards, Martin P.s. your comments where helpful and the right way to show me the way around, i can take positive criticismn :) |
From: Erik V. <eri...@xs...> - 2012-01-26 21:16:39
|
Done. The only thing needed was to exempt the player names list from reordering. This list was in fact only in one place used for other purposes than saving, and that single existing usage could easily be replaced. So I could also remove getPlayerNames() from the GameManagerI interface. As a bonus, I noticed, that the UI now shows the *reordered* player names in the UI after reloading . So that’s a first step in fixing the other problems. Erik. From: Erik Vos [mailto:eri...@xs...] Sent: Thursday, January 26, 2012 9:56 PM To: Dr....@t-...; 'Rails Development' Subject: Re: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Indeed the problem seems to be that the *current* player sequence is saved, instead of the *original* sequence. When reloading, the game engine replays the game from the start, so the original player names list must be saved. That should be easy to fix. Another problem, is that the player list is not a state variable and so reordering is not undoable. But I’ll leave that as is for a while, as Stefan will turn it upside down anyway. Erik. From: Dr....@t-... [mailto:Dr....@t-...] Sent: Thursday, January 26, 2012 8:12 PM To: Erik Vos; Rails Development Subject: Re: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Hi Erik, please find enclosed the savegame. The problem arises fro the fact that in 1880 i "artificially" reorder the players based on the outcome of Startround. The game of course only saves actions and some variables and the load mechanismn cant determine the changed player order. This leads to the fact that the playername array will have the original player as actionstarter "A" while getcurrentplayer() of course returns the new playerorder (in this case "C") as the players-array has been reordered after the startinground and C ist the player with the fewest money thus the first player in the new seat order. How do we want to go here ? If we add the original seat order as additional data to be saved we still have the problem to be solved that the actions up to a specific point in game time (end of Startround) which we currently cant pinpoint (as only actions get saved and restored), are connected to the wrong player. Should we perhaps create a special action that then can be saved ? and of course must be run automatically ? or manually ? Regards, Martin Von: "Erik Vos" <eri...@xs...> An: <Dr....@t-...> Cc: "Development list for Rails: an 18xx game" <rai...@li...> Betreff: RE: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Datum: Thu, 26 Jan 2012 14:45:07 +0100 Martin, OK, let's work on these issues together. 1. The simple way out would be to change highlighting only, but I would immediately concede that actually changing the visible player order is much better. So let's aim for that. However, before making plans, we should have a solution to the next problem as well. 2. Apparently, the player order change has not yet been fully worked out. Can you send me a saved file that doesn't reload, so I can check out why it fails? 3. This is a different matter that we can deal with separately. In any case, it's OK to start with using modal popups, which is much easier. Once that works, it's not a big deal to refactor to use non-modal popups. I can pick up the second part, or all of it if you still don't feel happy about it. Erik. From: Dr....@t-... [mailto:Dr....@t-...] Sent: Wednesday, January 25, 2012 10:02 PM To: Erik Vos Subject: Re: [Rails-devel] Fw: Re: Push Request : 1880 Code Update Part II Hi Erik, a number jump to my mind :) Problem 1: Based on the Fact that the PlayerOrder can change afte the outcome of the StartRound we need to have a flag to switch that order around and let the UI know that it needs to be aware of a new playerorder: Subsequently. 1. The upperPlayerCaption and lowerPlayerCaption need to be updated with the new player order. 2. the player related fields need to be updated also in new order. Currently the player order gets changed, the wrong player is shown as acting but the right player credited with the action. I.e. Player order in Display is A B C D, player c has fewest money after start is now starting player for stock round. Player A is highlighted performs an action and result of action is credited to player c in display. (this is right but confusing as player c should have moved in display to first colomn been highlighted and shown as performing the action :)) Problem 2: The reordering of players causes the game to reject any save game after the initial Startround. Player x cant perform that action... Problem 3: The StartCompany-mechanismn is now for StartroundWindow two actions subsequently (Because the share size of the BCR president share is fixed..) For each other company its three actions in order: a) Determine the startprice/startingorderposition b) Determine the size of the presidents share -20/30/40% c) Determine the BuildingRight based on restrictions from the presidents share (40& Shares can only have Phase A or B or C or D, 30% can have 2 Phases and 20% can have 3 Phases (A+B+C, B+C+D) This in connection with the radiobuttoncode is beyond my skills yet :) Those are my most urgent problems where the wall is to stubborn to give way to my head ! Regards, Martin P.s. your comments where helpful and the right way to show me the way around, i can take positive criticismn :) |