The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
October 03, 2024, 06:34:55 pm
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Starbase Café (Moderator: Death 999)
| | |-+  Star Control physics?
« previous next »
Pages: [1] 2 Print
Author Topic: Star Control physics?  (Read 2465 times)
Sargon
*Many bubbles*
***
Offline Offline

Posts: 129



View Profile
Star Control physics?
« on: January 08, 2017, 11:13:46 am »

This is not a philospohical or meta science discussion, heh

I have recently started learning unity and as part of learning the engine and practicing I decided to make a small SC like game.
I have done star control like games before and this is not too difficult, but I wonder what kind of thrust/physics does star control actually have(coding wise) and if there are several options or other ways to do it?

Basically each space ship(except for special ones) has a thrust and a maximum speed.
It's kind of like Newtonian physics only it seems when you thrust forward it "straighten" your velocity vector instead of just adding to your velocity vector up to infinity...
Also you can break heh.

So what kind of "flying" physics does SC have and what other suggestions do you have?
I will try something now and will tall you how it went.
Logged
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3873


We did. You did. Yes we can. No.


View Profile
Re: Star Control physics?
« Reply #1 on: January 09, 2017, 01:57:20 am »

You have correctly described the thrust physics. Just one other thing - there is a region around the planet in which the speed limit on engine acceleration doesn't apply. That is, if you thrust near the planet, there's no limit on how fast you can go. That's what makes gravity whips so effective, not the actual gravity.

I'm not sure what else you're asking for.
Logged
Sargon
*Many bubbles*
***
Offline Offline

Posts: 129



View Profile
Re: Star Control physics?
« Reply #2 on: January 10, 2017, 07:40:15 am »

Thanks,

Can you try this out? (It's using tutorial assets by Unity, but I made the coding...)

http://www.pompipompi.net/SpaceShooter/
Logged
Krulle
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1115


*Hurghi*! Krulle is *spitting* again!


View Profile
Re: Star Control physics?
« Reply #3 on: January 10, 2017, 11:34:39 am »

Moving physics feels right. Where's the planet? I want to do a gravity whip....!
You seem to have more possible angles than UQM/SC2 has.

Also, ship speed compared to weapon speed rather high. But that are balancing issues for later... (like all the stuff under the spoiler).
(click to show/hide)
« Last Edit: January 10, 2017, 11:38:00 am by Krulle » Logged
Sargon
*Many bubbles*
***
Offline Offline

Posts: 129



View Profile
Re: Star Control physics?
« Reply #4 on: January 10, 2017, 05:51:45 pm »

Left Ctrl for shooting.
Yea, the bullets are kind of too slow right now. As you mentioned...
There is wrapping now, maybe you tried it before the latest update.
I was updating it several times since this post.

Which ship size to max view/min view do you suggest?
Logged
Krulle
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1115


*Hurghi*! Krulle is *spitting* again!


View Profile
Re: Star Control physics?
« Reply #5 on: January 11, 2017, 10:12:31 am »

Well, that will also depend on the position/size of the planet.
In SC2, I always hated smacking into the planet because the planet was not shown and I was flying close to the border of the shown arena...
Or while fully-zoomed during the victory ditty.
hence I tended to stay under thrust, to see if the red dots from my exhaust show any sign of gravity change....

The new zooming in-out corresponds very well to the original auto-zoom function. Well done.
Killed my first asteroid. Haven't found a new one respawning.
(In SC2, if I remember correctly, there are always exactly 8 flying around. One killed/crashed on planet, a new one appears).

ctrl is not that smart to shoot for me, since I use that key in windows to indicate the position of my mouse cursor (on the multiple screens I often "loose track" where I left it when switching progs and doing things using keyboard)

The asteroid does not have collision checks yet? (except for shots)   ... I can fly right through it...
« Last Edit: January 11, 2017, 01:22:58 pm by Krulle » Logged
Sargon
*Many bubbles*
***
Offline Offline

Posts: 129



View Profile
Re: Star Control physics?
« Reply #6 on: January 12, 2017, 04:28:21 pm »

Added the planet(earh XD) and the possiblity to change it's gravity.
Now I have "every lasting" asteroids instead of asteroids that die after 20 seconds.

Gravity wipe isn't working too well now, I think it needs some non Newtonian physics or at least disable the "straighten drag" or increase thrust maximum speed?

By the way, you should browse in incognito mode or remember to clear the cache from your browser, otherwise you won't see the updated version.

Edit: Also you can now shoot with either the Left Ctrl or 'B'. Mouse button does not shoot now.
Logged
Krulle
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1115


*Hurghi*! Krulle is *spitting* again!


View Profile
Re: Star Control physics?
« Reply #7 on: January 12, 2017, 05:05:40 pm »

Gravity wipe whip isn't working too well now, I think it needs some non Newtonian physics or at least disable the "straighten drag" or increase thrust maximum speed?
Nope, as Death 999 pointed out above, in SC2/UQM near the planet the maximum speed cap is "off", so you can accelerate beyond your usual maximum speed... So, the usual physic is "non-newtonian", but in planet area you do get closer to newtonian physics.

Also the range of the gravity seems extremely weak. I sailed past very close, and still landed on the same side of the planet after once around the map. The gravity did not seem to have altered my path.
When pushing the "enemy" past the planet, the direction change seems to be very small.

Planet looks good. (love the rotation!)

And I saw asteroids bumping back from the planet.

Work in progress makes things look weird Smiley

(I assume there's no collision effect when bumping the planet yet, besides reversing the vector?)

The rest will come step by step, I am enjoying your progress!


I played around with the planet a bit.
I used my thruster to land "softly " on the planet, and then look what will happen.
I jumped a little higher each time I bumped back from the planet. After enough bumps I was able to achieve escape velocity, which I definitely did not have the first 3 bumps...
So, I am gaining kinetic energy from the planetary collisions while my engine is not in use.
Interesting effect.
In game, this will become irrelevant, no-one wants to trade crew/damage against free kinetic energy.... But interesting nonetheless.
« Last Edit: January 12, 2017, 05:24:16 pm by Krulle » Logged
Sargon
*Many bubbles*
***
Offline Offline

Posts: 129



View Profile
Re: Star Control physics?
« Reply #8 on: January 12, 2017, 05:54:40 pm »

Well I made gravity reduce by square distance, but it might not work too well in the game.
Could it be the gravity is reduced linearly in SC2?

Yea, I also did a 2.1 factor for the bump(it's 2 because it needs to negate your own velocity as well). So you gain energy.
A non gain/lost would need to be a factor of 2.
I am just afraid a bit if you become extremely slow you might enter the planet, because I didn't use unity's physics. So I guess I will either need to make a "translation" when ship is inside the collision, or to add a constant to the bump or a minimum velocity bump?
Although I remember that in SC2 you would just lose health really fast if you "stick" to the planet. So you didn't bump if your ship had 0 velocity.

So does the gravity wipe comes from the ship's unbounded thrust? I mean, if you just fly fast near the planet without using your engine it won't make you go faster? Oh I guess it will just change your direction without making you go faster?
Logged
Krulle
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1115


*Hurghi*! Krulle is *spitting* again!


View Profile
Re: Star Control physics?
« Reply #9 on: January 12, 2017, 10:51:46 pm »

Indeed, no thrust meant no acceleration near the planet, besides the usual attraction-acceleration and deceleration... You just had a different vector afterwards.
Also, sine the ship is far too large compared to the planet in SC, the gravity attraction decline with distance was most likely not inverse square law....
Logged
Sargon
*Many bubbles*
***
Offline Offline

Posts: 129



View Profile
Re: Star Control physics?
« Reply #10 on: January 13, 2017, 07:42:25 am »

Ok, I have made some changes to gravity and now it's possible to have gravity wipes.
I think I will work next on making AI and have two powers for each ship, just to test how it plays. The space ships are from a tutorial so I am going to change them, this is just for testing how it all works together.
Any suggestions for stuff to add and change before testing gameplay?
Logged
Krulle
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1115


*Hurghi*! Krulle is *spitting* again!


View Profile
Re: Star Control physics?
« Reply #11 on: January 13, 2017, 03:12:32 pm »

Okay, the gravity whip works, I achieve about double final speed of what I had before.
What does wonder me, though, is that I can go from 20 to 50 (falling towards the planet), and when leaving the planet I go back down to 40.
This breaking due to gravity pull back I do not remember from SC2. At least not to that degree I "felt" it here.

The difference in SC2 is still higher than just double the speed...
Try the Mycon for example. The Mycon podship is exceptionally good with gravity whips. I do not know the code at all, but it feels like the podship  can achieve tenfold speeds through gravity whips.


Regarding adding/removing/altering featrues: no, nothing important comes to my mind....
Possibly show how much health a ship has remaining?

Regarding balancing of ships you may want to change things later on anyway...
Logged
Sargon
*Many bubbles*
***
Offline Offline

Posts: 129



View Profile
Re: Star Control physics?
« Reply #12 on: January 19, 2017, 04:51:04 pm »

Hi, I have made a small update. Didn't have a lot of time to work on it due to work.
Basically I added AI to the enemy and you can battle out a bit.
Logged
Krulle
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1115


*Hurghi*! Krulle is *spitting* again!


View Profile
Re: Star Control physics?
« Reply #13 on: January 20, 2017, 10:17:04 am »

Feature missing: a restart button.
It is annoying to reload the whole page just to restart.
Logged
Sargon
*Many bubbles*
***
Offline Offline

Posts: 129



View Profile
Re: Star Control physics?
« Reply #14 on: March 26, 2017, 03:26:39 pm »

I have stopped working on this game for now.
It was partially for learning purpose.
I am now working on a new unity game, but it's a fantasy RPG.
I will post it in the general forum.
(I might continue this game at some point thoguh).
Logged
Pages: [1] 2 Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!