2

I usually using firebase for syncing every player for my multiplayer game but this time I can't because this time I want create a desktop game and firebase only support mobile.

can I use Gundb as alternative to store the player position and animation. and every client automatically syncing the data

alucard555
  • 21
  • 5

1 Answers1

0

@alucard555 yes, there is a very very simple example of a browser-based game (Asteroids in 250LOC!) that could work in a desktop app via Electron or something:

https://github.com/amark/gun/blob/master/examples/game/space.html

You can play the game (arrow keys to move, space to fire a shockwave, doesn't work on mobile or small screens) here:

http://gunjs.herokuapp.com/game/space.html

With regards to Unity3D specifically, you would need a JavaScript bridge. I myself have not done Unity3D development myself, but I have (?) heard (?) it supports JavaScript? Or some variant of it?

GUN by itself is plain vanilla JS, the only porting UnityScript may need is changing the default localStorage and WebSocket adapters (these are modular and can easily be switched out for something Unity supports).

However I do not have enough Unity3D experience to speak on this matter. (I just looked up Firebase's Unity support, and noticed that it is not JS based, it is C++. This may mean JS is incompatible with Unity?)

marknadal
  • 7,534
  • 4
  • 25
  • 22
  • The game that i make isnt a browser based game. its desktop game. And Create script in JS language in Unity. I Already install npm gun, but i still can't create var Gun in Unity JS script . Should i copy lib folder in github? when i import the lib folder to unity. Unity detect hundreds of error in the script – alucard555 Nov 27 '17 at 07:03