Help with multiplayer game showing shots fired on host&peers

0 favourites
  • 11 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • 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.

  • 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

  • Thanks manukeo I hope so too

  • 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.

  • 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

  • Hmm it works for me on my computer.

  • 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

  • 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

  • awesome !

    we can't see the rotation of the others tanks so they seem to act strangely sometimes. but it work !

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • Still having some problems with the movement but just with the Host. The host on the peers computer does not rotate but it does move. On the host computer the tank does move and rotate right. But all the peer's movement works right they all move and rotate.

    Have got the laser firing system up and working now. as well as the scoring system for hits.

    I will upload the latest version so you can check it out and see whats wrong with the Host coding that it does not show the rotation on the peer computer. Thanks so much.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)