the physics is broke'd!

Got something on your mind about the project? This is the correct place for that.


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

Post Reply
Zao
Peon
Peon
Posts: 9
Joined: 28 Oct 2007, 09:09

the physics is broke'd!

Post by Zao »

Pythagoras has been neglected!

one runs twice as fast when running diagonally

what about conservation of momentum? :/
User avatar
Saphy
Warrior
Warrior
Posts: 371
Joined: 09 Nov 2006, 18:32

Post by Saphy »

It isn't physics, it is just that characters are more emotionally incided to run faster diagonally. :p
User avatar
Modanung
Grand Knight
Grand Knight
Posts: 1719
Joined: 20 May 2005, 15:51
Location: Groningen, The Netherlands
Contact:

Post by Modanung »

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
Zao
Peon
Peon
Posts: 9
Joined: 28 Oct 2007, 09:09

Post by Zao »

Modanung wrote:They run 1 / sin(45) times as fast. But yes, I agree it's wrong.
will you show me a proof of this? Not because it's serious business, just for fun and to clear up my misconception.

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.
User avatar
Modanung
Grand Knight
Grand Knight
Posts: 1719
Joined: 20 May 2005, 15:51
Location: Groningen, The Netherlands
Contact:

Post by Modanung »

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. :)
If you're looking for 3D FOSS games be sure to check out LucKey Productions on itch.io
User avatar
AxlTrozz
Knight
Knight
Posts: 843
Joined: 04 Aug 2006, 23:12
Location: Now from TX

Post by AxlTrozz »

he :shock: ??? :?: :?:

ermm , yea yea is what I was thinking .....
Zao
Peon
Peon
Posts: 9
Joined: 28 Oct 2007, 09:09

Post by Zao »

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 totally should have known that, being a physics major and all. Quantum physics has distracted me from the basics I guess.

I would have said though, that the vector is now:

1 i-hat + 1 j-hat, 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 i-hat + y j-hat = 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?
blackrazor
Warrior
Warrior
Posts: 332
Joined: 18 Oct 2007, 13:38

Post by blackrazor »

hexagonal mapping ftw :)
User avatar
Pajarico
Knight
Knight
Posts: 592
Joined: 28 Feb 2005, 19:29
Contact:

Post by Pajarico »

I think most isometric games (or pseudo-isometric) 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?
Lv.: Maggot
Please, read the FAQ before posting.
User avatar
Rotonen
TMW Adviser
TMW Adviser
Posts: 3154
Joined: 08 Sep 2004, 19:48
Location: Bern, Switzerland

Post by Rotonen »

Zao wrote:I totally should have known that, being a physics major and all. Quantum physics has distracted me from the basics I guess.
For the ability to be extra mean: which university? :twisted:

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.
Zao
Peon
Peon
Posts: 9
Joined: 28 Oct 2007, 09:09

Post by Zao »

Rotonen wrote:
Zao wrote:I totally should have known that, being a physics major and all. Quantum physics has distracted me from the basics I guess.
For the ability to be extra mean: which university? :twisted:

Also approximating the square root of 2 is even worse in my eyes and leads to trivial stuff like collapsing houses.
Heh, the prestigious University of Alaska...

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 year-long undergrad course. In fact, he just got out of a two-week jailhouse "vacation" and still has the best grade in the class.
Zao
Peon
Peon
Posts: 9
Joined: 28 Oct 2007, 09:09

Post by Zao »

Pajarico wrote:I think most isometric games (or pseudo-isometric) 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 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.

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
Rotonen wrote:Also approximating the square root of 2 is even worse in my eyes and leads to trivial stuff like collapsing houses.
Well, you can always approximate better (up to the needs of your system) by adding more terms from a Taylor expansion.

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.
Post Reply