Integration with Photon Cloud: Multiplayer

Discuss game development design and post your game ideas

Post » Mon Aug 05, 2013 10:45 am

[QUOTE=Whiteclaws] Yus , Got it workeing ...[/QUOTE]Good! Pleased to hear!
[QUOTE=Whiteclaws]To update the game , you just export to html5 and remplace the files on the http server by the exported ones on the html server ?[/QUOTE]Yus.

[QUOTE=Whiteclaws]Also , is it compatible with the newest versions of C2 ?[/QUOTE]Yus.

Let's know if you have any probs.
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Mon Aug 05, 2013 6:24 pm

The plugin is not intuitive at all and really hard to use for someone who doesn't know what each events do code-wise , and without a join and leave command , it doesn't help too , to be honest , you should re-work the structure ( You could take the official websocket plugin as an inspiration) , for now , the plugin is not useable for other than you .

I would suggest restarting the plugin from ground-zero and concentrating on those CAEs

[Quote=Me]
On closed
Triggered when the connection is closed, either deliberately or due to an error.

On connected
Triggered when the connection is successfully established and the communication channel is now open.

On message
Triggered when a text message arrives from the server over an open connection. Use the MessageText expression to retrieve the content of the message.

---------------------------------------------------------------------

Close
Close any active connection. No more messages can be sent or will be received after closing.

Connect
Connect to the server

Send text
Send a text string to the server. This is ignored if the connection is not currently open.

---------------------------------------------------------------------

MessageText
In On message, the text content of the message just received from the server.

[/Quote]

Examples of the uses

[Quote]
You could send a message as "Object|UID|X|Y"

And you wouldn't need webplayer.X/Y
[/Quote]

That would be all the essential conditions for a game , and would largely sufficient

I'm sorry , but I gave it all what I could and I hope you can make this happen !Whiteclaws2013-08-05 18:38:14
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Wed Aug 07, 2013 9:58 am

@Whiteclaws
Tx for yr feedback.

I think you're expecting it to be a sort of websocket plugin, but that wasn't my aim, which was to make a higher-level behavior, that doesn't require the C2 game developer to decode low-level text strings.

As for the join and leave events, I followed the ExitGames Photon Cloud JS SDK examples, where the 'Join' and 'Leave' buttons are embedded in the index.html web page (my PhotonClient runtime modifies the C2 index.html to enable this). The effect is to remove from the C2 edittime the ability to modify those buttons.
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Wed Aug 07, 2013 5:31 pm

@Velojet ,

That would be pretty basic , but easier to get started with and to control the flow of the game with.

As for now , I can't define how hard it is to create a new player

On joigned - Send message - "Creation|Webplayer.ID|X|Y"
On message
-- tokenat(message,0,"|")= "Creation"
Create Player at tokenat(message,1,"|"), tokenat(message,2,"|")
Set Id to Webplayer.ID

Every tick
Send message "Movement|Webplayer.Id|X|Y"
-- On message
--- tokenat(message,0,"|")= "Movement"
---- Player.ID = tokenat(message,1,"|")
----- Set player position to tokenat(message,2,"|"),tokenat(message,3,"|")

It may be a bit low-level , but it's way more intuitive and easy-to-understand than the current "high-level" behavior

As for the join events , is there a way to auto-join the game without having an ugly join button ?

Finally ,

You could setup the messages to be multiple parameters ( function-ish ) Messages

So the dev could check the first parameter ( state ) , the second parameter ( X ) and third ( Y ) without having to use tokenat

I think this plugin has a lot of potential , and I don't want it to be flushed down in the servers of the scirra forumWhiteclaws2013-08-07 17:36:44
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Wed Aug 07, 2013 8:35 pm

@Whiteclaws
Thx very much for your continuing interest in this behavior!

[QUOTE=Whiteclaws]As for now , I can't define how hard it is to create a new player.[/QUOTE]Have a look at function MakeWebPlayer() in my demo. All you need are the coords of the remote web player, which my PhotonClient behavior will give you directly without any need for low-level tokenat() text string deconstruction.
Then all you have to do is to use my PhotonClient's Set WebPlayer's ID action and the standard C2 Create object action to have the web player appear. Much easier than your proposed code ;)

[QUOTE=Whiteclaws]As for the join events , is there a way to auto-join the game without having an ugly join button ?[/QUOTE]Still waiting on the ExitGames people to come through with this!Velojet2013-08-07 20:40:34
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Wed Aug 07, 2013 9:11 pm

Here's a direct comparison:

Whiteclaw's low-level code:
[CODE]tokenat(message,1,"|"), tokenat(message,2,"|")[/CODE]
My high-level PhotonClient expressions:
[CODE]WebPlayerX, WebPlayerY[/CODE]
I rest my case!
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Thu Aug 08, 2013 1:14 am

The request information from servers and all , just to create player

As of , you could just do

On joigned ,
Create player
Set player.ID to Webplayers.ID

On webplayer joigned :
Initialise data of web player to create (i.e. data to be used by C2 in creating web players)
Create Player
Set Player.Photon.WebplayerId to player.uid

All of this is pretty confusing and description doesn't give a lot of help

I know you want to make a high-level plugin , but all of this is really complex and not really intuitive for a person that doesn't know what each line does

I wouldn't trade simplicity and intuitivity for low event-count and complexityWhiteclaws2013-08-08 01:16:30
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Thu Aug 08, 2013 5:15 am

@Whiteclaws [QUOTE=Whiteclaws]... All of this is pretty confusing and description doesn't give a lot of help ...[/QUOTE]Have good study of my Workout demo. You'll find it pretty fully commented e.g.


Also, you'll get the usual C2-type prompts with all the PhotonClient ACEs.

And feel free to ask if there's not enough info there.
B
105
S
20
G
12
Posts: 549
Reputation: 20,320

Post » Wed Nov 13, 2013 10:47 am

Hi, @Velojet, any news about your script and photon?

Are you guys familiar to the Bloons TD matchmaking system for getting 2 clients in a server?

Bloons TD or this one http://slime.clay.io/

I need this Multiplayer System is it possible to make?
Velojet could you help me?
B
5
S
1
Posts: 16
Reputation: 957

Post » Sun Nov 24, 2013 5:24 am

I'm trying to make a Plugin based in the Behavior (a simple plugin version of the behavior). For now the plugin can create/join/leave a room, and send/receive a message. It is very basic...

Deko2013-11-25 21:33:55
B
3
S
1
G
2
Posts: 8
Reputation: 866

PreviousNext

Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 1 guest