Skip to main content
Tweeted twitter.com/StackSoftEng/status/951213888938369024
added 121 characters in body
Source Link
Caillou
  • 256
  • 1
  • 7

I'm currently building an interactive game which has a very special use case : The game is displayed on a giant screen on stage in a theatre, and the audience can play it with their smartphones (http://www.augmented-magic.com/)

My tools are :

  1. A desktop app made with Unity, displayed on stage
  2. A web server (RoR) who provides the javascript app to audience members

The game is :

  1. You can move a fireflie on you mobile screen, and see all the fireflies of the audience on the stage screen.
  2. That is all. I want to keep it simple for now

For my proof of concept, I had the following architecture :

  1. The web apps sends their own positions to the web server every 0.5ms (it's 500ms, sorry)
  2. The web server stores and updates all these positions (in memory, no database)
  3. The unity app asks the web server for all the positions every 0.5ms (500ms, again) and updates the game displayed on the stage screen accordingly

It worked well at first sight, but my tiny web server was on the knees when too many people played at the same time (which is really unfortunate for my kind of game).

So, I want to redesign this into :

  1. The web apps send their own positions directly to the Unity app, not the the web server
  2. The unity app is the real game server, storing and updating positions
  3. Yes, I like lists.

Now, here is my question : Would you communicate with TCP or UDP protocol between the JS in the web app and the unity game server ?

I'd like to know your thoughts :)

[EDIT] : I ended up creating a websocket server in my unity game with github.com/sta/websocket-sharp . Works very well

I'm currently building an interactive game which has a very special use case : The game is displayed on a giant screen on stage in a theatre, and the audience can play it with their smartphones (http://www.augmented-magic.com/)

My tools are :

  1. A desktop app made with Unity, displayed on stage
  2. A web server (RoR) who provides the javascript app to audience members

The game is :

  1. You can move a fireflie on you mobile screen, and see all the fireflies of the audience on the stage screen.
  2. That is all. I want to keep it simple for now

For my proof of concept, I had the following architecture :

  1. The web apps sends their own positions to the web server every 0.5ms (it's 500ms, sorry)
  2. The web server stores and updates all these positions (in memory, no database)
  3. The unity app asks the web server for all the positions every 0.5ms (500ms, again) and updates the game displayed on the stage screen accordingly

It worked well at first sight, but my tiny web server was on the knees when too many people played at the same time (which is really unfortunate for my kind of game).

So, I want to redesign this into :

  1. The web apps send their own positions directly to the Unity app, not the the web server
  2. The unity app is the real game server, storing and updating positions
  3. Yes, I like lists.

Now, here is my question : Would you communicate with TCP or UDP protocol between the JS in the web app and the unity game server ?

I'd like to know your thoughts :)

I'm currently building an interactive game which has a very special use case : The game is displayed on a giant screen on stage in a theatre, and the audience can play it with their smartphones (http://www.augmented-magic.com/)

My tools are :

  1. A desktop app made with Unity, displayed on stage
  2. A web server (RoR) who provides the javascript app to audience members

The game is :

  1. You can move a fireflie on you mobile screen, and see all the fireflies of the audience on the stage screen.
  2. That is all. I want to keep it simple for now

For my proof of concept, I had the following architecture :

  1. The web apps sends their own positions to the web server every 0.5ms (it's 500ms, sorry)
  2. The web server stores and updates all these positions (in memory, no database)
  3. The unity app asks the web server for all the positions every 0.5ms (500ms, again) and updates the game displayed on the stage screen accordingly

It worked well at first sight, but my tiny web server was on the knees when too many people played at the same time (which is really unfortunate for my kind of game).

So, I want to redesign this into :

  1. The web apps send their own positions directly to the Unity app, not the the web server
  2. The unity app is the real game server, storing and updating positions
  3. Yes, I like lists.

Now, here is my question : Would you communicate with TCP or UDP protocol between the JS in the web app and the unity game server ?

I'd like to know your thoughts :)

[EDIT] : I ended up creating a websocket server in my unity game with github.com/sta/websocket-sharp . Works very well

added 39 characters in body
Source Link
Caillou
  • 256
  • 1
  • 7

I'm currently building an interactive game which has a very special use case : The game is displayed on a giant screen on stage in a theatre, and the audience can play it with their smartphones (http://www.augmented-magic.com/)

My tools are :

  1. A desktop app made with Unity, displayed on stage
  2. A web server (RoR) who provides the javascript app to audience members

The game is :

  1. You can move a fireflie on you mobile screen, and see all the fireflies of the audience on the stage screen.
  2. That is all. I want to keep it simple for now

For my proof of concept, I had the following architecture :

  1. The web apps sends their own positions to the web server every 0.5ms (it's 500ms, sorry)
  2. The web server stores and updates all these positions (in memory, no database)
  3. The unity app asks the web server for all the positions every 0.5ms (500ms, again) and updates the game displayed on the stage screen accordingly

It worked well at first sight, but my tiny web server was on the knees when too many people played at the same time (which is really unfortunate for my kind of game).

So, I want to redesign this into :

  1. The web apps send their own positions directly to the Unity app, not the the web server
  2. The unity app is the real game server, storing and updating positions
  3. Yes, I like lists.

Now, here is my question : Would you communicate with TCP or UDP protocol between the JS in the web app and the unity game server ?

I'd like to know your thoughts :)

I'm currently building an interactive game which has a very special use case : The game is displayed on a giant screen on stage in a theatre, and the audience can play it with their smartphones (http://www.augmented-magic.com/)

My tools are :

  1. A desktop app made with Unity, displayed on stage
  2. A web server (RoR) who provides the javascript app to audience members

The game is :

  1. You can move a fireflie on you mobile screen, and see all the fireflies of the audience on the stage screen.
  2. That is all. I want to keep it simple for now

For my proof of concept, I had the following architecture :

  1. The web apps sends their own positions to the web server every 0.5ms
  2. The web server stores and updates all these positions (in memory, no database)
  3. The unity app asks the web server for all the positions every 0.5ms and updates the game displayed on the stage screen accordingly

It worked well at first sight, but my tiny web server was on the knees when too many people played at the same time (which is really unfortunate for my kind of game).

So, I want to redesign this into :

  1. The web apps send their own positions directly to the Unity app, not the the web server
  2. The unity app is the real game server, storing and updating positions
  3. Yes, I like lists.

Now, here is my question : Would you communicate with TCP or UDP protocol between the JS in the web app and the unity game server ?

I'd like to know your thoughts :)

I'm currently building an interactive game which has a very special use case : The game is displayed on a giant screen on stage in a theatre, and the audience can play it with their smartphones (http://www.augmented-magic.com/)

My tools are :

  1. A desktop app made with Unity, displayed on stage
  2. A web server (RoR) who provides the javascript app to audience members

The game is :

  1. You can move a fireflie on you mobile screen, and see all the fireflies of the audience on the stage screen.
  2. That is all. I want to keep it simple for now

For my proof of concept, I had the following architecture :

  1. The web apps sends their own positions to the web server every 0.5ms (it's 500ms, sorry)
  2. The web server stores and updates all these positions (in memory, no database)
  3. The unity app asks the web server for all the positions every 0.5ms (500ms, again) and updates the game displayed on the stage screen accordingly

It worked well at first sight, but my tiny web server was on the knees when too many people played at the same time (which is really unfortunate for my kind of game).

So, I want to redesign this into :

  1. The web apps send their own positions directly to the Unity app, not the the web server
  2. The unity app is the real game server, storing and updating positions
  3. Yes, I like lists.

Now, here is my question : Would you communicate with TCP or UDP protocol between the JS in the web app and the unity game server ?

I'd like to know your thoughts :)

Source Link
Caillou
  • 256
  • 1
  • 7

Between JS clients and a Unity game server : TCP or UDP?

I'm currently building an interactive game which has a very special use case : The game is displayed on a giant screen on stage in a theatre, and the audience can play it with their smartphones (http://www.augmented-magic.com/)

My tools are :

  1. A desktop app made with Unity, displayed on stage
  2. A web server (RoR) who provides the javascript app to audience members

The game is :

  1. You can move a fireflie on you mobile screen, and see all the fireflies of the audience on the stage screen.
  2. That is all. I want to keep it simple for now

For my proof of concept, I had the following architecture :

  1. The web apps sends their own positions to the web server every 0.5ms
  2. The web server stores and updates all these positions (in memory, no database)
  3. The unity app asks the web server for all the positions every 0.5ms and updates the game displayed on the stage screen accordingly

It worked well at first sight, but my tiny web server was on the knees when too many people played at the same time (which is really unfortunate for my kind of game).

So, I want to redesign this into :

  1. The web apps send their own positions directly to the Unity app, not the the web server
  2. The unity app is the real game server, storing and updating positions
  3. Yes, I like lists.

Now, here is my question : Would you communicate with TCP or UDP protocol between the JS in the web app and the unity game server ?

I'd like to know your thoughts :)