ID:158780
Jul 1 2009, 12:12 pm
|
|
I'm trying to make a ship battle game, but I don't know how to do space sucktion like in SS13. One that would involve only rooms exposed to the breach would be affected while players can save themselves by closing a door. Any ideas?
|
In response to ADT_CLONE
|
|
Ok, thanks for the tip. I used to code before, I'm just really rusty and trying something I've never done before. So I know what you mean.
|
I think when it comes to any particular physical phenomenon you want to simulate in your game, the answer is that there are many answers, but you'll want to decide on your own which one is appropriate depending on how your game plays.
If it were me, I would probably establish a breach point (find where space tile intersects non-space tile) and then run an evaluation of which rooms are affected. Rooms would be built through an evaluation of connected tiles preferably done well before a breach could have occured. Once a breach happens, it should be fairly easy to go through all tiles on a list of affected rooms and simply loop through every atom that isn't bolted down to be moved towards the breach at an appropriate rate. I'm pretty sure Space Station 13 uses prebuilt area atoms for their rooms (area atoms). You can see some evidence of this when alarms go off - only the affected areas glow. Going this route saves them from having to calculate which tiles make up an area, but requires manual map building for it to work. If realism is the key, you'll want to consider that a lot of what you see with atmospheric decompression in Sci-Fi is just a plot device. We're just dealing with air expanding out into the vacuum of space. If you're weightless, it wouldn't take much force at all to get blasted out into space. However, with that little air involved, expanding instead of being pushed, likely there wouldn't be enough force involved to influence a body that has some kind of resistance - gravity, magnetic boots, or even a restricting bit of furniture bolted to the ground might be enough to keep a body in the room. Then there's the matter of exposure without a space suit. Contrary to popular myth, it wouldn't cause you to explode. An interesting article on that. |
In response to Geldonyetich
|
|
Geldonyetich wrote:
I'm pretty sure Space Station 13 uses prebuilt area atoms for their rooms (area atoms). You can see some evidence of this when alarms go off - only the affected areas glow. Going this route saves them from having to calculate which tiles make up an area, but requires manual map building for it to work. Nope, the whole thing is essentially cellular automata. Each turf has a variable tracking how much gas it contains, and it flows from turf to turf. It is quite slow. There are areas for each room, but they simply poll this data. If realism is the key, you'll want to consider that a lot of what you see with atmospheric decompression in Sci-Fi is just a plot device. We're just dealing with air expanding out into the vacuum of space. If you're weightless, it wouldn't take much force at all to get blasted out into space. However, with that little air involved, expanding instead of being pushed, likely there wouldn't be enough force involved to influence a body that has some kind of resistance - gravity, magnetic boots, or even a restricting bit of furniture bolted to the ground might be enough to keep a body in the room. Wrong. Weightlessness has nothing to do with inertia. It'll take the same amount of force to move something in space as it would on earth. The difference is that, without gravity, there is no (or very little) friction against any surface, which means that small forces can add up to a large velocity rather than being entirely counteracted by static friction. In terms of how much pressure there is, it's a rather complex problem. You might get sucked through a hallway but be able to hold your own in a room, because the hallway is going to have a higher pressure in it due to a reduced cross-section. But I'm too tired to describe fluid mechanics right now. Fortunately, realism is not as important as veracity here. Do whatever "feels" right. |
In response to Garthor
|
|
Nope, the whole thing is essentially cellular automata. Each turf has a variable tracking how much gas it contains, and it flows from turf to turf. It is quite slow. There are areas for each room, but they simply poll this data. Good to know, thanks for the catch. I can see why they went with this approach considering what we're talking about is expansion of gas. It sounds more difficult than it is - I came up with something similar in regards to temperature distribution. Garthor is quite correct in saying this is a slower way to go about it. Wrong. Weightlessness has nothing to do with inertia. Of course. However, did I even say the word "inertia?" I said "resistance." This would include: The difference is that, without gravity, there is no (or very little) friction against any surface, which means that small forces can add up to a large velocity rather than being entirely counteracted by static friction. The examples I gave were, "gravity, magnetic boots, or even a restricting bit of furniture bolted to the ground." Things which induce additional resistance (potential causes of friction) - not just the resistance of inertia, which is based on the mass of the body involved. Honestly, Garthor, given how often you show up with a dissenting opinion in my posts, it seems to me you've made it a mission in life to prove me wrong over something. This is problematic in that such a steadfast conviction that is, in itself, a wrong that has extended its influence into causing you to misread what I write. Should you purge this tendency, I think you'll find we agree more than we disagree. |
In response to Geldonyetich
|
|
Geldonyetich wrote:
it seems to me you've made it a mission in life to prove me wrong over something. I have. |
In response to Garthor
|
|
Garthor wrote:
Geldonyetich wrote: Well, the good news is that it shouldn't take too long, but not today. Granted, the night is still young. |
It may not be as complex as you want, although the message is this is something you'll probably have to work through and make yourself.
As a little tip, you may want to consider areas. However these won't work dynamically(If the room changes), though will work if you have the same rooms.