Bullets in multiplayer are starting out ahead of the peer

Get help using Construct 2

Post » Wed Aug 26, 2015 2:05 am

When the peer is moving and shooting bullets, on the peer screen the bullets look like they're coming out ahead of the peer's movement. On the host screen they look fine, and the host's bullets look fine on both screens.

my events are like this:

on start
sync peer... sync bullet (both position only normal bandwidth low bytes)



peer
move
if (shoot key pressed) send input bit for fire to 1


host
move

move peer
if (peer input bit for fire is 1) spawn bullet on peer


How do I get the bullets to come out the same on the host and peer screens? This is on the same computer with zero lag so...
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
57
S
15
G
5
Posts: 164
Reputation: 7,948

Post » Wed Aug 26, 2015 5:51 pm

After close investigation I found the peer is lagging behind in movement by about a quarter second. I removed the enable predictive input call and now it works fine. It's a teenie bit choppy on the peer but moves ok and the bullets match up just fine. The multiplayer predictive input thingy was making it lag behind.


Judging from other people's posts on the subject it seems like enable predictive inputs only really works for 8 directional movement or movement that doesn't involve outside forces like gravity or physics.
Follow my CZero development on twitter https://twitter.com/CaptainZeroGame
B
57
S
15
G
5
Posts: 164
Reputation: 7,948

Post » Tue Oct 06, 2015 12:59 pm

@sinistar99
Can you send "capx" example?
B
16
S
2
G
2
Posts: 7
Reputation: 1,389


Return to How do I....?

Who is online

Users browsing this forum: SturmIV and 4 guests