PhotonEngine Help Needed

Get help using Construct 2

Post » Fri May 27, 2016 9:54 am

Followed the Tutorial and got everything working but one small problem

It says to
Code: Select all
Set Platform Enable

Image

But I dont use Platforming I use a addon called Spaceship

Image

And there no Set Spaceship Enable so what do I do is there a work around or fix or am I doing something wrong??!
B
55
S
33
G
19
Posts: 67
Reputation: 14,412

Post » Fri May 27, 2016 12:11 pm

Disable the default control of your spaceship behaviour and do this:

--------------------------------------------------------------------------------
On left pressed
If ActorNr=Photon.MyActorNr --> Simulate control Left
-------------------------------------------------------------------------------

The line ActorNr=Photon.MyActorNr select the local client.


Edit:
Oh and replace the Photon.ActorNr by a Photon.MyActorNr or you will have some problems.
Image
My Twitter:

@Sirvoidd

My Tutorial:

Multiplayer with Photon
B
34
S
12
G
9
Posts: 73
Reputation: 7,139

Post » Fri May 27, 2016 12:48 pm

First of all i wouldn't recommend sending X & Y every tick through photon. It will create a lot of messages being sent/received. You can send X & Y every 0.1-0.2 seconds and lerp the position on the recieving end. Much more bandwith multiplayer friendly. Best is to only send X.Y at start and stop of movement, or any direction change. Also, you can send both X and Y and alot of other things in one event at once using arrays.
Follow my progress on Twitter
or in this thread Archer Devlog
B
41
S
18
G
19
Posts: 1,055
Reputation: 14,019

Post » Sat May 28, 2016 12:11 am

tunepunk wrote:First of all i wouldn't recommend sending X & Y every tick through photon. It will create a lot of messages being sent/received. You can send X & Y every 0.1-0.2 seconds and lerp the position on the recieving end. Much more bandwith multiplayer friendly. Best is to only send X.Y at start and stop of movement, or any direction change. Also, you can send both X and Y and alot of other things in one event at once using arrays.


Yes I agree with you. When I writed the tutorial I did not pay attention to that ^^'
And I have not used the arrays to simplify the tutorial for the beginners.
My Twitter:

@Sirvoidd

My Tutorial:

Multiplayer with Photon
B
34
S
12
G
9
Posts: 73
Reputation: 7,139

Post » Wed Nov 02, 2016 4:13 am

Hey @Sirvoid and @tunepunk - quick question for you guys... is this a pretty common latency/lag scenario? I'm only sending X and Y every .3 seconds, and I'm sending it via a token:

Image

I know it's not TOO bad, but is there any way to tighten it up a bit more? OR in either of your experience, can you still have a great and competitive game session experience with that bit of lag? Or how would I work around it?

Thanks guys - you guys seem to know a lot about Photon so I figured I'd ask. Sorry to resurrect an old thread like this.
B
74
S
19
G
9
Posts: 377
Reputation: 9,258

Post » Wed Nov 02, 2016 11:04 am

mudmask wrote:Hey @Sirvoid and @tunepunk - quick question for you guys... is this a pretty common latency/lag scenario? I'm only sending X and Y every .3 seconds, and I'm sending it via a token:

Image

I know it's not TOO bad, but is there any way to tighten it up a bit more? OR in either of your experience, can you still have a great and competitive game session experience with that bit of lag? Or how would I work around it?

Thanks guys - you guys seem to know a lot about Photon so I figured I'd ask. Sorry to resurrect an old thread like this.


Hmmmm. For this kind of game i don't think i would send XY, except for adjusting positions.

If movement speed is constant, you can just send for example on key press: Sending only move, and the direction. For jump, send jump, speed and direction, and when the character stops moving you send stop moving, along with the XY position of the place to stop at, so the position is synced. A little bit of lag you can't really escape, but for this kind of game i would limit messages by just sending, on key down, and key up, basically. No need to send every 0.3 seconds.

The other clients would simulate exactly what the other player did.

For bullet's I'm not really using real bullets with collisions. I'm using a raycast approach on fire, and only send the XY position of the origin of the bullet, and the end position of the bullet (an solid object hit), when the other client get's that informatioin, i just move a sprite between those points, and detect collisions simply by distance between bullet player < XX pixels.

Hope that helps. If you have any other questions you can send me a PM,
Follow my progress on Twitter
or in this thread Archer Devlog
B
41
S
18
G
19
Posts: 1,055
Reputation: 14,019


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 1 guest