• Content count

  • Joined

  • Last visited

1 Follower

About botmaster

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. botmaster

    PIXI current versions in the future ?

    Risk is big in my experience, I built an entire framework around PIXI 4.1.something and when later tried to update to PIXI 4.5.something (I think it was 5) all hell broke loose. This was a huge disappointment to me, I was expecting PIXI 5 to do that eventually but not while still in version 4. I did evaluate the changes and found they were deep and numerous to the point that my framework would have to be completely rewritten. problem is I already have a bunch of apps in production and I can't throw so much testing time down the toilet and start over. So I'll stick to 4.1 for now and make the updates myself and as for PIXI 5 I might have later to adapt it to my framework and not the other way around. It's really a trend that I think Apple started with all frameworks nowadays, why being backward compatible when you can simply just not care about it at all.
  2. botmaster

    [Question] Trigger sprite events manually

    Keep in mind that "fake" interaction events do not have credentials and cannot be used in replacement of true user interaction. For example, on Ios the WebAudioAPI can only be activated upon a true user interaction event, faking such event will have no effect.
  3. botmaster

    Delta time is ruining my animations

    That type of displaying is often referenced as 'flatten' where all contained objects must be shader compatible and will all be rendered in one draw call. The code I showed was a pseudo code of course and the 'value' can refer to any numeric amount like the total number of frames of an animation or the total number of pixels to move an object by, or an angle, ect ... Frame based animation or motion gives you no control on how long/fast it will take for the animation or motion to complete. A 60 frames animation at 60fps in theory will complete in 1 second but due to framrate fluctuations it's going to be + or - 1 seconds. Even worse if the fps drops to 45 or 30 then your animation will take even longer to complete. Same for motion, adding +5 to the x property of an object to move it across the screen at each frame/update at 60fps doesn't guaranty the object would have moved 300px in 1 second, it might be close if framerate is consistent or very off if framrate is not. In time based animation you calculate by how much the initial value must increase based on how much time has passed since last update. For the motion example, the goal is to move by 300px in second which is (300/1000) = 0.3px per millisecond. With each update/tick you calculate how much time (in milliseconds) has passed since last update then you apply: var passedTime = currentTime - lastTime (in milliseconds, currentTime is the recorder time at this update, lastTime is the recorder time at last update) var valuepermillisecond = (300/1000) < this really should be dynamic and not hard coded values myobject.x += passedTime * valuepermillisecond // we move our object according to the time that has passed. In this case the object will have moved 300px in one second regardless of framerate. Now when dealing with frame animation the idea is the same but you must of course roundup the numbers since in time based you only deal with float. In that case that would be: var valuepermillisecond = (total number of frames/1000) myobject.gotoAndStop(Math.floor(valuepermillisecond))
  4. botmaster

    Delta time is ruining my animations

    I haven't used animatedSprite yet personally but it seems to have everything you need to run your animation on time based. Making everything time based is fairly simple but note that when you get very low FPS (and I mean global FPS here) then your time based animation will become shoppy, still accurate but shoppy. Also most if not all tween engines are time based. basic idea is: value / T (miliseconds) = total value per miliseconds myibject.x = (value / T) * currentT (in this case currentT is how much time has passed since the animation started but this can be adjusted from the last update as well)
  5. botmaster

    Delta time is ruining my animations

    I totally understand, what you want is what's called "time based" animation and PIXI doesn't provide that but in fairness most low level frameworks/technologies don't, they provide you with a tick and let you handle the rest. Flash or SriteKit work the same way for example. The smoothy.js I guess is meant to provide that time based feature so go with it. To further answer your question: - PIXI correctly doesn't provide any time based feature with its tick system - that tick system/delta doesn't control the framerate as you said since framerate cannot really be controlled - the delta value tells you how much time has passed since the last tick, this is what can be used to run a time based system (and this is what smoothie.js uses) - the real framerate is really how many requestanimationframe can be called per second, while you can lower the number of call by code you certainly cannot increase it so that's really the framerate basis, time based animation doesn't alter the framerate, it calculates what frame an animation should display based on how much time has passed, how many pixels an object should move based on how much time has passed, etc ...
  6. botmaster


    Just create a second container on top fo the gameboard, make it mirror position and scale then add to it your graphic and start your animation. Once the animation is over you can even as easily put the graphic back in gameboard. Use containers they make your life much easier.
  7. botmaster

    Delta time is ruining my animations

    There's not really anything special going on here, the delta value you get is about the same you'll get with the smoothie library. You don't have to use the ticker anyway and you can just stop it and provide your own routine.
  8. botmaster

    [Help] How to set color for each vertice of mesh

    You'll need a custom shader for that I'm pretty sure.
  9. botmaster

    [help] How Tweening work

    Tweening takes: 1. a measure of time, 2. an object. 3. one (or more) property (usually numeric) of that object, 4. an end value for that property. The tween then starts and run for the amount of time defined and apply a math formula each time it is called that includes: the actual time T, the start value of the property, the end value of the property and calculate the intermediate value that needs to be applied to the object. Most tween engine are time based but not all. Tweening is usually best used for defined animation where the end value doesn't change although most engine allow you to change on the fly the end values and tween properties to make them dynamic. Is it suitable for slow machine animation? yes it is > define the number of time and end angle the slot must spin > calculate the amount of time this requires > now you have all the values needed for a tween. The difference here is you must calculate everything before using a tween to animate a slot. What tweens are not suitable for usually: tweening an object that interacts (eg. bounce, hit other objects, ect) with other objects What tweens are good for: tweening an object to defined end values (that will not change or change very little), eg. train going from point A to point B. alpha going from 0 to 1, ect ...
  10. botmaster

    How to handle WebGL poor performance

    Thx I'll double check that.
  11. botmaster

    How to handle WebGL poor performance

    Thanks for responding, I'd like to avoid 2 and 3 if possible since it takes time and might result in a weird experience for the user. For 1, I could see an automatic system where the app detects the bad rendering and log the browser and device name with a webservice so that this device/browser combination is then blocked. 4. what do you mean viewports setup?
  12. botmaster

    How to handle WebGL poor performance

    I published a good dozen apps based on pixi, those apps do handle automatically their fps and resolution based on overall performance so they adjust themselves to the performance of the device. The system also handle just fine when the browser doesn't have any webgl available. Now this being said, there are browsers that do have webgl but apparently a very weak version where all webgl operations are slow and fairly limited in what it can handle, it that case my apps run at very low fps and even eventually crash the browser after a few minutes. My question is, what is the best way to handle this? I would rather detect those problems at the start and then either try a graphic2d solution or just not display the app and ask the user to choose a different browser but what should I be looking for in the webgl implementation to decide this? Should I start by timing webgl operations and take a decision if those operations are too slow? Or should I look for specific parameters in webgl that would tell me already this is gonna be too slow? What is a good clue(s) in webgl parameters that this webgl version is gonna be awful? Is there some additional tips with webgl pixi besides fps handling and resolution handling that could get some extra fps even in those situations? Anyway thanks for any insights.
  13. botmaster

    Keep child at original scale

    one parent: - child sprite < can scale - child text I don't see what's the big deal here?
  14. botmaster

    Custom renderer plugin - render at lower resolution

    You'll have to take a look at the shader and see why it behaves that way, maybe that shader allows you to set a uniform to lower resolution or maybe you need to make your own and make a custom renderer.
  15. botmaster

    Custom renderer plugin - render at lower resolution

    No it's not the natural webgl behavior, the texture sampling loop is based on whatever data you pass to your shaders and how your shaders handle that data, the size of the canvas is irrelevant, you are in complete control on how your shaders work and sample your textures.