#### BruceJohnJennerLawso

##### Dread Lord of the Idiots
You mean code for collision detection, or code that handles the physics once a collision is detected? The second can come in a rather wide range of complexity, from simple energy and momentum calculations to "oh hell I didn't want to write 100'000 lines"-rag-doll physics...

Both, but the complexity doesnt need to be too extreme, just simple stuff involving rigid boxes, spheres, and other simple shapes in 2D

#### Andy44

##### owner: Oil Creek Astronautix
Someone around here was asking what happens when you jump up inside a vehicle with centrifugal artificial gravity. Skip ahead to about 42 min to see a cosmonaut throwing darts on a curved path inside a big centrifuge...and watch the rest of the vid while you're at it, some interesting stuff.

#### Linguofreak

##### Well-known member
Just ran across a facepalm inducing article:

Apparently, Steam for Linux includes a shell script that runs "rm -rf $STEAMROOT/*". If the environment variable STEAMROOT does not exist, or has been nulled by some action (like moving the Steam directory), this becomes "rm -rf /*", which, for people who aren't Unix users, means "Delete *ALL* the files!!!". It will literally attempt to delete every file on every device attached to the system, including on backup drives and mounted network drives. In most cases it won't succeed (it will just delete every file that the user running Steam can access), but the worst part is that "rm -rf$STEAMROOT" would still do what was intended in normal circumstances without the apocalyptic bug if \$STEAMROOT is null, as "rm -rf" with no argument does nothing.

#### Mojave

##### Will Work For Gas
Moderator
Decided to make an Ace Combat-like song. It's similar to one of the songs you'd here in the hangar while choosing your plane. As you can tell the melody is similar to Kobayashi's

All of the music is mine excluding the drums and everything is played on the guitar.

https://soundcloud.com/beechcraft118/ace-jam

#### jedidia

##### shoemaker without legs
Both, but the complexity doesnt need to be too extreme, just simple stuff involving rigid boxes, spheres, and other simple shapes in 2D

Uhm... there's no boxes and spheres in 2d... :shifty:
You're strictly dealing with rectangles and circles here. Which are rather easy to do collision detection with. rectangles: Check if point is inside rectangle. Circle, check if point is within radius (to save on cycles, define the collision circle as the squared radius and compare a^2 + b^2 directly to that without having to take the root).

Even elipses aren't that much of a problem, if you define the collision area as a non-uniformly scaled circle (usually precise enough for gaming applications) and just scale your input coordinates accordingly instead of trying to mathematically figure out if the point is exactly within the definition of an elipse.

From there it's pretty much pure physics and depends entirely on what level you need. The most primitive one, used in [ame="http://de.wikipedia.org/wiki/Pong"]Pong[/ame]-likes, is to simply invert the appropriate signs of the movement vector, which automatically results in entry angle == exit angle. If both objects involved in the collision have a movement vector, it gets more complicated of course, but nothing you shouldn't be able to handle relatively easy.

Last edited:

#### RisingFury

##### OBSP developer
rigid boxes, spheres, and other simple shapes in 2D

I don't know how you managed to fit a box and a sphere into two dimensions.......................................

If 2D collision detection is what you want, it's VERY VERY simple, with any shape. Take two textures and check pixel-by-pixel if they overlap.

#### Urwumpe

##### Not funny anymore
Donator
I don't know how you managed to fit a box and a sphere into two dimensions.......................................

If 2D collision detection is what you want, it's VERY VERY simple, with any shape. Take two textures and check pixel-by-pixel if they overlap.

There are even much simpler and faster algorithms around, if you just use the coordinates. Especially if you are just interested in simple geometric shapes.

#### Athena

##### Smitty Werbenjagermanjensen

I feel the struggle...:lol:

#### jedidia

##### shoemaker without legs
And that doesn't mention the changes to the nouns by cases. Still, slavic tongues have it harder. They still got the whole 7 latin cases.

And I asked a friend from Finland once how many cases they actually had, because I heard ridiculous numbers. He told me he wasn't really sure... :blink:

#### RisingFury

##### OBSP developer
There are even much simpler and faster algorithms around, if you just use the coordinates. Especially if you are just interested in simple geometric shapes.

Yes, if you are interested in simple geometric shapes. But I said it'd work with any shape.

Today's graphics cards can do this very quickly, so it's not like it should be a problem. But that's assuming you have access to the graphics card.

#### Urwumpe

##### Not funny anymore
Donator
Yes, if you are interested in simple geometric shapes. But I said it'd work with any shape.

Today's graphics cards can do this very quickly, so it's not like it should be a problem. But that's assuming you have access to the graphics card.

It still takes longer than for example defining a complex shape from simpler shapes and then just using some smart algorithm (on the GPU or not... a GPU is a great choice for such calculations if you have millions of primitives to check)

#### ISProgram

##### SketchUp Orbinaut

(gasp) You gonna be okay?

Donator

#### Andy44

##### owner: Oil Creek Astronautix

The taste is pure nirvana.

#### RisingFury

##### OBSP developer
It still takes longer than for example defining a complex shape from simpler shapes and then just using some smart algorithm (on the GPU or not... a GPU is a great choice for such calculations if you have millions of primitives to check)

Sure it does, but if we're talking about game design - and let's face it, we are - the per-pixel check will allow you to get the algorithm done, then go straight to art. Any shape and any animation will be supported without you putting in extra effort to make sure collision works.

Sure, the algorithm is slower. Sure it is. I agree. But games don't deal with millions of 2D objects, they deal with tens and hundreds. Even a weak computer these days can easily handle that.

#### jedidia

##### shoemaker without legs
Sure it does, but if we're talking about game design - and let's face it, we are - the per-pixel check will allow you to get the algorithm done, then go straight to art.

Actually, this is what you do almost anywhere in coding but in game design. Most applications really don't care that much how much cycles they are eating... only games seriously optimise (OSes try to, but I can't quite tell how succesful they are at it :lol.

Still, it depends on the kind of game. With a simple 2d game you can probably get away with it, but even here you have to watch it real good that the suboptimal algorithms don't pile up. If your rendering isn't optimised, and your collision detection isn't, and maybe some other stuff isn't too, you can end up in a framerate train-wreck without having much to show for it. Been there, done that :lol: