Navigation

    Colyseus
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. mitchmeyer1
    3. Best
    • Profile
    • More
      • Continue chat with mitchmeyer1
      • Flag Profile
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups

    Best posts made by mitchmeyer1

    RE: Detect collision in server Colyseus (Solved)

    I do this on my server with no framework (not saying the framework isnt a better option, just wanted to contribute).

    Whenever a players x or y is updated i run this function which is inside the player class on the server.

    It essentially loops through all the other players in the room, and compares their x and y coordinates to the 1 player who just moved. If the other_players.x is < (player.x-0.4) && other_players.x is < (player.x+0.4) that means they are touching in terms of x axis (my players are about 1 unit wide.

    then if other_players.y is < (player.y-0.2) && other_players.y is > (player.y-0.5) that means my player is higher than them at about head level. You would have to play with the values depending on your character size

    If both of these are true i run the function to kill them and send that message to all the connected clients where they can vanish the player. I also add them to an array with a timeout so that if they are in that array they cannot be killed again within 2 seconds

    Hope this helps someone!

    posted in Questions & Help •
    How to used patched Colyseus code On Arena?

    Hey! I just moved to Arena from a self hosted server i have been using for the past year. Self hosted was great but experiencing a large number of abnormal disconnects and was recommended to me to try arena as it could be load balancing / infrastructure issues. So here i am!

    My problem is i patched the colyseus library to make the onLeave function have a 3rd parameter which is the "code". It works beautifully and gives me more insight on my onLeave function as to why the user left, so i can handle it differently based on the case.

    However when i did "npm run build" on my codebase to generate the js library to upload to arena, my colyseus dependency modifications are gone. In fact it doesnt look like the colyseus library is in the /lib folder at all. So i assume arena links up its own which would get rid of my change. Any way around this?

    posted in Colyseus Arena - Cloud Hosting •