I made this "2D Orbiter" at a game jam (also, it's open-source)

cr1

Promoting vegetables in space
Joined
Apr 20, 2008
Messages
152
Reaction score
1
Points
18
Location
Zurich
Something with "space, rockets and gravity" was all I could think of when I walked in to the GI Game Jam (organized by UWaterloo's Games Institute) about two weeks ago.

So here's grav, a 2D simpler version of Orbiter, where you control a rocket that obeys the laws of motion and gravity.
- Ship always looks at mouse.
- Click for full thrust, right-click for retro (30%).
- Beware, fuel is limited.
- Don't land too hard or aerobrake in the sun (heliobraking?).
- Landing in a spaceport refuels and repairs your ship.

Try it here! http://zhaop.me/grav/

Mirror if main link is down: http://grav.orbiter-radio.co.uk/ (thanks Xyon!)

I also had in mind other pretty neat stuff (gravity slingshots, space stations and explosions) that ultimately didn't make it, and you can see there's nothing much really to do in here ("how do I win"). So I'm definitely still going to work on this!

Would love to know what you guys think. What was not fun? What was frustrating? What would you really want to see next?

Hack it here: https://github.com/zhaop/grav/

orbiter-forum-screenshot.png
 
Last edited:

malisle

Donator
Donator
Joined
Jul 8, 2012
Messages
110
Reaction score
0
Points
16
Make it into an MFD game so that Orbinauts have something to do in those long and boring voyages :) Joking aside, I really like it. It reminds me of Space Agency, but with better physics.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,390
Reaction score
577
Points
153
Location
Vienna
Would love to know what you guys think. What was not fun? What was frustrating? What would you really want to see next?

First of all: nice little game :thumbup:. It seems to me that this is server based and already multi-player? I've seen a grey vessel going around while I was playing it...

Some feedback:

  • The mouse "steering" is a bit uncomfortable. Why did you not chose a traditional keyboard layout (WASD, cursor keys)?
  • The thrusters are a bit overpowered, very hard to use it to make fine course corrections. I did not try a modifier key (Shift, Control) to the mouse clicks, so perhaps you have that already in. If not, maybe you can use that scheme to implement a coarse/fine mode switching.
  • Do you use n-body gravity calculation? It seems like the various gravity objects heavily influence orbital trajectories of the vessel due to the close vicinity. It is not so easy to establish a stable orbit in this environment.
  • If the multi-player assumption is valid, I'd like to see a simple docking mechanism with other players. Dock them together nose on nose and let each main thruster move both vessels. Should make for some fun moments.
regards,
Face
 

BruceJohnJennerLawso

Dread Lord of the Idiots
Addon Developer
Joined
Apr 14, 2012
Messages
2,585
Reaction score
0
Points
36
That is really cool. :) Ive been working on a similar idea for a while now, but Im not quite as far along as this just yet:

https://github.com/BruceJohnJennerLawso/Ignition_Engine

This is really well done. Definitely would be cool as some sort of online multiplayer game to run from a server.

Two quick questions:

-Are the orbit prediction traces conic sections, or some other type of projection?
(if so, do you mind if I study your code and adapt it for mine?)

- How does the collision detection work? does the game just reflect the velocity vector component thats normal to the surface when a collision is detected?

---------- Post added 10-19-14 at 00:13 ---------- Previous post was 10-18-14 at 23:56 ----------

The mouse "steering" is a bit uncomfortable. Why did you not chose a traditional keyboard layout (WASD, cursor keys)?

Personally, I thought that part was okay, even when using a laptop touchpad. The idea probably wont graft well at all with implementing complete rotational dynamics, but its very intuitive and more fun to play with IMO.

This would be really cool as a front-end to a space economics simulation, add in space stations in regular orbits that act as trade hubs (maybe consider docking to be if the ships are within some distance of one another & have low enough relative velocity?)
 
Last edited:

Nicholander

New member
Joined
Aug 7, 2014
Messages
256
Reaction score
0
Points
0
Hmm... I can't connect to the zhaop.me website to play it, is it just down temporarily for everyone, or is it just me?
 

Bibi Uncle

50% Orbinaut, 50% Developer
Addon Developer
Joined
Aug 12, 2010
Messages
192
Reaction score
0
Points
0
Location
Québec, QC
Nice little app ! I've been trying to find that big star. Is it the red one ? I've been drifting for a long time now, and I can't find any other... :lol:

I see that you use PixiJS has a Library. I'm currently exploring the different technologies for canvas rendering. EaselJS was my favourite library, but I never saw PixiJS. What do you think about it ? It seems to handle WebGL much better than EaselJS. However, the compatibility isn't as effective. It runs very well in IE11 but not on IE10 or 9, even if the support the canvas.
 

RisingFury

OBSP developer
Addon Developer
Joined
Aug 15, 2008
Messages
6,427
Reaction score
491
Points
173
Location
Among bits and Bytes...
I love it!

Besides the blue planet and the yellow star, I found a gray planet. Kind of top left of the yellow star. And another giant red star, top of the yellow one, along with a green planet.

I love how the gravity works. The center of gravity seems to be somewhere between the yellow and red stars. To find it, I stopped to see where the ship would fall. It fell towards it. So opposite of the yellow star had to be another body :p

Going very fast also zooms you out.
 
Last edited:

Nicholander

New member
Joined
Aug 7, 2014
Messages
256
Reaction score
0
Points
0
Umm... guys? I still can't connect to the website to play it, what "magic" are you using to play it? Do you use the thing in the github? But that has no .exe. Seriously guys, help me here.
 

Bibi Uncle

50% Orbinaut, 50% Developer
Addon Developer
Joined
Aug 12, 2010
Messages
192
Reaction score
0
Points
0
Location
Québec, QC
You must use a browser that supports canvas rendering. I tested it in IE11 and Chrome. IE9 and 10 doesn't seem to work in emulation mode, and IE8 doesn't even support canvas rendering.

Check that you use a compatible browser.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,390
Reaction score
577
Points
153
Location
Vienna
Ok, after studying your code a bit, I think my assumption of it being server-based and multi-player was way off. I guess the grey ship I've seen is the "lolship", presumably just in for the "lulz"? :lol:
 

Nicholander

New member
Joined
Aug 7, 2014
Messages
256
Reaction score
0
Points
0
You must use a browser that supports canvas rendering. I tested it in IE11 and Chrome. IE9 and 10 doesn't seem to work in emulation mode, and IE8 doesn't even support canvas rendering.

Check that you use a compatible browser.
I use Firefox, I don't know what version it is, but I'm pretty sure it's the latest updated version.
 

Fizyk

Member
Joined
Jun 20, 2008
Messages
285
Reaction score
1
Points
18
Location
Warsaw
Website
ebvalaim.net
Hmm... I can't connect to the zhaop.me website to play it, is it just down temporarily for everyone, or is it just me?
What error do you get? Something like "address not resolved" or something like "connection timeout"? Because to me it sounds like either you have a DNS problem, or your provider (or firewall) is blocking this host for you for some reason.
 

Nicholander

New member
Joined
Aug 7, 2014
Messages
256
Reaction score
0
Points
0
Well, for about about half a minute seconds it says "Connecting..." and then it gets the "Server not found" thing.
 

Fizyk

Member
Joined
Jun 20, 2008
Messages
285
Reaction score
1
Points
18
Location
Warsaw
Website
ebvalaim.net
Ok, so it looks like something is blocking your connection. Maybe try connecting via a proxy server, for example from this list: http://www.publicproxyservers.com/proxy/list1.html
Remember to unblock javascript though (most proxies have a "remove scripts" checkbox - make sure it is not checked), since this whole game is in javascript (which on the other hand means that the proxy server won't slow it down, and that's good news ;) ).
 
Last edited:

Nicholander

New member
Joined
Aug 7, 2014
Messages
256
Reaction score
0
Points
0
I tried with the smartproxy.ml thing, and it's just a white screen. Is there some way to play it using the github download?
 

Fizyk

Member
Joined
Jun 20, 2008
Messages
285
Reaction score
1
Points
18
Location
Warsaw
Website
ebvalaim.net
Yes, you can download the content of the repository (either as a zip using the button on the right, or using "git clone") and then just view index.html in the browser.
 

Ripley

Tutorial translator
Donator
Joined
Sep 12, 2010
Messages
3,133
Reaction score
407
Points
123
Location
Rome
Website
www.tuttovola.org
Very nice!

1) Whenever I zoom out, fps drop to a slideshow (in firefox).
2) Maybe a (togglable) minimap in a corner could be useful.
 
Last edited:

cr1

Promoting vegetables in space
Joined
Apr 20, 2008
Messages
152
Reaction score
1
Points
18
Location
Zurich
LONG POST INCOMING

Oh dear, thank you for all of your kind comments and your feedback! I've been preparing for Hell week (midtermssss) so couldn't answer you all right away. I'm sorry!

  • The mouse "steering" is a bit uncomfortable. Why did you not chose a traditional keyboard layout (WASD, cursor keys)?
  • The thrusters are a bit overpowered, very hard to use it to make fine course corrections. I did not try a modifier key (Shift, Control) to the mouse clicks, so perhaps you have that already in. If not, maybe you can use that scheme to implement a coarse/fine mode switching.
  • Do you use n-body gravity calculation? It seems like the various gravity objects heavily influence orbital trajectories of the vessel due to the close vicinity. It is not so easy to establish a stable orbit in this environment.
  • If the multi-player assumption is valid, I'd like to see a simple docking mechanism with other players. Dock them together nose on nose and let each main thruster move both vessels. Should make for some fun moments.
Ok, after studying your code a bit, I think my assumption of it being server-based and multi-player was way off. I guess the grey ship I've seen is the "lolship", presumably just in for the "lulz"? :lol:
  • I thought the mouse allowed for more fine-grained control over where the rocket was going; keys felt too clunky in a fast moving game.
    Does it take a lot to get used to the mouse?
  • Agree with thrusters being overpowered. Thing is, it's almost at the limit of power needed just to lift off that blue planet, last time I checked.
    Would something like thrust levers (like in Orbiter) be a good idea?
  • The ship is attracted by every body here, so stable orbits are in fact hard. I'm guessing once I get planets orbiting stars, with the centrifuge acceleration orbits should be more stable.
  • lolship was in fact thrown in during the last 10 minutes of the jam. He's slightly dumb, doesn't know how to fly very well but always manages to land pretty smoothly :thumbup:
  • Multiplayer would be good, and doing servers with javascript sounds like a fun challenge I might need help with! I'm thinking nodejs.

It reminds me of Space Agency, but with better physics.
Argh, this is addicting! Came back from Oktoberfest at 3am, this kept me playing until 9 :D midtermssss!

That is really cool. :) Ive been working on a similar idea for a while now, but Im not quite as far along as this just yet:

https://github.com/BruceJohnJennerLawso/Ignition_Engine

This is really well done. Definitely would be cool as some sort of online multiplayer game to run from a server.

Two quick questions:

-Are the orbit prediction traces conic sections, or some other type of projection?
(if so, do you mind if I study your code and adapt it for mine?)

- How does the collision detection work? does the game just reflect the velocity vector component thats normal to the surface when a collision is detected?

Thanks! Try doing a 48-hour sprint and force yourself to finish some part of it ;)

The path prediction works by just brute-forcing the physics engine 600 steps forward (I think?) and drawing the path of the rocket. It does that every frame, so if you fire thrusters the prediction updates instantly. Physics is just sum of forces (gravity + friction + collision), then [ame="http://en.wikipedia.org/wiki/Euler_method"]Euler[/ame]. Collisions with the surface is reflection of velocity vector times a restitution constant, so some energy is lost.

The code is completely open, feel free to do things with it!

Hmm... I can't connect to the zhaop.me website to play it, is it just down temporarily for everyone, or is it just me?

Are you at a school or workplace with some kind of Internet filter? zhaop.me is actually on a free host, and I heard these filters love to block 'em.

Nice little app ! I've been trying to find that big star. Is it the red one ? I've been drifting for a long time now, and I can't find any other... :lol:

I see that you use PixiJS has a Library. I'm currently exploring the different technologies for canvas rendering. EaselJS was my favourite library, but I never saw PixiJS. What do you think about it ? It seems to handle WebGL much better than EaselJS. However, the compatibility isn't as effective. It runs very well in IE11 but not on IE10 or 9, even if the support the canvas.

The pink-red star is in fact the "big star". Much underwhelming and not deserving of its title? :lol:

Pixi.js was mostly a personal choice, I'm sure other libs would be just as appropriate. Pixi.js sells itself as the fastest rendering engine (and I bought into that, haha), and the API is similar to Flash (which I'm familiar with). I haven't thought of compatibility issues though, Pixi claims to support IE9+?

I love how the gravity works. The center of gravity seems to be somewhere between the yellow and red stars. To find it, I stopped to see where the ship would fall. It fell towards it. So opposite of the yellow star had to be another body :p

The L1 point between yellow star and blue planet was fun to find too :)

1) Whenever I zoom out, fps drop to a slideshow (in firefox).
2) Maybe a (togglable) minimap in a corner could be useful.

Ah, more compatibility issues. I can't seem to even zoom on Firefox; also, it seems a lot slower. I'll be working on this.
Does your laptop fan also go on steroids?


Sorry for the long post, I'll be working on this as soon as I'm back on track! In the meantime always feel free to hack this thing here.
 
Last edited:

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,390
Reaction score
577
Points
153
Location
Vienna
  • I thought the mouse allowed for more fine-grained control over where the rocket was going; keys felt too clunky in a fast moving game.
    Does it take a lot to get used to the mouse?


For me it did. But that might be just personal preference.



  • Agree with thrusters being overpowered. Thing is, it's almost at the limit of power needed just to lift off that blue planet, last time I checked.
    Would something like thrust levers (like in Orbiter) be a good idea?


Could you perhaps combine the mouse-click with keyboard modifiers? Say CTRL+click gives only 10% thrust.



  • The ship is attracted by every body here, so stable orbits are in fact hard. I'm guessing once I get planets orbiting stars, with the centrifuge acceleration orbits should be more stable.
The path prediction works by just brute-forcing the physics engine 600 steps forward (I think?) and drawing the path of the rocket. It does that every frame, so if you fire thrusters the prediction updates instantly. Physics is just sum of forces (gravity + friction + collision), then Euler. Collisions with the surface is reflection of velocity vector times a restitution constant, so some energy is lost.

Try Runge-Kutta instead of Euler integration method. Quite a difference in stability.

regards,
Face
 
Top