Opened 8 years ago

Last modified 3 years ago

#3806 new enhancement

Gamesetup - Optionally allow players to setup the game — at Version 8

Reported by: elexis Owned by: Imarok
Priority: Should Have Milestone: Backlog
Component: UI – Game setup Keywords: patch
Cc: rogue-spectre Patch:

Description (last modified by Imarok)

It would be nice if players could pick their own civilizations without having to communicate it via chat to the host.

Since it is a delicate issue to balance the teams, the setting could be implemented using a dropdownlist, giving players different degrees of freedom (none, civs only, civs+teams, all gamesettings)).


There is an according TODO in gamesetup.js:

	// TODO: Shouldn't players be able to choose their own assignment?
	for (let i = 0; i < g_MaxPlayers; ++i)
	{
		Engine.GetGUIObjectByName("playerAssignment["+i+"]").hidden = true;
		Engine.GetGUIObjectByName("playerCiv["+i+"]").hidden = true;
		Engine.GetGUIObjectByName("playerTeam["+i+"]").hidden = true;
	}

(Previous releases had signficantly imbalanced civilizations, so no sane host would have allowed players to pick OP civs. With alpha 19, balance is significantly improved, so that this feature becomes actually useful).


The remaining TODOs are: server code:

  • rewrite changeSetting message to send only the value and the name of the changed setting
  • Forward the changeSetting message only to the host
  • Only accept new settings message from host

gamesetup.js:

  • When recieving a changesetting message from server, check if change is legit. If so send new settings to server

Change History (19)

comment:1 by Itms, 8 years ago

Cc: rogue-spectre added
Priority: Nice to HaveShould Have

#2932 was a duplicate, with a less general aim.

I think this is an important issue.

comment:2 by elexis, 8 years ago

This is also a requirement for #3556. It is probably not simple, as the the controller of the gamesetup must not assume that it can access the server directly via the ScriptInterface, but needs to send the settings via network.

comment:3 by Imarok, 8 years ago

Owner: set to Imarok

comment:4 by Imarok, 8 years ago

My solution would be: Adding a new scriptfunction that sends a message(like chatmessage or readymessage) with the new setings to the server. Make the server listen to it. If the server recieves the message he applies the new values and updates the client with his UpdateGameAttributes function.

Is this draft right/ok?

by Imarok, 8 years ago

WIP Patch: already implemented a test button to set the revealMap setting to false, that can be used by every player

comment:5 by elexis, 8 years ago

PlayersCanChange -> GuestSettings ? Color & Civilization & Team => Color, Civilization and Team

Last edited 8 years ago by elexis (previous) (diff)

by Imarok, 8 years ago

still WIP, changed PlayersCanChange to GuestSettings

by Imarok, 8 years ago

wip patch

by Imarok, 8 years ago

This patch works completley. One little bug is that the guestsettings setting sometimes resets. Also I need to cleanup the code to remove comments, warnings and follow the CodingConventions.

by Imarok, 8 years ago

Fixes the ticket. The additional loading state will be removed when elexis made his patch for gamesetup.js

comment:6 by Imarok, 8 years ago

Keywords: review patch added
Milestone: BacklogAlpha 21

by Imarok, 8 years ago

Removed SetNetworkGameAttributes as it is unneeded now, removed the TODO mentioned in the ticket description, extended initDropdowns and some cleanup

by Imarok, 8 years ago

Removed the additonal loading state and done some cleanup

by Imarok, 8 years ago

pass string as ref and reverted L74

comment:7 by Imarok, 8 years ago

TODO:

  • Let player A not cange player B's color (same with civ and team)
  • Ensure the change was valid (maybe in a new ticket)

by Imarok, 8 years ago

Let player only change their own color/team/civ if guestsetting!="all", removed the CStr8->CStr changes

comment:8 by Imarok, 8 years ago

Description: modified (diff)
Keywords: review patch removed

by Imarok, 8 years ago

removed the failed hunk and added guest_settings.json that wasn't included in the previous patch

by Imarok, 8 years ago

ChangeSettingMessage only sends changed setting and value, forward ChangeSettingMessage only to host, ignore every AssignPlayerMessage not coming from host, ignore every SetGameAttributesMessage not coming from host

Note: See TracTickets for help on using tickets.