Refactoring

5 views
Skip to first unread message

Martin Bruse

unread,
May 7, 2018, 4:38:12 AM5/7/18
to diplic...@googlegroups.com
When I did the "all SCs build armies by default"-change to Chaos, I also refactored a lot of phase stuff:

- Default (classic style with possibility of customization) phase type now lives in the phase package, not in  variants/classical.
- Hundred phase now builds upon standard phase, instead of duplicating it.
- Phases are now required to have a PreProcess function that will be run during adjudication. After removal of invalid orders, but before any real adjudication.

Chris Babcock

unread,
May 7, 2018, 12:15:04 PM5/7/18
to diplic...@googlegroups.com
Several variants, e.g. Payola and Machiavelli, have orders that require preprocessing. My first thought was that PreProcess would be a step towards implementing some of those, but they require additional information that not part of the standard order definition. This additional information (usually bribes or offers) is evaluated, resulting in a list of standard orders that can be passed to the adjudicator. In order to use the PreProcess hook to implement these families of variants, removing invalid orders has to happen after PreProcess. 

Also, for robustness and for correctness, handling invalid orders needs to be implemented inline with the adjudication process as well as before. For robustness in that this would allow variants to be added in a more fault tolerant way. For correctness in that some use cases, like using the service as an adjudicator for live games, expect error reports inline rather than as a separate section that might be discarded. Also a unit which does not move as a consequence of a misorder cannot receive support, similar to a unit that was not ordered, but removing the order from the list and reporting the unit as unordered will result in problem reports when players make unintentional misorder in games where intentional misorders are allowed.

Chris


--
You received this message because you are subscribed to the Google Groups "diplicity-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diplicity-de...@googlegroups.com.
To post to this group, send email to diplic...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Bruse

unread,
May 7, 2018, 12:59:26 PM5/7/18
to diplic...@googlegroups.com
Anyone implementing Machiavelli or Payola is more than welcome to refactor the adjudicator as necessary :)

Chris Babcock

unread,
May 7, 2018, 2:15:09 PM5/7/18
to diplic...@googlegroups.com
Those variants, along with Crystal Ball, were implemented with preprocessors. Blind was done in postprocessing, but did require additional information in variant description files for some variants.

Wings can be implemented as a mix in variant on any map, but additional set up information is required when Wing units are part of the initial set up when enabled. I created a Wings set up file for Hundred 3.2, because of who I am. 

But, yeah. Mix in variants, ARDA "r" classification, are intended to be combined arbitrarily with one another and any map variant like mad C++ inheritancez - Wings, Blind, Payola, Crystal Ball, Build Any Centre, Portage...

Chris
Reply all
Reply to author
Forward
0 new messages