Problems with physics and huge universe

This forum is currently in read-only mode.
0 favourites
From the Asset Store
A terrifying package of 101 professional-quality sound effects for monsters, small beasts, huge behemoths, dragons and m
  • I created this game with ridiculously big universe, with diameter of about 2*2^30 pizels (= 2 147 483 648 pixels) and applied a physics behaviour. However, the block the player is controlling, stops and begins to ignore player's commands when it's taken too far, about 20 000 pixels from the starting point. And it's NOT far, at least compared to the hugeness of the universe (and yes, those stars have physics also, and the furthest ones are over two BILLIONS of pixels away, still not causing problems [is it 'cause they don't move?])

    Is it a bug with physics? Or just a restricment of the possible world size?

  • Wow, I've never seen such a big game universe!

    Yeah, the physics behavior has a finite world size. The Box2D docs don't make it clear the purpose of the world bounding box - it's just been made as large as reasonably would be expected to be useful, which does seem to end about 20,000 by 20,000. It vaguely mentions it might improve performance to use a smaller bounding box, but I don't know why. What you want is effectively an unlimited physics world size anyway - I'm not sure that's possible with existing physics engines.

    You might be able to get some mileage by changing the world x/y scale (either make it really huge, or really small, I forget which). Apart from that, I think you're pushing beyond the limits of a physics engine. I don't think they're designed to span billions of pixels.

  • Well, I'll have to make a custom engine then :I. The game type doesn't definitely need complex physics... The cube has have angular and linear velocity and I'm planning that the planets pull the cube with gravitational forces, but not each other. Nothing more than that. Or, well... I might try some kind of coarse gravitation map people talked about in some thread. Besides that, the most hardest part will be the collision with planet's surface. We'll see.

  • Well at least you know where its own private universe ends. I'm guessing you could add some code to extend it from there. Its interesting this kind of of reminds me of a show I saw that talked about whether or not the universe is shrinking or expanding. Any way it was like its hard to tell because gravity is not a constant throughout the universe. More like pockets of gravity, with some other force that's been dubbed dark energy, or dark matter.

    Perhaps you could use something similar, by using different layouts.

  • Okay, I got rid of the problems!

    I implemented my own physics. You should be able to travel everywhere in the universe, though I noticed that the game experience gets worse in the edges of the universe, it's probably hitting the boundaries of the float numbers accuarcy. BUT, you won't be in the edge of the universe in a while, since it's so friggin' huge. I'm thinking of creating a game on this engine, but I need still the concept and ideas...

    Tell me how far did you get :D

  • Oh, sorry for the double post. I forgot to tell a protip:

    It seems that the controls of the rocket engines are pretty hard. Every key in "QWERASDF" corresponds to one of the rocket engines of the cube. Use W and E to thrust forward. W causes a counterclockwise torque and E a clockwise one. Using them at same time keeps the current angular velocity. And use spacebar! It's the only automatical controller I build there, but it shoud help a lot :D (If this is going to be a game, I guess that I have to make some more automatic features, since manual functioning is so hard)

  • I'm thinking of creating a game on this engine, but I need still the concept and ideas...

    I think the controls would need a little more polish before you tried turning this into a game. At the moment they seem to be in their most complex form and with a tiny nudge you can send yourself spiralling into a head-ache inducing rotation, the gravity of each star doesn't help with this.

    I think that slowing everything right down so it has that slow motion feeling of space, or building up the speed over time from VERY SLOW to what you have now would work a lot smoother. Also if it took a long period of time to build up to the maximum speed it would make the exploration of what is already a huge universe, seem even larger than what it is.

    If you need ideas however I'd be happy to try and help you out, purely from a design perspective.

  • It's impressive how big the universe is, but as isyc said, the controls really leave something to be desired. The tiniest tap on a thruster sends you into a death spiral. To get anywhere you need the spacebar held down the entire time.

    It also takes FOREVER to turn around and go the other way. I'm thrusting at max and still drifting slowly backwards, backwards, backwards.... okay, finally moving forwards.... inching along... okay now I have some momentum. Maybe it's just because I had to play zoomed out really far to actually see any movement at all and I was just going way too fast.

    The speed also makes it hard to navigate in a cluster of stars. At least, I can't.

    One key for thrust, one key each for left/right turns, one key for reverse, and one for full-stop I think would be sufficient. I applaud you for trying to come up with a unique control scheme though.

  • that's really cool, reminds me of elite 2

    Needs some work but awesome cool

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Its HUGE cant say anything else...

  • umm i just did some calculations and if they are right and lets say that cube moves 1k pixels per second i got that it takes 24,9 days to travel across that 2.147 billion pixel thing

  • Positions are stored as floats, not integers, so the integer limit doesn't apply. The maximum limit a 32-bit float can store is about 340282347000000000000000000000000000000, but the precision gets less and less the closer you get to that limit. In other words, you'll run in to issues with floating point precision long before you hit that limit, but precisely when that's an issue remains to be answered. However, for all reasonable intents and purposes, you can go as far as you like.

  • Don't get bogged down with realism, it always spoils space games, you'll end up with huge universes with not much going on.

    Buch better to have a smaller universe with lots going on than a huge sparse one.

    Maybe split the game into zones, like solar systems, and have something interseting and unique in each, then allow people to travel between them.

  • the premise of this giant universe gives me the Noctis vibes.

    i really like that :)

  • I like even the look!

    I would suggest some kind of parallax background, otherwise is hard to know when you are moving in close cameras.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)