It doesn't have any multiplayer tho

DragonFireGames wdym interpolation, like sending the data in chunks? if so i’ve done that with a dumb game i was testing on replit but it works really well, not sure how achievable it’d be on code.org

    Letti42 Read the keyvalues every second. Between each second slide the position of the entity between the old position and the new one to give the appearance of a smooth game.

      DragonFireGames While I'm not sure how many exact there are i could probably find out, just going to be a pain in the ass since i have to move redeployments, I'd assume it'd be the same as the firebase rate limit, although perhaps they've set custom stuff on there end for the config model it runs in, from my extensive modification of those files with "firefly" or it's more like a request for the key then it returns some model which then gets passed in to load the data so it's gonna be a gut guess at the current time
      it should probably be around 5,000 reads / 100 seconds
      and 80 writes / 100 seconds
      (depending on which version there running under may vary these numbers and how there being executed)
      however i think according to the "read" stuff for CDO it seems to suffer a bit more which may be some form of reading it artificially so I'd say less than < 5,000 for reads CDO isn't really meant for real time multiplayer since your "socket" is using TCP vs what would usually be used as UDP connection......
      if anything a real time card strategy game may be the furthest you will be able to get to "real time" without overloading the server with users if anything you probably could get away with some Pokemon-esk game.
      Best of luck with your efforts

      Awards

      • â’¸ 1 from DragonFireGames
        Comment: Great information here, I will make sure to use it.

        DragonFireGames then yeah i've done that. you just need the movements of the player sent with keyvalues in an array in a timed buffer of, let's say 300 ms (about the latency of my other game). then that array of probably 7-10 ish movements gets received by the other players and is put into an array that is constantly updating the other players' positions but at a rate RELATIVE to what the timed buffer from before was

        if that didnt make sense, tldr:
        time the movements, send them, receive the movements and update positions
        one movement can be represented by a mouse down event. should be enough to get that smooth gameplay

          I'm going to pretend to know what you guys are saying and go along with it.

          Awards

          • â’¸ 6.9 from person
            Comment: Yeah that's what most of us do
          • â’¸ 1 from [WUT] Adam

          I think you should worry about a smooth game play one you figure out the how to make it work first.
          Ya know, focus on one thing at a time.

            Letti42 That is almost exactly what I am doing, however it fails utterly and completely when changing directions.

              Letti42 It is hard to predict how the player will turn in the future and then do it smoothly while still making it feel responsive.

                DragonFireGames well you need a buffer there.

                think of it like a live stream on twitch or youtube. Videos are sent in chunks. When the video is received, you don't play it immediately. Otherwise, if there's any sort of delay there won't be a seamless play of the live stream for when the next chunk arrives.
                In order to prevent this, Twitch and YouTube have a delay in their live stream of anywhere between just 2 seconds up to a whole minute! You need to have the same with your multiplayer game.

                So, instead of immediately showing player movement, have the program wait around half a second. This creates the same "buffer" that live streaming utilizes. This may increase your latency (affect the responsiveness), so it's important to not keep it too high.
                You're gonna want to append the movement in an array that, like I said before, is being run through a TIMED LOOP, so when you're mirroring user movement it appears seamless.

                here's a codepen i made that might help you visualize it. Notice how the first array doesn't get too big or too small. That's because of that loop i mentioned
                https://codepen.io/Letti42-the-lessful/pen/dyrMqdP

                  Letti42 But then the other players appear way behind where they actually are. Sure, I can do it with an buffer, but makes it too outdated for any type of useful multiplayer.

                  I've been planning out an online multiplayer game for a while now, and I thought I'd share my ideas. It's a platformer game, so if you're still planning on making a slither-type game this probably won't be very helpful, but I'll put it here anyways.

                  My idea is for a platformer game where 2-5 players are put in a small level with a few obstacles, and it's a race to get to the finish first. The player can take different paths to try and get to the end first, before the other players, and there are various objects that can be interacted with in different ways.

                  For the online multiplayer aspect, the player's movement and collisions are entirely local. All of the keyboard inputs and movements the player makes are processed the same way as a traditional single-player game, so there is no lag between inputs and movement for your own player. In a different part of the program, there's a loop that continuously uploads your player's data, and then reads the other players' data. The data includes x and y coordinates, velocity, and other metadata (such as player username and costume). When this data for another player is read, the game immediately updates the corresponding sprite with the coordinates and velocity.

                  If this was the all for the multiplayer network, the other players' movement would be extremely laggy and the sprites would jump from place to place. I came across this project on KA that is able to predict the future movement of a player by looking at the current velocity and anticipating future collisions. This could be implemented into the game so that when given a player's last known coordinates and velocity, it can project the player's current coordinates and velocity with relative accuracy. Collisions are also predicted. How far the model predicts future movement can be adjusted, so the program could calculate latency between when the data is updated and read, and use this to change the prediction time of the model.

                  Right now I don't have any proof-of-concept for this, it's just a theory, but I do think it's possible if done correctly.

                    Chat