Waltan's Recent Forum Activity

  • I have this map. I want to put it in 1 layout. So I have question about it.

    What will work faster?

    • If I will split this map to parts, and then put it it game as sprites and then make collision polygons for each of them?

    or

    • If I will make all black color with tiled background and rounded edges with sprites?
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • >

    > >

    > > Every 0,05 seconds:>Send ("alldata," & "," & id & "," & x & "," & y)

    > >

    > For the server part or a client? I'm a little misunderstood.

    >

    > If I will send some kind of data to the server, how can I split it

    Your client. You gonna delete the pick, the "is moving?" condition and put a clear "every 0,05"... as I said.

    The server side gonna be something like this:

    socket.on("message", function (data) {

    var new_data = data.split(',');

            if (new_data[0] == 'alldata') {

                id = new_data[1];

                x = new_data[2];

                y = new_data[3];

                

                socket.broadcast.emit("message",

                  ?'alldata,' + id + ',' + x + ',' + y);

            }

    Alright. Thank you.

    Also, how "socket.broadcast.emit" is different from "socket.send"?

    breackzin

  • Every 0,05 seconds:>Send ("alldata," & "," & id & "," & x & "," & y)

    For the server part or a client? I'm a little misunderstood.

    If I will send some kind of data to the server, how can I split it?

    By the way, what language do you speak? Are you deep into socket.io? I have problems myself about hosting it. Could you help me?

    My native language is Russian, but I can uderstand English well enough and write it clearly enough :)

    If you need help add me on Skype: ivladoss

  • Get it tested and see for yourself.

    It still did not helped. Maybe there is a problem with my code?

    <img src="https://dl.dropboxusercontent.com/u/34384736/construct/socket.png" border="0" />

  • every tick - system scroll to object "player"

    Hope this wil help.

  • Instead, use every 0,05 seconds.

    Are you sure this will help?

    What about 0,1?

  • I created a little project in which I have 2 players.

    Every tick Im asking server for the second player's coordinates and      

    along with this sending him mine.

    Everything works fine for the first 10-15 second. Then it began to lag and then it freezes.

    Can you tell me any other way how to optimise exchange of coordinates?

  • Maybe there is "On page closed" or "On game ended" condition?

  • He just means, you shouldnt connect in the layer where your map is.

    Or he means that you shouldnt connect twice...

    Jeck your inbox already, dude.

  • Im going to send your my skype name soon ok?

    Did you also checked the firewall of your router? Try to forward the port.

    Which ports should I open?

  • How can I sent multiple data using one event?

    Something like:

    On "Button" clicked -> Send "playermove", player.x,player.y

    And then on server:

    socket.on("playermove",function(data)

    {

    x = data.player.x

    y = data.player.y

    });

Waltan's avatar

Waltan

Member since 5 Jul, 2011

None one is following Waltan yet!

Trophy Case

  • 13-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies