Difference between revisions of "Multiplayer"

From GiderosMobile
 
(4 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
There are three ways to implement multiplayer games:
 
There are three ways to implement multiplayer games:
 
* '''Server Mode''': Dedicated server with public IP
 
* '''Server Mode''': Dedicated server with public IP
* '''Host Mode''': One player is the host, all other players connect to them
+
* '''Host Mode''': One player is the host, all other players connect to him
 
* '''Shared Mode''': Cloud Room has StateAuthority
 
* '''Shared Mode''': Cloud Room has StateAuthority
  
 
+
''Server Mode'' and ''Shared Mode'' can be daunting and won't be covered here.
''Server Mode'' and ''Shared Mode'' can be daunting and won't be covered here. Some multiplayer platforms SDK you can check:
 
* https://noobhub.co.za/
 
* https://github.com/Overtorment/NoobHub
 
* https://www.smartfoxserver.com/
 
* https://github.com/EsotericSoftware/kryonet
 
 
 
And to get you started using Noobhub:
 
* https://forum.gideros.rocks/discussion/4293/noobhub-free-opensource-multiplayer-and-network-messaging-for-gideros-coronasdk/p1
 
 
 
  
 
=== Host Mode ===
 
=== Host Mode ===
Host Mode is the easiest way to get started with multiplayer. In order to implement it in Gideros, we will use the '''Gideros Unite Framework''' written by Arturs Sosins (@'''ar2rsawseen''').
+
Host Mode is the easiest way to get started with multiplayer games. In order to implement it in Gideros, we will use the '''Gideros Unite Framework''' written by Arturs Sosins (@'''ar2rsawseen''').
  
The Gideros Unite framework allows a host (server) and clients to connect over a Local Area Network.
+
Get started here: '''[[Gideros Unite Framework]]'''
  
==== '''[[Gideros Unite Framework]]''' ====
+
=== LOSC ===
 +
Open Sound Control (OSC) for lua: https://github.com/davidgranstrom/losc
  
Some demo code:
+
OpenSoundControl (OSC) website: https://ccrma.stanford.edu/groups/osc/index.html
<syntaxhighlight lang="lua">
 
-- we can get all devices that are connected to our network
 
local devices = {}
 
serverlink:addEventListener("device", function(e)
 
print(e.data.id, e.data.ip, e.data.host)
 
devices[e.data.id] = {}
 
devices[e.data.id].ip = e.data.ip
 
devices[e.data.id].name = e.data.host
 
end)
 
  
serverlink:getDevices()
+
Get started here: '''[[Gideros LOSC]]'''
  
-- add some methods, that could be called by other clients or server through network
+
=== Some Other Multiplayer Platforms SDK ===
-- draw something
+
* https://noobhub.co.za/
serverlink:addMethod("draw", self.drawLine, self)
+
* https://github.com/Overtorment/NoobHub
-- end drawing
+
* https://www.smartfoxserver.com/
serverlink:addMethod("end", self.stopDrawing, self)
+
* https://github.com/EsotericSoftware/kryonet
-- clear drawing
 
serverlink:addMethod("clear", self.reset, self)
 
  
-- then you can call this methods when needed
+
To get you started using Noobhub with Gideros:
serverlink:callMethod("clear")
+
* https://forum.gideros.rocks/discussion/4293/noobhub-free-opensource-multiplayer-and-network-messaging-for-gideros-coronasdk/p1
serverlink:callMethod("draw", someX, someY)
 
 
 
-- or call method of specific device using its id
 
serverlink:callMethodOf("clear", 112233)
 
serverlink:callMethodOf("draw", someX, someY, 112233)
 
  
-- and when game is finished
 
serverlink:close()
 
</syntaxhighlight>
 
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Latest revision as of 19:47, 8 December 2024

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.pngPlatform linux.png

Multiplayer

There are three ways to implement multiplayer games:

  • Server Mode: Dedicated server with public IP
  • Host Mode: One player is the host, all other players connect to him
  • Shared Mode: Cloud Room has StateAuthority

Server Mode and Shared Mode can be daunting and won't be covered here.

Host Mode

Host Mode is the easiest way to get started with multiplayer games. In order to implement it in Gideros, we will use the Gideros Unite Framework written by Arturs Sosins (@ar2rsawseen).

Get started here: Gideros Unite Framework

LOSC

Open Sound Control (OSC) for lua: https://github.com/davidgranstrom/losc

OpenSoundControl (OSC) website: https://ccrma.stanford.edu/groups/osc/index.html

Get started here: Gideros LOSC

Some Other Multiplayer Platforms SDK

To get you started using Noobhub with Gideros: