cenotaph

cenotaph

Looking to design and develop an online game with this community

Introduction

Hi all,

Looking to design and develop this fun paper game from my childhood in digital with elixir, phoenix (channels, presence), and possibly LiveView with the members of this community.

I already have a working one with angular+socketio+python so this is a good learning curve with the elixir community.

Here is the game, rules, and a sample round of me trying to explain how the game works. This game might exist online already under different names for different cultures. I didn’t investigate.

Rules and Play

Design

I aim to follow the design principles that are demonstrated and explained brilliantly in this article as much as possible

Aspirations (intentionally left vague)

  • Hoping for store nothing approach
  • If things need to be stored somewhere, prefer eviction and memory based storage.
  • things should keep a tidy house at all times within their scope.

Behaviours

Player

Scenario: New user identification success
Given I am an anonymous user
  and I visit the Game Server 
  and I am required to enter my name
When I enter "nickname"
Then the "nickname" is accepted

Scenario: New user identification, nickname non UTF-8 encoding
Given I am an anonymous user
  and I visit the Game Server 
  and I am required to enter my name
When I enter "0xC0, 0xC1, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF"
Then the "0xC0, 0xC1, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF" is rejected

Scenario: New user identification, nickname too long
Given I am an anonymous user
  and I visit the Game Server 
  and I am required to enter my name
When I enter "nickname longer than 20 characters"
Then the "nickname longer than 20 characters" is rejected

I will slowly expand the following Rooms, Gathering Hall, and Server as scenarios in time.

Rooms

  • Can be created
  • Should have a string identifying the name
  • Should have a string language identifying the language used in the room.
  • Should have an identifier of being private or public
  • Minimum 3 players needed to start a round and play the game.
  • Able to know which players are in the room
  • There is no maximum player limit to a room but should investigate for performance reasons.
  • Can be joined only, if it hasn’t reached maximum user count and no active round is in play
  • Can initiate a new round by the ‘administrator’ if there are more than 2 players in the room.
  • Can be destroyed by the creator or administrator
  • Can be destroyed only if there is no active round
  • Players should be able to chat with each other outside of an active round
  • Should do self-cleaning where possible

Round

  • Can be initiated by 'administrator
  • All the players should receive the first question at the roughly same time
  • After answering a question, player should be presented with the next one.
  • If a player finishes all their questions, they simply wait for all players to finish.
  • If the player count has fallen below the minimum players at any instance, the round should be abandoned
  • Should be able to identify which players have answered the current/past questions
  • Should have a maximum time set to end the round if it does not end by player interaction.
  • Round finishes when all the questions are answered by all the players`
  • Round should be able to display the stories on each player’s screen upon finishing.
  • Chat should be activated when a round has finishes regardless of reason
  • Should do self-cleaning where possible

Gathering Hall

  • Should list all the public rooms that are available to join
  • Should include name, language, player count of each room
  • Should be able to filter by language
  • Should be able to sort by player count
  • Should do self-cleaning where possible

Community

I want this to be a community effort where people can peer-review each other’s code and approach and we can all learn from each other in a fun small project.

Repositories

Elixir Library - GitHub - ykurtbas/elixir-www: Elixir library for the online multiplayer game WhoWhatWhere · GitHub

Phoenix UI - GitHub - ykurtbas/phoenix-www: The phoenix application for WhoWhatWhere game · GitHub

More Questions?

I didn’t take any further design restrictions and decisions.

I probably missed a couple of important points, either on purpose - not to dictate the design or genuinely forgot. Please ask away!

Please let me know what you think or ideas for implementation, developing together.

Review

Please have a look at the commits to check if I am on the right path, specifically where to mutate the players in the room.

Most Liked

brainlid

brainlid

Hey @cenotaph! I recently released a PoC Elixir application that is similar to what you are talking about. I did it as a multi-player turned-based Tic-Tac-Toe game. But the game itself is really a “placeholder” for any kind of game that works in turns.

You can find it here: GitHub - fly-apps/tictac: Demonstration of building a clustered, distributed, multi-player, turn-based game server written in Elixir. · GitHub

Hopefully it can help! I’m happy to answer any questions as well.

kokolegorille

kokolegorille

I have been building some servers for 2 players board game (chess and go), as a hobby, when I started Elixir. It teached me a lot about OTP.

But I can tell managing the game is not the most complicated. You need to manage match maker, tournaments, clocks, ratings. I also enjoyed to see what happens when You kill random processes, and see the system heals.

Building a lobby, a match maker, a room manager is really fun. Whatever the frontend You choose.

marcelfahle

marcelfahle

Hi @cenotaph, for state management you can check out the book by @lance Halvorsen, which is amazing. It uses a state machine to manage the state of a battleship game which was very helpful for my own little round-based game.

Where Next?

Popular in Discussions Top

mmport80
I have put far too much effort into Dialyzer over the last year or so - and basically - I doubt it’s worth the effort. It’s not as easy ...
New
crabonature
I’m still quite new to Elixir. As I understand we got in Elixir “multi guards” as convention to simplify one large guard with or’s?: de...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
CharlesO
Erlang :list.nth simple, but 1 - based nth(1, [H|_]) -> H; nth(N, [_|T]) when N > 1 -> nth(N - 1, T). Elixir Enum.at … coo...
New
fireproofsocks
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New
RudManusachi
What configs will make sense to put to runtime.exs? – A bit of how I configure apps: I have generic configs in config/config.exs, dev...
New
chulkilee
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New
joeerl
I’m playing with Elixir - It’s fun. I think @rvirding does give Elixir courses these days. Re: files and database - when I given Erlang ...
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New
Markusxmr
Since Drab has been developed for a while in the open, introducing the Liveview functionality in a way it happend appears to undermine th...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29603 241
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 48342 226
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement