These are chat archives for pixijs/pixi.js

29th
Mar 2017
Janne Hyytiä
@Hachitus
Mar 29 2017 08:23

@Alan01252 I have some experience with that sort of scenario (http://flatworld.level7.fi/manualStressTest.html hit start button).

The thing is that if you have a static background in the game (not too big), that scenario should be really easy (Basically you just move the background-container and you can probably use tilesprites to help you with constructing it too). If you have a huge background and can't simply move it around as such, but have to only show / render part (the visible part) of it at a time, then it's more trickier.

I will be happy to try to help you, but I can also say, that my time is quite limited currently, so don't expect me to be fast :D

Alan
@Alan01252
Mar 29 2017 08:27
@Hachitus :) I think I saw a couple of your posts on the forums which helped me get where I am. Current renderings seems okay, getting 60fps on my machine and the now they're in separate containers it's a lot less crashy. https://i.imgur.com/hveiNLK.png
Alan
@Alan01252
Mar 29 2017 08:40
I tried this morning using tile sprites for the main ground image, which I assumed would be better performance, but despite achieving the same effect it felt worse than current methods too which was surprising ( despite the fact that I was able to remove a removeChildrenCall and a loop through the textures )
Janne Hyytiä
@Hachitus
Mar 29 2017 08:45

@Alan01252 Oh. I have understood that in certain cases tilesprites are not that effective, but unfortunately I don't have good experience on them, as I couldn't use them in my own project :(.

I think what you basically need is just a good camera for the game. I'm not totally up-to-date on current pixi status, but I remember some talk of it, even added to PIXI. There was at least a project for PIXI camera, which might help you, if I just find it... :D

Is the background map manageable size? Or is it some humongous thing? :D

Janne Hyytiä
@Hachitus
Mar 29 2017 08:51

Oh one thing I did forget. I use only webGL, if you use canvas I'm not sure about the performance on that. I had issues with it :D.

This you can at least check: https://github.com/georgiee/lab-pixicam

I think also @ivanpopelyshev will also have a lot of experience on this with his gameofbombs

I have managed to make my map movement work with horrible implementation ^_^. Basically setting things visible or hidden, depending if they are out of the viewport or not. So I would say performance shouldn't be an issue for you either. It might require some work though.

Alan
@Alan01252
Mar 29 2017 08:53
not too huge I don't think? it's (128 512) (128 * 512) at the moment, I'm not sure if that's in the realms of being large or not these days..
Will have a look at lab-pixicam now :) thanks for all your help!
Emil Ekberg
@emilekberg
Mar 29 2017 08:54
basically you only need to move the parent container with the negative amount of the object you want centered
Ivan Popelyshev
@ivanpopelyshev
Mar 29 2017 09:34
not found
@Alan01252 I know how to do tiles properly ;)
@Alan01252 contact me at ivan.popelyshev@gmail.com , ill write you
Alan
@Alan01252
Mar 29 2017 10:12
thanks guys, in case you're interested my current version is here https://alanhollis.com/battlecity-js-remake/ ( takes a few seconds to load the assets, not done a loading screen yet )
Alan
@Alan01252
Mar 29 2017 10:20
@ivanpopelyshev I sent you an email too! Thank you :)
Alan
@Alan01252
Mar 29 2017 11:32
thanks @ivanpopelyshev failing miserably just to get this plugin working with webpack2 :)
Alan
@Alan01252
Mar 29 2017 17:45
This tilemapping is awesome :) haven't got the redrawing perfect as after the first redraw my rocks are in a different place than they should be and so I collide against nothingness
however
I can now open the game in as many tabs as I like
without it being destroyed
( it being my computer ) thanks all