gerardAlbin

Members
  • Content Count

    5
  • Joined

  • Last visited

  1. Thank you, I learned a lot about event loop timers. I forgot to mention my game uses socket io so I couldn't get PM2 to work as it should. I'm going implement the cluster module manually, but there's a couple of issues. Im trying to make a proxy server on the top of the node workers so when a client connects to the server, the proxy server makes a decision on which worker the client should be routed. I want to redirect the client to the node instance for which some conditions exist. Like for example if the client wants to join a room search all node instances and connect to the instance the first free room is found or if the client wants to make a room, redirect him to the instance which has the least rooms. I have no idea how to make a proxy server though, is this even a good idea?
  2. Im not sure what you mean by using setInterval as a reliable thresholded tick. Could you provide some pseudocode example? Thanks.
  3. Server does some collision detection, game logic and handles input from clients. Nothing too heavy but I can imagine it could start getting slow if there's a lot of game instances. setInterval(() => { for (let game in games) { games[game].run(); } }, 1000/30); Is there any way I can distribute the load to more cores, or because of it's single threaded nature, nodejs was a bad decision for this particular game architecture?
  4. Thanks, switching it off does the job, but now I can't change the arc width using graphic.lineStyle(x, 0xFF0000, 1, 1, true), it appears as it doesn't matter what x I pass in, it's always thin. EDIT: Fixed it, I was passing the parameters wrong.
  5. Versions below and including 5.0.0-alpha.3: round graphics objects appear smooth and actually round. Versions above 5.0.0-alpha.3:round graphics objects appear like octagons, it gets worse the smaller they are. What could be causing this? https://imgur.com/a/rQfFHGi <!doctype html> <html> <head> <style> body{ margin: 0; } canvas{ display: block; background: blue; } </style> </head> <body> <canvas id="mycanvas"></canvas> <script src="pixi/pixi.js"></script> <script type="text/javascript"> console.log(PIXI.settings); const canvas = document.getElementById('mycanvas'); const app = new PIXI.Application({ view: canvas, width: 800, height: 600, backgroundColor: 0x000000, resolution: 1, autoDensity: true, antialias: true }); const graphic = new PIXI.Graphics(); graphic.x = app.renderer.width / 2; graphic.y = app.renderer.height / 2; app.stage.addChild(graphic); graphic.lineStyle(2, 0xFF0000, 1, 1, true); graphic.arc(0, 0, 10, 0, 2 * Math.PI); app.ticker.add(animate); function animate() { // graphic.rotation += 0.1; } </script> </body> </html>