SFML community forums

General => Feature requests => Topic started by: Stormboy on March 28, 2014, 01:58:20 pm

Title: Collision detection integration
Post by: Stormboy on March 28, 2014, 01:58:20 pm
Hi,
I was just thinking, it would be great if the Collision class (the one that's in the forum wiki) was integrated into an SFML module (Graphics maybe?). This is just my idea, so what do you guys think of it?

 :)
Title: Re: Collision detection integration
Post by: Laurent on March 28, 2014, 02:00:44 pm
Collision detection is clearly out of scope for SFML.
Title: Re: Collision detection integration
Post by: Stormboy on March 28, 2014, 02:02:40 pm
Collision detection is clearly out of scope for SFML.

Why is that? :/
Title: Re: Collision detection integration
Post by: Nexus on March 28, 2014, 02:03:03 pm
SFML is a multimedia library, not a game engine. Collision detection and response has also been discussed several times in the past, so you might want to search the forum.

To workaround the search bug, choose only some subforums, or use an external engine.
Title: Re: Collision detection integration
Post by: Stormboy on March 28, 2014, 02:05:15 pm
Oh allright, sorry. :|
Title: Re: Collision detection integration
Post by: Daddi on April 10, 2014, 04:38:49 pm
SFML is a multimedia library, not a game engine. [...] [/color]

I think its time to change :P
Go go for "SFGL", the simple and fast game library fork *g*
Title: Re: Collision detection integration
Post by: Jesper Juhl on April 10, 2014, 08:34:47 pm
SFML is a multimedia library, not a game engine. [...] [/color]

I think its time to change :P
Go go for "SFGL", the simple and fast game library fork *g*

I disagree. One of SFML's strengths is its focus on being a good multi media library and just that.
If it started to branch out and try to be a game engine it would inevitably end up having to make a lot of tradeoffs like; what kinds of collision detection should we provide (bounding box? Pixel perfect? What about alpha? ...) And should there be pathfinding algorithms as well? If so, which ones? Should it implement a scene graph? If so, suitable for what types of games? How about the game loop - should it take control of that as well? If so, should it be fixed time step or not?

Much better IMHO to leave SFML as a flexible media building block that people can build all sorts of different types of game engines (and lots of other applications) on top of.
Title: Re: Collision detection integration
Post by: MiShu on April 11, 2014, 05:37:22 pm
Try to use Box2D ;)
Its really cool physics engine.
Title: Re: Collision detection integration
Post by: MiShu on April 11, 2014, 05:55:03 pm
SFML is a multimedia library, not a game engine. [...] [/color]

I think its time to change :P
Go go for "SFGL", the simple and fast game library fork *g*

Reason?
SFML is really handy OOP C++11 multimedia library realized through OpenGL.
And I wanna use it on other platforms which not supported OpenGL such as Windows Phone, Windows RT, Xbox.
Its much more useful than integrated physics.
IMHO  :P
Title: Re: Collision detection integration
Post by: zsbzsb on April 11, 2014, 06:01:56 pm
@MiShu

You can edit posts if you have something else to say...  ;)

On topic: Physics built into SFML would be out of scope and I personally see no reason at all considering all the much better physics libraries out there.
Title: AW: Re: Collision detection integration
Post by: eXpl0it3r on April 11, 2014, 06:02:52 pm
SFML is really handy OOP C++11 multimedia library realized through OpenGL.
And I wanna use it on other platforms which not supported OpenGL such as Windows Phone, Windows RT, Xbox.
SFML doesn't support any C++11 feature yet and it will never work natively on Windows Phone, Windows RT nor Xbox, because that would require a DirectX renderer.
Of course there are always hackish ways to do things, but let's not go there.

The main problem with physics as part of SFML would be: maintenance.
Getting the physics right is hard and time consuming - it's not like Laurent and Nexus are already bored with the current SFML development. ;)
Title: Re: AW: Re: Collision detection integration
Post by: MiShu on April 11, 2014, 06:08:11 pm
SFML is really handy OOP C++11 multimedia library realized through OpenGL.
And I wanna use it on other platforms which not supported OpenGL such as Windows Phone, Windows RT, Xbox.
SFML doesn't support any C++11 feature yet and it will never work natively on Windows Phone, Windows RT nor Xbox, because that would require a DirectX renderer.
Of course there are always hackish ways to do things, but let's not go there.

The main problem with physics as part of SFML would be: maintenance.
Getting the physics right is hard and time consuming - it's not like Laurent and Nexus are already bored with the current SFML development. ;)

Yes, I know. But I hope that the DirectX wrapper will be implemented in the future :)
Title: Re: AW: Re: Collision detection integration
Post by: Nexus on April 11, 2014, 06:39:26 pm
Yes, I know. But I hope that the DirectX wrapper will be implemented in the future :)
Let's not be unrealistic; a DirectX wrapper is very unlikely to be implemented within the next few years. The plan is rather to support more modern OpenGL versions, as well as to improve the core library in various parts.

Thus, if DirectX is crucial for your purposes, you might want to investigate alternatives to SFML.
Title: Re: Collision detection integration
Post by: StormWingDelta on April 11, 2014, 08:47:30 pm
MiShu there are things out there that allow physics to be used with SFML like Box2D but SFML is mostly rendering things rather than checking if they've hit each other.
Title: Re: Collision detection integration
Post by: Phanoo on October 30, 2014, 02:27:30 pm
Collision detection is useful even for multimedia.
Multimedia application can have animated effects that requires collisions, or even something as simple as a click on a button (collision between a box and a point - the mouse coordinates)
Title: Re: Collision detection integration
Post by: Laurent on October 30, 2014, 02:34:35 pm
Quote
Multimedia application can have animated effects that requires collisions
This is quite a vague reply... we'd prefer real use cases, especially if you wake up a 6 month old thread.
And the answer to that is simple: some multimedia applications need collision detection (like... games), but it doesn't mean that collision detection must be part of the multimedia back-end. These are still two separate things.

Quote
or even something as simple as a click on a button (collision between a box and a point - the mouse coordinates)
Such trivial tests are already available in SFML (Rect<T>::contains).