In Custom mode you can build a full multiplayer (MP) game in which the players share the physical game world. In other words, they can collide with each other, and when a player for example destroys objects in the game world, such changes are automatically updated for others as well. All in all, you have more control over the events that each player encounters.
Making custom MP games requires a solid understanding of how to work with logic in HypeHype. If you're unsure whether this mode is necessary for your game, check out the light-weight features of the See Others mode first.
📢 Get a quickstart: Here's an MP Template which contains the basic setup of a platformer game: https://hypehype.com/game/multiplayer-template/r/tLlKW1lCxM4dZy
If you want to learn how to build such a setup on your own, keep reading!
Logic mode is recommended when creating a Custom MP game. It keeps the logic nodes visible at all times. To turn it on, tap the Three-dot menu on the left > View > Logic mode.
Reference objects appear in the game world when they are spawned. If the player has a gun, you may need to set it separately as a Reference object. Playtest to see that there are no unwanted parts floating around.
The Multiplayer Control node ensures that the game camera follows every player correctly.
The above example makes use of a premade player from the Asset Library. To make it work nicely with the game camera, a Multiplayer Control node was added to its logic. This node is also needed for assigning game objects only to specific players.
To spawn player characters and to assign them correctly to players who join, two nodes are necessary: Multiplayer Info and Multiplayer Player Spawner.
The MP Info node detects when players join and leave the game session. It sends out a Player Index, which refers to the order in which players join the game. The index of the first player is 0. The first joined player is also the host of the game session.
The player index is passed with a link to the MP Player Spawner node, and the same link executes the spawner. As a result, a new player character is spawned every time a player joins. The player index ensures that the game as accurate information on who should control each player character. The MP Player Spawner node is only used for spawning characters or other objects that the players control.
Here's a summary of logic nodes that are essential when creating Custom MP games:
Multiplayer Control | This node is needed when you want to assign an object or a UI for a specific player only. |
Multiplayer Info | Detects when a player joins leaves the session. Can send the Player Index and the name of the player. |
Multiplayer Player Spawner | This node spawns the character, car, motorcycle, cube or whatever entity each player is supposed to control in a game. Needs a Player Index as an input. |
Multiplayer Sync | Use this node to ensure that essential game events happen simultaneously for all players. |
You can also use these nodes in Custom MP games. They also work in the See Others mode.
Player Broadcaster | The node sends a signal to all players in a session. Can be used for triggering events or notifying players. |
Player Broadcast Listener | All players will receive the signal that Player Broadcast Listener picks up (vs. regular broadcast listener which only affects individual players at a time) |
Player Beacon | Detects all players in a specific area |
Global State | Syncs a number for all players in a game |
The following nodes are not supported in multiplayer games:
Multiplayer Settings Multiplayer Games See Others: Ghost Multiplayer