[Plugin] Photon Cloud

Post your completed addons to share with the community

Post » Sun Oct 30, 2016 9:35 pm

@mudmask

I had a little lag on the version with the multiplayer object.
But that could have been some pc stuttering as well.

Both seem to run fine.
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Sun Oct 30, 2016 9:42 pm

@Savvy001 - I guess the true test would be in implementing bullets and a scoring system...
B
72
S
18
G
9
Posts: 376
Reputation: 9,106

Post » Sun Oct 30, 2016 9:51 pm

Yep.
The thing is with the multiplayer plugin from C2 (as they told in articles) is that there can be many things "routers" and such between the players destinations around the world.
This mainly can cause a lot of lag.
For me why i go with photon is because it minimizes this problem.
Everyone connects to the cloud.
Seems to me like the short best route.
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Sun Oct 30, 2016 10:01 pm

@Savvy01 - I hear ya. So minimizing all those factors would be one of the biggest advantages. However here's what concerns me, but maybe I'm doing something wrong? Here are some side by sides:

Multiplayer Plugin:
Image

Photon Plugin:
Image

Is there any way to get that level of latency on photon? Even the examples that I've run that other people have made have similar results.
B
72
S
18
G
9
Posts: 376
Reputation: 9,106

Post » Sun Oct 30, 2016 10:09 pm

@mudmask
Well assuming you run the C2 version side by side on 1 pc does not make it connect "cross country".
Meaning the connection and data stays within your home network.

The photon version does connect to the photon cloud and the data then travels all the way back to you.
So the photon version gives a more accurate latency representation than the C2 version.

A question i have to ask, is did you copy paste the movement events from a photon example?
If so would you please be so kind to show a screenshot of the event that "raises" on motion of the character.
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Mon Oct 31, 2016 12:37 am

mudmask wrote:OK guys - this plugin seems really awesome...
.................
.....Thanks guys!



I will agree with what @mudmask said. This plugin makes Multiplayer MUCH simpler to implement, but the latency seems to be inferior to the Multiplayer object built into C2. That could possibly be a server thing like you said Mud, because it does say on the Photon site that the free server should mainly be used for testing and developing.

I haven't managed to get as bad of a lag issue as you have (Although I still get slight stuttering). How often do you have the movements of the player being updated?
Last edited by TabloidA on Mon Oct 31, 2016 12:41 am, edited 1 time in total.
I like giving game advice more than I actually like making games ;)

Image
B
40
S
15
G
3
Posts: 129
Reputation: 4,651

Post » Mon Oct 31, 2016 12:57 am

@Savvy001 Alright, here's what I have currently: http://i.imgur.com/WWjySN0.png

The opposing player is now in fact destroyed, except it doesn't need to be hit by the bullet to do so. Right when I press Shift.

It seems I need to find a way identify that the bullet hits only the enemy, because I'm sure what's happening currently is that it's looking for ANY instance of the player to get hit. An easy work around to this though could be to make two separate Player instances for both teams?
Last edited by TabloidA on Mon Oct 31, 2016 12:59 am, edited 1 time in total.
I like giving game advice more than I actually like making games ;)

Image
B
40
S
15
G
3
Posts: 129
Reputation: 4,651

Post » Mon Oct 31, 2016 12:59 am

@mudmask & @TabloidA

When i first started with the photon plugin.
I used the multiplayer example from the first post.
It had the same latency mudmask is showing.
This example capx photon provides, has a event raised for movement, but it is not set at each tick.
They have it set at like 0.2 seconds interval.
As soon as i removed that the latency was as good as gone.

So be sure to check that raising the motion of player characters.
Do it at each tick, or remove that condition completely.
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Mon Oct 31, 2016 1:17 am

TabloidA wrote:@Savvy001 Alright, here's what I have currently: http://i.imgur.com/WWjySN0.png

The opposing player is now in fact destroyed, except it doesn't need to be hit by the bullet to do so. Right when I press Shift.

It seems I need to find a way identify that the bullet hits only the enemy, because I'm sure what's happening currently is that it's looking for ANY instance of the player to get hit. An easy work around to this though could be to make two separate Player instances for both teams?


@TabloidA

Just add a variable to the bullet.
When you fire the bullet, set it to photon.myactornr

Then on collision with the bullet add the condition:
Player.actornr "does not equal" photon.myactornr

Then you when you shoot, the bullet can't hit you.

In my game the bullets all have actornr variables to figure out who hits who
And keeping the bullets from hitting the player who fired them.
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

Post » Mon Oct 31, 2016 1:39 am

@TabloidA

Also, make sure to use 2 different bullet types of each bullet.
1 Dummy (spawning on your pc, not harming anyone, this one is purely for visual reference)
2 Real Bullet (spawning on the other players pc's, harming them when they are being hit)

Imagine NOT doing this what would happen.
You fire a gun.
Bullets get spawned on both pc's, both harming the other player, and both sending event data to the other one.
This clutters up the data on the photon server, and it could trigger multiple hits when actually it was only 1.

The right way would be:
You fire a gun.
You see a dummy bullet flying.
All the other players see the "real" bullet flying.
The player is being hit with the real bullet.
His game checks if the bullet.actornr is the same as his Photon.myactornr
If true, then life is substracted, the bullet is destroyed and a event is sent to all other players with the update players life.
B
59
S
21
G
14
Posts: 779
Reputation: 13,927

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests