0
Then there shouldn't be any bouncing... If you did all the math correctly, that is. And check the collision in every frame.
| Thumbs Up: |
| Received: 186 |
Ok, I figured out the problem, and in the process of fixing it. I fixed the bouncing at edges, now I need to fix the bouncing when moving to a new surface that is at an angle.
The problem was that I thought I was doing the intercept of a sphere with a triangle, but my sphere had missing parts. If for example, my trajectory just missed the triangle, my "sphere" would go on but a real one would hit the edge anyway.
Also, I freaked out when my game completely stopped working. Undid the code etc, nothing helped. Restarted the computer, now it's fine. Go figure.
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about
| Thumbs Up: |
| Received: 186 |
Ok, here's a puzzler.
I got the weapons working (mostly), and the jumping works too. I also got the foes to aim at where I will be if I continue moving straight (which is nice, because I need to work more than just strafe to avoid shots).
But...
I jump a lot less high if I set the maximum number of shots in the scene to 1000 than if I set it to 10. Also, I jump higher if I set the graphics details lower.
I figured out the problem, but I figured some of you might want to test your programming skills.
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about
| Thumbs Up: |
| Received: 186 |
Answer to above:
Spoiler
Update: got shots to bounce off of walls, and almost got the "walking on walls" mechanic functioning properly.
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about
| Thumbs Up: |
| Received: 186 |
Walking on walls works. I still have to implement a second mode of it (more like Aliens) but the current mode works as intended.
Melee needs to be done... but shots work as intended, including ones with special effects like exploding, bouncing, or reacting to gravity.
I'm soon adding in effects like portals, forces like wind etc, and protective shields. A lot of the ground work for these is already implemented.
And I got the editing in-game to work ok. I can edit the walls fairly easily, but there's still a lot of work to be done there, and also to edit other stuff. It's also pretty trivial to edit stuff outside the game, like statistics for shots, in Excel.
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about
| Thumbs Up: |
| Received: 186 |
And flight. Don't forget flight.
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about
| Thumbs Up: |
| Received: 1 |
Kinda old reply but still.
About the framerate thingy, the dt thing can be fine, because if the frame takes longer to draw, you want to move further to keep the distance per second constant. But there's another solution, which is even better, it's called fixed timestep. It works like this: you say you want your game PHYSICS at 100 fps (render fps is irrelevant now). That means you want a physics tick every 10 ms. Then, if the frame took longer than 10 ms, eg. 30 ms, rather than updating all movements by 3x the amount (like you'd do with dt), you run the physics tick three times, 10 ms worth each. This way you won't have big jumps no matter the framerate. The drawback is that if you get a really big spike in frame length, eg. 3000ms, the physics update would run 300 times, which would slow the game even further going into downward spiral freezing the game. To prevent that you add an upper limit.
http://gafferongames.com/game-physic...your-timestep/
| Thumbs Up: |
| Received: 186 |
Wow thanks for the link.
I thought about fixing the timestep (but didn't think of a good way to prevent the spiral, so abandoned it). I think I have a better solution though, even if it involves a bit more advance work, it will help long-run by being useful in other places...
Basically, I will make a function that takes position, motion, and acceleration, and updates both position and motion properly over the time difference. The math is pretty simple, I just need to do it properly.
edit:
nice, found the equation I needed off your webpage:
I'm not sure why he himself does not use this, seems simpler (and more accurate) than what he's using.s = ut + 0.5at^2
That is, given a constant acceleration a, and an initial velocity u, we can work out how much distance (s) is travelled over the time t.
Last edited by Alaris; 03-11-2011 at 12:58.
== Alaris & clone ==
Proud Officer of The Order Of Dii [Dii] - join us
You can tell the quality of life of people by what they complain about
| Thumbs Up: |
| Received: 53 |
Got this link in my ArenaNet google alerts, and though it might be interesting for you game developy people :)
http://altdevblogaday.com/2011/11/12...ystems-part-1/