• Content count

  • Joined

  • Last visited

About Antriel

  • Rank
    Advanced Member

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
  • Location

Recent Profile Visitors

2,163 profile views
  1. Antriel

    Phaser as Multiplayer Server

    If I was making a multiplayer game with physics, I would either used standalone one (for something complex like full rigid body), or custom written simple one. Using something integrated like Arcade would bring pointless overhead. That said, if you are so inclined, it probably wouldn't be too much work to decouple Arcade code from Phaser and use that standalone. That's one of the main benefits of using open source libraries.
  2. Antriel

    Render Depth

    `setDepth(depth)` (or `depth = ...`) can't be simpler, if you just searched for either z index or depth you would find it immediately sorting/Depth Sorting.js sorting/z index.js
  3. Antriel

    Player Speed and Client prediction in Multiplayer Yeah. Yep. It's more about staying in sync with server. In my games I run prediction in the same rate as server runs its updates. Clocks drift could eventually mean the client would be too far behind/forward of the server and mess it up. Just be careful of indirect comparisons, like assuming n-th update from server corresponds to n-th update of client.
  4. Antriel

    Player Speed and Client prediction in Multiplayer

    Phaser 3 smoothes the delta time, which could cause the issues you are seeing. You would want to either change phaser's timestep or calculate the dt yourself. Also keep in mind that computers use crystals for tracking time and they don't exactly have high precision. With clock drift of around 20ppm, your time which can mean around 16ms difference between server and client within 7.5 minutes. Not much, but something for long plays, it can start showing.
  5. Antriel

    Why game sometimes blinks while running in cordova webview?

    I heard setting `preserveDrawingBuffer` to true can help in webgl for older devices. Not sure if that applies to cordova, but worth a try. For phaser you can set it in the game config `{ render: { preserveDrawingBuffer: true } }`.
  6. Antriel

    What editors do you use? (/recommend)

    I started using VSCode for everything, though I mostly use Haxe. The text based game I'm doing when I have spare time, I'm planning on doing custom extension for displaying the story source (written in my custom format) in separate pane as html with better visualization. Similar to what VSCode already does for markdown. From what I saw, VSCode is very extensible.
  7. I'm just gonna add to all this that if you use TileSprite, it would cause this kind of issue too due to aforementioned pixel bleeding. And that's regardless of where the sprite is on the atlas, rather it depends on how the TileSprite cuts it out (as it actually creates a new texture).
  8. Antriel

    Positioning GameObjects on an auto scale game Basically it depends on how far you want to go and it's also game specific. Personally I fill the whole screen and depending on what the game is either display more of the world or just scale it, or shift things around. UI is always positioned relatively so it scales, game objects might or might not be (usually not, but again, depends on the game).
  9. Antriel

    Design Issue [2D Top Down RPG]

    ECS is all about being data driven and decoupling logic. Whether the game is turn-based or real-time shouldn't matter too much. In your case you can have an AI system that is triggered only when the entity has its turn. It does its thing and changes the relevant components, which are then used by rendering system to display the action. Event queues, state machines... are all concepts that can work with ECS. When you think about it ECS is a form of state machine itself (systems are transitions, components the states, entity is basically just a group of components, so a state). You can implement anything on top of that. What helps me when designing these things is to think about what data represents the basic unit of functionality I want to achieve (i.e. define a component). How that data can change, when, and why (data flow, i.e. systems). What other data might be needed (coupling, i.e. other components a system might need to do its job). When you have a solid image of this, you can usually start with pretty solid design and iterate on it as you realize more things. Also keep in mind you don't necessary have to run your systems every frame. You can have a system that is only triggered when the enemy executes its turn. In the end all that systems are is a data transformation, a state transition.
  10. Antriel

    Transparent Background

    I would expect the hand-made ones to be much much worse. Best way? When you spot a mistake, fix the JSDoc! If the JSDoc fix doesn't suffice, make an issue on the generator git repo, or even better fix it and make a pull request.
  11. Antriel

    Frame rate independent movement

    In a multiplayer game you would want to make your own syncing solution as Phaser smooths out the delta time.
  12. Antriel

    Frame rate independent movement

    I'm not really sure what's happening here from just the pic. It looks as if the RAF was throttled by the browser, considering the total time is just ~7ms. No, there shouldn't be any additional columns. You do physics along with the render, but you do enough physics steps to catch up if needed (or none if not enough time passed). If the movement rate (not FPS) isn't stable, it means the fixed timestep isn't implemented properly.
  13. Antriel

    Frame rate independent movement

    Compare the accumulated delta given to you in the update function with actual real time delta.
  14. Antriel

    Frame rate independent movement

    Seems to be the case from the code, but I didn't test it. It runs within the scene update loop inside another loop.
  15. Antriel

    Frame rate independent movement

    Maybe something to do with how Phaser smooths the delta time. I would try to debug and see what are the raw delta values and the actual delta applied to Arcade. The fixed timestep code in Arcade's World.update looks good.