Owlzy Posted March 31, 2017 Share Posted March 31, 2017 Hi there, I'm working on a tile based game using PIXI but as it is a commercial project I can't share the code. I was hoping if I explained what I'm doing someone more experienced may be able to give me some input if it is something you have come across already? Initially had some issues with lines between tiles when moving the container that holds them, but this was resolved in a number of ways such as not using texture packer, PIXI.SCALE_MODES.NEAREST and making sure to round off the x, y values so they are always integers, simple enough to fix. Then having noticed was getting a poor fps on mobile I decided was time to optimise. Initially I tried culling tiles not in view, but I didn't notice a huge performance difference with this. So I decide I should use a render texture, and render the entire map container to the texture each frame. This gave me a huge boost when testing on mobile, I'm a happy man but then... the lines between tiles are back when moving the container... There are quite a few dynamic tiles such a platforms that move etc, hence why rendering the entire container. So my next step is to try and be smart and split it into two containers, static and dynamic, refresh the dynamic container and only update the static one when I need to (preferably just once at the beginning). Now I'm wondering if this would even work, as when I move the map container to move the player the static tiles, although they don't move individually, will still need updating every frame to get smooth movement. I want to stick with render textures as I feel this is the correct way to go about it, and that perfomance boost But wonder am I missing something here. The Tilingsprite class for instance is not one I understand well, I think perhaps I could use it here? Thanks and apologies for a long post without a specific question. Cheers, Owlzy 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.