Skip to main content
GameDev.net gamedev.net
🔒 Locked

Black Holes

Started by EmrldDrgn Oct 30, 2006 at 9:09 PM 40 replies 9.6k views
Original Post
EmrldDrgn
EmrldDrgn
Has anyone done any work on using (somewhat) realistic black holes in games, for instance space combat games? Also, does a black hole's size affect its gravitational pull in any meaningful way?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~I program in C++, on MSVC++ '05 Express, and on Windows. Most of my programs are also for windows.
Ceoddyn
Ceoddyn
Very little is known about black holes (or if they even exist). From what little I know and some guess work, I'd say:

1) they have no specific size

2) their gravitational pull has no specific measurement

Really they exist outside of our common understanding of physics, so feel free to come up with your own mechanics for black holes in your game and/or disreguard everything I've said (as it is speculation).
Morpheus011
Morpheus011
In my mind when I think of the mechanics of a black hole in a game, I imagine it working like a sink drain, where anything in the vicinity is slowly "sucked in" to the space (or lack thereof) of the black hole.
Bob Janova
Bob Janova
Outside the event horizon, it's just a perfectly ordinary large mass effect. Inside, theoretically it is also just a large mass effect, so large you can't escape, but since you can never observe it you can do whatever you like to someone's screen who's in a black hole ;).
Graphain
Graphain
Quote:
Original post by Ceoddyn
Very little is known about black holes (or if they even exist). From what little I know and some guess work, I'd say:

1) they have no specific size

2) their gravitational pull has no specific measurement

Really they exist outside of our common understanding of physics, so feel free to come up with your own mechanics for black holes in your game and/or disreguard everything I've said (as it is speculation).


I am reasonably certain we have a lot of evidence to prove the existence of black holes although for obvious reasons we can only observe their effects. They do have a specific size, or at least their area of effect does which is dependent upon their size as a star before collapse and I'm pretty sure we can predict their force although on this last point I have to concede that our deductions are mostly theoretical.

Then again most people don't know a lot about black holes (including myself) so you could get away with a fairly sinkhole type approach and say stretch the spaceship as it got close to the black hole.
sBibi
sBibi
There are various types of black holes, among which: non-rotating (schwarzschild) blackoles, and rotating (Kerr) blackholes. (and maybe some other types/subtypes, I don't know)
the easiest one to simulate would be a non-rotating one.

Quote:
Also, does a black hole's size affect its gravitational pull in any meaningful way?

actually, it is the black hole's mass (thus gravitational pull) that defines its size (more specifically, the size of its event horizon, more on that later...).

you can define a black hole with various parameters in your game: mass, angular momentum, and electric charge. (although you probably don't care about the last one)

for a non-rotating blackhole, if you know its mass, you can get its visible size by computing the schwarzschild radius:

sr = 2.0 * G * mass / (c * c);

(where G is the gravitational constant, and c the speed of light in vacuum)
basically, this radius is the distance from the blackhole below which the blackhole's gravitational pull is so strong that even particles travelling at the speed of light cannot escape.
what this means graphically is that you "see" a pitch black sphere of radius == sr, and this is your blackhole.

you can go even further with this, and have intermediate states. you can see a blackhole as a regular star/object whose event horizon has risen above the object's physical surface, so actually simulate a transition from a regular star that collapses into a blackhole, and render the transition accordingly. (although you would need raytracing to "accurately" render this, you might be able to fake it with regular rendering, as a star that's in between blackhole and star would probably (just speculating, didn't check it on paper (and even ten, I don't know enough about this stuff.. perhaps someone here will be able to give you more details))) look like a black sphere with a small circular "window" on its center where you would still see the star's surface.

another interesting thing to do if you want to render blackholes would be to simulate the bending of light rays in the blackhole's vicinity. you could do that by rendering a cubemap from the blackhole's center, then render a large billboard centered on the blackhole, and for each pixel of the billboard, depending on its position and distance to the blackhole, somehow compute an indexing vector into your cubemap...

you'll also probably want to have a look at the articles in wikipedia, and see what they have on the nasa website...


EDIT: ah.. crap... triple cross-post... sorry... :D

EDIT2: btw, on a gravitational point of view, a blackhole behaves exactly the same way as a regular celestial body (like a star) would. and the "stretching" thing, is the same as sattellite-ripping tidal effects close to giant planets, so as long as you perform these computations correctly for other massive bodies, there is no specific code to add for blackholes.
kindjie
kindjie
Quote:
Original post by Ceoddyn
Very little is known about black holes (or if they even exist). From what little I know and some guess work, I'd say:

1) they have no specific size

2) their gravitational pull has no specific measurement

Really they exist outside of our common understanding of physics, so feel free to come up with your own mechanics for black holes in your game and/or disreguard everything I've said (as it is speculation).


Actually, none of this is true. :)

The size of a black hole is essentially a point (ie. singularity) - the size of its event horizon is a function of its mass. This is basicly the part that you would "see." You can model the gravitational pull of a black hole the same way you would any other spherical symmetric object of the same mass, so in your game you would probably use good old Newtonian dynamics.

Affects that you would see outside of the event horizon include: gravitational lensing, accretion disks, and galactic jets.

Inside the event horizon, things get a little more complicated. Basicly, if an object fell into the event horizon, any kind of acceleration (even away from the black hole) would have it reach the singularity faster. The object would also be stretched towards the singularity, and compressed perpendicular to it.

I'm sure Google has some images if you need a better idea.
[size="1"]Try GardenMind by Inspirado Games !
All feedback welcome.
[s]
[/s] [size="1"]Twitter: [twitter]Owen_Inspirado[/twitter]
Facebook: Owen Wiggins [size="1"]Goog
sBibi
sBibi
mh, something else: about the singularity thing, I'm not sure a blackhole necessarily means a singularity.
if you take a neutron star, what stops if from collapsing further is the strong nuclear force repelling neutrons from one another (which gives a density around 1.10^18 Kg/m^3 if I'm not mistaken), and even then, when the star's mass becomes large enough that the neutron-repelling force can't stop it from collapsing, it collapses again to a quark star... (it seems "logical" (although here, what seems logic might lead to very wrong deductions, of course))...

so, why systematically throw in a singularity? why couldn't there be blackholes with quark stars inside? (and how can we know there isn't yet another collapsing level below that?)
if any one could answer, or has any links answering these questions, or explaining why not, I'd be very interested! thanks :)

EDIT: perhaps it has something to do with the fact that neutron stars can have quark cores, and that a full quark star would necessarily have a core collapsed one or more levels further, and that it is assumed there are no further steps, and no sub-particles below quarks, so the whole thing actually collapses to a singularity? Oo


EDIT2:
Quote:
btw, on a gravitational point of view, a blackhole behaves exactly the same way as a regular celestial body (like a star) would. and the "stretching" thing, is the same as sattellite-ripping tidal effects close to giant planets, so as long as you perform these computations correctly for other massive bodies, there is no specific code to add for blackholes.


to give a more concrete example:
if you consider the earth, and the sun, and you make the earth orbit so close to the sun that it almost touches it, the earth, although totally roasted, will stay together. if you want it to actually be ripped apart by tidal forces, you'll have to move it to an orbit that's actually below the sun's surface (so that's not possible), however, if the sun had a smaller radius, you could experience such effects... it's the same with blackholes. as they have a smaller radius, orbiting objects can be tidally disrupted much more often, as they may come closer.

[Edited by - sBibi on October 31, 2006 12:58:41 AM]
Mastaba
Mastaba
Quote:
Original post by sBibi
mh, something else: about the singularity thing, I'm not sure a blackhole necessarily means a singularity.
if you take a neutron star, what stops if from collapsing further is the strong nuclear force repelling neutrons from one another (which gives a density around 1.10^18 Kg/m^3 if I'm not mistaken), and even then, when the star's mass becomes large enough that the neutron-repelling force can't stop it from collapsing, it collapses again to a quark star... (it seems "logical" (although here, what seems logic might lead to very wrong deductions, of course))...

so, why systematically throw in a singularity? why couldn't there be blackholes with quark stars inside? (and how can we know there isn't yet another collapsing level below that?)
if any one could answer, or has any links answering these questions, or explaining why not, I'd be very interested! thanks :)

EDIT: perhaps it has something to do with the fact that neutron stars can have quark cores, and that a full quark star would necessarily have a core collapsed one or more levels further, and that it is assumed there are no further steps, and no sub-particles below quarks, so the whole thing actually collapses to a singularity? Oo


String theorists propose new things which eliminate the singularity of a black hole altogether. Some of these things are called "stringy black holes" and "black membranes".
sBibi
sBibi
ah, nice.. thanks, I'll google on that =)
owl
owl
Einstein didn't believe black holes were actually possible... I wonder why?
[size="2"]I like the Walrus best.
hankie23
hankie23
thanks for that site krum, i was also looking for it.
dv
dv
Here is a link to a relativistic raytracer used for rendering a black hole simulation:
http://www.photon.at/~werner/bh/gvsim.html
~dv();
Damon Shamkite
Damon Shamkite
The reason why a "black hole" is called "black" in the first place (no idea where "hole" comes from, though) is because the gravitational forces are so high that even light cannot escape from it.

The event horizon is mostly a thing we know from TV. In reality, it is a lot less spectacular. You could call it the "point of no return", nothing more. There is no deep magic associated with it, no gleaming barrier, no stargate, no wormholes to fly through (though I can obviously not prove that no wormhole exists in a black hole, it is hilarious to assume that you can fly through one).
Light emitted beyond the event horizon cannot possibly reach your eye, therefore you cannot see the event horizon or anything beyond it (black).
What you can see is the objects being "sucked in" before they reach the event horizon (if they are emissive or reflecting). I assume they will appear to have a colour shift, too.

Thus the "correct" way of rendering a black hole would be to not render it at all, but only the things that are "sucked in". Something like a large rotating vortex is probably both dramatic and realistic enough.

Modelling/rendering the inside of a black hole is kind senseless from a logical point of view, as you are
1. unable to see it from the outside
2. unable to see inside a black hole, either
3. torn apart by gravitational force and smashed to bits colliding with other objects attracted by the black hole long, long, long before you even come near the event horizon

You may want to consider a kind of distortion effect and shift objects in and out of visibility. If a black hole is "near", you might be able to see an object that you could not normally see, as light rays do not travel in a straight line any more. Or, you might slightly affect the paths of rockets and laser beams (you do know that laser beams are invisible, don't we all ;)) while being in the general vicinity of a black hole, to make the game harder.

Of course, you have every artistic freedom to make black holes whatever you think is cool, anyway. So if you think it should be a bright yellow rotating disk of flames and a pair of tentacles in the middle, then make it that way :)
If you want it to be a teleport to the other side of the galaxy, make it that way.
The users will probably have no knowledge of black holes other than from movies and TV series, so practically anything will be accepted as long as it is consistent. It's the same as with visible laser beams. The user doesn't know, the user doesn't care.
Motorherp
Motorherp
Quote:
Original post by owl
Einstein didn't believe black holes were actually possible... I wonder why?


Something that always bothered me about black-holes before I knew more about them was the inescapable inevitability that the existance of just one black-hole would lead to the eventual destruction of the entire universe. Given that the universe has been capable of creating black-holes for so many billions of years, and evidence suggests the existance of many many block-holes, how is it that the universe is still in existance and we are around to observe it? I think this is probably what bothered Einstein too. However as has been recently shown, black-holes will eventualy evaporate due to Hawking radiation releasing thier matter back into the universe. Hence its possible for black-holes to exist in a state of equilibrium with the universe and the above paradox is avoided.

[size="1"] [size="4"]:: SHMUP-DEV ::
Mastaba
Mastaba
Quote:
Original post by Motorherp
However as has been recently shown, black-holes will eventualy evaporate due to Hawking radiation releasing thier matter back into the universe. Hence its possible for black-holes to exist in a state of equilibrium with the universe and the above paradox is avoided.


Not exactly. The temperature of a black hole due to Hawking radiation is inversely proportional to its mass. The bigger the black hole, the cooler it is. In fact, a black hole of one solar mass would accumulate more mass due to the cosmic microwave background radiation it sucks up, than the mass it loses via Hawking radiation, resulting in a net gain of mass, i.e. not evaporating. Only black holes whose mass is smaller than that of the Moon, approximately, would be emitting more Hawking radiation than absorbing CMR, and thus would have a net loss in mass (assuming nothing else was falling in). Granted, in time, as the CMR continues to cool, there will be less and less CMR for black holes to take on, and so the critical mass at which black holes start evaporating would slowly increase. But the point is, all the black holes we currently have evidence for are much much larger than 1 solar mass and none of those would be evaporating.
erissian
erissian
Quote:
Original post by Ceoddyn
Very little is known about black holes (or if they even exist). From what little I know and some guess work, I'd say:

1) they have no specific size

2) their gravitational pull has no specific measurement

Really they exist outside of our common understanding of physics, so feel free to come up with your own mechanics for black holes in your game and/or disreguard everything I've said (as it is speculation).


As an astrophysicist, I'm going to have to disagree with that.

Quote:
Original post by Motorherp
Something that always bothered me about black-holes before I knew more about them was the inescapable inevitability that the existance of just one black-hole would lead to the eventual destruction of the entire universe. Given that the universe has been capable of creating black-holes for so many billions of years, and evidence suggests the existance of many many block-holes, how is it that the universe is still in existance and we are around to observe it? I think this is probably what bothered Einstein too. However as has been recently shown, black-holes will eventualy evaporate due to Hawking radiation releasing thier matter back into the universe. Hence its possible for black-holes to exist in a state of equilibrium with the universe and the above paradox is avoided.


Black holes aren't all consuming beasts. Our own Sun could be replaced by a black hole of the same mass and we'd do just fine (except for the whole heat, light, and radiation thing) :)

We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
jovani
jovani
Quote:
Original post by erissian
Black holes aren't all consuming beasts. Our own Sun could be replaced by a black hole of the same mass and we'd do just fine (except for the whole heat, light, and radiation thing) :)

For the planets to do fine it would have to be a black hole of the same mass.
I think I read somewhere that the minimum mass required to generate a gravity force strong enough to overcome the nuclear forces between protons and neutrons is about three to four solar masses. So even if the sun was made of iron it cannot turn into a back hole by natural causes.


erissian
erissian
Quote:
Original post by jovani
Quote:
Original post by erissian
Black holes aren't all consuming beasts. Our own Sun could be replaced by a black hole of the same mass and we'd do just fine (except for the whole heat, light, and radiation thing) :)

For the planets to do fine it would have to be a black hole of the same mass.


I agree :)

Quote:

I think I read somewhere that the minimum mass required to generate a gravity force strong enough to overcome the nuclear forces between protons and neutrons is about three to four solar masses. So even if the sun was made of iron it cannot turn into a back hole by natural causes.


A black hole can have any mass provided it's compact enough, although its lifetime is proportional to its mass. Interesting that you should mention iron though, it being the most prolific byproduct of the stellar fusion process.
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.