• Content Count

  • Joined

  • Last visited

Everything posted by Antriel

  1. Antriel


    Now it's `this.scale.resize`. The whole scale manager basically does all of this for you. Not entirely what I do though, but you can choose between scale and resizing.
  2. Antriel

    Cross-Code coming to Switch Discussion

    I have no idea how they did it, but technically it shouldn't be too difficult to get it working with the original html5. Switch does have a browser, it wouldn't be far-fetched if it supported webgl. And if not, bundling it with V8/chakra and doing some thin wrapper over opengl should also work, although that would probably require some tinkering.
  3. Antriel

    Don`t see text in container

    Think about the order of the items in the container. EDIT: And I just see it was pointless to waste time here, as you already had it solved on the Phaser forum...
  4. Antriel

    How much faster is phaser3?

    Could be the automatic depth sorting, implemented by heap sort iirc. Not entirely sure it's faster than insertion sort (at least at smaller counts I would expect insertion to be faster, but there it probably doesn't matter), but in either case, whenever anything is added to scene, it's pushed to the end and the child array is marked to be sorted. Then again, every other engine has to do something like that at some point too.
  5. Antriel

    How much faster is phaser3?

    Synthetic benches aren't very useful when it comes to big numbers. It all comes down to how the pipeline is setup, which is usually based on real-world uses and not optimizing for benchmarks.
  6. That is a bit weird. It shouldn't be happening often, maybe at most 1% of messages unless you are on very bad network. This leads me to think that the server has Nagle's algorithm enabled (TCP_NODELAY – buffering of data until there's enough to send out, it is usually enabled by default and the higher latency could make it more aggressive.). Try looking into that.
  7. Server sends message A then B. Message A gets lost along the way, client receives message B, but given how TCP works, it won't be accessible yet (head of line blocking). TCP handles resends and server sends message A again. Client receives it and supplies A and B one after another to your application. That's one very realistic option (longer the path, higher the chance for packet drops). But it can be anything that causes one message to arrive sooner or later compared to other message. Routes can change, packets can get delayed. In general, you can't depend on the rate to be perfect.
  8. Antriel

    How much faster is phaser3?

    They get rendered, although there is a way to cull them if you want (not always faster though, as it needs to figure out which are in bounds, but you can always make your own culling that would be faster if possible). No idea about fillrate of off-screen stuff. They do get send to GPU for rendering, but the actual fragments won't get rendered if they are outside, so I would reckon it won't affect fillrate. But I'm just guessing.
  9. Antriel

    OkijinGames Visual Fx

    Might be best to ask the man himself, pinging @OkijinGames. He did write this about it though:
  10. Antriel

    How much faster is phaser3?

    On WebGL, unless the engine does something really silly, it mostly comes down to fillrate (amount of pixels you push), and amount of data the CPU needs to prepare. That depends on the rendering pipeline. Usually it's much more worth it to send a lot of data, so it is flexible. The synthetic benchmarks that just try to spawn as much as possible don't really tell much about real-world performance. In either case, here's example from phaser that uses special object optimized for performance (doesn't send as much data to the gpu, but can't rotate/scale the objects). For me it doesn't slow down at all at 20k.\game objects\blitter\benchmark test 3.js I don't have experience with pixi, but knowing how Phaser 3 works, I would be quite surprised if pixi was substantially faster in anything. I would expect them to be similar, or pixi slightly worse. Of course Phaser being a whole game framework, there is some extra overhead, but definitely nothing that could cause problems.
  11. Antriel

    Phaser 3 - synchronisation with server

    Personally I handle logic separate from Phaser, using it just for the rendering. What I use is a combination of update and my own setTimeout to move the game logic forward and send inputs to the server. Basically this, except I have 2 entry points (both RAF, i.e. Phaser's update, and my own timer). On top of that is interpolation of other entities, prediction of player's entity and syncing time with the server.
  12. It's a way to have refresh rate of something locked to signals from something else. I use it to sync clients time with server network tick.
  13. That stackexchange answer is quite close to phase-locked loop I describe here:
  14. Antriel

    Objects might fall through despite of collision

    You can increase the `fps` parameter of Arcade in game config.
  15. Antriel

    So, what's the deal with sound?

    See how phaser does it: Checking on init: And subsequent waiting for input to unlock:
  16. Antriel

    So, what's the deal with sound? Basically you need to start/unlock the audio on user input first, then it works at any time. I handle that by making user start the game via click after the preloader.
  17. 50 Hz is normal. Try doing the setInterval that just logs the time too, with something like 10 ms interval. If that fires around the problematic message, with +-10ms interval, then event loop isn't too busy. Also, is there a visible missing date? Like before there's delta of 0, is there delta of 100? If not then it really feels like the message callback is ran more than it should (which you can determine by the contents of the message).
  18. Then it's either what @mattstyles said, or your event loop is too busy and can't process the message fast enough – that might show in profiling. I would try to simply log `` on arrival of messages and maybe also run another timeout with much smaller timestep than what server sends, logging the time too, to visualize whether event loop is free or not.
  19. The packet drops along the way, you can't test for that like that. You could try doing it on a good LAN connection (that you tested) or a localhost loopback, which shouldn't drop packets at all.
  20. Unfortunately, not with TCP. And the only way to do UDP on the web is via WebRTC, which is aimed at media and p2p networking, so achieving client-server architecture there is difficult.
  21. Websockets use TCP under the hood. If a packet drops along the way, TCP will buffer any additional packets until it also receives the one it lost. After it does, it will supply everything it has, which can cause what you see. There is nothing you can do to prevent that apart from using multiple websocket connections and implementing something like udp over tcp.
  22. Antriel

    Is there a problem with phaser time

    Yeah. Basically if you needed de/acceleration, you would adjust speed by using the `dt`. Which won't work well unless you use fixed delta time. Which is what the articles I linked talk about.
  23. Antriel

    Is there a problem with phaser time

    Phaser smooths out the delta time (see source) so that the gameplay is better. That's what causes the desync with real time. If you need precise timing, you need to run your own clock. Keep in mind internal things like tweens will still use Phaser's clock. If that's an issue, either tween manually or hack Phaser to pass unsmoothed deltaTime. The issue you see on the android device could be cause by JIT/startup causing slower performance at the beginning, which results in big delta time, which Phaser in turns lowers into sensible values. So a second passes, but Phaser only simulated half a second. Also keep in mind that your fix approach won't really work well on devices with different frame rates. It's not always 60 fps. I recommend reading Fix Your Timestep and if you plan on having custom physics read Integration Basics (`x += velocity * dt` is ok, but if `velocity` depends on delta too, better read it).
  24. Antriel

    Be Careful with GameDistribution

    Given that mine is also changed and changed between today and yesterday, I would assume the issue is purely internal. The values looked pretty legit, so I'm quite certain it's not a hack, just some very dumb programming.
  25. There isn't `current_time` ever used there, it's just used to describe the principle. If you look at it properly you see it also subtracts time from the current time.