Search Unity

Space game idea

Discussion in 'Game Design' started by Ed_Muel, May 14, 2022.

  1. Ed_Muel

    Ed_Muel

    Joined:
    Mar 16, 2017
    Posts:
    51
    I've been mulling this over for a while, but struggling to think of a way I can pull it off

    It kind of annoys (not really but maybe a little bit) me that every scifi has artificial gravity, we've barely left the planet and that's the first thing they get down. When in reality we barely know what gravity is let alone have some way of recreating it. Which got me thinking about a game without it at all.

    So it's a game based in space and zero g... But it's not a space sim, there's still aliens and space battles and combat with lasers and projectiles, but all without gravity.

    Movement is pulling along walls or pushing off but then you're stuck on a line until you hit something. You could jump from ship to ship although I would probably then give them a bit of a jet pack to manouveve a little bit left or right and spin. You can grab on to objects, but will bounce off them if going to fast.

    Not sure how melee would work in space but reckon you could make something interesting where you keep bouncing off with each hit.
    Lasers would be standard, but why not have a projectile weapon that knocks you or whatever you're holding on to backwards.

    Has anyone seen any decent space zero g games, it's the animations I would have thought would be the hardest part to get a hold of, and I can't imagine the mechanics of space would be easy to calculate, I struggled rotating a camera round an axis, let alone working out the pushing of objects in space.
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    The Lone Echo series does zero-g really well in VR.
     
  3. Ed_Muel

    Ed_Muel

    Joined:
    Mar 16, 2017
    Posts:
    51
    Yeah, I've just checked that out and it looks pretty sweet.

    Annoying that it's on Oculus and is quite platformery, as there definitely could be a third person action game in there. But, just seeing it confirms it's all well out of my league :) it needs to look and fancy in space to get the benefit of the vistas and what not, and the physics looks complex, their animations for swinging through space look awesome... I'll probably just buy an Oculus and call it a draw.
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    If you play Lone Echo and it inspires you to make a game, you could try a 2D version. With Unity, in many ways 3D isn't harder than 2D. But 2D at least constrains one dimension when you're designing levels and gameplay, which makes it easier in that respect.
     
  5. Ed_Muel

    Ed_Muel

    Joined:
    Mar 16, 2017
    Posts:
    51
    Yeah I'm sure I could, it would still work/look great in 2d and simplify the math a lot, but I am feeling like this project is for someone else.

    I have 2 games on the go already that aren't my favorite games to play, but ones I picked because 1. I could personally add something and 2. it could theoretically be done by a single developer with a full time job and 2 young kids. I'm not sure this fits in to either category.

    Great shout for a game to play though, and if someone wants to make a more actiony third person one then I'll happily play that as well.
     
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Recreating gravity is indeed difficult, but recreating the effects of gravity is actually fairly straightforward.

    Gravity causes acceleration. Acceleration is modeled exceptionally well with vector math. One of the things that you'll notice if you give that a go is that there is no practical difference between you accelerating against a thing vs. that thing accelerating against you. In other words, there's no difference between us being pulled into the ground on Earth by its gravity, and a space ship being pushed into us because it's accelerating forwards.

    So, sure, we have no idea how to make Star Trek / Star Wars style magical gravity which is entirely independent of how the vessel is moving. But we do have designs for both space ships and space stations which are able to simulate the effects of gravity using technology we have right now.

    If your space ship is going to be accelerating through space (i.e. if it is going to go somewhere) then it already has a stable force in a given direction. Any occupant on the ship is going to be "pushed" in the opposite direction to its acceleration. So if we want the effect of gravity then all we need to do is align the rooms in the ship so that the "floor" is oriented against the typical direction of travel*. Of course when the ship stops accelerating or is chancing direction then the gravity goes away or changes. This comes up in quite a bit of sci-fi (though probably books more than movies).

    Space stations are a bit more difficult, but the same principle applies. It's why so many of them have a ring shaped design. They typically want to remain stationery so they're not accelerating. Instead, so-called centrifugal force** is used. The ring is rotated, and anything rotating along the ring is "pushed" towards its outside. Again, this is not actually gravity, but that makes no practical difference to any bodies undergoing the resulting forces.

    Now, I still think a game about this stuff would be great. Some of my favourite parts of Dead Space were the sections where gravity changed. There's great opportunity for interesting exploration and re-use of spaces, and giving people unique and engaging puzzles to solve which would also sneakily teach them some applied physics. To do that you'll need to first have a firm grasp of the physics for yourself, though. That said, it's mostly vector math, and you'll be learning that in order to make games anyway.

    * Travel in space is not like travel in a car or plane. There's no legally mandated speed limit and there's no drag, so you just keep accelerating until it's time to slow down. And then you maintain your force vector by just turning around. That comes with other benefits you should totally look into, but which are off topic here.

    ** Centrifugal force is not actually a force, but that's also a topic for another time.
     
    Ryiah and GimmyDev like this.
  7. Ed_Muel

    Ed_Muel

    Joined:
    Mar 16, 2017
    Posts:
    51
    Oh I'm not denying it's possible to build a real space ship that can mimic gravity, just that games rarely have any concept of gravity being a thing at all, books tend to be better and the odd films does okay, (i liked ad astra) but games just have a magical artificial gravity button...

    It just feels like there's a niche there though right? Like there's loads of little bits that would look and feel great to play... You've got all this great physics and environments, the way you pull yourself round the inside / outside ship looks awesome, combat would almost be a little bit bullet timey as you kick off walls. Step away from puzzle and make it a smart persons shooter, I reckon you're laughing... Look at dying light
     
  8. Cato11

    Cato11

    Joined:
    Jan 5, 2021
    Posts:
    233
    I think your idea is an intriguing one, I've played very few zero-g games but the gameplay is awesome if done right. It might sound trivial but I still remember the zero-g level of Crash Bandicoot 2 (waaay back on PS1!) being insanely fun. I never played Dead Space but I recall seeing some videos that looked great, and a lot of people said the gameplay of those sections is superb.

    I suspect it would be quite hard to implement though. You could go for a physically accurate model taking into account mass or just fake it with some "floaty" animations. Faking gravitational effects is surprisingly easy, as angrypenguin says.

    From a gameplay perspective, some things to consider:

    • If you're floating around a lot and there is combat, how do you keep it engaging and not frustrating? Combat usually involves evasion so you'd need some kind of propulsion as you mentioned. You'd also need to factor in a need to have tight controls and balance the "floatiness" against the need for precision when firing.
    • If movement is primarily pulling against walls, then you are constrained somewhat by narrow level design. For example if you had a large open area, you'd be moving around the perimeter most of the time. You could theoretically hop through the central space by placing floating objects there, but they too would be moving. So you'd need to constrain their movements to make the space navigable.
    • Bouncing off during melee could work but you also don't want it to be frustrating. It would need a lot of tinkering to get the right amount of "bounce".
    These are just some initial thoughts. It certainly is an intriguing idea!
     
  9. GimmyDev

    GimmyDev

    Joined:
    Oct 9, 2021
    Posts:
    160
    what angrypenguin said ...

    ... but also diamagnetic and paramagnetic levitation (levitation on earth only) ...
    ... and simple magnet on wearable and equipment ...
     
  10. Ed_Muel

    Ed_Muel

    Joined:
    Mar 16, 2017
    Posts:
    51
    Sorry I missed these updates,

    There are a lot of level design decisions you'd have to make, but that's the heart of making a game. You'd have to plan out your station to allow someone to move around like that. Access corridors you reach both sides of so you can't get stuck without a wall. Don't have gaps that big your jets can't get you out of it... Then have some creative fun that makes the most of it. The difference between challenging and frustrating is generally how punishing it is when a player gets it wrong.

    I'm not saying it wouldn't need balancing, but then no more than any other game.

    I had a look in to the actual science bits, I might have gotten my maths wrong, I'm old and I just googled it, but to create a nice comfortable G you'd have to accelerate at 22mph a second, which is pretty fast. That's a net increase of 1.9M mph every day... And if you've got a hefty sized station thats a lot of fuel, when you could just learn to float

    Not opposed to magnets, and they may well play a part in certain situations / rooms, but that's not going to feel the same as Gravity, if you're clothes are pulling you down.
     
  11. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Yes, that's ~9.8 meters per second, which is the approximate gravity at sea level on Earth. Yes it is "pretty fast", but keep in mind that any vessel launching into space, or even flying on Earth, has to exceed that to lift against Earth's gravity in the first place. Once outside of Earth's atmosphere, also consider that there is no drag.

    You're still right that a huge vessel = huge mass = huge amounts of energy to accelerate, of course. It could be worth looking at habitat rings or similar in cases where the acceleration isn't achievable.

    In any case, given the distances between objects in space you almost certainly want to be accelerating all the time. As far as we are currently aware it is impossible for an object of any mass to reach the speed of light, likely requiring huge amounts of energy to travel at a fraction of that. So even traveling to our nearest star (~4 light years away) is a journey of a decade or more.

    Long term absence of gravity has negative effects on the human body, so that's probably not a good idea.
     
  12. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,175
    To use a phrase from Toy Story: You're not recreating gravity. You're slamming the floor into the user's feet with style. :p

    Speaking of which I saw a surprising number of threads concerning centrifugal force but none of them had much of a solution. I suppose the easiest would be to calculate the direction the force is supposed to be "coming from" and adjust the gravity vector.
     
    Last edited: Jun 20, 2022
  13. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    That would be because there is no such thing as "centrifugal force". It does not exist. It is an illusion.
    upload_2022-6-20_9-28-39.png
    In the absence of an external force any object continues to move with its existing velocity. That's what's known as "momentum".

    In my little diagram there, the red dot is an object which is already moving at some speed. That's represented by the blue line.

    Lets imagine that the object is a rock in a sling, being hurled around someone's head. In that case the rock will follow an arc, such as the black line. To go in a circle it is constantly being pulled towards a central point. As soon as the sling pouch opens and that pull disappears the rock will be traveling only under its own momentum, and will go back to following the blue path.

    The thing we call "centrifugal force" is just the difference in momentum between two objects. What appears to us to be a force is in fact just the difference between an object's existing motion and a new direction it's being made to move in because something else is in the way.

    So if you're standing in the rotating habitat ring of a space station there is nothing pushing you outwards from the center. Instead, the floor you're standing on is moving sideways. That gives you a bit of momentum (blue line) in the same direction that the floor is currently moving. But the floor isn't moving in a straight line, it's moving in a curve (black line). So in the next moment there's a slight mismatch between your momentum and the direction the floor is moving in.

    The floor is swinging around in a curve, and your existing momentum is a straight line. The difference between the two is a vector which points into the floor, but the only force is one going sideways.

    So, why don't you feel like you're being pushed sideways? Because the floor and everything else nearby is moving at the same speed, so it's cancelled out. From your frame of reference the only apparent acceleration is that vector into the floor.

    In many cases that would be close enough. If the player is in a large enough area that the curvature is noticeable I'd probably go one step further: set the PhysX gravity to (0,0,0) and give each body a ConstantForce component pointing away from the axis of rotation.

    But if you want to simulate it properly you don't do that at all. Instead you make sure that there is appropriate friction between objects and then you actually rotate the vessel. Anything in contact with it will be accelerated sideways until their momentum (almost) synchronizes, at which point every object will behave per the red dot above.
     
    Last edited: Jun 20, 2022
    Ryiah likes this.
  14. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,175
    I understand that but it's a common term to refer to this.