kaan Posted July 4, 2016 Share Posted July 4, 2016 When I started building a game, I didn't think map drawing/re-drawing would be an early issue, but when I placed 30-40K 16x16 test tiles on the map, it became an issue, the fps quickly dropped to 10-20's I initially intended to draw the entire map at start, and hoped PIXI would ignore the parts which are outside the viewpoint, I'm assuming this is not the case? (It obviously isn't, let's move on) My current solution is to redraw the map at each 100px movements, I was initially only drawing the additional 100px's, however at the edge's things got complicated, things that should be behind things got above them, so I started redrawing everything, which is simple, yet ~3K sprites are destroyed and re-created at each update, which happens regularly if the character is moving I tried using pixi-display and setting an explicit zOrder for each tile - and - more easily updating tiles, deleting/adding ~100 sprites at each update, yet the performance doesn't change much So, currently, with the "redraw the entire viewpoint" method, the fps is 60, yet I feel some minor sluggishness, some frames are 50ms, the retiling takes 10-20ms, and considering there is few actual map data, I'm not sure whether re-visiting a hefty map data would be an overhead too (I'm unsure whether 2D range trees etc. are needed or not) I'm just wondering whether I'm re-inventing the wheel, whether there is an intended solution that will solve the problem without any significant overhead etc. I'm yet to inspect the existing solutions, pixi-tilemap to start with, I had to find an immediate solution and redraw-all was it Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.