• Content Count

  • Joined

  • Last visited

  1. got this weird bug when drawing lots of circles let gameWidth = 800; let gameHeight = 608; const app = new PIXI.Application({ width: gameWidth, height: gameHeight, resolution: 1, antialias: true }); document.body.appendChild(app.view); var circles = new PIXI.Graphics(); app.stage.addChild(circles); let nSegmentsX = gameWidth / 16; let nSegmentsY = gameHeight / 16; circles.beginFill(0x5cafe2); for (let x = 0 ;x<nSegmentsX; x++){ for (let y = 0 ;y<nSegmentsY; y++){ circles.drawCircle(x*16 + 8, y*16 + 8, 8); } } It only happens when drawing circles with radius 7 and above in this case, anything below that drawing is normal as you can see in picture 3
  2. 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?
  3. Im not sure what you mean by using setInterval as a reliable thresholded tick. Could you provide some pseudocode example? Thanks.
  4. 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?
  5. 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.
  6. 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? <!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>