#Role based game help pls

1 messages · Page 1 of 1 (latest)

versed fulcrum
#

I am starting to make a game similar to among us, There are 2 roles, the "CardMaster" and the "Civilian", the civilians go around doing tasks to get cards that they then use to damage the CardMasters heart(object on map) whilst the CardMaster uses cards he has in his deck (randomly chosen at the start of a round) to kill all the civilians before they kill his heart.

I have got the multiplayer system just set up (Player pos sync and stuff) But i have no idea how to set up the roles or cards or decks at all (or even code it)

Although i most definitely shouldn't pursue this project as i am not great at programming (i have the basics and semi advanced stuff) I am very adamant on making it a game

limpid field
#

Your roles can be an enum in your player class.

For cards, I usually use scriptable objects. The SOs will contain the title, image and description and other stats of each card. As well as a card id. A deck will just be a list of card IDs. The same for a player hand. You can then look up the card IDs to display your cards.

Over the network you are just sending card IDs back and forth.

versed fulcrum
#

For the roles do I have the host client choose or every client pick one and check that no-one else has the same role

limpid field
#

You can do it any way you want. They can be randomly assigned when the match starts. Or you can have the clients choose in advance if you are doing some kind of matchmaking.

versed fulcrum
#

I gonna go with the host choosing the roles as it seems simpler lol

#

Is there a way to get every player connected in a list? If so how?

limpid field
#

The host/server has access to ConnectedClientsList

But if you need player data then it's easier to create your own list through the ClientConnectedCallback

versed fulcrum
#

Also i switched to role ID's (int 0 = civilian 1 = cardmaster) instead as i couldnt figure out how to use enums as a networked variable

versed fulcrum
limpid field
versed fulcrum