Topic:   Space Movement- How would you do it?   (Read 21856 times)


0 Members and 1 Guest are viewing this topic.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Space Movement- How would you do it?
« on: November 01, 2011, 11:30:05 AM »
How would you guys make movement if you were making a space game?

How would you account for inertia, lack of friction and even propulsion as a space ship would like to move of it's own accord?
What about max speeds? Surely a ship shouldn't be able to propel itself to an infinite increasing velocity.

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: Space Movement- How would you do it?
« Reply #1 on: November 01, 2011, 03:16:55 PM »
"Now three researchers think they have found the source of inertia — and it turns out to be much closer to home. Inertia, they say, comes from the apparently empty space that surrounds us all — or rather, from the buzz of activity that, according to quantum theory, fills even a perfect vacuum, where subatomic particles are being created and annihilated in the blink of an eye. It is this ever-present sea of energy that the researchers believe resists the acceleration of mass, and so creates inertia." (http://www.calphysics.org/haisch/science.html, paragraph 3.)

So yes there is inertia, and because of that, it can't gain speed over that cap, or velocity over space terminal velocity.
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Charlo


  • GMG-er

  • **


  • Posts: 451
Re: Space Movement- How would you do it?
« Reply #2 on: November 01, 2011, 07:25:11 PM »
Just make it so that you keep moving in the direction you were accelerating, even after letting go of the button and attempting to turn.

The max speed thing shouldn't be an issue, since you're making a game, not a space simulator.  Just cap it at something where it's not so fast as to be unplayable.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Space Movement- How would you do it?
« Reply #3 on: November 01, 2011, 11:04:47 PM »
What about outside forces?

Lets say your ship gets struck by a missile that on detonation propels it at a greater velocity than that of the ship's top speed, how would you compensate?
I foresee the problem being when the player attempts to move, it'll jump this ship's velocity to under the ship's max velocity. The jump would most likely be very noticeable.

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: Space Movement- How would you do it?
« Reply #4 on: November 03, 2011, 03:42:53 PM »
I've never taken a physics class, but if it was me i'd make all the velocity change to zero, and then remake a large amount of velocity in the direction of the rockets collision course as push-back.
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

x


  • GMG-er

  • **


  • Posts: 247
Re: Space Movement- How would you do it?
« Reply #5 on: November 05, 2011, 06:08:12 AM »
Newton worked this one out in the 18th century.

I made an implementation of vector based newtonian space movement a while ago -- here is a really shitty example: http://mirrorimg.net/im1/oht.zip

Obviously I introduced some inconsistencies to make it more fun to move around -- for example there is no friction in space, but I simulated friction anyways so it feels more natural.

Sorry its only compiled for Windows. I could compile it for Linux, but since I don't have a mac I can't compile it for mac.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Space Movement- How would you do it?
« Reply #6 on: January 06, 2012, 06:38:27 PM »
If you don't want it to suddenly go down to the speed limit when they hit go just program it so it only accelerates if it wouldn't go over the cap, and if it would add more than the cap add exactly enough speed to match it. It avoids automatically resetting speed. Another idea is to add friction only above a certain speed, again, not exactly realistic but possibly good for gameplay.
Of course it should always allow movement if it would slow you down.

Speaking of platformers... Oh no sorry got sidetracked there.
« Last Edit: January 06, 2012, 06:40:17 PM by Connors »
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

EqwanoX


  • Administrator

  • GMG Extraordinaire

  • *****


  • Posts: 1180
Re: Space Movement- How would you do it?
« Reply #7 on: January 13, 2012, 08:48:52 AM »
i would like to make a terminal velocity clone but whats the math equation for determining the trajectory of projectiles that coincide with the ships rotation, i know its something with pi but im not good with complex mathamamatics

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Space Movement- How would you do it?
« Reply #8 on: January 13, 2012, 10:03:58 AM »
Yeah I just remembered I was gonna ask Gan how you fire projectiles based on rotation... Or fly the ship for that matter.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Space Movement- How would you do it?
« Reply #9 on: January 13, 2012, 10:11:15 AM »
I can create a shooting projectile demo based on real world physics using trigonometry after I finish the HTML5 GM.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Space Movement- How would you do it?
« Reply #10 on: January 13, 2012, 03:46:55 PM »
No I mean like in that nova space game how do you move based on rotation?
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Space Movement- How would you do it?
« Reply #11 on: January 13, 2012, 04:14:40 PM »
I have an acceleration and velocity vector. Just some fancy trigonometry. Just a few angles, rotation and magnitude calculations.