Introducing “The Big Feud”
“The Big Feud” is a client-funded project designed to improve training times and knowledge retention for the client’s employees. This project took under 5 months of development between a team of three. One artist, one network programmer, and one UI programmer. The aesthetic and function of the program were highly restricted to the client’s ideals.
My role on this team was the network programmer. I was responsible for ensuring the program’s connectivity worked as expected for the client. This means allowing multiple players to connect to a host that runs the game. The game uses the host as the game master who is in charge of progressing the game while the players are split up into teams similar to the hit TV show “Family Feud”.
Because our team was small, I wore more than one hat. In addition to networking the project, I was in charge of a lot of the functionality and assisting in the UI programming. Myself and the other programmer were quite new to Unity at the time so we had to work together to solve many of the problems we faced. These ranged from simple debugging button highlights to more complex tasks like client synching.
Simple and Effective Customization
Our client prioritized the ability to customize the experience. We wanted to ensure we met the client’s wants and needs, focusing on the practical options they would need for effective training and freedom of choice. We allow the host to decide on all the settings seen in the photo above. Our team highlighted the importance of communication by consistently checking with our client to get our work approved and hearing suggestions or ideas for what the client envisioned for the project.
The figure above depicts the settings page for the custom questions. In addition to having simple questions and answers, we wanted to give our client the option to assign point values to all custom answers. This emphasizes the project’s game aspects and amplifies the training’s effectiveness by leveraging human competition.
Code Examples and Explanations
Multiplayer through Unity Photon Package
public class PhotonLobby : MonoBehaviourPunCallbacks
{
private void Awake()
{
lobby = this;
}
void Start()
{
if (full)
{
PhotonNetwork.LeaveRoom();
full = false;
}
PhotonNetwork.ConnectUsingSettings();
full = false;
}
public override void OnConnectedToMaster()
{
Debug.Log("Player has connected to master");
hostButton.SetActive(true);
playerButton.SetActive(true);
hostCode.SetActive(true);
playerCode.SetActive(true);
}
public override void OnJoinRoomFailed(short returnCode, string message)
{
Debug.Log("Failed to join. No Rooms available");
CreateRoom();
}
void CreateRoom()
{
Debug.Log("CreatingRoom");
RoomOptions roomOps = new RoomOptions() { IsVisible = true, IsOpen = true, MaxPlayers = 10 };
PhotonNetwork.CreateRoom(hostInput.text, roomOps);
Debug.Log(hostInput.text);
SceneManager.LoadScene("playerWait");
}
public override void OnJoinedRoom()
{
Debug.Log("Joined Room");
if(player1 == count - 2){
SceneManager.LoadScene("playerWait");
}
Debug.Log(PhotonNetwork.CurrentRoom.PlayerCount);
}
public override void OnCreateRoomFailed(short returnCode, string message)
{
Debug.Log("Failed to create. Name already made.");
CreateRoom();
}
public void OnHostClicked()
{
Debug.Log("BattleButton Clicked");
player1 = 21;
hostButton.SetActive(false);
playerButton.SetActive(false);
startButton.SetActive(true);
CreateRoom();
Debug.Log("Loaded scene");
}
[PunRPC]
void SyncValues(bool myFull)
{
full = myFull;
Debug.Log(full);
}
public void OnPlayerClicked()
{
Debug.Log("BattleButton Clicked");
hostButton.SetActive(false);
playerButton.SetActive(false);
cancelButton.SetActive(true);
player1 = count - 2;
Debug.Log(playerInput.text);
PhotonNetwork.JoinRoom(playerInput.text);
}
public void OnCancelButtonClicked()
{
Debug.Log("Cancel Button clicked");
cancelButton.SetActive(false);
playerButton.SetActive(true);
hostButton.SetActive(true);
PhotonNetwork.LeaveRoom();
}
}
Considering our client requests and our team’s manpower limitations, we researched the best option to implement a multiplayer system. We looked for a system that remained lightweight and easy to work with for our team and met the client’s expectations of the application. That left us with the Photon multiplayer package.
The Photon multiplayer package allows for simplistic multiplayer, which fits well into the scope of our project. I was tasked with researching and implementing all the networking. One aspect of this process I underestimated was how difficult testing could be. Considering this was the first project I worked with in Unity and the first multiplayer I worked on, I didn’t have the knowledge base for testing effectively. I found ways to work with my teammates to test several devices to ensure the networking and multiplayer features worked as intended. Looking back I see many ways to improve my old work methods which would help this project production and testing move much faster.
UI and Settings Code
public class inputQuestions : MonoBehaviour
{
public InputField QuestionInputField;
public string[] questionsList;
public static string referenceText;
public void SaveList()
{
var theQuestions = QuestionInputField.text;
referenceText = QuestionInputField.text;
Debug.Log("This is the custimized text: " + referenceText);
questionsList = theQuestions.Split('-');
}
}
The code above is just a small glimpse into the UI systems we had in place. We wanted to ensure the client received what they had asked for and expected when it came to customizable questions, answers, and points. We gave the client instructions that were needed to make sure everything in the game went smoothly. The biggest instruction to follow (we had these instructions in the game as well) was making sure between each question, answer, and point value there was a “-” which allowed the program to parse, pair, and store the data needed. Furthermore, we provided detailed documentation and held multiple training sessions to help the client become familiar with every aspect of the system. The feedback from the client was continuously monitored, helping us to make iterative improvements to the system. By doing so, we strived to create an intuitive and seamless experience that exceeded the client’s expectations. We were particularly proud of how the UI allowed for easy adjustments, catering to different game formats and ensuring longevity in the client’s use of the program.