-
Notifications
You must be signed in to change notification settings - Fork 0
Multiplayer
In Singularity we will have a number of Message
s. These will be simple, immutable records that are easily serialisable.
At singularity.common.representations.pyramidscheme.multiplayer
, there is an
abstract class Message {
}
with concrete classes
class QueueDetailsMessage extends Message {
class QueueDetails implements Serializable {
String username;
String champion;
HashMap<String, Integer> deck;
}
}
for each message specified in the protocol section.
When a user wants to play multiplayer, they have to join a matchmaking queue. The player will need to have chosen a name, and a deck, before joining the queue.
class QueueDetails implements Serializable {
String username; // Where username is the name the client has self assigned
String champion;
HashMap<String, Integer> deck; // where String is the name of card, where Integer is the quantity
}
class QueueConfirm implements Serializable {
int token; // Where token is a unique assigned identifier created by singularity
}
Note that token
will be used in all future communications generated by each client. This permits two clients to have the same username.
When Singularity has successfully found a pairing between users, it attempts to start a game between them.
class GameDetails implements Serializable {
long seed; // A RNG seed for the game
}
class OpponentDetails implements Serializable {
String username;
String champion;
}
OpponentDetails
is just a forwarded copy of QueueDetails
. Ideally, all this information is unpacked into Match
(or some other class that can be accessed through a Singleton). BasicMatchController
will need to unpack all this information from Match
on initialization.
class OpponentDeck implements Serializable {
class Card implements Serializable {
String cardname;
String UID;
}
ArrayList<Card> cards;
}
Singularity has tagged all cards of both decks, to assign them a unique identifier. This will be used to coordinate game actions.
class Shuffle imlements Serializable {
int token; // The token of the client that's shuffling the deck
String target; // Decks or pyramids can be shuffled
}
class ArrangePyramid implements Serializable {
int token;
String arrangementName; // e.g. "pyramid"
}
class PlayCard implements Serializable {
int token;
int cardUID;
int x;
int y;
}
class HoldCard implements Serializable {
int token;
int cardUID;
int x;
int y;
}
class GrindCard implements Serializable {
int token;
int cardUID;
}
class PassTurn implements Serializable {
int token;
}
class ChampionAbility implements Serializable {
int token;
String ability;
int targetCardUID;
}
Note that the specified x
and y
coordinates are the senders screenspace coordinates. Reiterating, he player will transmit a message using their screenspace coordiantes. The other player will need to convert these coordinates (perhaps by mirroring the x
coordinate) so the card is placed / moved to the correct location.
Saving and Loading
Statistics tracking
- Statistics Tracking Overview
- Statistics Tracking
- User Statistics
- Champion Statistics
- Common Statistics
Game Play
APIs
- Section One: Pyramid Scheme Beginner's Guide
- Section Two: Getting Started
- Section Three: The Pyramid
- Section Four: Game Layout Explanation
- Section Five: Cards
- Section Six: Champions
- Section Seven: DuckDust
- Section: Eight: How to play Pyramid Scheme
- Section Nine: Ways to play
- Section Ten: Deck Building
- Section Eleven: How to Acquire Cards
- Section Twelve: Achievements
- Section Thirteen: Accessories
Other Guides
Design Guides
Overviews
- Architecture Overview
- UI Overview
- Main Menu Screen Overview
- Standardised Screen Graphics
- Overview of Graphics
Features
- Story Mode
- Cutscenes
- Beginners Guide Tutorial
- Clock
- Deckbuilding
- Card Deck Gallery
- Champion Roster
- Market Place
- Card Packs
- Game Settings
- Tool-tips
Animations
Splash Screen & Create Account Screen
Player Account Settings
AI
Duck Dust
Brainstorming
- Brainstorming - General
- Brainstorming - UI
- Brainstorming - Mechanics
- Brainstorming - Pyramid Design Discussion
- Brainstorming - Champions, Abilities and Design Mock-up
- Brainstorming - Achievement
Future Development