Re: DT in BGT

2019-02-22 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT Using different values for the time passing for acceleration and movement seems ... odd, and potentially unstable.Ah, OK, for the sound of the ball moving, you can just play it once when the ball starts moving, and have it loop, then destroy it when the ball stops. Depending

Re: DT in BGT

2019-02-22 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT So, the time thing is to calculate the actual physics equations correctly.  For example, take this equation:velocity = initial velocity plus acceleration multiplied by timeAccording to the person who is in physics, the initial way I did it where I did:VF.x = (V).x+A.x)*DT

Re: DT in BGT

2019-02-22 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT So, the time thing is to calculate the actual physics equations correctly.  For example, take this equation:velocity = initial velocity plus acceleration multiplied by timeWhat I mean is that the "time" there is not DT, but rather actual time.  Then, when you act

Re: DT in BGT

2019-02-22 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT I am very confused about what the actual time bit is doing and why.Unless I missed it, there's no actual bouncing, and the ball stops once it hits the court. You'd either need to make it bounce realistically, or have the sound play on impact, and only on impact. (Or come up

Re: DT in BGT

2019-02-21 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT The goal there was not to have a variable DT.  The goal was to use time correctly in the equations, then move according to DT.  According to the physics person that is helping me, this example:VF.x = (V0.x+A.x)*DT*cosine(phi);is incorrect.  He said that you don't use DT

Re: DT in BGT

2019-02-21 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT The goal there was not to have a variable DT.  The goal was to use time correctly in the equations, then move according to DT.  According to the physics person that is helping me, this example:VF.x = (V0.x+A.x)*DT*cosine(phi);is incorrect.  He said that you don't use DT

Re: DT in BGT

2019-02-21 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT The goal there was not to have a variable DT.  The goal was to use time correctly in the equations, then move according to DT.  According to the physics person that is helping me, this example:VF.x = (V0.x+A.x)*DT*cosine(phi);is incorrect.  He said that you don't use DT

Re: DT in BGT

2019-02-21 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT The goal there was not to have a variable DT.  The goal was to use time correctly in the equations, then move according to DT.  According to the physics person that is helping me, this example:VF.x = (V0.x+A.x)*DT*cosine(phi);is incorrect.  He said that you don't use DT

Re: DT in BGT

2019-02-21 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT The goal there was not to have a variable DT.  The goal was to use time correctly in the equations, then move according to DT.  According to the physics person that is helping me, this example:VF.x = (V0.x+A.x)*DT*cosine(phi);is incorrect.  He said that you don't use DT

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT You don't need to worry about clock::update. I'm not sure when it would ever be needed, but it seemed possible that it might be useful at the time, so I included it just to be safe.Not using a constant dt will result in the same problems from the beginning. The point

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT You don't need to worry about clock::update. It's hard to think of a good reason someone would need it, but it didn't seem impossible, so I included it just to be safe.If you use the amount of realtime that elapses for dt, you'd probably get more accurate physics on one

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT In order to use the clock correctly, how exactly is the update method meant to be used?  I assume it basically returns true if a single frame has passed, right?  Just trying to figure out where to use that, or what it would be used for, since when I actually called update

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT In order to use the clock correctly, how exactly is the update method meant to be used?  I assume it basically returns true if a single frame has passed, right?  Just trying to figure out where to use that, or what it would be used for, since when I actually called update

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT In order to use the clock correctly, how exactly is the update method meant to be used?  I assume it basically returns true if a single frame has passed, right?  Just trying to figure out where to use that, or what it would be used for. URL: https://forum.audiogames.net/post

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT The deal with the dynamic menu is just because it's a blocking function, so all the time you spend on the menu counts. You can safely ignore it for the most part.I'm not sure where the extra ms are coming from. I don't see how they could be bugs in the clock itself, but it's

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT After adding the line, the tick appears to be called more uniformly, anywhere from  14-20 MS, and at 0.998, 59 frames passed.  I don't understand why it's ever waiting past 0.016, though, since that's what delay should be  since I've got FPS set to 60.  Not sure whether you

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT After adding the line, the tick appears to be called more uniformly, anywhere from  14-20 MS, and at 0.998, 59 frames passed.  Not sure whether you saw what I wrote about dynamic menu and movement, but I'll post here for convenience, because I do not understand what the hell

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Almost working now.  So close, but then on the final test...Lot of info here.  It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT The pattern makes sense if something's delaying it, since the shorter delays would be the clock trying to compensate for the apparent lag. But I'm not sure that that's what's happening, given those numbers. The long frames are suspiciously close to twice as long

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Almost working now.  So close, but then on the final test...Lot of info here.  It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Here's the StartMatch() function.  I probably didn't do this correctly, but:void StartMatch(bool _online_ = true){//Sets starting values for position and Booleans that cover rules.MustServe = true;rules.games=0;rules.serving=true;m1.load("sounds/power.ogg"

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT It appears that tick() was called approximately 43 times in a one-second period, but there are differences in the amount of time between iteration.  For example:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Here's the StartMatch() function.  I probably didn't do this correctly, but:void StartMatch(bool _online_ = true){//Sets starting values for position and Booleans that cover rules.MustServe = true;rules.games=0;rules.serving=true;m1.load("sounds/power.ogg"

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT Is there a reason for the wait(5)? Strictly speaking, it shouldn't matter, because the clock waits however much time is left in the frame, and 5ms shouldn't be enough to cause issues without some other source of lag. If it isn't necessary, though, I'd try commenting it out

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Whre would I put a timer to check how often tick is called?  Tick already has a timer, so I'm not sure putting another one there works well.  Here's the StartMatch() function.  I probably didn't do this correctly, but:void StartMatch(bool _online_ = true){//Sets starting

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Whre would I put a timer to check how often tick is called?  Tick already has a timer, so I'm not sure putting another one there works well.  Here's the StartMatch() function.  I probably didn't do this correctly, but:void StartMatch(bool _online_ = true){//Sets starting

Re: DT in BGT

2019-02-19 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT The profiler can be misleading at times, but in this case, the only oddity that sticks out is start_match.The vast majority of the time being in clock::tick makes sense, since that's where the calls to wait are. The dynamic_menu being high also makes sense, since its duration

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Again, long post, so please read in its entirety.  To answer your question, nope, not doing anything else when running that test.  I even went into task manager and shut down a bunch of background processes like cortana and other windows shit, and still got 43 FPS when set

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Again, long post, so please read in its entirety.  To answer your question, nope, not doing anything else when running that test.  I even went into task manager and shut down a bunch of background processes like cortana and other windows shit, and still got 43 FPS when set

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Nope, not doing anything else when running that test.  I even went into task manager and shut down a bunch of background processes like cortana and other windows shit, and still got 43 FPS when set to 50.As far as players agreeing, I tried doing that initially, although I

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Nope, not doing anything else when running that test.  I even went into task manager and shut down a bunch of background processes like cortana and other windows shit, and still got 43 FPS when set to 50.As far as players agreeing, I tried doing that initially, although I

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Nope, not doing anything else when running that test.  I even went into task manager and shut down a bunch of background processes like cortana and other windows shit, and still got 43 FPS when set to 50.As far as players agreeing, I tried doing that initially, although I

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Nope, not doing anything else when running that test.  I even went into task manager and shut down a bunch of background processes like cortana and other windows shit, and still got 43 FPS when set to 50.As far as players agreeing, I tried doing that initially, although I

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT Yeah, I'm completely lost as to how it could possibly be that slow. Are you doing anything else while it's running? Those specs are way better than what I've got, so the results should, in theory, be better than what I got, if anything.Both players should get the same results

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT So, what in the world would drop me to 50 FPS when running at 60?  I mean, my code should not be taxing my PC at all.  I'm running latest version of windows.  I've got 16 GB ram with an I7 processor.  No graphics in this game at all.  Graphics tend to lag a machine, yes

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT So, what in the world would drop me to 50 FPS when running at 60?  I mean, my code should not be taxing my PC at all.  I'm running latest version of windows.  I've got 16 GB ram with an I7 processor.  No graphics in this game at all.  Graphics tend to lag a machine, yes

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT So, what in the world would drop me to 50 FPS when running at 60?  I mean, my code should not be taxing my PC at all.  I'm running latest version of windows.  I've got 16 GB ram with an I7 processor.  No graphics in this game at all.  Graphics tend to lag a machine, yes

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT So, what in the world would drop me to 50 FPS when running at 60?  I mean, my code should not be taxing my PC at all.  I'm running latest version of windows.  I've got 16 GB ram with an I7 processor.  No graphics in this game at all.  Graphics tend to lag a machine, yes

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT So, what in the world would drop me to 50 FPS when running at 60?  I mean, my code should not be taxing my PC at all.  I'm running latest version of windows.  I've got 16 GB ram with an I7 processor.  No graphics in this game at all.  Graphics tend to lag a machine, yes

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT So, what in the world would drop me to 50 FPS when running at 60?  I mean, my code should not be taxing my PC at all.  I'm running latest version of windows.  I've got 16 GB ram with an I7 processor.  No graphics in this game at all.  Graphics tend to lag a machine, yes

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT I'm guessing that declaring dt globally doesn't work because of something to do with the order of how classes and their properties are initialized under the hood. Probably the same reason a global keyconfig crashes but a handle doesn't.I can imagine random computer

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT I'm guessing that declaring dt globally doesn't work because of something to do with the order of how classes and their properties are initialized under the hood. Probably the same reason a global keyconfig crashes but a handle doesn't.I can imagine random computer

Re: DT in BGT

2019-02-18 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT I'm guessing that declaring dt globally doesn't work because of something to do with the order of how classes and their properties are initialized under the hood. Probably the same reason a global keyconfig crashes but a handle doesn't.I can imagine random computer

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  Lot of info in this post, so please read in its entirety.  For the life of me, I still  don't understand why I get this error.  If I declare DT globally, like this:double DT = 0.001*C.delay;BGT compiler says:Line: double

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  Lot of info in this post, so please read in its entirety.  For the life of me, I still  don't understand why I get this error.  If I declare DT globally, like this:double DT = 0.001*C.delay;BGT compiler says:Line: double

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  Lot of info in this post, so please read in its entirety.  For the life of me, I still  don't understand why I get this error.  If I declare DT globally, like this:double DT = 0.001*C.delay;BGT compiler says:Line: double

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  Lot of info in this post, so please read in its entirety.  For the life of me, I still  don't understand why I get this error.  If I declare DT globally, like this:double DT = 0.001*C.delay;BGT compiler says:Line: double

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  Lot of info in this post, so please read in its entirety.  For the life of me, I still  don't understand why I get this error.  If I declare DT globally, like this:double DT = 0.001*C.delay;BGT compiler says:Line: double

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  Lot of info in this post, so please read in its entirety.  For the life of me, I still  don't understand why I get this error.  If I declare DT globally, like this:double DT = 0.001*C.delay;BGT compiler says:Line: double

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  Lot of info in this post, so please read in its entirety.  For the life of me, I still  don't understand why I get this error.  If I declare DT globally, like this:double DT = 0.001*C.delay;BGT compiler says:Line: double

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  Lot of info in this post, so please read in its entirety.  For the life of me, I still  don't understand why I get this error.  If I declare DT globally, like this:double DT = 0.001*C.delay;BGT compiler says:Line: double

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  What in the world would cause this?  Also, for the life of me, I still  don't understand why I get this error.  If I declare DT globally, like this:double DT = 0.001*C.delay;BGT compiler says:Line: double DT = 0.001

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  What in the world would cause this?  Also, I still for the life of me don't understand why I get this error.  If I say:double DT = 0.001*C.delay;BGT compiler says:Line: double DT = 0.001*C.delay;Error: 'delay

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT I wouldn't even begin to know where to start looking.  What in the world would cause this? URL: https://forum.audiogames.net/post/412475/#p412475 -- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT Update checks to see if a frame has passed, whereas tick waits however long is left until the next frame.If you're consistently getting ticks taking in the neighborhood of twice as long as they should, something's screwy somewhere, and I'd probably stick timers and logs all

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT You have two methods in clock.  Tick() and update().  Update appears to reset the timer for each frame after DT is reached:bool update(){if (time.elapsed>=delay) {time.restart();time.resume();return true;}return false;}That would seem to suggest that wherever tick() is cal

Re: DT in BGT

2019-02-17 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT If you mean the clock's tick method, I always call it in the main loop. The math needs know how much time passes between frames, but if clock::tick is called in any function or method that might be invoked more than once per frame, things will get very confusing very

Re: DT in BGT

2019-02-16 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Ok, just noticed that the clock wasn't exactly working correctly.  Where do the tick and update functions need to be so that things actually update right?  Do I want the tick and update functions in my main game loop where I check for all sorts of rules, key presses and other

Re: DT in BGT

2019-02-16 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Ok, just noticed that the clock wasn't exactly working correctly.  Where do the tick and update functions need to be so that things actually update right?  Do I want the tick and update functions in my main game loop where I check for all sorts of rules, key presses and other

Re: DT in BGT

2019-02-14 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT The reason v0 changes to vf is because you're calculations are for the time that passes from frame to frame. There probably isn't much need to remember what the initial velocity was 10 frames ago, but you do need to know what it is at the end of the previous frame. URL

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Got it, I think.  Just under the line that moves the ball:pos += vel*DT;I added one line of code:V0 += G;Where G is a gravity vector.  Test log now shows:Beginning move function.  Initial velocity z is 20, accelleration z is 0.  DT is 0.016.In move function, just

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Got it, I think.  Just under the line that moves the ball:pos += vel*DT;I added one line of code:V0 += G;Where G is a gravity vector.  Test log now shows:Beginning move function.  Initial velocity z is 20, accelleration z is 0.  DT is 0.016.In move function, just

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Got it, I think.  Just under the line that moves the ball:pos += vel*DT;I added one line of code:V0 += G;Where G is a gravity vector.  Test log now shows:Beginning move function.  Initial velocity z is 20, accelleration z is 0.  DT is 0.016.In move function, just

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT But if I set V0 to VF, then doesn't that screw up the equation?  It seems like the ball would never rise like it's supposed to.  If I throw a ball upwards at an initial  velocity V0 of, say, 30, it will rise, and as gravity exerts a force on the ball, that velocity

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT Dt is 1/60, so that's correct.The issue seems to be that vf needs to become the new v0. If v0.z is always 20, vf will always be 19.83[...]. Strictly speaking, v0 should be set to the ball's velocity. It doesn't matter if this is before or after vf is calculated, unless you

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Ok, so I changed the code to reflect what you wrote above:VF.z = (V0.z+(A.z*DT))...Log shows:Beginning move function.  Initial velocity z is 20, accelleration z is -9.814196167.  DT is 0.016.In move function, just past where velocity vector values are assigned

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Ok, so I changed the code to reflect what you wrote above:VF.z = (V0.z+(A.z*DT))...Log shows:Beginning move function.  Initial velocity z is 20, accelleration z is -9.814196167.In move function, just past where velocity vector values are assigned, and just before the line

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT Something about the arrangement of parentheses is confusing. If v.z == 20 and A.z == -9.81, (v.z+A.z)*dt gets the wrong answer, because dt is being multiplied by v.z.I think what you want is more like (v0.z + (A.z * dt)) * cosine(phi). Actually, I'm not sure that cos

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Ok, slightly confused.  I've got two velocity vectors.  V0, or initial velocity, and VF, or final velocity.  The equation for final velocity is:vx = vx0 + ax * tvy = vy0 + ay * tvz = vz0 + az * tWhich is what I did here, I think, unless somehow I didn't write it correctly

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: DT in BGT It seems like you're using the equation for finding velocity after a certain amount of time has passed, but not adding it to the current velocity. If I'm reading it right, anyway, which might not be the case.For gravity defined as a vector, I'd probably just leave it at vf

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Ok, so what the hell.  Trying something new to see whether velocity would update correctly, I added the equations for the velocity to the ball move function.  Accelleration vector at the moment is currently (0, 0, -9.81) to account for gravity.  Initial velocity, or V0, when

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Ok, so what the hell.  Trying something new to see whether velocity would update correctly, I added the equations for the velocity to the ball move function.  Accelleration vector at the moment is currently (0, 0, -9.81) to account for gravity.  Initial velocity, or V0, when

Re: DT in BGT

2019-02-13 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Ok, so what the hell.  Trying something new to see whether velocity would update correctly, I added the equations for the velocity to the ball move function.  Accelleration vector at the moment is currently (0, 0, -9.81) to account for gravity.  Initial velocity, or V0, when

Re: DT in BGT

2019-02-04 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Ok, so I've begun incorporating the new code into my existing code, and for the most part things appear to be working correctly in terms of movement, although the distance discrepancy stated in the above post still confuses me.  Now, what is the best way to handle the bounce

Re: DT in BGT

2019-02-04 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT Ok, so I've begun incorporating the new code into my existing code, and for the most part things appear to be working correctly in terms of movement, although the height going below 0 still confuses me.  Now, what is the best way to handle the bounce of the ball on the court

Re: DT in BGT

2019-02-01 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT UPDATE:  Adding 180 degrees and recalculating theta mirrors the angle correctly:B.pos.z = 50;deg += 180;//recalculate theta.DTR(deg);B.moving = true;move();And the previous movement is mirrored.  I do notice that apparently as height lowers, it never equals 0, because

Re: DT in BGT

2019-02-01 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT UPDATE:  Adding 180 degrees and recalculating theta mirrors the angle correctly:B.pos.z = 50;deg += 180;//recalculate theta.DTR(deg);B.moving = true;move();And the previous movement is mirrored.  I do notice that apparently as height lowers, it never equals 0, because

Re: DT in BGT

2019-02-01 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT UPDATE:  Adding 180 degrees and recalculating theta mirrors the angle correctly:B.pos.z = 50;deg += 180;//recalculate theta.DTR(deg);B.moving = true;move();And the previous movement is mirrored.  One thing I do notice that quite frankly royally pisses me off is that when

Re: DT in BGT

2019-02-01 Thread AudioGames . net Forum — Developers room : JLove via Audiogames-reflector
Re: DT in BGT UPDATE:  Adding 180 degrees and recalculating theta mirrors the angle correctly:B.pos.z = 50;deg += 180;//recalculate theta.DTR(deg);B.moving = true;move();And the previous movement is mirrored.  One thing I do notice that quite frankly royally pisses me off is that when

  1   2   3   >