From: Stefan F. <ste...@we...> - 2012-01-02 18:18:35
|
Frederick: below are my follow-up comments on your patch. So my proposals are: * Move main code from OperatingRound to RevenueAdapter. Use a NetworkTrain that runs for 2 majors and check if it runs for non-zero revenue. * Instead of modifying the game engine, change the message in the UI at time of train buying depending on that result. * Keep the modification until "Enforce" RevenueCalculation options are available. Stefan My main point is that your patch does not comply to the current level of enforcement defined by the GameOptions. Currently RouteCalculation is set to "Suggest", thus it does not enforce the calculated amount (e.g. it does not prevent entering a revenue exceeding it). Other Options (planned for future) are: * "Enforce" - In that level the game engine strictly enforces the rules without suggesting anything. Here Rails would calculate the optimal revenue, however it would not display the amount, it would only raise an error if a player enters revenue exceeding the calculated amount. This allows competitive play which might suite sophisticated players. * "Suggest & Enforce" - This combines suggest and enforce and is optimal for novice players. Your implementation falls into the latter category, as it both strictly enforces and indicates in the UI (by enabling/disabling the DONE button) if the company has a route or not. To keep your patch in synch with "Suggest" it should not change the behavior of the game engine, but simply have the UI tell the player if or if not his/her company has to buy a train or not, depending if the route algorithm has found a route or not. From a technical point of view: I already stated that I suggest to add something like boolean hasRoute() to the RevenueAdapter inside the algorithm package. So the consumers/clients below interacts with the algorithm package, in that sense the game engine is a client of algorithm if it needs that bit of information. If the UI itself gets the information feeded indirectly via the game engine or directly from algorithm is not that important anymore. It even might depend on what it is used for. If it is more a hint mechanism ("suggest") directly, if ("enforce") it is rule enforcement indirectly. > Regarding rails' layering: > It would be a valid design decision to keep route awareness out of the > game engine. But then every consumer of the game engine has to take > care of becoming route aware on himself. Currently, that's not a big > deal as there is only one consumer (the UI). But in the longer term, > there could also be other consumers (RemoteHuman, AI) and, then, > having put route awareness into the game engine would come in very > handy. > |