Creating a game with Phoenix

Hi, I’m currently experimenting with creating a game on Phoenix.
I have a front-end using Unity that currently sends GET and POST requests to the server to retrieve and send updates on the current game environment and game state, but I am looking to use channels for more real-time functionality.

I have been searching online for ways to implement channels in the way I want to use it, but most of it utilize a web front-end to send messages.
Is there a way to use channels just to send and receive json messages without creating a web front-end?
If so, can anyone help point me in the right direction to do so?
If not, are there any other alternatives that I can look into?

Otherwise, is repeatedly sending GET requests to the server from the front-end application a reliable method to consistently update the game state and environment?

Thanks everyone for your help.

Hello and welcome,

Maybe this could help. although it does not seem to have a lot of activities.

A couple of years ago our Global-Game-Jam game ‘InVected’ (ElixirForum topic) used Phoenix in a similar way, where Phoenix manages a web-interface that people connect to on their mobile phone, which turns their phone in a joystick.

Phoenix then forwards the state-changes to the main game (written with Unity and its C#-dialect) running on a large screen.

The phones are connected to Phoenix over a websocket. Phoenix is connected to the Unity game using a TCP socket.

This is of course Jam-code and as such quite messy, but maybe it helps.
GitHub repository of the game

2 Likes