Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

killroy last won the day on June 5 2015

killroy had the most liked content!

killroy

Members
  • Content Count

    50
  • Joined

  • Last visited

  • Days Won

    1

killroy last won the day on June 5 2015

killroy had the most liked content!

Community Reputation

6 Newbie

About killroy

  • Rank
    Advanced Member
  • Birthday 06/20/1979

Contact Methods

Profile Information

  • Gender
    Male
  • Location
    Malta
  • Interests
    Games, node.js, multi-player back-end coding.

Recent Profile Visitors

3,147 profile views
  1. I'm not familiar with that How can it do that with less processing? Are you talking about mathematical operations? I mean there are only a couple of divides and multiplies, really. And does the ThrowPropsPlugin work if the distance or velocity is arbitrarily changed during any frame? Perhaps a better demonstration of the algorithm is the 3D RTS I'm working on: https://twitter.com/killroy42/status/818436958816993280 The turning thrusters are simply read out from the acceleration value. The target point is the mouse cursor, and the algorithm is applied to linear distance and angular distan
  2. You asked for a demo posted to the forums on Twitter, so here it is. The important bit is this function: const calcAccel = (x, v, maxA, dt) => { if(dt === 0) return 0; const signX = (x < 0)?-1:1; const a = signX * (Math.sqrt(Math.abs(1 + (2 * x) / (maxA * dt * dt))) * maxA - (v * signX) / dt - maxA); return Math.min(maxA, Math.max(-maxA, a)); } It takes a distance, velocity, maximum acceleration and time delta and returns the acceleration that needs to be applied to reach the destination and stop there given acceleration and velocity constraints. The attractive part of
  3. Thanks, that's what I was looking for. I'll check it out!
  4. Well, I was aware that it would work within GSAP. I'm trying to keep my codepen prototypes as independent of 3rd party libs as possible. Here, the shake system used GSAP, but it basically "infects" everything else such that a system using the shake would now have to be modified to use GSAP throughout. Is there no way to tell GSAP which properties to modify and have it not modify others?
  5. It seems that when animating x/y coordinates (via transforms), GSAP sets the entire matrix, without taking changes to other properties into account. In the codepen, I shake the display by animating x/y, and I update scale when the window resizes. If you resize the window while the shaking is taking place, GSAP modifies the scale, even though scale is not part of the animation. Is there a way to purely animate x/y without touching other properties? I suspect the reason is that GSAP animates the transform matrix, instead of individual properties. Thanks, Sven
  6. Hey Jack, If you want, I can get you a log in to the alpha of the game to see what I am doing Since the animation also causes sound effects and changes in alpha, I imagine that increasing timescale, while not rendering more frames, might cause more alpha changes per second and other things that could take more CPU/GPU. The callback skip wasn't on GSAPs side, but on my own. I had a timeout in place to debug other issues that was triggering when the computer froze up and simply stopped execution (called "debugger;") to aid problem analysis. But in this case it was a false positive.
  7. Thanks for the explanation, it clears it up for me. I am starting to suspect the issue is more related to performance. I run the animations at 10x speed for testing purposes, and this causes frequent complete freezes of my whole computer. I had a timeout of 5 seconds on a move of the game to detect bad states, and that was getting triggered. I am running tests now with a longer timeout and only 2x animation speed. I still get occasional freezes, but it seems the animations complete now. The freezing is still a problem of course and I need to find away to optimize things, but at this st
  8. I currently have a problem with a "dirty" timeline. No matter what I do to it, I can not get it to play, even after clearing, etc. What properties should I inspect that might cause this timeline to refuse to play? It is not nested, and I have tried .clear() and .invalidate() as well as .startTime(0). In isolation, a fresh timeline works fine. I would like to know what properties I need to inspect to be able to identify the offending leftover data form previous use of this timeline, so I can learn more about how they work and how to clean one up. I am aware that I could simple throw
  9. Hi, I do not nest any timelines. Each Card component gets one simple timeline initiated like this: var timeline = new TimelineLite({paused: true}); An animation is added by looping through the tweens and adding them with timeline.to/timeline.set, and calling timeline.play() after all the tweens are called. In this case, for example, the card applies 18 animations successfully and then fails on the 19th. The 19th animation in this case does nothing special, just 2 or 3 .to() tweens. I am currently adding a timeline.call(function() {}) before and after adding the tweens for a
  10. Ok, I have some more data. Would really appreciate the help regarding the undocumented stuff... This is some timeline data logging from just before the troublesome animation is played: HANDLING pauseToDeckPlayer - totalProgress: 1 - totalDuration: 5.399999999999999 - totalTime: 5.399999999999999 - startTime: 9.251 - rawTime: 5.450000000000017 - isActive: true And here is some timeline data from after my timeout handler fires: - CardView.animate[pauseToDeckPlayer] > TIMED OUT after 1929.9999999999998 - duration: 6.199999999999998 - progress: 0.870967741935483
  11. Hi Guys, due to the complexity of my project, I am certain that solving the problem is easier then reducing the test case. A tween overwrite is unlikely, as I use a single timeline per card, and simply add tweens for each animation during the execution of the game. My long term goal is to have a timeline for the game to which timelines for each individual animation are added. So that at the end of the game, the entire game is captured in this timeline, and I can jump back and replay any part of it at different speeds. Right now, I am looking into how .isActive() is functioning
  12. Hi, I've output other values from the timeline, showing that it is neither paused, nor finished, but has started, yet is still inactive. Further testing by inserting various tween callbacks to track multiple animations applied over time during game play show that previous animations did not complete either, which might cause the issues. Is there a way of enabling any kind of debug logging from GSAP to throw errors or log into console if animations fail for some reason? BTW, I am layering an animation on top of GSAP, since you don't provide an easy way to store dynamic animations as
  13. Hi, I am currently debugging an issue. It started with sometimes onComplete handlers not getting called. I've been trying to track down what/when it's happening. For a while I had suspected that a gimbal lock stopped the animation somehow. But I am not sure anymore. Currently I have a test timeline set up somewhat like this (pseudo code): .to(0, {onComplete: debug}) .to(0, {onComplete: debug}) .to(0.01, {onComplete: debug}) Which would cause debug to get called twice only. I added a timeout handler to capture this state. When I inspect hte timeline, isActive() returns false, but
  14. I've tried one more thing, which seems to work: .set({x: newX, y: newY, immediateRender: true}) .to(0, {display: 'block'}) I am guessing that this takes 2 frames to execute, though. I'm still curious why this works this way, and why neither a single .set nor two consecutive .set work as one would expect. It seems to me that all properties in a single .set() statement should execute in the same frame.
  15. Hi, I'm trying something like (pseudo code): .set({x: newX, y:newY, display: 'block'}) to both show an item and place it at a new location. But it flashes briefly at the old location, indicating that the display property gets updated one frame before the X/Y updates. Even though "set" shouldn't cause an animation, it seems to go through the animation system somehow. Is there a way to ensure the position is updated BEFORE the display property is changed? Placing them in separate .set() commands doesn't work. Regards, Sven
×