Multiplayer areas

From Lasers-Enigma Documentation
Jump to: navigation, search

Introduction

Doing multiplayer areas is very cool for players but it is also complicated for puzzle makers.

Players together

Creating an area where players will be several in the same space can be interesting to allow players to collaborate in their reflection on the puzzle.

On the other hand, the plugin does not contain any components that require actions to be performed in a limited time, so it means that being two in the same space offers no particular advantage. In other words, a single person can solve such a puzzle as well as two players together.

So if you want, for a puzzle where players are not separated, to really require 2 players, you will have to use redstone (with, for example, pistons) or command blocks or even other plugins that adds other features.

Players splited on each side of a room

On the contrary, by separating your players and having each of them solve their own part of the global enigma, you will be sure to make interesting multiplayer rooms.

Unfortunately, creating such puzzles is more complex than creating solo puzzles. In order to create such puzzles, you will have to be careful about the 2 following problems.

The entrance

Creating the entrance of multiplayer areas involves building a system that ensures that there are 2 players and that they are well separated, on each side of the room.

To do this, the easiest way is to create a small system based on pressure plates and doors.

The entrance corridor will have to split in two. Each of these two corridors must be blocked by a door.

In the first corridor there will be a pressure plate before the door. She'll open the door to the second corridor.

In the second corridor there will be a pressure plate after the door. She'll open the door to the first corridor.


With such a system it is simply necessary to ensure that the space between the pressure plates and the opposite door is wide enough so that it is not possible to cheat by running to the opposite door.

Player stuck problem

If a player dies at the worst moment, it is possible that he gets back to the area checkpoint (at its entrance) while the other player already leaved the area.

The area being reinitialized, the players will not be able to get back together in the same area to solve it again so they will both get stuck.

For such rare cases the solution is to add a condition for the doors opening using a command block:

By creating an always activated repeating command block and by putting a command like this one you can detect if a player is within a zone (a cuboid): execute positioned <X> <Y> <Z> run execute if entity @p[dx=<relative X>,dy=<relative Y>,dz=<relative Z>]

Then you can use a comparator to retrieve a redstone signal if this command block found a player within the selected zone.

The following schema shows what is should look like.

Final schema

Multiplayer.png

More than 2 players

Doing multiplayer areas for more than 2 players is not really more complicated than doing it for 2 players.

You will just have to adapt the entrance system.