the physics is broke'd!
Forum rules
This forum is for feature requests, content changes additions, anything not a Bug in the software.
Please report all bugs on the Support Forums
This forum is for feature requests, content changes additions, anything not a Bug in the software.
Please report all bugs on the Support Forums
the physics is broke'd!
Pythagoras has been neglected!
one runs twice as fast when running diagonally
what about conservation of momentum? :/
one runs twice as fast when running diagonally
what about conservation of momentum? :/
 Modanung
 Knight
 Posts: 1719
 Joined: Fri May 20, 2005 4:51 pm
 Location: Groningen, The Netherlands
 Contact:
They run 1 / sin(45) times as fast. But yes, I agree it's wrong.
If you're looking for 3D FOSS games be sure to check out LucKey Productions on itch.io
will you show me a proof of this? Not because it's serious business, just for fun and to clear up my misconception.Modanung wrote:They run 1 / sin(45) times as fast. But yes, I agree it's wrong.
My logic behind saying twice is fast is that when you hold the right arrow while pressing up and down you don't lose any speed in the x direction while you traverse y, so I conclude that no velocity is lost and so both y and x must add completely to double the value.
Or do you mean the individual projections onto y and x are 1/sin(45) as fast.
 Modanung
 Knight
 Posts: 1719
 Joined: Fri May 20, 2005 4:51 pm
 Location: Groningen, The Netherlands
 Contact:
Adding vectors doesn't work that way.
Lets say by pressing right the speed of the character is set to (1 , 0) and by pressing up it is set to (0 , 1). Pressing both results in a speed vector of (1 , 1). But that doesn't meen the speed is 2.
The speed is equal to the diagonal of a 1x1 square which is the same as the longest side of a right isosceles triangle. Which is equal to 'c' in a^2 + b^2 = c^2... a=b=1 and thus c = sqrt(2) = 1,4 = 1 / sin(pi/4 rad) = 1 / sin(45 deg).
It's quite simple actually.
Lets say by pressing right the speed of the character is set to (1 , 0) and by pressing up it is set to (0 , 1). Pressing both results in a speed vector of (1 , 1). But that doesn't meen the speed is 2.
The speed is equal to the diagonal of a 1x1 square which is the same as the longest side of a right isosceles triangle. Which is equal to 'c' in a^2 + b^2 = c^2... a=b=1 and thus c = sqrt(2) = 1,4 = 1 / sin(pi/4 rad) = 1 / sin(45 deg).
It's quite simple actually.
If you're looking for 3D FOSS games be sure to check out LucKey Productions on itch.io
I totally should have known that, being a physics major and all. Quantum physics has distracted me from the basics I guess.Modanung wrote:Adding vectors doesn't work that way.
Lets say by pressing right the speed of the character is set to (1 , 0) and by pressing up it is set to (0 , 1). Pressing both results in a speed vector of (1 , 1). But that doesn't meen the speed is 2.
The speed is equal to the diagonal of a 1x1 square which is the same as the longest side of a right isosceles triangle. Which is equal to 'c' in a^2 + b^2 = c^2... a=b=1 and thus c = sqrt(2) = 1,4 = 1 / sin(pi/4 rad) = 1 / sin(45 deg).
It's quite simple actually.
I would have said though, that the vector is now:
1 ihat + 1 jhat, which has a magnitude sqrt(1^2 + 1^2) = sqrt(2) = 1.4
just because I'm lazy and it's a much simpler proof.
Anyway, thanks; always good to keep fresh on my trig
EDIT: I guess my misconception was that the mechanics were broke and that the vectors weren't being added right
So now I'm trying to think how you would fix that in the game:
You'd want to fix it so that x ihat + y jhat = 1
so 1 = sqrt(1/2 + 1/2)
so x and y would have to be cut down to sqrt(1/2) each for when players are traveling diagonally?

 Novice
 Posts: 332
 Joined: Thu Oct 18, 2007 2:38 pm
I think most isometric games (or pseudoisometric) work like that, in diagonal thy move to tile 1,1 in the same time as moving to 0,1 or 1,0. I think Mario and Luigi RPGs doesn't do the calculation like that, but I might be wrong.
Is my conception that this can't be avoided in a tile based movement system, right?
Is my conception that this can't be avoided in a tile based movement system, right?
For the ability to be extra mean: which university?Zao wrote:I totally should have known that, being a physics major and all. Quantum physics has distracted me from the basics I guess.
Also approximating the square root of 2 is even worse in my eyes and leads to trivial stuff like collapsing houses.
This message used to be meaningful.
Heh, the prestigious University of Alaska...Rotonen wrote:For the ability to be extra mean: which university?Zao wrote:I totally should have known that, being a physics major and all. Quantum physics has distracted me from the basics I guess.
Also approximating the square root of 2 is even worse in my eyes and leads to trivial stuff like collapsing houses.
but to be fair, we are one of the few remaining programs that we get a full year of:
electrodynamics
classical mechanics
advanced lab
quantum (modern)
I guess we're switching over to the new way though, one semester for each of those and then one "math physics" semester to make up for the missing semesters.
One of my classmates is in Grad Mechanics (which mostly has grad students from other schools) and he's way ahead of them because of the yearlong undergrad course. In fact, he just got out of a twoweek jailhouse "vacation" and still has the best grade in the class.
I don't think so... I'm pretty sure that the programmers decide the speed people go in the first place in the both the x and y axes.Pajarico wrote:I think most isometric games (or pseudoisometric) work like that, in diagonal thy move to tile 1,1 in the same time as moving to 0,1 or 1,0. I think Mario and Luigi RPGs doesn't do the calculation like that, but I might be wrong.
Is my conception that this can't be avoided in a tile based movement system, right?
I'm assuming all they have to do is:
(pseudocode)
Code: Select all
if (two directions pressed at once)
xspeed = xspeed/sqrt(2)
yspeed = yspeed/sqrt(2)
end
Well, you can always approximate better (up to the needs of your system) by adding more terms from a Taylor expansion.Rotonen wrote:Also approximating the square root of 2 is even worse in my eyes and leads to trivial stuff like collapsing houses.
In our case though, I was only really interested in proving that (1,1) didn't result in a speed of 2, which I should have known anyway, but none of my physics courses lately involve vectors. Thermo has avoided positions and velocity totally (statistical descriptions) and Quantum, of course, treats particles as waves.