Shared kingdom: game internals need some refactoring badly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I feel most bugs in SharedKingom come through the misuse of the Player paradigm. I am also unhappy in the awkward way teams are currently handled. Both features feel "added in" (which they are of course) instead of "planned out".
In my opinion, Player (that is wl.Game().players) should only be 2 in a 2v2 shared kingdom and 4 in a 2v2 non shared kingdom.
Another paradigm like Controller (4 in shared kingdom and 2v2) is wiser; it would also get rid of the clunky real_player lua function which is kind of confusing. While we're at it, a Game().teams lua property would kill some of the complexity in handling team games atm.
So summing it up:
2v2 (shared kingdom): 4 Controllers, 2 Players, 2 Teams
2v2 (non shared kingdom): 4 Controllers, 4 Players, 2 Teams
1v1: 2 Controllers, 2 Players, 2 Teams.
In fact, the controllers could completely be hidden from the user and the Lua Engine.
Widelands does not understand all these concepts ATM, which clearly reflects in the statistics. I suggest added teams to statistics (via a toggleswitch or so) and updating the game internals to copy with Controllers or Players differently.
Bugs that would vanish by such a design are e.g. 646660, 646657.
Changed in widelands: | |
status: | Opinion → Confirmed |
Changed in widelands: | |
status: | Triaged → In Progress |
Changed in widelands: | |
milestone: | none → build16-rc1 |
Changed in widelands: | |
status: | In Progress → Fix Committed |
Changed in widelands: | |
assignee: | Nasenbaer (nasenbaer) → nobody |
nasenbaer, I assigned you because you worked on the shared kingdom feature. I'd really like to hear your opinion.