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 on the sound, it might sound better the way you have it.

URL: https://forum.audiogames.net/post/413889/#p413889




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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...is incorrect.  You do not multiply by DT, but rather T, actual time.  Then, when you actually move the ball, that is when you use DT.position = velocity multiplied by DT.That's why you need some way to actually get time.As for the sound thing, you are confused.  I wasn't referring to sound of impact on the ball or the ball bouncing.  I was referring to the actual sound of the ball as it travels through the air.  The only way that I can think to make it work correctly is to have that sound play every x number of frames, because if I don't, the sound goes so fast that it's a buzzing that is so loud and overwhelms everything.  If I have it play every x number of frames, it plays correctly.  Not sure if there's a better way to do it.  The sound had nothing to do with impact or bouncing.  Not sure what made you think that, since when the ball hits the ground, I call a separate method entirely for bounce outside of move:if(pos.z <= 0){moving = false;bounce();}This part:if(C.frame == 50){B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);C.frame = 0;}Is for the ball as it travels through the air.  I hope that clears up the confusion.

URL: https://forum.audiogames.net/post/413878/#p413878




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 actually move the ball, that is when you use DT.position = velocity multiplied by DT.That's why you need some way to actually get time.As for the sound thing, you are confused.  I wasn't referring to sound of impact on the ball or the ball bouncing.  I was referring to the actual sound of the ball as it travels through the air.  The only way that I can think to make it work correctly is to have that sound play every x number of frames, because if I don't, the sound goes so fast that it's a buzzing that is so loud and overwhelms everything.  If I have it play every x number of frames, it plays correctly.  Not sure if there's a better way to do it.  The sound had nothing to do with impact or bouncing.  Not sure what made you think that, since when the ball hits the ground, I call a separate method entirely for bounce outside of move:if(pos.z <= 0){moving = false;bounce();}This part:if(C.frame == 50){B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);C.frame = 0;}Is for the ball as it travels through the air.  I hope that clears up the confusion.

URL: https://forum.audiogames.net/post/413878/#p413878




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 with a work-around that decouples the sound from movement, but that's more complicated.)It is easy to wind up with impact sounds that rapidfire every frame. In this case, you'd need it to play only when the ball goes from falling to not falling. Gravity doesn't really care, and is still affecting the ball whether the ground is stopping it or not, so you'd either want to stop gravity from accelerating a grounded ball, or just have the bounce play if it's falling at < g*dt, where g*dt is how much vel would change in a single frame of gravity. I might even put a slight margin of error and go with 2×g×dt. ... Wait, why haven't I done this in ECTAS? That would stop knives on platforms from fall-spamming. But I'm still lost as to what they mean regarding time.

URL: https://forum.audiogames.net/post/413656/#p413656




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 as the time, you use actual time, but then move by DT.  So, to determine force when the ball his hit, I think my NewShot method would need something like this:void NewShot(double phi, double theta, bool opponentShot = false){//Making sure that the shot cannot occur when rules do not apply.if(B.pos.z == 0 or LastShooter == 1 and !opponentShot)return;//You can't hit the ball if you're too far away.if(distance() > 4){env.play_stationary("sounds/miss.ogg", false);return;}//Get current real time.CT = RealTime.elapsed;//Account for some rules.rules.shots++;if(rules.serving){rules.service++;MustServe=false;B.tossing=false;LastShooter= server;}else{LastShooter++;if(LastShooter > 2)LastShooter = 1;}if(LastShooter == 1){//Original values sent to opponent, will have to be changed based on new code.string message = (deg+180) + ".";Server.send_reliable(0, message, Ball);}rules.bounces = 0;env.play_2d("sounds/shot.ogg", user.x, user.y, x, y, false);B.rising=true;B.moving=true;if(rules.shots==2){rules.serving = false;rules.faults = 0;}//Set initial vel here, at the moment for debugging and testing purposes, will be changed later.V0.x = 200;V0.y = 200;//Make sure chosen angle is correct.  Remember that he has switched it so that phi measures azimuthal angle, and theta measures elevation for some reason in this case.A.x = SetAngle(phi);A.y = SetAngle(phi);Theta(B.pos.z, r);//Now calculate time that it took to actually complete, to use in the equations, and log the value of T for debugging and testing purposes.  NOTE:  T is usually 22 or 23.T = RealTime.elapsed-CT;test.add_entry("T is " + T + ".");//Set velocity using T instead of DT.SetVel();//This is done because the only way to get the ball sound to play correctly seems to be to have it play every x number of frames.  If you know of a better way, let me know.C.frame = 0;//Call move method for the ball.B.move();}}Now, in ball::move, I say:void move(){//Move the ball based on velocity with DT.  I had it set velocity each time to account for the change in gravity acceleration.pos += SetVel()*DT;//Account for gravity.A += G;//For when the ball bounces.if(pos.z <= 0){moving = false;bounce();}//This is done for the sound.  If I don't do it this way, the sound plays so fast that it's just a buzzing that overwhelms everything, and is why I set frames to 0 in the shot method.  Again, if you've got a better way, by all means let me know.if(C.frame == 50){B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);C.frame = 0;}env.update_sound_2d(B.slot, B.pos.x, B.pos.y);}I hope that made sense.  If you've got any better ideas of ways to handle things, please feel free to let me know.

URL: https://forum.audiogames.net/post/413540/#p413540




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 as the time, you use actual time, but then move by DT.  So, to determine force when the ball his hit, I think my NewShot method would need something like this:void NewShot(double phi, double theta, bool opponentShot = false){//Making sure that the shot cannot occur when rules do not apply.if(B.pos.z == 0 or LastShooter == 1 and !opponentShot)return;//You can't hit the ball if you're too far away.if(distance() > 4){env.play_stationary("sounds/miss.ogg", false);return;}//Get current real time.CT = RealTime.elapsed;//Account for some rules.rules.shots++;if(rules.serving){rules.service++;MustServe=false;B.tossing=false;LastShooter= server;}else{LastShooter++;if(LastShooter > 2)LastShooter = 1;}if(LastShooter == 1){//Original values sent to opponent, will have to be changed based on new code.string message = (deg+180) + ".";Server.send_reliable(0, message, Ball);}rules.bounces = 0;env.play_2d("sounds/shot.ogg", user.x, user.y, x, y, false);B.rising=true;B.moving=true;if(rules.shots==2){rules.serving = false;rules.faults = 0;}//Set initial vel here, at the moment for debugging and testing purposes, will be changed later.V0.x = 200;V0.y = 200;//Make sure chosen angle is correct.  Remember that he has switched it so that phi measures azimuthal angle, and theta measures elevation for some reason in this case.A.x = SetAngle(phi);A.y = SetAngle(phi);Theta(B.pos.z, r);//Now calculate time that it took to actually complete, to use in the equations, and log the value of T for debugging and testing purposes.  NOTE:  T is usually 22 or 23.T = RealTime.elapsed-CT;test.add_entry("T is " + T + ".");//Set velocity using T instead of DT.SetVel();//This is done because the only way to get the ball sound to play correctly seems to be to have it play every x number of frames.  If you know of a better way, let me know.C.frame = 0;//Call move method for the ball.B.move();}}Now, in ball::move, I say:void move(){//Move the ball based on velocity with DT.  I had it set velocity each time to account for the change in gravity acceleration.pos += SetVel()*DT;//Account for gravity.A += G;//For when the ball bounces.if(pos.z <= 0){moving = false;bounce();}//This is done for the sound.  If I don't do it this way, the sound plays so fast that it's just a buzzing that overwhelms everything.  Again, if you've got a better way, by all means let me know.if(C.frame == 50){B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);C.frame = 0;}env.update_sound_2d(B.slot, B.pos.x, B.pos.y);}I hope that made sense.  If you've got any better ideas of ways to handle things, please feel free to let me know.

URL: https://forum.audiogames.net/post/413540/#p413540




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 as the time, you use actual time, but then move by DT.  So, to determine force when the ball his hit, I think my NewShot method would need something like this:void NewShot(double phi, double theta, bool opponentShot = false){//Making sure that the shot cannot occur when rules do not apply.if(B.pos.z == 0 or LastShooter == 1 and !opponentShot)return;//You can't hit the ball if you're too far away.if(distance() > 4){env.play_stationary("sounds/miss.ogg", false);return;}//Get current real time.CT = RealTime.elapsed;//Account for some rules.rules.shots++;if(rules.serving){rules.service++;MustServe=false;B.tossing=false;LastShooter= server;}else{LastShooter++;if(LastShooter > 2)LastShooter = 1;}if(LastShooter == 1){string message = (deg+180) + ".";Server.send_reliable(0, message, Ball);}rules.bounces = 0;env.play_2d("sounds/shot.ogg", user.x, user.y, x, y, false);B.rising=true;B.moving=true;if(rules.shots==2){rules.serving = false;rules.faults = 0;}//Set initial vel here, at the moment for debugging and testing purposes, will be changed later.V0.x = 200;V0.y = 200;//Make sure chosen angle is correct.  Remember that he has switched it so that phi measures azimuthal angle, and theta measures elevation for some reason in this case.A.x = SetAngle(phi);A.y = SetAngle(phi);Theta(B.pos.z, r);//Now calculate time that it took to actually complete, to use in the equations, and log the value of T for debugging and testing purposes.  NOTE:  T is usually 22 or 23.T = RealTime.elapsed-CT;test.add_entry("T is " + T + ".");//Set velocity using T instead of DT.SetVel();//This is done because the only way to get the ball sound to play correctly seems to be to have it play every x number of frames.  If you know of a better way, let me know.C.frame = 0;//Call move method for the ball.B.move();}}Now, in ball::move, I say:void move(){//Move the ball based on velocity with DT.  I had it set velocity each time to account for the change in gravity acceleration.pos += SetVel()*DT;//Account for gravity.A += G;//For when the ball bounces.if(pos.z <= 0){moving = false;bounce();}//This is done for the sound.  If I don't do it this way, the sound plays so fast that it's just a buzzing that overwhelms everything.  Again, if you've got a better way, by all means let me know.if(C.frame == 50){B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);C.frame = 0;}env.update_sound_2d(B.slot, B.pos.x, B.pos.y);}I hope that made sense.  If you've got any better ideas of ways to handle things, please feel free to let me know.

URL: https://forum.audiogames.net/post/413540/#p413540




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 as the time, you use actual time, but then move by DT.  So, to determine force when the ball his hit, I think my NewShot method would need something like this:void NewShot(double phi, double theta, bool opponentShot = false){//Making sure that the shot cannot occur when rules do not apply.if(B.pos.z == 0 or LastShooter == 1 and !opponentShot)return;//You can't hit the ball if you're too far away.if(distance() > 4){env.play_stationary("sounds/miss.ogg", false);return;}//Get current real time.CT = RealTime.elapsed;//Account for some rules.rules.shots++;if(rules.serving){rules.service++;MustServe=false;B.tossing=false;LastShooter= server;}else{LastShooter++;if(LastShooter > 2)LastShooter = 1;}if(LastShooter == 1){string message = (deg+180) + ".";Server.send_reliable(0, message, Ball);}rules.bounces = 0;env.play_2d("sounds/shot.ogg", user.x, user.y, x, y, false);B.rising=true;B.moving=true;if(rules.shots==2){rules.serving = false;rules.faults = 0;}//Set initial vel here, at the moment for debugging and testing purposes, will be changed later.V0.x = 200;V0.y = 200;//Make sure chosen angle is correct.  Remember that he has switched it so that phi measures azimuthal angle, and theta measures elevation for some reason in this case.A.x = SetAngle(phi);A.y = SetAngle(phi);Theta(B.pos.z, r);//Now calculate time that it took to actually complete, to use in the equations.T = RealTime.elapsed-CT;test.add_entry("T is " + T + ".");//Set velocity using T instead of DT.SetVel();//This is done because the only way to get the ball sound to play correctly seems to be to have it play every x number of frames.  If you know of a better way, let me know.C.frame = 0;//Call move method for the ball.B.move();}}Now, in ball::move, I say:void move(){//Move the ball based on velocity with DT.  I had it set velocity each time to account for the change in gravity acceleration.pos += SetVel()*DT;//Account for gravity.A += G;//For when the ball bounces.if(pos.z <= 0){moving = false;bounce();}//This is done for the sound.  If I don't do it this way, the sound plays so fast that it's just a buzzing that overwhelms everything.  Again, if you've got a better way, by all means let me know.if(C.frame == 50){B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);C.frame = 0;}env.update_sound_2d(B.slot, B.pos.x, B.pos.y);}I hope that made sense.  If you've got any better ideas of ways to handle things, please feel free to let me know.

URL: https://forum.audiogames.net/post/413540/#p413540




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 as the time, you use actual time, but then move by DT.  So, to determine force when the ball his hit, I think my NewShot method would need something like this:void NewShot(double phi, double theta, bool opponentShot = false){//Making sure that the shot cannot occur when rules do not apply.if(B.pos.z == 0 or LastShooter == 1 and !opponentShot)return;//You can't hit the ball if you're too far away.if(distance() > 4){env.play_stationary("sounds/miss.ogg", false);return;}//Get current real time.CT = RealTime.elapsed;//Account for some rules.rules.shots++;if(rules.serving){rules.service++;MustServe=false;B.tossing=false;LastShooter= server;}else{LastShooter++;if(LastShooter > 2)LastShooter = 1;}if(LastShooter == 1){string message = (deg+180) + ".";Server.send_reliable(0, message, Ball);}rules.bounces = 0;env.play_2d("sounds/shot.ogg", user.x, user.y, x, y, false);B.rising=true;B.moving=true;if(rules.shots==2){rules.serving = false;rules.faults = 0;}//Set initial vel here, at the moment for debugging and testing purposes, will be changed later.V0.x = 200;V0.y = 200;//Make sure chosen angle is correct.A.x = SetAngle(phi);A.y = SetAngle(phi);Theta(B.pos.z, r);//Now calculate time that it took to actually complete, to use in the equations.T = RealTime.elapsed-CT;test.add_entry("T is " + T + ".");//Set velocity using T instead of DT.SetVel();//This is did because the only way to get the ball sound to play correctly seems to be to have it play every x number of frames.  If you know of a better way, let me know.C.frame = 0;//Call move method for the ball.B.move();}}Now, in ball::move, I say:void move(){//Move the ball based on velocity with DT.  I had it set velocity each time to account for the change in gravity acceleration.pos += SetVel()*DT;//Account for gravity.A += G;//For when the ball bounces.if(pos.z <= 0){moving = false;bounce();}//This is done for the sound.  If I don't do it this way, the sound plays so fast that it's just a buzzing that overwhelms everything.  Again, if you've got a better way, by all means let me know.if(C.frame == 50){B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);C.frame = 0;}env.update_sound_2d(B.slot, B.pos.x, B.pos.y);}I hope that made sense.  If you've got any better ideas of ways to handle things, please feel free to let me know.

URL: https://forum.audiogames.net/post/413540/#p413540




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 is to keep the time passing between frames as close to constant as possible, such that the errors mostly cancel each other out before you get the scale of seconds.

URL: https://forum.audiogames.net/post/413076/#p413076




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 machine, but you would be right back where you started with multiplayer being a mess. In theory, you could do it that way, but it's much easier to sync frames than realtime. You're going to get inconsistent delays, no matter what, due to the differences in computers, delays over the network, etc. The slight differences in realtime that pass between calls to move will add up, and you'd basically have to have the server control everything and send that constantly.Using a constant frame delay for dt has it so that, even if there is some lag, you know that in 100 frames after the ball was hit, it will be in the same place for both players, which you could not say for 1.7s. The players won't be in the same frame at the same time, but outside of extreme situations, they'll be close enough that you can account for the difference without relying on the server to do everything.The thing about realtime calculations is that you would need to track every force and when it was applied to remain deterministic. You'd basically be calculating everything that happened since the last input, and then you'd still need to worry about overpenetration, etc. Frames allow you to calculate what happened in the past frame, without there being as much room for error. It's basically a tradeoff between millisecond accuracy and determinism, due to never being able to predict for sure what millisecond the calculations will be performed in. The purpose of the clock is to keep dt as close to constant as possible, and the errors should mostly average out on the scale of seconds.

URL: https://forum.audiogames.net/post/413073/#p413073




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 in the code in the past, it basically cut the amount of FPS I was getting in half.  After doing further research on using DT, apparently I need a way to keep track of the amount of time between frames, and I'm supposed to use that as DT?  I'm a little confused.  I wonder if the clock update function would be where that's used.  Something like:double T = RealTime.elapsed;bool update(){if (time.elapsed>=delay) {double frametime = RealTime.elapsed-T;time.restart();time.resume();return true;}return false;}Or something close to that.

URL: https://forum.audiogames.net/post/413067/#p413067




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 in the code in the past, it basically cut the amount of FPS I was getting in half.

URL: https://forum.audiogames.net/post/413067/#p413067




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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/413067/#p413067




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 not impossible. A couple of milliseconds seems like it might just be within BGT's margin of error, but if I find anything else wrong with the clock, I'll be sure to report it.

URL: https://forum.audiogames.net/post/413022/#p413022




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 saw what I wrote about dynamic menu and movement, but I'll post here for convenience, because I do not understand what the hell is causing this.What, the, fuck?  So this time I decided to see what would happen in terms of frame rate if I just walked my player back and forth on the court.  Frame rate dropped a little, to 590.  But there's the question.  Looking at my profile, I see:Total execution time: 58413 msNumber of functions called: 11void clock::tick(): 39733 ms (68.02%)int dynamic_menu::run_extended(string, bool, int, bool): 14689 ms (25.15%)The fuck?  What does moving my player have to do with the dynamic menu?  I do not call dynamic menu when I move.  When I don't move, profile looks like this:Total execution time: 53878 msNumber of functions called: 8void clock::tick(): 50429 ms (93.6%)void StartMatch(bool = true): 1480 ms (2.75%)int dynamic_menu::run_extended(string, bool, int, bool): 1172 ms (2.18%)So what the fuck?  Player::move looks like this:void move(int direction){if(pm.elapsedreturn;switch(direction){case forward:if(y>=net)return;y++;break;case back:if(y<=UserBaseline-5)return;y--;break;case left:if(x<=LeftSideline-5)return;x--;break;case right:if(x>=RightSideline+5)return;x++;break;}if(!OMoving){env.update_listener_2d(user.x, user.y);env.play_stationary("sounds/step.ogg", false);}if(OMoving)env.play_2d("sounds/step.ogg", user.x, user.y, opponent.x, opponent.y, false);Server.send_unreliable(0, (RightSideline-user.x)+"__"+(OpponentBaseline-user.y), Player);pm.restart();}As you can see, simple, and no calls to dynamic menu.  What the hell?

URL: https://forum.audiogames.net/post/413017/#p413017




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 is causing this.What, the, fuck?  So this time I decided to see what would happen in terms of frame rate if I just walked my player back and forth on the court.  Frame rate dropped a little, to 590.  But there's the question.  Looking at my profile, I see:Total execution time: 58413 msNumber of functions called: 11void clock::tick(): 39733 ms (68.02%)int dynamic_menu::run_extended(string, bool, int, bool): 14689 ms (25.15%)The fuck?  What does moving my player have to do with the dynamic menu?  I do not call dynamic menu when I move.  When I don't move, profile looks like this:Total execution time: 53878 msNumber of functions called: 8void clock::tick(): 50429 ms (93.6%)void StartMatch(bool = true): 1480 ms (2.75%)int dynamic_menu::run_extended(string, bool, int, bool): 1172 ms (2.18%)So what the fuck?  Player::move looks like this:void move(int direction){if(pm.elapsedreturn;switch(direction){case forward:if(y>=net)return;y++;break;case back:if(y<=UserBaseline-5)return;y--;break;case left:if(x<=LeftSideline-5)return;x--;break;case right:if(x>=RightSideline+5)return;x++;break;}if(!OMoving){env.update_listener_2d(user.x, user.y);env.play_stationary("sounds/step.ogg", false);}if(OMoving)env.play_2d("sounds/step.ogg", user.x, user.y, opponent.x, opponent.y, false);Server.send_unreliable(0, (RightSideline-user.x)+"__"+(OpponentBaseline-user.y), Player);pm.restart();}As you can see, simple, and no calls to dynamic menu.  What the hell?

URL: https://forum.audiogames.net/post/413017/#p413017




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.  Next, I added the wait(1000) prior to restarting the timers.  I set frame rate to 60.  This means that after each 0.016 seconds, a frame should pass.  That means that at 0.096 seconds, six frames should have passed.  Log shows:Tick called.  Elapsed real time is 0 seconds.  Number of frames is 0.Tick called.  Elapsed real time is 0.034 seconds.  Number of frames is 1.Tick called.  Elapsed real time is 0.038 seconds.  Number of frames is 2.Tick called.  Elapsed real time is 0.068 seconds.  Number of frames is 3.Tick called.  Elapsed real time is 0.072 seconds.  Number of frames is 4.Tick called.  Elapsed real time is 0.103 seconds.  Number of frames is 5.The pattern still appears to hold.  Not sure why the calls to tick aren't more uniform, instead it gets called back to back virtually, then waits, then back to back, then waits.  So far, loss of one frame at 0.1 seconds.  Log at the bottom shows:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 590.  So, it appears that I lose one frame every second.  What I don't understand is why the tick method basically gets called that way instead of uniformly across the board.  Is there a way to improve that?  And why now all of a sudden is this appearing to work correctly?  Even if there was initial lag after the sounds, wouldn't the first 10 seconds have shown that, say 50 FPS instead of 60, but then the next ten seconds would have shown correctly, since the lag should have been gone by then?  In other words, I can see the first ten seconds being affected by the lag, but after the sounds are loaded, the lag goes away and everything after should work correctly, right?  Besides, how the hell would loading sounds eat that much of 16 GB of ram that it lags to the point that you lose that much performance?  And after sounds are loaded, why doesn't lag go away after the first ten seconds?  It seems like Philip really, really must have screwed something up when he made BGT, or Windows has got some serious, serious issues.  NOTE:  Retesting shows the following:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 604.Amount of real time that has passed is 10.005seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.009seconds.  DT is 0.016.  Number of frames that have passed is 608.How I'm getting extra frames I don't know.  Is there a way to prevent that?  Extra frames could be an issue across machines.  Could cause the initial problem I had, ball landing differently on different cords.  Really don't want that.  NOTE 2:  This has also changed my profile results.  StartMatch now went down considerably.  Not sure why that is, since I actually added a wait there, but look:Total execution time: 53671 msNumber of functions called: 9void clock::tick(): 50275 ms (93.67%)void StartMatch(bool = true): 1482 ms (2.76%)int dynamic_menu::run_extended(string, bool, int, bool): 1033 ms (1.92%)void main(): 863 ms (1.61%)bool logger::write(string, bool): 6 ms (0.01%)void MainMenu(): 5 ms (0.01%)void CheckEvents(): 3 ms (0.01%)void Voice::speak(string): 2 ms (0%)I don't understand that.  I would have thought the wait call would have lengthened StartMatch.  NOTE 3:  What, the, fuck?  So this time I decided to see what would happen in terms of frame rate if I just walked my player back and forth on the court.  Frame rate

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 as they should be.Can OK, I went and tried testing the clock by itself, and it turns out that there is a bug if the first tick happens less than delay ms after the clock was last reset. I completely failed to account for the possibility of a delay that was shorter than expected. This caused a double negative to show up in the first frame, and the oscillation you found is the result of the clock compensating without a way to prevent the problem from repeating for short frames.I fixed it by adding this line before the call to wait in clock.bgt:if(elapsed<0) elapsed=0;So yeah, you found a bug in the clock. I'm not sure if this will fix the problem, since tiny variations were still happening after I fixed it, with some frames getting random extra ms even though they weren't doing anything, but it was on the order of 22ms instead of 20ms at worst, and the clock compensates for it correctly. Now, if it turns out those 1-2ms are also from a bug in the clock, I'll let you know, but it should never wait longer than delay, with that fix, so I'm assuming the noise is from my computer.

URL: https://forum.audiogames.net/post/413014/#p413014




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 seconds.Tick called.  Elapsed real time is 0.046 seconds.Then, it almost immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.  Next, I added the wait(1000) prior to restarting the timers.  I set frame rate to 60.  This means that after each 0.016 seconds, a frame should pass.  That means that at 0.096 seconds, six frames should have passed.  Log shows:Tick called.  Elapsed real time is 0 seconds.  Number of frames is 0.Tick called.  Elapsed real time is 0.034 seconds.  Number of frames is 1.Tick called.  Elapsed real time is 0.038 seconds.  Number of frames is 2.Tick called.  Elapsed real time is 0.068 seconds.  Number of frames is 3.Tick called.  Elapsed real time is 0.072 seconds.  Number of frames is 4.Tick called.  Elapsed real time is 0.103 seconds.  Number of frames is 5.The pattern still appears to hold.  Not sure why the calls to tick aren't more uniform, instead it gets called back to back virtually, then waits, then back to back, then waits.  So far, loss of one frame at 0.1 seconds.  Log at the bottom shows:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 590.  So, it appears that I lose one frame every second.  What I don't understand is why the tick method basically gets called that way instead of uniformly across the board.  Is there a way to improve that?  And why now all of a sudden is this appearing to work correctly?  Even if there was initial lag after the sounds, wouldn't the first 10 seconds have shown that, say 50 FPS instead of 60, but then the next ten seconds would have shown correctly, since the lag should have been gone by then?  In other words, I can see the first ten seconds being affected by the lag, but after the sounds are loaded, the lag goes away and everything after should work correctly, right?  Besides, how the hell would loading sounds eat that much of 16 GB of ram that it lags to the point that you lose that much performance?  And after sounds are loaded, why doesn't lag go away after the first ten seconds?  It seems like Philip really, really must have screwed something up when he made BGT, or Windows has got some serious, serious issues.  NOTE:  Retesting shows the following:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 604.Amount of real time that has passed is 10.005seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.009seconds.  DT is 0.016.  Number of frames that have passed is 608.How I'm getting extra frames I don't know.  Is there a way to prevent that?  Extra frames could be an issue across machines.  Could cause the initial problem I had, ball landing differently on different cords.  Really don't want that.  NOTE 2:  This has also changed my profile results.  StartMatch now went down considerably.  Not sure why that is, since I actually added a wait there, but look:Total execution time: 53671 msNumber of functions called: 9void clock::tick(): 50275 ms (93.67%)void StartMatch(bool = true): 1482 ms (2.76%)int dynamic_menu::run_extended(string, bool, int, bool): 1033 ms (1.92%)void main(): 863 ms (1.61%)bool logger::write(string, bool): 6 ms (0.01%)void MainMenu(): 5 ms (0.01%)void CheckEvents(): 3 ms (0.01%)void Voice::speak(string): 2 ms (0%)I don't understand that.  I would have thought the wait call would have lengthened StartMatch.  NOTE 3:  What, the, fuck?  So this time I decided to see what would happen in terms of frame rate if I just walked my player back and forth on the court.  Frame rate

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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.  Next, I added the wait(1000) prior to restarting the timers.  I set frame rate to 60.  This means that after each 0.016 seconds, a frame should pass.  That means that at 0.096 seconds, six frames should have passed.  Log shows:Tick called.  Elapsed real time is 0 seconds.  Number of frames is 0.Tick called.  Elapsed real time is 0.034 seconds.  Number of frames is 1.Tick called.  Elapsed real time is 0.038 seconds.  Number of frames is 2.Tick called.  Elapsed real time is 0.068 seconds.  Number of frames is 3.Tick called.  Elapsed real time is 0.072 seconds.  Number of frames is 4.Tick called.  Elapsed real time is 0.103 seconds.  Number of frames is 5.The pattern still appears to hold.  Not sure why the calls to tick aren't more uniform, instead it gets called back to back virtually, then waits, then back to back, then waits.  So far, loss of one frame at 0.1 seconds.  Log at the bottom shows:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 590.  So, it appears that I lose one frame every second.  What I don't understand is why the tick method basically gets called that way instead of uniformly across the board.  Is there a way to improve that?  And why now all of a sudden is this appearing to work correctly?  Even if there was initial lag after the sounds, wouldn't the first 10 seconds have shown that, say 50 FPS instead of 60, but then the next ten seconds would have shown correctly, since the lag should have been gone by then?  In other words, I can see the first ten seconds being affected by the lag, but after the sounds are loaded, the lag goes away and everything after should work correctly, right?  Besides, how the hell would loading sounds eat that much of 16 GB of ram that it lags to the point that you lose that much performance?  And after sounds are loaded, why doesn't lag go away after the first ten seconds?  It seems like Philip really, really must have screwed something up when he made BGT, or Windows has got some serious, serious issues.  NOTE:  Retesting shows the following:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 604.Amount of real time that has passed is 10.005seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.009seconds.  DT is 0.016.  Number of frames that have passed is 608.How I'm getting extra frames I don't know.  Is there a way to prevent that?  Extra frames could be an issue across machines.  Could cause the initial problem I had, ball landing differently on different cords.  Really don't want that.  NOTE 2:  This has also changed my profile results.  StartMatch now went down considerably.  Not sure why that is, since I actually added a wait there, but look:Total execution time: 53671 msNumber of functions called: 9void clock::tick(): 50275 ms (93.67%)void StartMatch(bool = true): 1482 ms (2.76%)int dynamic_menu::run_extended(string, bool, int, bool): 1033 ms (1.92%)void main(): 863 ms (1.61%)bool logger::write(string, bool): 6 ms (0.01%)void MainMenu(): 5 ms (0.01%)void CheckEvents(): 3 ms (0.01%)void Voice::speak(string): 2 ms (0%)I don't understand that.  I would have thought the wait call would have lengthened StartMatch.  NOTE 3:  What, the, fuck?  So this time I decided to see what would happen in terms of frame rate if I just walked my player back and forth on the court.  Frame rate dropped a little, to 590.  But there's the question.  Looking at my profile, I

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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.  Next, I added the wait(1000) prior to restarting the timers.  I set frame rate to 60.  This means that after each 0.016 seconds, a frame should pass.  That means that at 0.096 seconds, six frames should have passed.  Log shows:Tick called.  Elapsed real time is 0 seconds.  Number of frames is 0.Tick called.  Elapsed real time is 0.034 seconds.  Number of frames is 1.Tick called.  Elapsed real time is 0.038 seconds.  Number of frames is 2.Tick called.  Elapsed real time is 0.068 seconds.  Number of frames is 3.Tick called.  Elapsed real time is 0.072 seconds.  Number of frames is 4.Tick called.  Elapsed real time is 0.103 seconds.  Number of frames is 5.The pattern still appears to hold.  Not sure why the calls to tick aren't more uniform, instead it gets called back to back virtually, then waits, then back to back, then waits.  So far, loss of one frame at 0.1 seconds.  Log at the bottom shows:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 590.  So, it appears that I lose one frame every second.  What I don't understand is why the tick method basically gets called that way instead of uniformly across the board.  Is there a way to improve that?  And why now all of a sudden is this appearing to work correctly?  Even if there was initial lag after the sounds, wouldn't the first 10 seconds have shown that, say 50 FPS instead of 60, but then the next ten seconds would have shown correctly, since the lag should have been gone by then?  In other words, I can see the first ten seconds being affected by the lag, but after the sounds are loaded, the lag goes away and everything after should work correctly, right?  Besides, how the hell would loading sounds eat that much of 16 GB of ram that it lags to the point that you lose that much performance?  And after sounds are loaded, why doesn't lag go away after the first ten seconds?  It seems like Philip really, really must have screwed something up when he made BGT, or Windows has got some serious, serious issues.  NOTE:  Retesting shows the following:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 604.Amount of real time that has passed is 10.005seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.009seconds.  DT is 0.016.  Number of frames that have passed is 608.How I'm getting extra frames I don't know.  Is there a way to prevent that?  Extra frames could be an issue across machines.  Could cause the initial problem I had, ball landing differently on different cords.  Really don't want that.  NOTE 2:  This has also changed my profile results.  StartMatch now went down considerably.  Not sure why that is, since I actually added a wait there, but look:Total execution time: 53671 msNumber of functions called: 9void clock::tick(): 50275 ms (93.67%)void StartMatch(bool = true): 1482 ms (2.76%)int dynamic_menu::run_extended(string, bool, int, bool): 1033 ms (1.92%)void main(): 863 ms (1.61%)bool logger::write(string, bool): 6 ms (0.01%)void MainMenu(): 5 ms (0.01%)void CheckEvents(): 3 ms (0.01%)void Voice::speak(string): 2 ms (0%)I don't understand that.  I would have thought the wait call would have lengthened StartMatch.

URL: https://forum.audiogames.net/post/413001/#p413001




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.  Next, I added the wait(1000) prior to restarting the timers.  I set frame rate to 60.  This means that after each 0.016 seconds, a frame should pass.  That means that at 0.096 seconds, six frames should have passed.  Log shows:Tick called.  Elapsed real time is 0 seconds.  Number of frames is 0.Tick called.  Elapsed real time is 0.034 seconds.  Number of frames is 1.Tick called.  Elapsed real time is 0.038 seconds.  Number of frames is 2.Tick called.  Elapsed real time is 0.068 seconds.  Number of frames is 3.Tick called.  Elapsed real time is 0.072 seconds.  Number of frames is 4.Tick called.  Elapsed real time is 0.103 seconds.  Number of frames is 5.The pattern still appears to hold.  Not sure why the calls to tick aren't more uniform, instead it gets called back to back virtually, then waits, then back to back, then waits.  So far, loss of one frame at 0.1 seconds.  Log at the bottom shows:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 590.  So, it appears that I lose one frame every second.  What I don't understand is why the tick method basically gets called that way instead of uniformly across the board.  Is there a way to improve that?  And why now all of a sudden is this appearing to work correctly?  Even if there was initial lag after the sounds, wouldn't the first 10 seconds have shown that, say 50 FPS instead of 60, but then the next ten seconds would have shown correctly, since the lag should have been gone by then?  In other words, I can see the first ten seconds being affected by the lag, but after the sounds are loaded, the lag goes away and everything after should work correctly, right?  Besides, how the hell would loading sounds eat that much of 16 GB of ram that it lags to the point that you lose that much performance?  And after sounds are loaded, why doesn't lag go away after the first ten seconds?  It seems like Philip really, really must have screwed something up when he made BGT, or Windows has got some serious, serious issues.  NOTE:  Retesting shows the following:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 604.Amount of real time that has passed is 10.005seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.009seconds.  DT is 0.016.  Number of frames that have passed is 608.How I'm getting extra frames I don't know.  Is there a way to prevent that?  Extra frames could be an issue across machines.  Could cause the initial problem I had, ball landing differently on different cords.  Really don't want that.  NOTE 2:  This has also changed my profile results.  StartMatch now went down considerably.  Not sure why that is, since I actually added a wait there, but look:Total execution time: 53671 msNumber of functions called: 9void clock::tick(): 50275 ms (93.67%)void StartMatch(bool = true): 1482 ms (2.76%)int dynamic_menu::run_extended(string, bool, int, bool): 1033 ms (1.92%)void main(): 863 ms (1.61%)bool logger::write(string, bool): 6 ms (0.01%)void MainMenu(): 5 ms (0.01%)void CheckEvents(): 3 ms (0.01%)void Voice::speak(string): 2 ms (0%)I don't understand that.

URL: https://forum.audiogames.net/post/413001/#p413001




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.  Next, I added the wait(1000) prior to restarting the timers.  I set frame rate to 60.  This means that after each 0.016 seconds, a frame should pass.  That means that at 0.096 seconds, six frames should have passed.  Log shows:Tick called.  Elapsed real time is 0 seconds.  Number of frames is 0.Tick called.  Elapsed real time is 0.034 seconds.  Number of frames is 1.Tick called.  Elapsed real time is 0.038 seconds.  Number of frames is 2.Tick called.  Elapsed real time is 0.068 seconds.  Number of frames is 3.Tick called.  Elapsed real time is 0.072 seconds.  Number of frames is 4.Tick called.  Elapsed real time is 0.103 seconds.  Number of frames is 5.The pattern still appears to hold.  Not sure why the calls to tick aren't more uniform, instead it gets called back to back virtually, then waits, then back to back, then waits.  So far, loss of one frame at 0.1 seconds.  Log at the bottom shows:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 590.  So, it appears that I lose one frame every second.  What I don't understand is why the tick method basically gets called that way instead of uniformly across the board.  Is there a way to improve that?  And why now all of a sudden is this appearing to work correctly?  Even if there was initial lag after the sounds, wouldn't the first 10 seconds have shown that, say 50 FPS instead of 60, but then the next ten seconds would have shown correctly, since the lag should have been gone by then?  In other words, I can see the first ten seconds being affected by the lag, but after the sounds are loaded, the lag goes away and everything after should work correctly, right?  Besides, how the hell would loading sounds eat that much of 16 GB of ram that it lags to the point that you lose that much performance?  And after sounds are loaded, why doesn't lag go away after the first ten seconds?  It seems like Philip really, really must have screwed something up when he made BGT, or Windows has got some serious, serious issues.  NOTE:  Retesting shows the following:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 604.Amount of real time that has passed is 10.005seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.009seconds.  DT is 0.016.  Number of frames that have passed is 608.How I'm getting extra frames I don't know.  Is there a way to prevent that?  Extra frames could be an issue across machines.  Could cause the initial problem I had, ball landing differently on different cords.  Really don't want that.

URL: https://forum.audiogames.net/post/413001/#p413001




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.  Next, I added the wait(1000) prior to restarting the timers.  I set frame rate to 60.  This means that after each 0.016 seconds, a frame should pass.  That means that at 0.096 seconds, six frames should have passed.  Log shows:Tick called.  Elapsed real time is 0 seconds.  Number of frames is 0.Tick called.  Elapsed real time is 0.034 seconds.  Number of frames is 1.Tick called.  Elapsed real time is 0.038 seconds.  Number of frames is 2.Tick called.  Elapsed real time is 0.068 seconds.  Number of frames is 3.Tick called.  Elapsed real time is 0.072 seconds.  Number of frames is 4.Tick called.  Elapsed real time is 0.103 seconds.  Number of frames is 5.The pattern still appears to hold.  Not sure why the calls to tick aren't more uniform, instead it gets called back to back virtually, then waits, then back to back, then waits.  So far, loss of one frame at 0.1 seconds.  Log at the bottom shows:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 590.  So, it appears that I lose one frame every second.  What I don't understand is why the tick method basically gets called that way instead of uniformly across the board.  Is there a way to improve that?  And why now all of a sudden is this appearing to work correctly?  Even if there was initial lag after the sounds, wouldn't the first 10 seconds have shown that, say 50 FPS instead of 60, but then the next ten seconds would have shown correctly, since the lag should have been gone by then?  In other words, I can see the first ten seconds being affected by the lag, but after the sounds are loaded, the lag goes away and everything after should work correctly, right?  Besides, how the hell would loading sounds eat that much of 16 GB of ram that it lags to the point that you lose that much performance?  And after sounds are loaded, why doesn't lag go away after the first ten seconds?  It seems like Philip really, really must have screwed something up when he made BGT.  NOTE:  Retesting shows the following:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 604.Amount of real time that has passed is 10.005seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.009seconds.  DT is 0.016.  Number of frames that have passed is 608.How I'm getting extra frames I don't know.  Is there a way to prevent that?  Extra frames could be an issue across machines.  Could cause the initial problem I had, ball landing differently on different cords.  Really don't want that.

URL: https://forum.audiogames.net/post/413001/#p413001




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.  Next, I added the wait(1000) prior to restarting the timers.  I set frame rate to 60.  This means that after each 0.016 seconds, a frame should pass.  That means that at 0.096 seconds, six frames should have passed.  Log shows:Tick called.  Elapsed real time is 0 seconds.  Number of frames is 0.Tick called.  Elapsed real time is 0.034 seconds.  Number of frames is 1.Tick called.  Elapsed real time is 0.038 seconds.  Number of frames is 2.Tick called.  Elapsed real time is 0.068 seconds.  Number of frames is 3.Tick called.  Elapsed real time is 0.072 seconds.  Number of frames is 4.Tick called.  Elapsed real time is 0.103 seconds.  Number of frames is 5.The pattern still appears to hold.  Not sure why the calls to tick aren't more uniform, instead it gets called back to back virtually, then waits, then back to back, then waits.  So far, loss of one frame at 0.1 seconds.  Log at the bottom shows:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 590.  So, it appears that I lose one frame every second.  What I don't understand is why the tick method basically gets called that way instead of uniformly across the board.  Is there a way to improve that?  And why now all of a sudden is this appearing to work correctly?  Even if there was initial lag after the sounds, wouldn't the first 10 seconds have shown that, say 50 FPS instead of 60, but then the next ten seconds would have shown correctly, since the lag should have been gone by then?  In other words, I can see the first ten seconds being affected by the lag, but after the sounds are loaded, the lag goes away and everything after should work correctly, right?  Besides, how the hell would loading sounds eat that much of 16 GB of ram that it lags to the point that you lose that much performance?  And after sounds are loaded, why doesn't lag go away after the first ten seconds?  It seems like Philip really, really must have screwed something up when he made BGT.  NOTE:  Retesting shows the following:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 604.Amount of real time that has passed is 10.005seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.009seconds.  DT is 0.016.  Number of frames that have passed is 608.How I'm getting extra frames I don't know.  Is there a way to prevent that?

URL: https://forum.audiogames.net/post/413001/#p413001




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.  Next, I added the wait(1000) prior to restarting the timers.  I set frame rate to 60.  This means that after each 0.016 seconds, a frame should pass.  That means that at 0.096 seconds, six frames should have passed.  Log shows:Tick called.  Elapsed real time is 0 seconds.  Number of frames is 0.Tick called.  Elapsed real time is 0.034 seconds.  Number of frames is 1.Tick called.  Elapsed real time is 0.038 seconds.  Number of frames is 2.Tick called.  Elapsed real time is 0.068 seconds.  Number of frames is 3.Tick called.  Elapsed real time is 0.072 seconds.  Number of frames is 4.Tick called.  Elapsed real time is 0.103 seconds.  Number of frames is 5.The pattern still appears to hold.  Not sure why the calls to tick aren't more uniform, instead it gets called back to back virtually, then waits, then back to back, then waits.  So far, loss of one frame at 0.1 seconds.  Log at the bottom shows:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 590.  So, it appears that I lose one frame every second.  What I don't understand is why the tick method basically gets called that way instead of uniformly across the board.  Is there a way to improve that?  And why now all of a sudden is this appearing to work correctly?  Even if there was initial lag after the sounds, wouldn't the first 10 seconds have shown that, say 50 FPS instead of 60, but then the next ten seconds would have shown correctly, since the lag should have been gone by then?  In other words, I can see the first ten seconds being affected by the lag, but after the sounds are loaded, the lag goes away and everything after should work correctly, right?  Besides, how the hell would loading sounds eat that much of 16 GB of ram that it lags to the point that you lose that much performance?  If that's the case, it seems like Philip really, really must have screwed something up when he made BGT.

URL: https://forum.audiogames.net/post/413001/#p413001




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.  Next, I added the wait(1000) prior to restarting the timers.  I set frame rate to 60.  This means that after each 0.016 seconds, a frame should pass.  That means that at 0.096 seconds, six frames should have passed.  Log shows:Tick called.  Elapsed real time is 0 seconds.  Number of frames is 0.Tick called.  Elapsed real time is 0.034 seconds.  Number of frames is 1.Tick called.  Elapsed real time is 0.038 seconds.  Number of frames is 2.Tick called.  Elapsed real time is 0.068 seconds.  Number of frames is 3.Tick called.  Elapsed real time is 0.072 seconds.  Number of frames is 4.Tick called.  Elapsed real time is 0.103 seconds.  Number of frames is 5.The pattern still appears to hold.  Not sure why the calls to tick aren't more uniform, instead it gets called back to back virtually, then waits, then back to back, then waits.  So far, loss of one frame at 0.1 seconds.  Log at the bottom shows:Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 590.  So, it appears that I lose one frame every second.  What I don't understand is why the tick method basically gets called that way instead of uniformly across the board.  Is there a way to improve that?  And why now all of a sudden is this appearing to work correctly?  Even if there was initial lag after the sounds, wouldn't the first 10 seconds have shown that, say 50 FPS instead of 60, but then the next ten seconds would have shown correctly, since the lag should have been gone by then?

URL: https://forum.audiogames.net/post/413001/#p413001




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.  I removed the wait(5).  The pattern still appears to hold with tick calls:Tick called.  Elapsed real time is 0 seconds.Tick called.  Elapsed real time is 0.042 seconds.Tick called.  Elapsed real time is 0.046 seconds.Tick called.  Elapsed real time is 0.084 seconds.Tick called.  Elapsed real time is 0.086 seconds.Tick called.  Elapsed real time is 0.124 seconds.Tick called.  Elapsed real time is 0.127 seconds.Tick called.  Elapsed real time is 0.166 seconds.As you can see, one longer iteration, then a very short one, then a longer one.

URL: https://forum.audiogames.net/post/413001/#p413001




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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");server=1;rules.serving=true;user.x=CenterLine+1;user.y=UserServiceLine;opponent.x=CenterLine-1;opponent.y=OpponentServiceLine;//Load and set volume of the sound for the crowd.sound ambience;ambience.load("sounds/ambience.ogg");ambience.volume = -10;//Start the clock timer so that the clock actually starts at the beginning of the match.TRestart(C.time);//Start the timer for real time so that it corresponds with the clock timer for FPS debugging purposes.TRestart(RealTime);//Now initiate the loop:ambience.play_looped();while(true){CheckEvents();wait(5);}}Again, not that huge.  Unless I massively screwed something up, I still don't see how it's causing such a big loss of frame rate.  If you see something screwed up, by all means, let me know.

URL: https://forum.audiogames.net/post/412989/#p412989




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.

URL: https://forum.audiogames.net/post/413001/#p413001




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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");server=1;rules.serving=true;user.x=CenterLine+1;user.y=UserServiceLine;opponent.x=CenterLine-1;opponent.y=OpponentServiceLine;//Load and set volume of the sound for the crowd.sound ambience;ambience.load("sounds/ambience.ogg");ambience.volume = -10;//Start the clock timer so that the clock actually starts at the beginning of the match.TRestart(C.time);//Start the timer for real time so that it corresponds with the clock timer for FPS debugging purposes.TRestart(RealTime);//Now initiate the loop:ambience.play_looped();while(true){CheckEvents();wait(5);}}Again, not that huge.  Unless I massively screwed something up, I still don't see how it's causing such a big loss of frame rate.  If you see something screwed up, by all means, let me know.  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 immediately gets called again:Tick called.  Elapsed real time is 0.054 seconds.But the next iteration doesn't happen until 0.092.  Then 0.101, 0.139, 0.148.  The pattern appears to be one call at longer intervals, followed by a very close call after, then a longer time, then a call close:  So after 0.148, the longer call at 0.185, then the close at 0.195, then the longer time at 0.231, then close at 245, then long at 277...not sure what this means.  Keep in mind that for purposes of this test, I am doing nothing but sitting.  No player movement, no movement of the ball.

URL: https://forum.audiogames.net/post/412989/#p412989




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 to see what happens.A Delay of 25ms would be 40fps, but it shouldn't be making that big a difference, if any.I have this theory that BGT is more vulnerable to lag immediately after big RAM operations, which loading the sounds might count as. If most of the lag is happening in the first few frames, I would expect an extra delay before starting the loop to overcome it. And I'm not really convinced that this theory is correct, especially with all that RAM you have. Still, maybe a wait(1000), or a speak_wait or similar, between setting the ambience volume and restarting the timers would be enough for it to recover? Again, just a weak hypothesis based on my battles with lag a couple years ago, but if removing the wait(5) doesn't fix it, it might be worth a try.

URL: https://forum.audiogames.net/post/412997/#p412997




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 values for position and Booleans that cover rules.MustServe = true;rules.games=0;rules.serving=true;m1.load("sounds/power.ogg");server=1;rules.serving=true;user.x=CenterLine+1;user.y=UserServiceLine;opponent.x=CenterLine-1;opponent.y=OpponentServiceLine;//Load and set volume of the sound for the crowd.sound ambience;ambience.load("sounds/ambience.ogg");ambience.volume = -10;//Start the clock timer so that the clock actually starts at the beginning of the match.TRestart(C.time);//Start the timer for real time so that it corresponds with the clock timer for FPS debugging purposes.TRestart(RealTime);//Now initiate the loop:ambience.play_looped();while(true){CheckEvents();wait(5);}}Again, not that huge.  Unless I massively screwed something up, I still don't see how it's causing such a big loss of frame rate.  If you see something screwed up, by all means, let me know.

URL: https://forum.audiogames.net/post/412989/#p412989




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 values for position and Booleans that cover rules.MustServe = true;rules.games=0;rules.serving=true;m1.load("sounds/power.ogg");server=1;rules.serving=true;user.x=CenterLine+1;user.y=UserServiceLine;opponent.x=CenterLine-1;opponent.y=OpponentServiceLine;//Load and set volume of the sound for the crowd.sound ambience;ambience.load("sounds/ambience.ogg");ambience.volume = -10;//Start the clock timer so that the clock actually starts at the beginning of the match.TRestart(C.time);//Start the timer for real time so that it corresponds with the clock timer for FPS debugging purposes.TRestart(RealTime);//Now initiate the loop:ambience.play_looped();while(true){CheckEvents();wait(5);}}Again, not that huge.  Still don't see how it's causing such a big loss of frame rate.

URL: https://forum.audiogames.net/post/412989/#p412989




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 is better measured in seconds, what with being a loop that interacts with the user. Start_match makes sense over the others, just because of initialization and such, but I'm not sure why it would take 13 seconds, and presumably it's not still running while check events is being called.What I did to try and isolate lag was to have timers for that purpose, and log how much time elapses in each frame. Granted, this mostly just showed me that BGT freaked out immediately after messing with sounds or doing a big bout of garbage collection, but neither of those is to blame here, so it might prove more useful, if tedious.I'm not sure where to look, though, based on those profiler results. The profiler here gives more or less exactly the expected results. If start_match waits for a sound to play, or something like that, there's that explained, too. I guess I'd start by logging how much time passes between calls to c.tick, just to be sure that it's not something weird with the clock. From there, I'd try to divide it into something resembling half, then go whereever the data points.

URL: https://forum.audiogames.net/post/412865/#p412865




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 to 50.As far as players agreeing, I tried doing that initially, although I think I got it wrong.  I tried sending shot strength and direction , to the opponent when I struck the ball.  My thinking was that if the opponent has the same shot strength I do and direction, his machine would call the move method, and the ball should move the same way on both machines.  As I said before, math is immutable, so 2 + 2 will always be four.  So I figured that the formula of calculating the shot had the same values on both machines, there shouldn't be an issue.  If I have a shot strength of 5, and I hit the ball 45 degrees to the right, then if I pass shot strength to him and the direction, albeit mirroring it for sound pool, his machine should call the move method and move the same amount, given that shot strength is equal.  However, the ball was intermittently landing off by one coordinate between the two machines.  Always one coordinate, never more, and always in the direction that the ball was struck.  That might be because of the way I initially had movement running, solely based on timers.  I suspect that the timers were getting different results on both machines, and there were so many that it was causing issues.  I don't know whether changing it to the way I have it now, where it actually uses equations of physics and DT will fix that, but theoretically it should, since velocity isn't going to change based on timers.  I have removed all of the timers from my code with the exception of the one to measure DT, and the one for player movement, but that one only controls how fast the player walks, and that has nothing to do with the ball.  There are no ball timers in my code anymore.  But this frame rate issue is disturbing the hell out of me.  What the fuck is the problem?  There's absolutely nothing in my loop that should cause this level of drop.  The main game loop, with comments,  looks like this:void CheckEvents(){network_event Event;Event = Server.request();switch(Event.type){case 1:speaker.speak("Peer has connected to server from address "+Server.get_peer_address(Event.peer_id)+".");break;case 2://So that opponent position updates correctly.if(string_contains(Event.message, "__", 1) > -1){string[] position = string_split(Event.message, "__", true);opponent.x = string_to_number(position[0]);opponent.y = string_to_number(position[1]);env.update_listener_2d(opponent.x, opponent.y);env.play_2d("sounds/step.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends the shot info to the opponent so that the opponent's machine can calculate ball trajectory correctly.if(string_contains(Event.message, ",", 1) > -1){string[] NewShot = string_split(Event.message, ",", true);opponent.NewShot(string_to_number(NewShot[0]), true);}//Sends the coordinates of the ball to machine 2 when user of machine one is holding the ball before the ball is tossed.if(Event.message == "toss"){B.pos.x = opponent.x;B.pos.y = opponent.y;B.pos.z = 4;env.play_2d("sounds/toss.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends position of the ball to machine 2 at the time of serve along with relevant shot info so that machine 2 can calculate trajectory with the same values.if(string_contains(Event.message, "::", 1) > -1){string[] serveState = string_split(Event.message, "::", true);B.pos.x = string_to_number(serveState[0]);B.pos.y = string_to_number(serveState[1]);B.pos.z = string_to_number(serveState[2]);opponent.ShotStrength = string_to_number(serveState[3]);}break;case 3:speaker.speakInterrupt("Peer "+Server.get_peer_address(Event.peer_id)+" has disconnected.");break;}That's all of the network stuff.  Now this is just the main loop:C.tick();//Testing FPS.if(RealTime.elapsed>= 1)logtime();//This is to check to see that the player serves from the correct side of the court as per the rules of tennis.if(rules.serving){if(!rules.even(rules.p))rules.DC = true;if(rules.even(rules.p))rules.DC = false;}//To allow the move function to iterate.if(B.moving)B.move();//Same for tossing the ball.if(B.tossing)B.toss();//This makes sure that server never goes past 2, since only 2 players are involved.if(server > 2)server = 1;//Just a fuck load of key checks, a lot of which are in here right now for testing and debugging purposes.if(key_pressed(KEY_ESCAPE)){env.destroy_all();exit();}if(key_pressed(KEY_T))speaker.speak(deg + ", " + theta + ".");if(key_pressed(KEY_D))speaker.speak(rules.DC);if(key_pressed(KEY_C))speaker.speak(user.x + ", " + user.y + ". ");if(key_pr

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 to 50.As far as players agreeing, I tried doing that initially, although I think I got it wrong.  I tried sending shot strength and direction , to the opponent when I struck the ball.  My thinking was that if the opponent has the same shot strength I do and direction, his machine would call the move method, and the ball should move the same way on both machines.  As I said before, math is immutable, so 2 + 2 will always be four.  So I figured that the formula of calculating the shot had the same values on both machines, there shouldn't be an issue.  If I have a shot strength of 5, and I hit the ball 45 degrees to the right, then if I pass shot strength to him and the direction, albeit mirroring it for sound pool, his machine should call the move method and move the same amount, given that shot strength is equal.  However, the ball was intermittently landing off by one coordinate between the two machines.  Always one coordinate, never more, and always in the direction that the ball was struck.  That might be because of the way I initially had movement running, solely based on timers.  I suspect that the timers were getting different results on both machines, and there were so many that it was causing issues.  I don't know whether changing it to the way I have it now, where it actually uses equations of physics and DT will fix that, but theoretically it should, since velocity isn't going to change based on timers.  I have removed all of the timers from my code with the exception of the one to measure DT, and the one for player movement, but that one only controls how fast the player walks, and that has nothing to do with the ball.  There are no ball timers in my code anymore.  But this frame rate issue is disturbing the hell out of me.  What the fuck is the problem?  There's absolutely nothing in my loop that should cause this level of drop.  The main game loop, with comments,  looks like this:void CheckEvents(){network_event Event;Event = Server.request();switch(Event.type){case 1:speaker.speak("Peer has connected to server from address "+Server.get_peer_address(Event.peer_id)+".");break;case 2://So that opponent position updates correctly.if(string_contains(Event.message, "__", 1) > -1){string[] position = string_split(Event.message, "__", true);opponent.x = string_to_number(position[0]);opponent.y = string_to_number(position[1]);env.update_listener_2d(opponent.x, opponent.y);env.play_2d("sounds/step.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends the shot info to the opponent so that the opponent's machine can calculate ball trajectory correctly.if(string_contains(Event.message, ",", 1) > -1){string[] NewShot = string_split(Event.message, ",", true);opponent.NewShot(string_to_number(NewShot[0]), true);}//Sends the coordinates of the ball to machine 2 when user of machine one is holding the ball before the ball is tossed.if(Event.message == "toss"){B.pos.x = opponent.x;B.pos.y = opponent.y;B.pos.z = 4;env.play_2d("sounds/toss.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends position of the ball to machine 2 at the time of serve along with relevant shot info so that machine 2 can calculate trajectory with the same values.if(string_contains(Event.message, "::", 1) > -1){string[] serveState = string_split(Event.message, "::", true);B.pos.x = string_to_number(serveState[0]);B.pos.y = string_to_number(serveState[1]);B.pos.z = string_to_number(serveState[2]);opponent.ShotStrength = string_to_number(serveState[3]);}break;case 3:speaker.speakInterrupt("Peer "+Server.get_peer_address(Event.peer_id)+" has disconnected.");break;}That's all of the network stuff.  Now this is just the main loop:C.tick();//Testing FPS.if(RealTime.elapsed>= 1)logtime();//This is to check to see that the player serves from the correct side of the court as per the rules of tennis.if(rules.serving){if(!rules.even(rules.p))rules.DC = true;if(rules.even(rules.p))rules.DC = false;}//To allow the move function to iterate.if(B.moving)B.move();//Same for tossing the ball.if(B.tossing)B.toss();//This makes sure that server never goes past 2, since only 2 players are involved.if(server > 2)server = 1;//Just a fuck load of key checks, a lot of which are in here right now for testing and debugging purposes.if(key_pressed(KEY_ESCAPE)){env.destroy_all();exit();}if(key_pressed(KEY_T))speaker.speak(deg + ", " + theta + ".");if(key_pressed(KEY_D))speaker.speak(rules.DC);if(key_pressed(KEY_C))speaker.speak(user.x + ", " + user.y + ". ");if(key_pr

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 think I got it wrong.  I tried sending shot strength and direction , to the opponent when I struck the ball.  My thinking was that if the opponent has the same shot strength I do and direction, his machine would call the move method, and the ball should move the same way on both machines.  As I said before, math is immutable, so 2 + 2 will always be four.  So I figured that the formula of calculating the shot had the same values on both machines, there shouldn't be an issue.  If I have a shot strength of 5, and I hit the ball 45 degrees to the right, then if I pass shot strength to him and the direction, albeit mirroring it for sound pool, his machine should call the move method and move the same amount, given that shot strength is equal.  However, the ball was intermittently landing off by one coordinate between the two machines.  Always one coordinate, never more, and always in the direction that the ball was struck.  That might be because of the way I initially had movement running, solely based on timers.  I suspect that the timers were getting different results on both machines, and there were so many that it was causing issues.  I don't know whether changing it to the way I have it now, where it actually uses equations of physics and DT will fix that, but theoretically it should, since velocity isn't going to change based on timers.  I have removed all of the timers from my code with the exception of the one to measure DT, and the one for player movement, but that one only controls how fast the player walks, and that has nothing to do with the ball.  There are no ball timers in my code anymore.  But this frame rate issue is disturbing the hell out of me.  What the fuck is the problem?  There's absolutely nothing in my loop that should cause this level of drop.  The main game loop, with comments,  looks like this:void CheckEvents(){network_event Event;Event = Server.request();switch(Event.type){case 1:speaker.speak("Peer has connected to server from address "+Server.get_peer_address(Event.peer_id)+".");break;case 2://So that opponent position updates correctly.if(string_contains(Event.message, "__", 1) > -1){string[] position = string_split(Event.message, "__", true);opponent.x = string_to_number(position[0]);opponent.y = string_to_number(position[1]);env.update_listener_2d(opponent.x, opponent.y);env.play_2d("sounds/step.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends the shot info to the opponent so that the opponent's machine can calculate ball trajectory correctly.if(string_contains(Event.message, ",", 1) > -1){string[] NewShot = string_split(Event.message, ",", true);opponent.NewShot(string_to_number(NewShot[0]), true);}//Sends the coordinates of the ball to machine 2 when user of machine one is holding the ball before the ball is tossed.if(Event.message == "toss"){B.pos.x = opponent.x;B.pos.y = opponent.y;B.pos.z = 4;env.play_2d("sounds/toss.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends position of the ball to machine 2 at the time of serve along with relevant shot info so that machine 2 can calculate trajectory with the same values.if(string_contains(Event.message, "::", 1) > -1){string[] serveState = string_split(Event.message, "::", true);B.pos.x = string_to_number(serveState[0]);B.pos.y = string_to_number(serveState[1]);B.pos.z = string_to_number(serveState[2]);opponent.ShotStrength = string_to_number(serveState[3]);}break;case 3:speaker.speakInterrupt("Peer "+Server.get_peer_address(Event.peer_id)+" has disconnected.");break;}That's all of the network stuff.  Now this is just the main loop:C.tick();//Testing FPS.if(RealTime.elapsed>= 1)logtime();//This is to check to see that the player serves from the correct side of the court as per the rules of tennis.if(rules.serving){if(!rules.even(rules.p))rules.DC = true;if(rules.even(rules.p))rules.DC = false;}//To allow the move function to iterate.if(B.moving)B.move();//Same for tossing the ball.if(B.tossing)B.toss();//This makes sure that server never goes past 2, since only 2 players are involved.if(server > 2)server = 1;//Just a fuck load of key checks, a lot of which are in here right now for testing and debugging purposes.if(key_pressed(KEY_ESCAPE)){env.destroy_all();exit();}if(key_pressed(KEY_T))speaker.speak(deg + ", " + theta + ".");if(key_pressed(KEY_D))speaker.speak(rules.DC);if(key_pressed(KEY_C))speaker.speak(user.x + ", " + user.y + ". ");if(key_pressed(KEY_O))speaker.speak(opponent.x + ", " + opponent.y + ". 

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 think I got it wrong.  I tried sending shot strength and direction , to the opponent when I struck the ball.  My thinking was that if the opponent has the same shot strength I do and direction, his machine would call the move method, and the ball should move the same way on both machines.  As I said before, math is immutable, so 2 + 2 will always be four.  So I figured that the formula of calculating the shot had the same values on both machines, there shouldn't be an issue.  If I have a shot strength of 5, and I hit the ball 45 degrees to the right, then if I pass shot strength to him and the direction, albeit mirroring it for sound pool, his machine should call the move method and move the same amount, given that shot strength is equal.  However, the ball was intermittently landing off by one coordinate between the two machines.  Always one coordinate, never more, and always in the direction that the ball was struck.  That might be because of the way I initially had movement running, solely based on timers.  I suspect that the timers were getting different results on both machines, and there were so many that it was causing issues.  I don't know whether changing it to the way I have it now, where it actually uses equations of physics and DT will fix that, but theoretically it should, since velocity isn't going to change based on timers.  I have removed all of the timers from my code with the exception of the one to measure DT, and the one for player movement, but that one only controls how fast the player walks, and that has nothing to do with the ball.  There are no ball timers in my code anymore.  But this frame rate issue is disturbing the hell out of me.  What the fuck is the problem?  There's absolutely nothing in my loop that should cause this level of drop.  The main game loop, with comments,  looks like this:void CheckEvents(){network_event Event;Event = Server.request();switch(Event.type){case 1:speaker.speak("Peer has connected to server from address "+Server.get_peer_address(Event.peer_id)+".");break;case 2://So that opponent position updates correctly.if(string_contains(Event.message, "__", 1) > -1){string[] position = string_split(Event.message, "__", true);opponent.x = string_to_number(position[0]);opponent.y = string_to_number(position[1]);env.update_listener_2d(opponent.x, opponent.y);env.play_2d("sounds/step.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends the shot info to the opponent so that the opponent's machine can calculate ball trajectory correctly.if(string_contains(Event.message, ",", 1) > -1){string[] NewShot = string_split(Event.message, ",", true);opponent.NewShot(string_to_number(NewShot[0]), true);}//Sends the coordinates of the ball to machine 2 when user of machine one is holding the ball before the ball is tossed.if(Event.message == "toss"){B.pos.x = opponent.x;B.pos.y = opponent.y;B.pos.z = 4;env.play_2d("sounds/toss.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends position of the ball to machine 2 at the time of serve along with relevant shot info so that machine 2 can calculate trajectory with the same values.if(string_contains(Event.message, "::", 1) > -1){string[] serveState = string_split(Event.message, "::", true);B.pos.x = string_to_number(serveState[0]);B.pos.y = string_to_number(serveState[1]);B.pos.z = string_to_number(serveState[2]);opponent.ShotStrength = string_to_number(serveState[3]);}break;case 3:speaker.speakInterrupt("Peer "+Server.get_peer_address(Event.peer_id)+" has disconnected.");break;}That's all of the network stuff.  Now this is just the main loop:C.tick();//Testing FPS.if(RealTime.elapsed>= 1)logtime();//This is to check to see that the player serves from the correct side of the court as per the rules of tennis.if(rules.serving){if(!rules.even(rules.p))rules.DC = true;if(rules.even(rules.p))rules.DC = false;}//To allow the move function to iterate.if(B.moving)B.move();//Same for tossing the ball.if(B.tossing)B.toss();//This makes sure that server never goes past 2, since only 2 players are involved.if(server > 2)server = 1;//Just a fuck load of key checks, a lot of which are in here right now for testing and debugging purposes.if(key_pressed(KEY_ESCAPE)){env.destroy_all();exit();}if(key_pressed(KEY_T))speaker.speak(deg + ", " + theta + ".");if(key_pressed(KEY_D))speaker.speak(rules.DC);if(key_pressed(KEY_C))speaker.speak(user.x + ", " + user.y + ". ");if(key_pressed(KEY_O))speaker.speak(opponent.x + ", " + opponent.y + ". 

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 think I got it wrong.  I tried sending shot strength and direction , to the opponent when I struck the ball.  My thinking was that if the opponent has the same shot strength I do and direction, his machine would call the move method, and the ball should move the same way on both machines.  As I said before, math is immutable, so 2 + 2 will always be four.  So I figured that the formula of calculating the shot had the same values on both machines, there shouldn't be an issue.  If I have a shot strength of 5, and I hit the ball 45 degrees to the right, then if I pass shot strength to him and the direction, albeit mirroring it for sound pool, his machine should call the move method and move the same amount, given that shot strength is equal.  However, the ball was intermittently landing off by one coordinate between the two machines.  Always one coordinate, never more, and always in the direction that the ball was struck.  That might be because of the way I initially had movement running, solely based on timers.  I suspect that the timers were getting different results on both machines, and there were so many that it was causing issues.  I don't know whether changing it to the way I have it now, where it actually uses equations of physics and DT will fix that, but theoretically it should, since velocity isn't going to change based on timers.  I have removed all of the timers from my code with the exception of the one to measure DT, and the one for player movement, but that one only controls how fast the player walks, and that has nothing to do with the ball.  There are no ball timers in my code anymore.  But this frame rate issue is disturbing the hell out of me.  What the fuck is the problem?  There's absolutely nothing in my loop that should cause this level of drop.  The main game loop, with comments,  looks like this:void CheckEvents(){network_event Event;Event = Server.request();switch(Event.type){case 1:speaker.speak("Peer has connected to server from address "+Server.get_peer_address(Event.peer_id)+".");break;case 2://So that opponent position updates correctly.if(string_contains(Event.message, "__", 1) > -1){string[] position = string_split(Event.message, "__", true);opponent.x = string_to_number(position[0]);opponent.y = string_to_number(position[1]);env.update_listener_2d(opponent.x, opponent.y);env.play_2d("sounds/step.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends the shot info to the opponent so that the opponent's machine can calculate ball trajectory correctly.if(string_contains(Event.message, ",", 1) > -1){string[] NewShot = string_split(Event.message, ",", true);opponent.NewShot(string_to_number(NewShot[0]), true);}//Sends the coordinates of the ball to machine 2 when user of machine one is holding the ball before the ball is tossed.if(Event.message == "toss"){B.pos.x = opponent.x;B.pos.y = opponent.y;B.pos.z = 4;env.play_2d("sounds/toss.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends position of the ball to machine 2 at the time of serve along with relevant shot info so that machine 2 can calculate trajectory with the same values.if(string_contains(Event.message, "::", 1) > -1){string[] serveState = string_split(Event.message, "::", true);B.pos.x = string_to_number(serveState[0]);B.pos.y = string_to_number(serveState[1]);B.pos.z = string_to_number(serveState[2]);opponent.ShotStrength = string_to_number(serveState[3]);}break;case 3:speaker.speakInterrupt("Peer "+Server.get_peer_address(Event.peer_id)+" has disconnected.");break;}That's all of the network stuff.  Now this is just the main loop:C.tick();//Testing FPS.if(RealTime.elapsed>= 1)logtime();//This is to check to see that the player serves from the correct side of the court as per the rules of tennis.if(rules.serving){if(!rules.even(rules.p))rules.DC = true;if(rules.even(rules.p))rules.DC = false;}//To allow the move function to iterate.if(B.moving)B.move();//Same for tossing the ball.if(B.tossing)B.toss();//This makes sure that server never goes past 2, since only 2 players are involved.if(server > 2)server = 1;//Just a fuck load of key checks, a lot of which are in here right now for testing and debugging purposes.if(key_pressed(KEY_ESCAPE)){env.destroy_all();exit();}if(key_pressed(KEY_T))speaker.speak(deg + ", " + theta + ".");if(key_pressed(KEY_D))speaker.speak(rules.DC);if(key_pressed(KEY_C))speaker.speak(user.x + ", " + user.y + ". ");if(key_pressed(KEY_O))speaker.speak(opponent.x + ", " + opponent.y + ". 

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 think I got it wrong.  I tried sending shot strength and direction , to the opponent when I struck the ball.  My thinking was that if the opponent has the same shot strength I do and direction, his machine would call the move method, and the ball should move the same way on both machines.  As I said before, math is immutable, so 2 + 2 will always be four.  So I figured that the formula of calculating the shot had the same values on both machines, there shouldn't be an issue.  If I have a shot strength of 5, and I hit the ball 45 degrees to the right, then if I pass shot strength to him and the direction, albeit mirroring it for sound pool, his machine should call the move method and move the same amount, given that shot strength is equal.  However, the ball was intermittently landing off by one coordinate between the two machines.  Always one coordinate, never more, and always in the direction that the ball was struck.  That might be because of the way I initially had movement running, solely based on timers.  I suspect that the timers were getting different results on both machines, and there were so many that it was causing issues.  I don't know whether changing it to the way I have it now, where it actually uses equations of physics and DT will fix that, but theoretically it should, since velocity isn't going to change based on timers.  I have removed all of the timers from my code with the exception of the one to measure DT, and the one for player movement, but that one only controls how fast the player walks, and that has nothing to do with the ball.  There are no ball timers in my code anymore.  But this frame rate issue is disturbing the hell out of me.  What the fuck is the problem?  There's absolutely nothing in my loop that should cause this level of drop.  The main game loop, with comments,  looks like this:void CheckEvents(){network_event Event;Event = Server.request();switch(Event.type){case 1:speaker.speak("Peer has connected to server from address "+Server.get_peer_address(Event.peer_id)+".");break;case 2://So that opponent position updates correctly.if(string_contains(Event.message, "__", 1) > -1){string[] position = string_split(Event.message, "__", true);opponent.x = string_to_number(position[0]);opponent.y = string_to_number(position[1]);env.update_listener_2d(opponent.x, opponent.y);env.play_2d("sounds/step.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends the shot info to the opponent so that the opponent's machine can calculate ball trajectory correctly.if(string_contains(Event.message, ",", 1) > -1){string[] NewShot = string_split(Event.message, ",", true);opponent.NewShot(string_to_number(NewShot[0]), true);}//Sends the coordinates of the ball to machine 2 when user of machine one is holding the ball before the ball is tossed.if(Event.message == "toss"){B.pos.x = opponent.x;B.pos.y = opponent.y;B.pos.z = 4;env.play_2d("sounds/toss.ogg", user.x, user.y, opponent.x, opponent.y, false);}//Sends position of the ball to machine 2 at the time of serve along with relevant shot info so that machine 2 can calculate trajectory with the same values.if(string_contains(Event.message, "::", 1) > -1){string[] serveState = string_split(Event.message, "::", true);B.pos.x = string_to_number(serveState[0]);B.pos.y = string_to_number(serveState[1]);B.pos.z = string_to_number(serveState[2]);opponent.ShotStrength = string_to_number(serveState[3]);}break;case 3:speaker.speakInterrupt("Peer "+Server.get_peer_address(Event.peer_id)+" has disconnected.");break;}That's all of the network stuff.  Now this is just the main loop:C.tick();//Testing FPS.if(RealTime.elapsed>= 1)logtime();//This is to check to see that the player serves from the correct side of the court as per the rules of tennis.if(rules.serving){if(!rules.even(rules.p))rules.DC = true;if(rules.even(rules.p))rules.DC = false;}//To allow the move function to iterate.if(B.moving)B.move();//Same for tossing the ball.if(B.tossing)B.toss();//This makes sure that server never goes past 2, since only 2 players are involved.if(server > 2)server = 1;//Just a fuck load of key checks, a lot of which are in here right now for testing and debugging purposes.if(key_pressed(KEY_ESCAPE)){env.destroy_all();exit();}if(key_pressed(KEY_T))speaker.speak(deg + ", " + theta + ".");if(key_pressed(KEY_D))speaker.speak(rules.DC);if(key_pressed(KEY_C))speaker.speak(user.x + ", " + user.y + ". ");if(key_pressed(KEY_O))speaker.speak(opponent.x + ", " + opponent.y + ". 

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, starting from the same conditions. That's what the clock is for. The trick is making sure the conditions are the same when player actions are performed. In this case, it's probably sufficient for the players to agree on the ball's position and velocity when one of them acts.

URL: https://forum.audiogames.net/post/412744/#p412744




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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, but there's no graphical issue here.  So what the hell is bogging down my machine to the level that it drops framerate from 60 to 50?  I would think whatever is doing that would have to be massively resource-intensive.  Nothing running on my PC at the moment that should be taking up enough resources to be an issue.  Next question.  If I can't synchronize number of frames during network events, then how would I proceed to keep machines synchronized?  There's got to be some way to do it, since I know for a fact that online games do manage to accomplish it.  If I play my friend in a game of Madden, for example, the ball doesn't land at different places on the different machines.  If I throw the ball, and it lands incomplete on my opponent's 10 yard line, then my opponent sees the ball land incomplete on his 10 yard line, not his 20.  That means there has to be some way to accomplish this.NOTE:  I dropped my framerate to 50 in my game ccode to see if it would run well since it was running at 50 anyway, and this is now what I see:Amount of real time that has passed is 10.023seconds.  DT is 0.02.  Number of frames that have passed is 435.Amount of real time that has passed is 10.038seconds.  DT is 0.02.  Number of frames that have passed is 436.Amount of real time that has passed is 10.037seconds.  DT is 0.02.  Number of frames that have passed is 436.What the hell?  It ran at 50 when at 60, so I figured it'd be able to handle 50 no problem.  Now it's running at 43?  I know for a fact this machine isn't that slow.  This is really beginning to piss me the fuck off.  And I have no idea where to begin looking to try to fix the issue.NOTE 2:  Just as I suspected, when I googled frame loss, everything I see says that what tends to cause drops of frame rate, or affect frame rate the most, is graphics.  There are no fucking graphics here.  None.  Computer specs:Windows Version:  10.0.17134Processor Intel(R) Core(TM) i7-4980HQ CPU @ 2.8 Ghz, 4 core(s), 8 logical processors16 GB ramWith no graphics to worry about, that should be more than enough to not have this fucking issue.NOTE 3:  As a test, I went into task manager and killed a bunch of unnecessary running processes to see whether freeing more RAM would change things.  Subsequent test at 50 FPS shows:Amount of real time that has passed is 10.024seconds.  DT is 0.02.  Number of frames that have passed is 435.Amount of real time that has passed is 10.01seconds.  DT is 0.02.  Number of frames that have passed is 435.As you can see, nothing changed.  So what the bloody fuck?

URL: https://forum.audiogames.net/post/412725/#p412725




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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, but there's no graphical issue here.  So what the hell is bogging down my machine to the level that it drops framerate from 60 to 50?  I would think whatever is doing that would have to be massively resource-intensive.  Nothing running on my PC at the moment that should be taking up enough resources to be an issue.  Next question.  If I can't synchronize number of frames during network events, then how would I proceed to keep machines synchronized?  There's got to be some way to do it, since I know for a fact that online games do manage to accomplish it.  If I play my friend in a game of Madden, for example, the ball doesn't land at different places on the different machines.  If I throw the ball, and it lands incomplete on my opponent's 10 yard line, then my opponent sees the ball land incomplete on his 10 yard line, not his 20.  That means there has to be some way to accomplish this.NOTE:  I dropped my framerate to 50 in my game ccode to see if it would run well since it was running at 50 anyway, and this is now what I see:Amount of real time that has passed is 10.023seconds.  DT is 0.02.  Number of frames that have passed is 435.Amount of real time that has passed is 10.038seconds.  DT is 0.02.  Number of frames that have passed is 436.Amount of real time that has passed is 10.037seconds.  DT is 0.02.  Number of frames that have passed is 436.What the hell?  It ran at 50 when at 60, so I figured it'd be able to handle 50 no problem.  Now it's running at 43?  I know for a fact this machine isn't that slow.  This is really beginning to piss me the fuck off.  And I have no idea where to begin looking to try to fix the issue.NOTE 2:  Just as I suspected, when I googled frame loss, everything I see says that what tends to cause drops of frame rate, or affect frame rate the most, is graphics.  There are no fucking graphics here.  None.  Computer specs:Windows Version:  10.0.17134Processor Intel(R) Core(TM) i7-4980HQ CPU @ 2.8 Ghz, 4 core(s), 8 logical processors16 GB ramWith no graphics to worry about, that should be more than enough to not have this fucking issue.

URL: https://forum.audiogames.net/post/412725/#p412725




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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, but there's no graphical issue here.  So what the hell is bogging down my machine to the level that it drops framerate from 60 to 50?  I would think whatever is doing that would have to be massively resource-intensive.  Nothing running on my PC at the moment that should be taking up enough resources to be an issue.  Next question.  If I can't synchronize number of frames during network events, then how would I proceed to keep machines synchronized?  There's got to be some way to do it, since I know for a fact that online games do manage to accomplish it.  If I play my friend in a game of Madden, for example, the ball doesn't land at different places on the different machines.  If I throw the ball, and it lands incomplete on my opponent's 10 yard line, then my opponent sees the ball land incomplete on his 10 yard line, not his 20.  That means there has to be some way to accomplish this.NOTE:  I dropped my framerate to 50 in my game ccode to see if it would run well since it was running at 50 anyway, and this is now what I see:Amount of real time that has passed is 10.023seconds.  DT is 0.02.  Number of frames that have passed is 435.Amount of real time that has passed is 10.038seconds.  DT is 0.02.  Number of frames that have passed is 436.Amount of real time that has passed is 10.037seconds.  DT is 0.02.  Number of frames that have passed is 436.What the hell?  It ran at 50 when at 60, so I figured it'd be able to handle 50 no problem.  Now it's running at 43?  I know for a fact this machine isn't that slow.  This is really beginning to piss me the fuck off.  And I have no idea where to begin looking to try to fix the issue.NOTE 2:  Just as I suspected, when I googled frame loss, everything I see says that what tends to cause drops of frame rate, or affect frame rate the most, is graphics.  There are no fucking graphics here.  None.  Computer specs:Windows Version:  10.0.17134Processor Intel(R) Core(TM) i7-4980HQ CPU @ 2.8 Ghz16 GB ramWith no graphics to worry about, that should be more than enough to not have this fucking issue.

URL: https://forum.audiogames.net/post/412725/#p412725




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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, but there's no graphical issue here.  So what the hell is bogging down my machine to the level that it drops framerate from 60 to 50?  I would think whatever is doing that would have to be massively resource-intensive.  Nothing running on my PC at the moment that should be taking up enough resources to be an issue.  Next question.  If I can't synchronize number of frames during network events, then how would I proceed to keep machines synchronized?  There's got to be some way to do it, since I know for a fact that online games do manage to accomplish it.  If I play my friend in a game of Madden, for example, the ball doesn't land at different places on the different machines.  If I throw the ball, and it lands incomplete on my opponent's 10 yard line, then my opponent sees the ball land incomplete on his 10 yard line, not his 20.  That means there has to be some way to accomplish this.NOTE:  I dropped my framerate to 50 in my game ccode to see if it would run well since it was running at 50 anyway, and this is now what I see:Amount of real time that has passed is 10.023seconds.  DT is 0.02.  Number of frames that have passed is 435.Amount of real time that has passed is 10.038seconds.  DT is 0.02.  Number of frames that have passed is 436.Amount of real time that has passed is 10.037seconds.  DT is 0.02.  Number of frames that have passed is 436.What the hell?  It ran at 50 when at 60, so I figured it'd be able to handle 50 no problem.  Now it's running at 43?  I know for a fact this machine isn't that slow.  This is really beginning to piss me the fuck off.  And I have no idea where to begin looking to try to fix the issue.

URL: https://forum.audiogames.net/post/412725/#p412725




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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, but there's no graphical issue here.  So what the hell is bogging down my machine to the level that it drops framerate from 60 to 50?  I would think whatever is doing that would have to be massively resource-intensive.Next question.  If I can't synchronize number of frames during network events, then how would I proceed to keep machines synchronized?  There's got to be some way to do it, since I know for a fact that online games do manage to accomplish it.  If I play my friend in a game of Madden, for example, the ball doesn't land at different places on the different machines.  If I throw the ball, and it lands incomplete on my opponent's 10 yard line, then my opponent sees the ball land incomplete on his 10 yard line, not his 20.  That means there has to be some way to accomplish this.NOTE:  I dropped my framerate to 50 in my game ccode to see if it would run well since it was running at 50 anyway, and this is now what I see:Amount of real time that has passed is 10.023seconds.  DT is 0.02.  Number of frames that have passed is 435.Amount of real time that has passed is 10.038seconds.  DT is 0.02.  Number of frames that have passed is 436.Amount of real time that has passed is 10.037seconds.  DT is 0.02.  Number of frames that have passed is 436.What the hell?  It ran at 50 when at 60, so I figured it'd be able to handle 50 no problem.  Now it's running at 43?  I know for a fact this machine isn't that slow.  This is really beginning to piss me the fuck off.  And I have no idea where to begin looking to try to fix the issue.

URL: https://forum.audiogames.net/post/412725/#p412725




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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, but there's no graphical issue here.  So what the hell is bogging down my machine to the level that it drops framerate from 60 to 50?  I would think whatever is doing that would have to be massively resource-intensive.Next question.  If I can't synchronize number of frames during network events, then how would I proceed to keep machines synchronized?  There's got to be some way to do it, since I know for a fact that online games do manage to accomplish it.  If I play my friend in a game of Madden, for example, the ball doesn't land at different places on the different machines.  If I throw the ball, and it lands incomplete on my opponent's 10 yard line, then my opponent sees the ball land incomplete on his 10 yard line, not his 20.  That means there has to be some way to accomplish this.

URL: https://forum.audiogames.net/post/412725/#p412725




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 shenanigans causing enough lag to reduce the effective framerate to 50, but I am just as lost as to where the extra frames come from.If the wait function rounds to the nearest millisecond, or truncates anything past the decimal, then it's going to give different results than we'd expect. However, your first test was close enough that I'm not sure how much that could explain it.One thing I found when I made the clock class is that there was consistently a millisecond of difference between what was reported by timers and what was sent to wait, even when there were no other sources of lag. Because of this, the tick method tries to compensate, which could account for some of the discrepency.I copied the code you provided and ran it, and I got similar results with 2-10 extra frames. Thinking it might be a rounding issue, I tried it again at 50fps (dt = 0.02). There were a few huge lag spikes in the log (10.1 to 10.6 seconds of realtime, instead of 10 + a couple centiseconds), presumably because I was reading the previous log at the time to try and get an idea of where the discrepency was coming from. The results never went higher than 502, but sometimes got as low as 495. The low values can be explained by lag. I can account for one of the extra frames due to the tick coming before the log, but I'm less sure about the other. I should also mention that 502 frames was the most common result, with all the others being 495-499, presumably due to random lag. I should also note that the amount of lag that made it into the realtime results has no correlation with the frame count, since the offending lag has to come in the final frame to show up in the realtime result.Even if the 1ms compensation and truncating aren't to blame for the high results for 60fps, it's worth noting that there will be rounding errors regardless, because floating point arithmetic is imprecise for most fractions. It still seems odd that this would result in extra frames, rather than fewer.Simply put, without being able to rely on all players having predictable amounts of lag, there will always be some small discrepencies. Given the same initial state, you'll have the same final state, even if one machine takes a fraction of a second longer to get there. The problem comes when those discrepencies add up, and it becomes necessary to push the players back toward synchronicity. Sending the frame count along with player input might help, but it isn't going to solve the problem by itself.The discrepencies you're finding in frame count, though, are mostly due to things beyond our control, like floating point limitations and whatever Windows is doing and the state of the hardware, etc. There will be lag over the network, too, which is probably going to be far more troublesome.I've never had a solid test case for the most common solutions to the lag-induced client discrepency issue, so I can't promise what the best way to deal with it is. If you force the clients to agree after every network event, there's a good chance this will result in jank and other such glitches. If the lag is extreme enough, that might happen anyway (I mean, it happens in mainstream multiplayer games), but can probably be minimized.[edit] I think I've figured out the other extra frame in my 50fps test. The realtime timer restarts before the loop, but the clock's timer does not, so any delay between the creation of the clock and starting the loop counts toward the first frame. So 502 frames in 10seconds makes sense. But you really shouldn't be getting more than 2 extra frames at any framerate, so I think it's probably mostly floating point imprecision for certain numbers. If it's waiting 16ms instead of 16.6[...], the maximum frame count in 10s should be 627. The effective dt for 610 is 16.3934ms, but since we have established two frames due to the timers doing different things, it's more like 1/608 = 16.447ms. I'm not sure what causes that, but given how frustrating lag can be when playing, and how few the extra frames are (not even up to 61fps), it's probably an error on the side of convenience, what with not effecting the need to account for lag either way.[/edit]

URL: https://forum.audiogames.net/post/412580/#p412580




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 shenanigans causing enough lag to reduce the effective framerate to 50, but I am just as lost as to where the extra frames come from.If the wait function rounds to the nearest millisecond, or truncates anything past the decimal, then it's going to give different results than we'd expect. However, your first test was close enough that I'm not sure how much that could explain it.One thing I found when I made the clock class is that there was consistently a millisecond of difference between what was reported by timers and what was sent to wait, even when there were no other sources of lag. Because of this, the tick method tries to compensate, which could account for some of the discrepency.I copied the code you provided and ran it, and I got similar results with 2-10 extra frames. Thinking it might be a rounding issue, I tried it again at 50fps (dt = 0.02). There were a few huge lag spikes in the log (10.1 to 10.6 seconds of realtime, instead of 10 + a couple centiseconds), presumably because I was reading the previous log at the time to try and get an idea of where the discrepency was coming from. The results never went higher than 502, but sometimes got as low as 495. The low values can be explained by lag. I can account for one of the extra frames due to the tick coming before the log, but I'm less sure about the other. I should also mention that 502 frames was the most common result, with all the others being 495-499, presumably due to random lag. I should also note that the amount of lag that made it into the realtime results has no correlation with the frame count, since the offending lag has to come in the final frame to show up in the realtime result.Even if the 1ms compensation and truncating aren't to blame for the high results for 60fps, it's worth noting that there will be rounding errors regardless, because floating point arithmetic is imprecise for most fractions. It still seems odd that this would result in extra frames, rather than fewer.Simply put, without being able to rely on all players having predictable amounts of lag, there will always be some small discrepencies. Given the same initial state, you'll have the same final state, even if one machine takes a fraction of a second longer to get there. The problem comes when those discrepencies add up, and it becomes necessary to push the players back toward synchronicity. Sending the frame count along with player input might help, but it isn't going to solve the problem by itself.The discrepencies you're finding in frame count, though, are mostly due to things beyond our control, like floating point limitations and whatever Windows is doing and the state of the hardware, etc. There will be lag over the network, too, which is probably going to be far more troublesome.I've never had a solid test case for the most common solutions to the lag-induced client discrepency issue, so I can't promise what the best way to deal with it is. If you force the clients to agree after every network event, there's a good chance this will result in jank and other such glitches. If the lag is extreme enough, that might happen anyway (I mean, it happens in mainstream multiplayer games), but can probably be minimized.[edit] I think I've figured out the other extra frame in my 50fps test. The realtime timer restarts before the loop, but the clock's timer does not, so any delay between the creation of the clock and starting the loop counts toward the first frame. So 502 frames in 10seconds makes sense. But you really shouldn't be getting more than 2 extra frames at any framerate, so I think it's probably mostly floating point imprecision for certain numbers. [/edit]

URL: https://forum.audiogames.net/post/412580/#p412580




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 shenanigans causing enough lag to reduce the effective framerate to 50, but I am just as lost as to where the extra frames come from.If the wait function rounds to the nearest millisecond, or truncates anything past the decimal, then it's going to give different results than we'd expect. However, your first test was close enough that I'm not sure how much that could explain it.One thing I found when I made the clock class is that there was consistently a millisecond of difference between what was reported by timers and what was sent to wait, even when there were no other sources of lag. Because of this, the tick method tries to compensate, which could account for some of the discrepency.I copied the code you provided and ran it, and I got similar results with 2-10 extra frames. Thinking it might be a rounding issue, I tried it again at 50fps (dt = 0.02). There were a few huge lag spikes in the log (10.1 to 10.6 seconds of realtime, instead of 10 + a couple centiseconds), presumably because I was reading the previous log at the time to try and get an idea of where the discrepency was coming from. The results never went higher than 502, but sometimes got as low as 495. The low values can be explained by lag. I can account for one of the extra frames due to the tick coming before the log, but I'm less sure about the other. I should also mention that 502 frames was the most common result, with all the others being 495-499, presumably due to random lag. I should also note that the amount of lag that made it into the realtime results has no correlation with the frame count, since the offending lag has to come in the final frame to show up in the realtime result.Even if the 1ms compensation and truncating aren't to blame for the high results for 60fps, it's worth noting that there will be rounding errors regardless, because floating point arithmetic is imprecise for most fractions. It still seems odd that this would result in extra frames, rather than fewer.Simply put, without being able to rely on all players having predictable amounts of lag, there will always be some small discrepencies. Given the same initial state, you'll have the same final state, even if one machine takes a fraction of a second longer to get there. The problem comes when those discrepencies add up, and it becomes necessary to push the players back toward synchronicity. Sending the frame count along with player input might help, but it isn't going to solve the problem by itself.The discrepencies you're finding in frame count, though, are mostly due to things beyond our control, like floating point limitations and whatever Windows is doing and the state of the hardware, etc. There will be lag over the network, too, which is probably going to be far more troublesome.I've never had a solid test case for the most common solutions to the lag-induced client discrepency issue, so I can't promise what the best way to deal with it is. If you force the clients to agree after every network event, there's a good chance this will result in jank and other such glitches. If the lag is extreme enough, that might happen anyway (I mean, it happens in mainstream multiplayer games), but can probably be minimized.

URL: https://forum.audiogames.net/post/412580/#p412580




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 DT = 0.001*C.delay;Error: 'delay' is not a member of 'clock'But actually, it is most assuredly a member of clock.  However, if I add a function to return DT, it works fine:double SetFrameRate(){DT = 0.001*C.delay;return DT;}And it works fine.  What the hell?  That makes no sense.  In an attempt to start troubleshooting, I created a very simple BGT script to test framerate, hence the related error above.  Code is:#include "clock.bgt"#include "voice.bgt"#include "logger.bgt"bool testing = false;logger log;Voice speaker;timer RT;clock C(60);double DT;void main(){init();RT.pause();show_game_window("");RT.restart();testing = true;while(true){C.tick();if(RT.elapsed>= 1){log.write("TimeTest.log", true);log.add_entry("Amount of real time that has passed is " + (RT.elapsed/1000.0) + "seconds.  DT is " + DT + ".  Number of frames that have passed is " + C.frame + ".");C.frame = 0;RT.restart();}//key presses just to see current values.if(key_pressed(KEY_E))speaker.speak(RT.elapsed);if(key_pressed(KEY_F))speaker.speak(C.frame);if(key_pressed(KEY_ESCAPE)){testing = false;exit();}}}//Function to return DT, since I get that error if I don't.double init(){DT = 0.001*C.delay;return DT;}log shows:Amount of real time that has passed is 10.001seconds.  DT is 0.016.  Number of frames that have passed is 610.Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 604.Ok, so that presents a few questions.  First, how is the number of frames at 610 after 10.001 seconds?  How in the hell did ten frames pass in a thousandth of a second?  Then, even weirder, we have this:Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.The hell?  That's more time than 10.001 is, yet there are fewer frames.  That makes no sense at all.  Then, even stranger, on the next line we have the exact same amount of time, down to the thousandth of a second, and still fewer frames, at 604.  Then, even less time passes above that, but more frames:Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.What the fuck?  10.029 yields first 606 frames.  Then on the very next iteration of exactly 10.029 we get 604 frames, while here, 10.012, less time, yields 608, and the kicker, 10.001, the least amount of time of all of them, gives 610?  I don't get this at all.  What in bloody hell is going on?  NOTE:  Interestingly, if I add C.update() to the code just below C.tick(), it cuts the amount of frames in half for some reason, so around 300 for 10 seconds.  So not sure how to use update correctly, since cutting number of frames is not what I want to accomplish.UPDATE:  Given what I found out about the update function cutting the frame rate in half, I removed the update() calls from everywhere in my game code, and now log shows:Amount of real time that has passed is 10.01seconds.  DT is 0.016.  Number of frames that have passed is 514.Amount of real time that has passed is 10.003seconds.  DT is 0.016.  Number of frames that have passed is 513.Amount of real time that has passed is 10.002seconds.  DT is 0.016.  Number of frames that have passed is 513.So still not where it should be.

URL: https://forum.audiogames.net/post/412475/#p412475




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 DT = 0.001*C.delay;Error: 'delay' is not a member of 'clock'But actually, it is most assuredly a member of clock.  However, if I add a function to return DT, it works fine:double SetFrameRate(){DT = 0.001*C.delay;return DT;}And it works fine.  What the hell?  That makes no sense.  In an attempt to start troubleshooting, I created a very simple BGT script to test framerate, hence the related error above.  Code is:#include "clock.bgt"#include "voice.bgt"#include "logger.bgt"bool testing = false;logger log;Voice speaker;timer RT;clock C(60);double DT;void main(){init();RT.pause();show_game_window("");RT.restart();testing = true;while(true){C.tick();if(RT.elapsed>= 1){log.write("TimeTest.log", true);log.add_entry("Amount of real time that has passed is " + (RT.elapsed/1000.0) + "seconds.  DT is " + DT + ".  Number of frames that have passed is " + C.frame + ".");C.frame = 0;RT.restart();}//key presses just to see current values.if(key_pressed(KEY_E))speaker.speak(RT.elapsed);if(key_pressed(KEY_F))speaker.speak(C.frame);if(key_pressed(KEY_ESCAPE)){testing = false;exit();}}}//Function to return DT, since I get that error if I don't.double init(){DT = 0.001*C.delay;return DT;}log shows:Amount of real time that has passed is 10.001seconds.  DT is 0.016.  Number of frames that have passed is 610.Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 604.Ok, so that presents a few questions.  First, how is the number of frames at 610 after 10.001 seconds?  How in the hell did ten frames pass in a thousandth of a second?  Then, even weirder, we have this:Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.The hell?  That's more time than 10.001 is, yet there are fewer frames.  That makes no sense at all.  Then, even stranger, on the next line we have the exact same amount of time, down to the thousandth of a second, and still fewer frames, at 604.  Then, even less time passes above that, but more frames:Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.What the fuck?  10.029 yields first 606 frames.  Then on the very next iteration of exactly 10.029 we get 604 frames, while here, 10.012, less time, yields 608, and the kicker, 10.001, the least amount of time of all of them, gives 610?  I don't get this at all.  What in bloody hell is going on?  NOTE:  Interestingly, if I add C.update() to the code just below C.tick(), it cuts the amount of frames in half for some reason, so around 300 for 10 seconds.  So not sure how to use update correctly, since cutting number of frames is not what I want to accomplish.

URL: https://forum.audiogames.net/post/412475/#p412475




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 DT = 0.001*C.delay;Error: 'delay' is not a member of 'clock'But actually, it is most assuredly a member of clock.  However, if I add a function to return DT, it works fine:double SetFrameRate(){DT = 0.001*C.delay;return DT;}And it works fine.  What the hell?  That makes no sense.  In an attempt to start troubleshooting, I created a very simple BGT script to test framerate, hence the related error above.  Code is:#include "clock.bgt"#include "voice.bgt"#include "logger.bgt"bool testing = false;logger log;Voice speaker;timer RT;clock C(60);double DT;void main(){init();RT.pause();show_game_window("");RT.restart();testing = true;while(true){C.tick();if(RT.elapsed>= 1){log.write("TimeTest.log", true);log.add_entry("Amount of real time that has passed is " + (RT.elapsed/1000.0) + "seconds.  DT is " + DT + ".  Number of frames that have passed is " + C.frame + ".");C.frame = 0;RT.restart();}//key presses just to see current values.if(key_pressed(KEY_E))speaker.speak(RT.elapsed);if(key_pressed(KEY_F))speaker.speak(C.frame);if(key_pressed(KEY_ESCAPE)){testing = false;exit();}}}//Function to return DT, since I get that error if I don't.double init(){DT = 0.001*C.delay;return DT;}log shows:Amount of real time that has passed is 10.001seconds.  DT is 0.016.  Number of frames that have passed is 610.Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 604.Ok, so that presents a few questions.  First, how is the number of frames at 610 after 10.001 seconds?  How in the hell did ten frames pass in a thousandth of a second?  Then, even weirder, we have this:Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.The hell?  That's more time than 10.001 is, yet there are fewer frames.  That makes no sense at all.  Then, even stranger, on the next line we have the exact same amount of time, down to the thousandth of a second, and still fewer frames, at 604.  Then, even less time passes above that, but more frames:Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.What the fuck?  10.029 yields first 606 frames.  Then on the very next iteration of exactly 10.029 we get 604 frames, while here, 10.012, less time, yields 608, and the kicker, 10.001, the least amount of time of all of them, gives 610?  I don't get this at all.  What in bloody hell is going on?SIDE NOTE:  Interestingly, if I add C.update() to the code just below C.tick(), it cuts the amount of frames in half for some reason, so around 300 for 10 seconds.  So not sure how to use update correctly, since cutting number of frames is not what I want to accomplish..

URL: https://forum.audiogames.net/post/412475/#p412475




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 DT = 0.001*C.delay;Error: 'delay' is not a member of 'clock'But actually, it is most assuredly a member of clock.  However, if I add a function to return DT, it works fine:double SetFrameRate(){DT = 0.001*C.delay;return DT;}And it works fine.  What the hell?  That makes no sense.  In an attempt to start troubleshooting, I created a very simple BGT script to test framerate, hence the related error above.  Code is:#include "clock.bgt"#include "voice.bgt"#include "logger.bgt"bool testing = false;logger log;Voice speaker;timer RT;clock C(60);double DT;void main(){init();RT.pause();show_game_window("");RT.restart();testing = true;while(true){C.tick();if(RT.elapsed>= 1){log.write("TimeTest.log", true);log.add_entry("Amount of real time that has passed is " + (RT.elapsed/1000.0) + "seconds.  DT is " + DT + ".  Number of frames that have passed is " + C.frame + ".");C.frame = 0;RT.restart();}//key presses just to see current values.if(key_pressed(KEY_E))speaker.speak(RT.elapsed);if(key_pressed(KEY_F))speaker.speak(C.frame);if(key_pressed(KEY_ESCAPE)){testing = false;exit();}}}//Function to return DT, since I get that error if I don't.double init(){DT = 0.001*C.delay;return DT;}log shows:Amount of real time that has passed is 10.001seconds.  DT is 0.016.  Number of frames that have passed is 610.Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 604.Ok, so that presents a few questions.  First, how is the number of frames at 610 after 10.001 seconds?  How in the hell did ten frames pass in a thousandth of a second?  Then, even weirder, we have this:Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.The hell?  That's more time than 10.001 is, yet there are fewer frames.  That makes no sense at all.  Then, even stranger, on the next line we have the exact same amount of time, down to the thousandth of a second, and still fewer frames, at 604.  Then, even less time passes above that, but more frames:Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.What the fuck?  10.029 yields first 606 frames.  Then on the very next iteration of exactly 10.029 we get 604 frames, while here, 10.012, less time, yields 608, and the kicker, 10.001, the least amount of time of all of them, gives 610?  I don't get this at all.  What in bloody hell is going on?SIDE NOTE:  Interestingly, if I add C.update() to the code just below C.tick(), it cuts the amount of frames in half for some reason, so around 300 for 10 seconds.

URL: https://forum.audiogames.net/post/412475/#p412475




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 DT = 0.001*C.delay;Error: 'delay' is not a member of 'clock'But actually, it is most assuredly a member of clock.  However, if I add a function to return DT, it works fine:double SetFrameRate(){DT = 0.001*C.delay;return DT;}And it works fine.  What the hell?  That makes no sense.  In an attempt to start troubleshooting, I created a very simple BGT script to test framerate, hence the related error above.  Code is:#include "clock.bgt"#include "voice.bgt"#include "logger.bgt"bool testing = false;logger log;Voice speaker;timer RT;clock C(60);double DT;void main(){init();RT.pause();show_game_window("");RT.restart();testing = true;while(true){C.tick();if(RT.elapsed>= 1){log.write("TimeTest.log", true);log.add_entry("Amount of real time that has passed is " + (RT.elapsed/1000.0) + "seconds.  DT is " + DT + ".  Number of frames that have passed is " + C.frame + ".");C.frame = 0;RT.restart();}//key presses just to see current values.if(key_pressed(KEY_E))speaker.speak(RT.elapsed);if(key_pressed(KEY_F))speaker.speak(C.frame);if(key_pressed(KEY_ESCAPE)){testing = false;exit();}}}//Function to return DT, since I get that error if I don't.double init(){DT = 0.001*C.delay;return DT;}log shows:Amount of real time that has passed is 10.001seconds.  DT is 0.016.  Number of frames that have passed is 610.Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 604.Ok, so that presents a few questions.  First, how is the number of frames at 610 after 10.001 seconds?  How in the hell did ten frames pass in a thousandth of a second?  Then, even weirder, we have this:Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.The hell?  That's more time than 10.001 is, yet there are fewer frames.  That makes no sense at all.  Then, even stranger, on the next line we have the exact same amount of time, down to the thousandth of a second, and still fewer frames, at 604.  Then, even less time passes above that, but more frames:Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.What the fuck?  10.029 yields first 606 frames.  Then on the very next iteration of exactly 10.029 we get 604 frames, while here, 10.012, less time, yields 608?  I don't get this at all.  What in the sam hell is going on?SIDE NOTE:  Interestingly, if I add C.update() to the code just below C.tick(), it cuts the amount of frames in half for some reason, so around 300 for 10 seconds.

URL: https://forum.audiogames.net/post/412475/#p412475




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 DT = 0.001*C.delay;Error: 'delay' is not a member of 'clock'But actually, it is most assuredly a member of clock.  However, if I add a function to return DT, it works fine:double SetFrameRate(){DT = 0.001*C.delay;return DT;}And it works fine.  What the hell?  That makes no sense.  In an attempt to start, I created a very simple BGT script to test framerate, hence the related error above.  Code is:#include "clock.bgt"#include "voice.bgt"#include "logger.bgt"bool testing = false;logger log;Voice speaker;timer RT;clock C(60);double DT;void main(){init();RT.pause();show_game_window("");RT.restart();testing = true;while(true){C.tick();if(RT.elapsed>= 1){log.write("TimeTest.log", true);log.add_entry("Amount of real time that has passed is " + (RT.elapsed/1000.0) + "seconds.  DT is " + DT + ".  Number of frames that have passed is " + C.frame + ".");C.frame = 0;RT.restart();}//key presses just to see current values.if(key_pressed(KEY_E))speaker.speak(RT.elapsed);if(key_pressed(KEY_F))speaker.speak(C.frame);if(key_pressed(KEY_ESCAPE)){testing = false;exit();}}}//Function to return DT, since I get that error if I don't.double init(){DT = 0.001*C.delay;return DT;}log shows:Amount of real time that has passed is 10.001seconds.  DT is 0.016.  Number of frames that have passed is 610.Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 604.Ok, so that presents a few questions.  First, how is the number of frames at 610 after 10.001 seconds?  How in the hell did ten frames pass in a thousandth of a second?  Then, even weirder, we have this:Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.The hell?  That's more time than 10.001 is, yet there are fewer frames.  That makes no sense at all.  Then, even stranger, on the next line we have the exact same amount of time, down to the thousandth of a second, and still fewer frames, at 604.  Then, even less time passes above that, but more frames:Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.What the fuck?  10.029 yields first 606 frames.  Then on the very next iteration of exactly 10.029 we get 604 frames, while here, 10.012, less time, yields 608?  I don't get this at all.  What in the sam hell is going on?SIDE NOTE:  Interestingly, if I add C.update() to the code just below C.tick(), it cuts the amount of frames in half for some reason, so around 300 for 10 seconds.

URL: https://forum.audiogames.net/post/412475/#p412475




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 DT = 0.001*C.delay;Error: 'delay' is not a member of 'clock'But actually, it is.  However, if I add a function to return DT, it works fine:double SetFrameRate(){DT = 0.001*C.delay;return DT;}And it works fine.  The hell?  In an attempt to start, I created a very simple BGT script to test framerate.  Code is:#include "clock.bgt"#include "voice.bgt"#include "logger.bgt"bool testing = false;logger log;Voice speaker;timer RT;clock C(60);double DT;void main(){init();RT.pause();show_game_window("");RT.restart();testing = true;while(true){C.tick();if(RT.elapsed>= 1){log.write("TimeTest.log", true);log.add_entry("Amount of real time that has passed is " + (RT.elapsed/1000.0) + "seconds.  DT is " + DT + ".  Number of frames that have passed is " + C.frame + ".");C.frame = 0;RT.restart();}//key presses just to see current values.if(key_pressed(KEY_E))speaker.speak(RT.elapsed);if(key_pressed(KEY_F))speaker.speak(C.frame);if(key_pressed(KEY_ESCAPE)){testing = false;exit();}}}//Function to return DT, since I get that error if I don't.double init(){DT = 0.001*C.delay;return DT;}log shows:Amount of real time that has passed is 10.001seconds.  DT is 0.016.  Number of frames that have passed is 610.Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 604.Ok, so that presents a few questions.  First, how is the number of frames at 610 after 10.001 seconds?  How in the hell did ten frames pass in a thousandth of a second?  Then, even weirder, we have this:Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.The hell?  That's more time than 10.001 is, yet there are fewer frames.  That makes no sense at all.  Then, even stranger, on the next line we have the exact same amount of time, down to the thousandth of a second, and still fewer frames, at 604.  Then, even less time passes above that, but more frames:Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.What the fuck?  10.029 yields first 606 frames.  Then on the very next iteration of exactly 10.029 we get 604 frames, while here, 10.012, less time, yields 608?  I don't get this at all.  What in the sam hell is going on?SIDE NOTE:  Interestingly, if I add C.update() to the code just below C.tick(), it cuts the amount of frames in half for some reason, so around 300 for 10 seconds.

URL: https://forum.audiogames.net/post/412475/#p412475




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 DT = 0.001*C.delay;Error: 'delay' is not a member of 'clock'But actually, it is.  However, if I add a function to return DT, it works fine:double SetFrameRate(){DT = 0.001*C.delay;return DT;}And it works fine.  The hell?  In an attempt to start, I created a very simple BGT script to test framerate.  Code is:#include "clock.bgt"#include "voice.bgt"#include "logger.bgt"bool testing = false;logger log;Voice speaker;timer RT;clock C(60);double DT;void main(){init();RT.pause();show_game_window("");RT.restart();testing = true;while(true){C.tick();if(RT.elapsed>= 1){log.write("TimeTest.log", true);log.add_entry("Amount of real time that has passed is " + (RT.elapsed/1000.0) + "seconds.  DT is " + DT + ".  Number of frames that have passed is " + C.frame + ".");C.frame = 0;RT.restart();}//key presses just to see current values.if(key_pressed(KEY_E))speaker.speak(RT.elapsed);if(key_pressed(KEY_F))speaker.speak(C.frame);if(key_pressed(KEY_ESCAPE)){testing = false;exit();}}}//Function to return DT, since I get that error if I don't.double init(){DT = 0.001*C.delay;return DT;}log shows:Amount of real time that has passed is 10.001seconds.  DT is 0.016.  Number of frames that have passed is 610.Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 604.Ok, so that presents a few questions.  First, how is the number of frames at 610 after 10.001 seconds?  How in the hell did ten frames pass in a thousandth of a second?  Then, even weirder, we have this:Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.The hell?  That's more time than 10.001 is, yet there are fewer frames.  That makes no sense at all.  Then, even stranger, on the next line we have the exact same amount of time, down to the thousandth of a second, and still fewer frames, at 604.  Then, even less time passes above that, but more frames:Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.What the fuck?  10.029 yields first 606, then 604 frames, while here, 10.012, less time, yields 608?  I don't get this at all.  What in the sam hell is going on?SIDE NOTE:  Interestingly, if I add C.update() to the code just below C.tick(), it cuts the amount of frames in half for some reason, so around 300 for 10 seconds.

URL: https://forum.audiogames.net/post/412475/#p412475




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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*C.delay;Error: 'delay' is not a member of 'clock'But actually, it is.  However, if I add a function to return DT, it works fine:double SetFrameRate(){DT = 0.001*C.delay;return DT;}And it works fine.  The hell?  In an attempt to start, I created a very simple BGT script to test framerate.  Code is:#include "clock.bgt"#include "voice.bgt"#include "logger.bgt"bool testing = false;logger log;Voice speaker;timer RT;clock C(60);double DT;void main(){init();RT.pause();show_game_window("");RT.restart();testing = true;while(true){C.tick();if(RT.elapsed>= 1){log.write("TimeTest.log", true);log.add_entry("Amount of real time that has passed is " + (RT.elapsed/1000.0) + "seconds.  DT is " + DT + ".  Number of frames that have passed is " + C.frame + ".");C.frame = 0;RT.restart();}//key presses just to see current values.if(key_pressed(KEY_E))speaker.speak(RT.elapsed);if(key_pressed(KEY_F))speaker.speak(C.frame);if(key_pressed(KEY_ESCAPE)){testing = false;exit();}}}//Function to return DT, since I get that error if I don't.double init(){DT = 0.001*C.delay;return DT;}log shows:Amount of real time that has passed is 10.001seconds.  DT is 0.016.  Number of frames that have passed is 610.Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 604.Ok, so that presents a few questions.  First, how is the number of frames at 610 after 10.001 seconds?  How in the hell did ten frames pass in a thousandth of a second?  Then, even weirder, we have this:Amount of real time that has passed is 10.029seconds.  DT is 0.016.  Number of frames that have passed is 606.The hell?  That's more time than 10.001 is, yet there are fewer frames.  That makes no sense at all.  Then, even stranger, on the next line we have the exact same amount of time, down to the thousandth of a second, and still fewer frames, at 604.  Then, even less time passes above that, but more frames:Amount of real time that has passed is 10.012seconds.  DT is 0.016.  Number of frames that have passed is 608.What the fuck?  10.029 yields first 606, then 604 frames, while here, 10.012, less time, yields 608?  I don't get this at all.  What in the sam hell is going on?SIDE NOTE:  Interestingly, if I add C.update() to the code, it cuts the amount of frames in half for some reason.

URL: https://forum.audiogames.net/post/412475/#p412475




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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' is not a member of 'clock'But actually, it is.  However, if I add a function to return DT, it works fine:double SetFrameRate(){double DT = 0.001*C.delay;return DT;}And it works fine.  The hell?

URL: https://forum.audiogames.net/post/412475/#p412475




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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/mailman/listinfo/audiogames-reflector


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 over the place to try and find it.I ran into a terrible case of this in, like, April or June 2017. I discovered that I had a huge object mortality rate (hence all the commented out destructors in 2d), and after a great deal of whittling it down to a sane amount... the lag was still atrocious. I eventually concluded my computer was just being a jerk, after optimizing shape usage, AI, etc barely put a dent in it.As for how this affects networking, yes, the players need to have the same things happening on the same frames, or as close to this as possible. There are various strategies used to try and achieve synchronicity, because even with consoles that can more reliably prevent the games from lagging differently, they can't prevent network lag. This can get kinda weird, with things like rollbacks and frame-dropping. And let's not forget how, just the other day, Swamp had an issue where zombies were being drawn toward (0, 0) because of connections so poor that they were confusing the server.It really doesn't seem like anything should be causing what you have to run at what is effectively half speed, though. That's going to be ... interesting, to diagnose.

URL: https://forum.audiogames.net/post/412468/#p412468




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.  To be thorough, I then created a separate timer to track real time and added the following lines of code to my main game loop for testing:if(RealTime.elapsed>= 1){test.add_entry("Amount of real time that has passed is " + (RealTime.elapsed/1000.0) + "seconds.  Number of frames that have passed is " + C.frame + ".");C.frame = 0;TRestart(RealTime);}This should write the number of frames that pass each time ten seconds pass.  I have FPS set to 60, so 600 frames should pass.  This is what log shows:Amount of real time that has passed is 10.005seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.01seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.011seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.001seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.What the hell?  I double checked, and FPS is set to 60.  Aside from there being about half of the frames that there should be, some of these numbers make no sense.  For example:Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.Ok, but then we've got:Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.And at 10.01, we've got 301.  So if 10.031 shows 302, 10.001 shows 301, 10.01 also shows 301, 10.005 also shows 301, then how in the ever-loving realm of fuck does 10.008, which is less than 10.031, less than 10.01, and only slightly above 10.005, show 303?  That makes no damn sense.  And I thought this was going to help with the initial problem I was having that began this whole thing, where the ball was landing at different coordinates on different machines.  If my machine thinks that 303 frames pass after 10.008 seconds, and your machine thinks that 301 frames pass after 10.01 seconds, then we're still gonna have the same issue, since my machine would have passed two more frames than yours, right?  So does this mean I'm still going to have the same damn problem after all of the work I've completed?  And why in the hell are only half of the frames there?

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.  To be thorough, I then created a separate timer to track real time and added the following lines of code to my main game loop for testing:if(RealTime.elapsed>= 1){test.add_entry("Amount of real time that has passed is " + (RealTime.elapsed/1000.0) + "seconds.  Number of frames that have passed is " + C.frame + ".");C.frame = 0;TRestart(RealTime);}This should write the number of frames that pass each time ten seconds pass.  I have FPS set to 60, so 600 frames should pass.  This is what log shows:Amount of real time that has passed is 10.005seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.01seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.011seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.001seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.What the hell?  I double checked, and FPS is set to 60.  Aside from there being about half of the frames that there should be, some of these numbers make no sense.  For example:Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.Ok, but then we've got:Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.And at 10.01, we've got 301.  So if 10.031 shows 302, 10.001 shows 301, 10.01 also shows 301, 10.005 also shows 301, then how in the ever-loving realm of fuck does 10.008, which is less than 10.031, less than 10.01, and only slightly above 10.005, show 303?  That makes no damn sense.  And I thought this was going to help with the initial problem I was having that began this whole thing, where the ball was landing at different coordinates on different machines.  If my machine thinks that 303 frames pass after 10.008 seconds, and your machine thinks that 301 frames pass after 10.01 seconds, then we're still gonna have the same issue, since my machine would have passed two more frames than yours, right?  So does this mean I'm still going to have the same damn problem after all of the work I've completed?

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.  To be thorough, I then created a separate timer to track real time and added the following lines of code to my main game loop for testing:if(RealTime.elapsed>= 1){test.add_entry("Amount of real time that has passed is " + (RealTime.elapsed/1000.0) + "seconds.  Number of frames that have passed is " + C.frame + ".");C.frame = 0;TRestart(RealTime);}This should write the number of frames that pass each time ten seconds pass.  I have FPS set to 60, so 600 frames should pass.  This is what log shows:Amount of real time that has passed is 10.005seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.01seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.011seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.001seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.What the hell?  I double checked, and FPS is set to 60.  Aside from there being about half of the frames that there should be, some of these numbers make no sense.  For example:Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.Ok, but then we've got:Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.And at 10.01, we've got 301.  So if 10.031 shows 302, 10.001 shows 301, 10.01 also shows 301, 10.005 also shows 301, then how in the ever-loving realm of fuck does 10.008, which is less than 10.031, less than 10.01, and only slightly above 10.005, show 303?  That makes no damn sense.  And I thought this was going to help with the initial problem I was having that began this whole thing, where the ball was landing at different coordinates on different machines.  If my machine think that 303 frames pass after 10.008 seconds, and your machine thinks that 301 frams pass after 10.008 seconds, then we're still gonna have the same issue, since my machine would have passed two more frames than yours, right?  So does this mean I'm still going to have the same damn problem after all of the work I've completed?

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.  To be thorough, I then created a separate timer to track real time and added the following lines of code to my main game loop for testing:if(RealTime.elapsed>= 1){test.add_entry("Amount of real time that has passed is " + (RealTime.elapsed/1000.0) + "seconds.  Number of frames that have passed is " + C.frame + ".");C.frame = 0;TRestart(RealTime);}This should write the number of frames that pass each time ten seconds pass.  I have FPS set to 60, so 600 frames should pass.  This is what log shows:Amount of real time that has passed is 10.005seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.01seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.011seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.001seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.What the hell?  I double checked, and FPS is set to 60.  Aside from it being about half of what it should be, some of these numbers make no sense.  For example:Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.Ok, but then we've got:Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.And at 10.01, we've got 301.  So if 10.031 shows 302, 10.001 shows 301, 10.01 also shows 301, 10.005 also shows 301, then how in the ever-loving realm of fuck does 10.008, which is less than 10.031, less than 10.01, and only slightly above 10.005, show 303?  That makes no damn sense.  And I thought this was going to help with the initial problem I was having that began this whole thing, where the ball was landing at different coordinates on different machines.  If my machine think that 303 frames pass after 10.008 seconds, and your machine thinks that 301 frams pass after 10.008 seconds, then we're still gonna have the same issue, since my machine would have passed two more frames than yours, right?  So does this mean I'm still going to have the same damn problem after all of the work I've completed?

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.  To be thorough, I then created a separate timer to track real time and added the following lines of code to my main game loop for testing:if(RealTime.elapsed>= 1){test.add_entry("Amount of real time that has passed is " + (RealTime.elapsed/1000.0) + "seconds.  Number of frames that have passed is " + C.frame + ".");C.frame = 0;TRestart(RealTime);}This should write the number of frames that pass each time ten seconds pass.  I have FPS set to 60, so 600 frames should pass.  This is what log shows:Amount of real time that has passed is 10.005seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.01seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.011seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.001seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.What the hell?  I double checked, and FPS is set to 60.  Aside from it being about half of what it should be, some of these numbers make no sense.  For example:Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.Ok, but then we've got:Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.And at 10.001, we've got 301.  So if 10.031 shows 302, 10.001 shows 301, 10.005 also shows 301, then how in the ever-loving realm of fuck does 10.008, which is less than 10.031 and only slightly above 10.005, show 303?  That makes no damn sense.  And I thought this was going to help with the initial problem I was having that began this whole thing, where the ball was landing at different coordinates on different machines.  If my machine think that 303 frames pass after 10.008 seconds, and your machine thinks that 301 frams pass after 10.008 seconds, then we're still gonna have the same issue, since my machine would have passed two more frames than yours, right?  So does this mean I'm still going to have the same damn problem after all of the work I've completed?

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.  To be thorough, I then created a separate timer to track real time and added the following lines of code to my main game loop for testing:if(RealTime.elapsed>= 1){test.add_entry("Amount of real time that has passed is " + (RealTime.elapsed/1000.0) + "seconds.  Number of frames that have passed is " + C.frame + ".");C.frame = 0;TRestart(RealTime);}This should write the number of frames that pass each time ten seconds pass.  I have FPS set to 60, so 600 frames should pass.  This is what log shows:Amount of real time that has passed is 10.005seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.01seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.011seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.001seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.What the hell?  I double checked, and FPS is set to 60.  Aside from it being about half of what it should be, some of these numbers make no sense.  For example:Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.Ok, but then we've got:Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.And at 10.001, we've got 301.  So if 10.031 shows 302, 10.001 shows 301, 10.005 also shows 301, then how in the ever-loving realm of fuck does 10.008, which is less than 10.031 and only slightly above 10.005, show 303?  That makes no damn sense.

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.  To be thorough, I then created a separate timer to track real time and added the following lines of code to my main game loop for testing:if(RealTime.elapsed>= 1){test.add_entry("Amount of real time that has passed is " + (RealTime.elapsed/1000.0) + "seconds.  Number of frames that have passed is " + C.frame + ".");C.frame = 0;TRestart(RealTime);}This should write the number of frames that pass each time ten seconds pass.  I have FPS set to 60, so 600 frames should pass.  This is what log shows:Amount of real time that has passed is 10.005seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.01seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.011seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.001seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.What the hell?  I double checked, and FPS is set to 60.  Aside from it being about half of what it should be, some of these numbers make no sense.  For example:Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.Ok, but then we've got:Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.And at 10.001, we've got 301.  So if 10.031 shows 302, 10.001 shows 301, 10.005 also shows 301, then how in the ever-loving realm of fuck does 10.008, which is less than 10.031 and only slightly about 10.005, show 303?  That makes no damn sense.

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.  To be thorough, I then created a separate timer to track real time and added the following lines of code to my main game loop for testing:if(RealTime.elapsed>= 1){test.add_entry("Amount of real time that has passed is " + (RealTime.elapsed/1000.0) + "seconds.  Number of frames that have passed is " + C.frame + ".");C.frame = 0;TRestart(RealTime);}This should write the number of frames that pass each time ten seconds pass.  I have FPS set to 60, so 600 frames should pass.  This is what log shows:Amount of real time that has passed is 10.005seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.01seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.011seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.001seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.What the hell?  I double checked, and FPS is set to 60.  Aside from it being about half of what it should be, some of these numbers make no sense.  For example:Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.Ok, but then we've got:Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.And at 10.001, we've got 301.  So if 10.031 shows 302, and 10.001 shows 301, how in the hell does 10.008, which is less than 10.031, show 303?  That makes no damn sense.

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.  To be thorough, I then created a separate timer to track real time and added the following lines of code to my main game loop for testing:if(RealTime.elapsed>= 1){test.add_entry("Amount of real time that has passed is " + (RealTime.elapsed/1000.0) + "seconds.  Number of frames that have passed is " + C.frame + ".");C.frame = 0;TRestart(RealTime);}This should write the number of frames that pass each time ten seconds pass.  I have FPS set to 60, so 600 frames should pass.  This is what log shows:Amount of real time that has passed is 10.005seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.01seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.011seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.001seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.What the hell?

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.  I then created a separate timer to track real time and added the following lines of code to my main game loop for testing:if(RealTime.elapsed>= 1){test.add_entry("Amount of real time that has passed is " + (RealTime.elapsed/1000.0) + "seconds.  Number of frames that have passed is " + C.frame + ".");C.frame = 0;TRestart(RealTime);}This should write the number of frames that pass each time ten seconds pass.  I have FPS set to 60, so 600 frames should pass.  This is what log shows:Amount of real time that has passed is 10.005seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.01seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.011seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.031seconds.  Number of frames that have passed is 302.Amount of real time that has passed is 10.001seconds.  Number of frames that have passed is 301.Amount of real time that has passed is 10.008seconds.  Number of frames that have passed is 303.What the hell?

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60.  I added the test entry in the update function, just before time.restart(), and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.  I ran a check to show what the timer showed after each frame right before it was reset with FPS set to 60, and there's quite a bit of jumping around.  Ten frames:frames = 1, and elapsed times is 34. frames = 2, and elapsed times is 28. frames = 3, and elapsed times is 26. frames = 4, and elapsed times is 30. frames = 5, and elapsed times is 27. frames = 6, and elapsed times is 26. frames = 7, and elapsed times is 28. frames = 8, and elapsed times is 26. frames = 9, and elapsed times is 25. frames = 10, and elapsed times is 25.Notice the large variability from frame 1 to 2, where timer goes from 34 to 28, sometimes down to 25.  Then I ran a test to see whether it indeed ran 60 frames per second.  I had my iPhone set a timer for 10 seconds, and started the game.  After 10 seconds, number of frames shows as only 284.  Last time I checked, 60 x 10 was 600, not 284.  Not sure what is wrong here.

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 called, update() has to be called as well, although update is a Boolean, so not positive.  Just want to make sure that I get this correct.

URL: https://forum.audiogames.net/post/412454/#p412454




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 quickly.If it helps, the way this was handled in Java was that the Timer class takes two parameters: the delay between frames, and the function to call every frame. In this way, you didn't even bother with a main loop, instead just starting the timer. BGT doesn't have multithreading, though, so the best I could come up with was having a {keycheck(); step(dt); clock.tick();} sort of loop.

URL: https://forum.audiogames.net/post/412304/#p412304




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 things, or do the tick and update functions only go in places where the ball, racket, or players move, and thusly, math becomes relevant?  I assume the latter, but I want to make sure.

URL: https://forum.audiogames.net/post/412292/#p412292




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 things, or do the tick and update functions only go in places where the ball, racket, or players move?  I assume the latter, but I want to make sure.

URL: https://forum.audiogames.net/post/412292/#p412292




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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: https://forum.audiogames.net/post/411621/#p411621




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is 20.Ball is now at 0, 0, 13.330154419.Beginning move function.  Initial velocity z is 10.185803833, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is 10.185803833.Ball is now at 0, 0, 13.5031661987305.Beginning move function.  Initial velocity z is 0.37160766602, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is 0.37160766602.Ball is now at 0, 0, 13.5094995498657.Beginning move function.  Initial velocity z is -9.4300012588501, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is -9.4300012588501.Ball is now at 0, 0, 13.3523330688477.Beginning move function.  Initial velocity z is -19.2400016784668, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is -19.2400016784668.Ball is now at 0, 0, 13.0316667556763.Beginning move function.  Initial velocity z is -29.0500030517578, accelleration z is 0.  DT is 0.016.It seems to work now, although I am not sure whether actual velocity is supposed to go past -9.81 like that.  If not, I need to know so I can fix it.UPDATE:  In experimenting with adjusting the function to throw the ball, I noticed something I did not know you could do with vectors in BGT.  I put my code back the way it was, where velocity is returned in a function:vector SetVel(){VF.x = (V0.x+(A.x*DT))*sine(theta)*cosine(phi);VF.y = (V0.y+(A.y*DT))*sine(theta)*sine(phi);VF.z = (V0.z+(A.z*DT))*cosine(phi);return VF;}I didn't know I could do this with vectors, but this works from wherever I please:VF = SetVel();If I had known that, updating vel anywhere wouldn't have been an issue.  Damn.  I assume I can do it with the other vectors as well.

URL: https://forum.audiogames.net/post/411595/#p411595




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is 20.Ball is now at 0, 0, 13.330154419.Beginning move function.  Initial velocity z is 10.185803833, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is 10.185803833.Ball is now at 0, 0, 13.5031661987305.Beginning move function.  Initial velocity z is 0.37160766602, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is 0.37160766602.Ball is now at 0, 0, 13.5094995498657.Beginning move function.  Initial velocity z is -9.4300012588501, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is -9.4300012588501.Ball is now at 0, 0, 13.3523330688477.Beginning move function.  Initial velocity z is -19.2400016784668, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is -19.2400016784668.Ball is now at 0, 0, 13.0316667556763.Beginning move function.  Initial velocity z is -29.0500030517578, accelleration z is 0.  DT is 0.016.It seems to work now, although I am not sure whether actual velocity is supposed to go past -9.81 like that.  If not, I need to know so I can fix it.UPDATE:  In experimenting with adjusting the function to throw the ball, I noticed something I did not know you could do with vectors in BGT.  I put my code back the way it was, where velocity is returned in a function:vector SetVel(){VF.x = (V0.x+(A.x*DT))*sine(theta)*cosine(phi);VF.y = (V0.y+(A.y*DT))*sine(theta)*sine(phi);VF.z = (V0.z+(A.z*DT))*cosine(phi);return VF;}I didn't know I could do this with vectors, but this works from wherever I please:VF = SetVel();If I had known that, updating vel anywhere wouldn't have been an issue.  Damn.

URL: https://forum.audiogames.net/post/411595/#p411595




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is 20.Ball is now at 0, 0, 13.330154419.Beginning move function.  Initial velocity z is 10.185803833, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is 10.185803833.Ball is now at 0, 0, 13.5031661987305.Beginning move function.  Initial velocity z is 0.37160766602, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is 0.37160766602.Ball is now at 0, 0, 13.5094995498657.Beginning move function.  Initial velocity z is -9.4300012588501, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is -9.4300012588501.Ball is now at 0, 0, 13.3523330688477.Beginning move function.  Initial velocity z is -19.2400016784668, accelleration z is 0.  DT is 0.016.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is 0.  velocity z is -19.2400016784668.Ball is now at 0, 0, 13.0316667556763.Beginning move function.  Initial velocity z is -29.0500030517578, accelleration z is 0.  DT is 0.016.It seems to work now, although I am not sure whether actual velocity is supposed to go past -9.81 like that.  If not, I need to know so I can fix it.

URL: https://forum.audiogames.net/post/411595/#p411595




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 will decrease.  Once it hits 0, the ball has reached its max height, at which point it will begin to fall back to earth.  If I make VF = V0, then how will the ball be able to rise like it should?

URL: https://forum.audiogames.net/post/411591/#p411591




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 have other calculations that rely on v0 not updating until the next frame.So vf doesn't change because v0 doesn't change.

URL: https://forum.audiogames.net/post/411588/#p411588




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 19.8365001678467.Ball is now at 0, 0, 13.3306083679199.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, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 19.8365001678467.Ball is now at 0, 0, 13.6612167358398.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, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 19.8365001678467.Ball is now at 0, 0, 13.9918251037598.What...The hell?  Aside from the fact that the velocity still remains constant, and that V0 isn't decreasing, 19.8365001678467 is very, very wrong.  Also, DT seems weird to me.  I have FPS set to 60.

URL: https://forum.audiogames.net/post/411583/#p411583




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 to move the ball.  Accelleration z is -9.814196167.  velocity z is 19.8365001678467.Ball is now at 0, 0, 13.3306083679199.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 to move the ball.  Accelleration z is -9.814196167.  velocity z is 19.8365001678467.Ball is now at 0, 0, 13.6612167358398.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 to move the ball.  Accelleration z is -9.814196167.  velocity z is 19.8365001678467.Ball is now at 0, 0, 13.9918251037598.What...The hell?  Aside from the fact that the velocity still remains constant, 19.8365001678467 is very, very wrong.

URL: https://forum.audiogames.net/post/411583/#p411583




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 is necessary, here, since that would rotate gravity.Having said all that, if dt == 1 and phi == 0, (20-9.81)*1*cos(0) should indeed give 10.19.

URL: https://forum.audiogames.net/post/411581/#p411581




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 in terms of code:VF.x = (V0.x+A.x)*DT*sine(theta)*cosine(phi);VF.y = (V0.y+A.y)*DT*sine(theta)*sine(phi);VF.z = (V0.z+A.z)*DT*cosine(phi);So, if V0 is (0, 0, 20) such that, for now, the ball exceeds gravity so that it should move upward, and assuming that, again, for now, gravity is the only force on the ball:(V0.z+A.z) is equal to (20+-9.81), which should equal 10.19.  So the next time the ball move function iterates, shouldn't V0.z be 10.19, not 20?  Then the equation occurs again:VF.z = (10.19+-9.81)… which equals 0.38, if my math is correct.  Isn't that the way this should work?  Each time the ball move function iterates, the math done on the preceeding iteration should hold, since the vector values get reassigned each time the equation runs.  Look:VF.x = (V0.x+A.x)...VF.y = (V0.y+A.y)...VF.z = (V0.z+A.z)...So each time the ball move function iterates, VF.x, y,  and z are assigned, correct?  Shouldn't that allow for the values to assign correctly?  Or am I missing something?

URL: https://forum.audiogames.net/post/411561/#p411561




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 += g*dt. That's probably a mistake, since there are other forces involved, but the point is still that you're finding the change, then adding that to the original. I've generally broken this into separate changes, rather than calculating all the changes and saying v += dv for the whole frame, but there's probably a reason the latter is better.

URL: https://forum.audiogames.net/post/411554/#p411554




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 entering the move function is (0, 0, 20), just an arbitrary number to see whether it updates right.  Theoretically, the ball should travel upwards, then as gravity pulls it, initial velocity should slow until reaching 0, and then the ball should fall.  The ball move function, with only log entries omitted, is:void move(){VF.x = (V0.x+A.x)*DT*sine(theta)*cosine(phi);VF.y = (V0.y+A.y)*DT*sine(theta)*sine(phi);VF.z = (V0.z+A.z)*DT*cosine(phi);pos += VF*DT;if(pos.z <= 0){moving = false;bounce();}if(C.frame == 30){B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);C.frame = 0;}C.tick();C.update();env.update_sound_2d(B.slot, B.pos.x, B.pos.y);}Instead of what it's supposed to do, though, the velocity just remains constant.  From test log:Beginning move function.  Initial velocity z is 10, accelleration z is -9.814196167.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 0.003166659735143.Ball is now at 0, 0, 12.524520874.Beginning move function.  Initial velocity z is 10, accelleration z is -9.814196167.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 0.003166659735143.Ball is now at 0, 0, 12.0001049041748.Beginning move function.  Initial velocity z is 10, accelleration z is -9.814196167.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 0.003166659735143.Ball is now at 0, 0, 12.0001573562622.As you can see, the velocity just remains constant.  It's not supposed to do that, I don't think.  And since I put the math equations inside of this function, they should update with each iteration, correct?  What am I doing wrong here?

URL: https://forum.audiogames.net/post/411544/#p411544




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 entering the move function is (0, 0, 20), just an arbitrary number to see whether it updates right.  Theoretically, the ball should travel upwards, then as gravity pulls it, initial velocity should slow until reaching 0, and then the ball should fall.  The ball move function, with only log entries omitted, is:void move(){VF.x = (V0.x+A.x)*DT*sine(theta)*cosine(phi);VF.y = (V0.y+A.y)*DT*sine(theta)*sine(phi);VF.z = (V0.z+A.z)*DT*cosine(phi);pos += VF*DT;if(pos.z <= 0){moving = false;bounce();}if(C.frame == 30){B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);C.frame = 0;}C.tick();C.update();env.update_sound_2d(B.slot, B.pos.x, B.pos.y);}Instead of what it's supposed to do, though, the velocity just remains constant.  From test log:Beginning move function.  Initial velocity z is 10, accelleration z is -9.814196167.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 0.003166659735143.Ball is now at 0, 0, 12.524520874.Beginning move function.  Initial velocity z is 10, accelleration z is -9.814196167.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 0.003166659735143.Ball is now at 0, 0, 12.0001049041748.Beginning move function.  Initial velocity z is 10, accelleration z is -9.814196167.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 0.003166659735143.Ball is now at 0, 0, 12.0001573562622.As you can see, the velocity just remains constant.  It's not supposed to do that, I don't think.  And since I put the math equations inside of this function, they should update with each iteration, correct?  What am I doing wrong here?

URL: https://forum.audiogames.net/post/411544/#p411544




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 entering the move function is (0, 0, 20), just an arbitrary number to see whether it updates right.  Theoretically, the ball should travel upwards, then as gravity pulls it, initial velocity should slow until reaching 0, and then the ball should fall.  The ball move code is:void move(){VF.x = (V0.x+A.x)*DT*sine(theta)*cosine(phi);VF.y = (V0.y+A.y)*DT*sine(theta)*sine(phi);VF.z = (V0.z+A.z)*DT*cosine(phi);pos += VF*DT;if(pos.z <= 0){moving = false;bounce();}if(C.frame == 30){B.slot = env.play_2d("sounds/ball.ogg", user.x, user.y, B.pos.x, B.pos.y, false);C.frame = 0;}C.tick();C.update();env.update_sound_2d(B.slot, B.pos.x, B.pos.y);}Instead of what it's supposed to do, though, the velocity just remains constant.  From test log:Beginning move function.  Initial velocity z is 10, accelleration z is -9.814196167.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 0.003166659735143.Ball is now at 0, 0, 12.524520874.Beginning move function.  Initial velocity z is 10, accelleration z is -9.814196167.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 0.003166659735143.Ball is now at 0, 0, 12.0001049041748.Beginning move function.  Initial velocity z is 10, accelleration z is -9.814196167.In move function, just past where velocity vector values are assigned, and just before the line to move the ball.  Accelleration z is -9.814196167.  velocity z is 0.003166659735143.Ball is now at 0, 0, 12.0001573562622.As you can see, the velocity just remains constant.  It's not supposed to do that, I don't think.  And since I put the math equations inside of this function, they should update with each iteration, correct?  What am I doing wrong here?

URL: https://forum.audiogames.net/post/411544/#p411544




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 of the ball on the court, approach angle and rebound angle?

URL: https://forum.audiogames.net/post/409502/#p409502




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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, approach angle and rebound angle?

URL: https://forum.audiogames.net/post/409502/#p409502




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 the block of code that starts:if(B.z == 0)never executes, and when I check after a while, B.z is way, way less than 0, like negative 35 or so.  So I changed it to:if(B.z <= 0)and then it works, but a lot of the time it waits until it is negative before executing.  So I had to say:if(B.z <= 0)B.z = 0;I don't understand why Z is never just 0.  Theoretically, as the ball travels, z has to hit exactly 0 at some point, and when that happens, the line if(B.z == 0) should execute.  Changing it to:if(B.z <= 0)does allow the ball to stop.  One other thing I do notice that quite frankly royally pisses me off is that when mirroring, the ball doesn't land where it started.  In other words, ball starts at position 0, 0, 50.  After travelling at 45 degrees, it lands at 31.0134830474854, 31.0134830474854, 0.  After mirroring, which should bring it right back to where it was on x and y, at 0, 0, it shows that ball lands at 0.248107805848122, 0.248107805848122, 0.  Why the discrepancy?  Shouldn't it travel the same exact distance on each side?  Numbers are immutable, as is the math done upon those numbers. 2 plus 2 will always be four, 2 times 2 will always be 8, and so on.  I don't understand the discrepancy here, since the only thing that I did was exactly mirror the previous shot, with no other changes.  It should be like driving a car to the store down the street, then back home, the same distance for both, right?  These sort of discrepancies are what cause the problem I have that has forced me to entirely rewrite this code in the first fucking place.  I thought that using vectors and applying actual immutable math equations to this would stop this sort of shit.  So what the fuck is causing the discrepancy now?UPDATE 2:  I ran the test 5 times, and the numbers for x and y came out exactly the same each time.  Before I move, I set degrees to 45.  Starting cords for the vector position of the ball are x at 0, y at 0, and z, for height, at 50.  Degrees set to 45, and the test commences.  Endin position is x at 31.0134830474854, y at 31.0134830474854, z at 0.  When mirroring, z is set back to 50, and the return begins.  However, the position ends with x at 0.248107805848122, y at 0.248107805848122, and z at 0.  So at least the discrepancy itself is a constant one.  In five tests, those coordinates matched exactly all 5 times.  Theoretically, though, shouldn't the ball return to exactly 0 x and 0 y where it started?  There shouldn't be any discrepancy, given that height was set to exactly the same in both cases, right?  Math doesn't change, and neither does distance.  If distance A = 5, then if distance b is simply a mirror of a, it should equal 5 as well, right?

URL: https://forum.audiogames.net/post/408860/#p408860




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 the block of code that starts:if(B.z == 0)never executes, and when I check after a while, B.z is way, way less than 0, like negative 35 or so.  So I changed it to:if(B.z <= 0)and then it works, but a lot of the time it waits until it is negative before executing.  So I had to say:if(B.z <= 0)B.z = 0;I don't understand why Z is never just 0.  Theoretically, as the ball travels, z has to hit exactly 0 at some point, and when that happens, the line if(B.z == 0) should execute.  Changing it to:if(B.z <= 0)does allow the ball to stop.  One other thing I do notice that quite frankly royally pisses me off is that when mirroring, the ball doesn't land where it started.  In other words, ball starts at position 0, 0, 50.  After travelling at 45 degrees, it lands at 31.0134830474854, 31.0134830474854, 0.  After mirroring, which should bring it right back to where it was on x and y, at 0, 0, it shows that ball lands at 0.248107805848122, 0.248107805848122, 0.  Why the discrepancy?  Shouldn't it travel the same exact distance on each side?  Numbers are immutable, as is the math done upon those numbers. 2 plus 2 will always be four, 2 times 2 will always be 8, and so on.  I don't understand the discrepancy here, since the only thing that I did was exactly mirror the previous shot, with no other changes.  It should be like driving a car to the store down the street, then back home, the same distance for both, right?  These sort of discrepancies are what cause the problem I have that has forced me to entirely rewrite this code in the first fucking place.  I thought that using vectors and applying actual immutable math equations to this would stop this sort of shit.  So what the fuck is causing the discrepancy now?UPDATE 2:  I ran the test 5 times, and the numbers for x and y came out exactly the same each time.  Before I move, I set degrees to 45.  Starting cords for the vector position of the ball are x at 0, y at 0, and z, for height, at 50.  Degrees set to 45, and the test commences.  Endin position is x at 31.0134830474854, y at 31.0134830474854, z at 0.  When mirroring, z is set back to 50, and the return begins.  However, the position ends with x at 0.248107805848122, y at 0.248107805848122, and z at 0.  So at least the discrepancy itself is a constant one.  In five tests, those coordinates matched exactly all 5 times.  Theoretically, though, shouldn't the ball return to exactly 0 x and 0 y where it started?  There shouldn't be any discrepancy, given that height was set to exactly the same in both cases, right?  Math doesn't change, and neither does distance.  if distance A = 5, then if distance b is a mirror of a, it should equal 5 as well, right?

URL: https://forum.audiogames.net/post/408860/#p408860




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 mirroring, the ball doesn't land where it started.  In other words, ball starts at position 0, 0, 50.  After travelling at 45 degrees, it lands at 31.0134830474854, 31.0134830474854, 0.  After mirroring, which should bring it right back to where it was on x and y, at 0, 0, it shows that ball lands at 0.248107805848122, 0.248107805848122, 0.  Why the discrepancy?  Shouldn't it travel the same exact distance on each side?  Numbers are immutable, as is the math done upon those numbers. 2 plus 2 will always be four, 2 times 2 will always be 8, and so on.  I don't understand the discrepancy here, since the only thing that I did was exactly mirror the previous shot, with no other changes.  It should be like driving a car to the store down the street, then back home, the same distance for both, right?  These sort of discrepancies are what cause the problem I have that has forced me to entirely rewrite this code in the first fucking place.  I thought that using vectors and applying actual immutable math equations to this would stop this sort of shit.  So what the fuck is causing the discrepancy now?UPDATE 2:  I ran the test 5 times, and the numbers for x and y came out exactly the same each time.  Before I move, I set degrees to 45.  Starting cords for the vector position of the ball are x at 0, y at 0, and z, for height, at 50.  Degrees set to 45, and the test commences.  Endin position is x at 31.0134830474854, y at 31.0134830474854, z at 0.  However, when mirroring, the position ends with x at 0.248107805848122, y at 0.248107805848122, and z at 0.  So at least the discrepancy itself is a constant one. in five tests, those coordinates matched exactly all 5 times.  Theoretically, though, shouldn't the ball return to exactly 0 x and 0 y where it started?

URL: https://forum.audiogames.net/post/408860/#p408860




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


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 mirroring, the ball doesn't land where it started.  In other words, ball starts at position 0, 0, 50.  After travelling at 45 degrees, it lands at 31.0134830474854, 31.0134830474854, 0.  After mirroring, which should bring it right back to where it was on x and y, at 0, 0, it shows that ball lands at 0.248107805848122, 0.248107805848122, 0.  Why the discrepancy?  Shouldn't it travel the same exact distance on each side?  Numbers are immutable, as is the math done upon those numbers. 2 plus 2 will always be four, 2 times 2 will always be 8, and so on.  I don't understand the discrepancy here, since the only thing that I did was exactly mirror the previous shot, with no other changes.  It should be like driving a car to the store down the street, then back home, the same distance for both, right?  These sort of discrepancies are what cause the problem I have that has forced me to entirely rewrite this code in the first fucking place.  I thought that using vectors and applying actual immutable math equations to this would stop this sort of shit.  So what the fuck is causing the discrepancy now?

URL: https://forum.audiogames.net/post/408860/#p408860




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


  1   2   3   >