Help with multiplayer game showing shots fired on host&peers

Get help using Construct 2

Post » Sun Feb 01, 2015 8:20 pm

I am trying to learn how to make a multiplayer game. I have been making changes off the demo. I have changed the demo into a tank game and updated the graphics for that. I changed the movement of the tanks so they drive around like tanks. And I have added a rotating turret that the laser shoots out of. The tank movement is working right in the multiplayer ( tanks move like they should on all host and peer screens)

The problem I am having is with the firing the laser. I have changed it from the demo beam ( beam from point to point) to a laser shot that is using the bullet behavior. I have it working on the local computer you see the shots going off. But the shots do not show up on any of the other computers in the game.

I have uploaded the game cap so you can look at it and see if you can find out why the laser shots are not showing up on all computer playing the game. I am a very new to the multiplayer coding so any help you can give will be a big help.
You do not have the required permissions to view the files attached to this post.
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Sun Feb 01, 2015 8:38 pm

im unable to help you but i'm glad you shared this capx. with comments to explain

its chinese to me at the moment but i'll dissect it patiently and try to understand how multiplayer works ...

i hope you'll find some answer :)
B
19
S
5
Posts: 104
Reputation: 1,761

Post » Sun Feb 01, 2015 8:45 pm

Thanks manukeo :) I hope so too
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Sun Feb 01, 2015 9:34 pm

Here. You had put the spawn laser code in the wrong section. It should go under Common Group so peers and host can see it.
I moved some bits of your code around so there's a chance some of the notes don't match up anymore just so your aware.

You're going to also want to change your code to test for hit on tank collision with laser instead of the aim spot. But I assume you knew that and you're getting to it. :)
You do not have the required permissions to view the files attached to this post.
B
33
S
8
G
2
Posts: 100
Reputation: 2,635

Post » Sun Feb 01, 2015 10:03 pm

I tried this out and it is not working right. getting the same problem as in my version. you just see the laser fire on just one of the computers not on the other peers or host. I also tried the code in the common group. and I could not get it to work thats why I move it to both the host group and the peer group.. but thanks for trying thatserafimkid :)
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Sun Feb 01, 2015 10:21 pm

Hmm it works for me on my computer.
Last edited by thatserafimkid on Sun Feb 01, 2015 10:23 pm, edited 1 time in total.
B
33
S
8
G
2
Posts: 100
Reputation: 2,635

Post » Sun Feb 01, 2015 10:22 pm

Wow very weird after I reload my older Version after trying thaserafimkid changes out. It now seems to be working right. you can see laser fire from all players. Humm must of been old cold in the buffer when I was trying it out on line.

you can check it out here

https://dl.dropboxusercontent.com/u/1244375/Multiplayer%20Tank%20game%20example/index.html
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Sun Feb 01, 2015 10:36 pm

Humm still needs more work seemed to work ok for a little bit. then after playing with it for a while it seemed to get out of sync.
please take a look at it and see what you can find. Or if you see something that could be done better let me know. I always like to learn new ways of doing things :)
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Sun Feb 01, 2015 11:11 pm

awesome !

we can't see the rotation of the others tanks so they seem to act strangely sometimes. but it work !
B
19
S
5
Posts: 104
Reputation: 1,761

Post » Sun Feb 01, 2015 11:27 pm

thatserafimkid I have to say I am sorry your code is working. Not sure what I did, maybe a lag in when it gets updated to my dropbox. But thanks that did do the trick. now I have to find out why it sometimes it don't show the tanks rotation. and change the hit check to the laser shot and not the mouse pointer from the demo.
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 11 guests