Some multiplayer questions - could someone please educate?

Discussion and feedback on Construct 2

Post » Mon Oct 13, 2014 9:39 am

I went through all the tutorials in detail on multiplayer and have few questions. Will be great if someone could please answer them -

1. Which method out of the below should be used to propagate data from peer to host in multiplayer and in what conditions each of them is used and why?

A. Set Client input state "<variable>" to something and then use Multiplayer.PeerState ("peerid", "<variable>") sequence
B. Send message with peer data within the message
C. Use Sync variable

2. Can we set client input state on any event inside peer group OR should it happen only on multiplayer - on client update event?

3. Why cant we not specifiy a boolean type variable in sync variable ? The sync variable dropdown doesnt show boolean variable of the object.

4. Difference between PeerId and MyId
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Mon Oct 13, 2014 10:01 am

kmsravindra wrote:I went through all the tutorials in detail on multiplayer and have few questions. Will be great if someone could please answer them -


1. Which method out of the below should be used to propagate data from peer to host in multiplayer and in what conditions each of them is used and why?

A. It think this is wrong, it should be Multiplayer.PeerState (AssociatedObject.peerid, "<variable>") sequence
B. Refer to my reply in your previous thread.
C. Refer to my reply in your previous thread.

2. I have no comment on this, but I think if you use outside of the on client update, it's either having no effect on host or it works like a trigger. I haven't test this out, probably do this on weekend.
3. This has something to do with the 8bit=1byte excerpt. I don't remember where I read it from.
4. MyId is always the client user Id, while peerID will be the peer that involved in the triggered event.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Mon Oct 13, 2014 10:16 am

Thanks @DuckfaceNinja.

For 1.A, this is what I have and it doesn't work...

scan3.jpg
You do not have the required permissions to view the files attached to this post.
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Mon Oct 13, 2014 10:38 am

This isn't working precisely, just a demo.
You do not have the required permissions to view the files attached to this post.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728

Post » Mon Oct 13, 2014 10:56 am

@kmsravindra I think you still need at least one "OnClientUpdate" to communicate your input.

The thing I'm unsure of if it is used outside the "OnClientUpdate" whether will it still update the host if "OnClientUpdate" events is placed after "SetClientInput".
Last edited by DuckfaceNinja on Mon Oct 13, 2014 11:04 am, edited 1 time in total.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Mon Oct 13, 2014 11:02 am

DuckfaceNinja wrote:@kmsravindra You still need at least one "OnClientUpdate" to communicate your input.

The thing I'm unsure of if it is used outside the "OnClientUpdate" whether will it still update the host if "OnClientUpdate" events is placed after "SetClientInput".


Multiplayer is ready for input
> On client update


Edit:
mp-1.JPG


Well something like this... sorry I use touch, not mouse ;)
You do not have the required permissions to view the files attached to this post.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728

Post » Mon Oct 13, 2014 11:06 am

DUTOIT wrote:Multiplayer is ready for input
> On client update

I'm curious what will happen if you remove on client update, and just leave the ready for input.

I don't quite remember, but I think "is ready for input" is used by host, undoubtedly I need to revisit this one.
Last edited by DuckfaceNinja on Mon Oct 13, 2014 11:12 am, edited 1 time in total.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Mon Oct 13, 2014 11:08 am

DuckfaceNinja wrote:
DUTOIT wrote:Multiplayer is ready for input
> On client update

I'm curious what will happen if you remove on client update, and just leave the ready for input.


Just disabled
Lol, it works same... learnt something, can that be right?????
I was using it as a safety check... :?:

Edit
Is ready for input
True when a peer is ready to send input to the host. This means On client update has triggered at least once, or is about to trigger. Do not allow players using input prediction to move or act before this condition is true or On client update has triggered: doing so will simply cause an input prediction error since the host is not yet ready to receive input.

On client update
Triggered when a peer is about to send its input state to the host. The input state should be updated in this trigger using the Set client state action.


So "Is ready for input" is the better way then... I was just using it to avoid an input prediction error, but it looks like they both work
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728

Post » Mon Oct 13, 2014 11:18 am

DUTOIT wrote:Just disabled
Lol, it works same... learnt something, can that be right?????
I was using it as a safety check... :?:

Ah if it works the same, the "On client update" is not needed at all, that should invalidate my statement
"You still need at least one "OnClientUpdate" to communicate your input"

I guess the "On Client Update" is still a mystery to me.
DUTOIT wrote:So "Is ready for input" is the better way then... I was just using it to avoid an input prediction error, but it looks like they both work

I don't remember how I used "is ready for input" before, it might not be necessary at all for that event. I still think the sync is already started on start layout. Can you check what'll happen if both onclientupdate and isreadyforinput is removed?
Last edited by DuckfaceNinja on Mon Oct 13, 2014 11:24 am, edited 1 time in total.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Mon Oct 13, 2014 11:20 am

DuckfaceNinja wrote:I guess the "On Client Update" is still a mystery to me.


You and me both... ;)
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests