When comparing Unity3D vs SFML, the Slant community recommends Unity3D for most people. In the question“What are the best 2D game engines?” Unity3D is ranked 9th while SFML is ranked 26th. The most important reason people chose Unity3D is:
Unity3D provides an exhaustive documentation where everything is given a full description supplied by a number of examples as well as video and text tutorials and live training sessions to understand the ins and outs of the engine. In addition there's an ever-growing community that can offer advice to help resolve any situations that may arise. Along with the official Unity resources, there are [many high quality](http://www.slant.co/topics/346/~beginner-resources-to-learn-unity) (and often free) third party tutorials available.
Ranked in these QuestionsQuestion Ranking
Pro Lots of resources to learn from
Unity3D provides an exhaustive documentation where everything is given a full description supplied by a number of examples as well as video and text tutorials and live training sessions to understand the ins and outs of the engine. In addition there's an ever-growing community that can offer advice to help resolve any situations that may arise.
Along with the official Unity resources, there are many high quality (and often free) third party tutorials available.
Pro Lots of assets can be found in the Asset Store
For those developers who can't afford an artist, or aren't skilled enough to create their own art, Unity features an Asset Store full of a wide variety of free and paid assets that can be easily added to a game. The Asset Store has more than just music and art. It also has code and modules that can be added to games including unique lighting or GUI systems. It also has powerful asset management and attribute inspection.
Pro Allows for rapid prototyping
Unity's modular system and usability allows for quickly developing a prototype of an idea. It has features like drag & drop editing, shaders, animation and other systems already in place to allow diving right into developing a game.
Pro Easy learning curve
The way the editor is structured, by setting scripts on objects, and the use of a high-level language, C#, makes it easy to learn.
Pro Very popular
Unity is a proven game engine. It is used by a wide range of developers - from small indies to triple-A companies such as Microsoft, Paradox, Square Enix and Sega.
Pro Great editor
The editor GUI is very powerful and intuitive. It allows pausing gameplay and manipulating the scene at any time as well as progress gameplay frame by frame. It also has powerful asset management and attribute inspection.
Pro Works with 3rd party IDEs
You can use any C# IDE for it, but the ones tested which have Unity integration are:
- Microsoft Visual Studio
- Visual Studio Code (much faster than VS, but a bit harder to set up for Unity development)
- JetBrains Rider (very fast, has lots of functionality and best Unity integration, but it is not free)
Pro Can be used for free
As long as the development company makes $100k or less, it can use the free version of Unity to release games.
Pro Over 20 platforms
Unity offers over 20 platforms for publishing including mobile, console, web, VR, and more.
Not tailored for specific types of games (like Unreal...), so it won't get in your way if you want to make something unique.
Pro Has a great animation system
Unity provides a great state machine animation system called Mechanim allowing to separate animation from the model and assign the same animoations to different models.
Pro Very optimized
Unity runs very smoothly even on systems that are considered "weak" by today's standards.
Pro Powerful standard shaders
The built in standard shader in Unity 5 is incredibly optimized and supports PBS/PBR.
Pro Can create custom forms and tools
Pro OUYA support
Pro Flexibility is provided by a strong component programming model
Pro Well structured
Overall, a coherent engine with a rational approach. People who complain a lot about being forced to hack around it usually dont read the docs, like the one that describe orders of execution (https://docs.unity3d.com/Manual/ExecutionOrder.html), or specific functions hooks and such. Some like to say it lacks raw power where people who are used to standard optimizations have no problem. For exemple It is not uncomon to encounter users who complain about low FPS but forgot to activate occlusion, flag static elements, activate animations culling, and so on. As for complaints about C#, people who are transitioning from C++ were already bad at C++ before being bad at C#. They often come from the PC world where the sheer power of today's machines is very forgiving compared to the platforms we had to develop for in the 80s~90s. One of their errors is for exemple to never read this doc: https://docs.unity3d.com/Manual/BestPracticeGuides.html.
Pro Has awesome plugins
Pro Free for mobile development
Unity allows free mobile development. There are some limitations.
Pro Very effiecient and usable.
Pro zlib/PNG license
In short, SFML is free for any use (commercial or personal, proprietary or open-source). You can use SFML in your project without any restriction. You can even omit to mention that you use SFML -- although it would be appreciated.
Pro Can be combined with OpenGL
If you hate something about the way SFML handles graphics, you can just combine it with OpenGL. It's completely smooth and works as expected, without any additional dependencies.
Pro Active community and wiki
You can ask questions on their own personal forum which is full of users, and their wiki is constantly being maintained. They even have an IRC
Pro Works on every platform
SFML 2.2 brought forth Android & iOS functionality, and SFML games work on Linux, Mac and Windows out of the box, since SFML is written with OpenGL.
Pro Great documentation
SFML is very well documented, even with short examples of use for many functions and modules. Furthermore, there are books like 'SFML essentials' and 'SFML for game development' which teach you how to use this library to its fullest.
Pro Good for OpenGL
If you are thinking about using OpenGL, look no further, you can open a window, and handle events in less than 15 lines, and it provides input, time, and even networking, plus alot more. It has become my favorite c++ library :D
Pro Great library
SFML is a collection of modular, well designed libraries you can implement an engine or game on top of. The API provides tons of good documentation and is very straightforward to use. You can get a game up and running with SFML quite quickly and with minimal effort.
Pro Clean code
An SFML project's code-base is usually clean and easy to read. All public SFML classes are under the namespace "sf" so it is easy to tell which code is yours and which belongs to SFML (of course you can stop this by typing
using namespace sf;).
Pro Available in many languages
There's support for many languages besides C++, current supported languages are: C, .NET, Crystal, D, Euphoria, Go, Java, Julia, Nim, OCaml, Pascal, Python, Ruby and Rust, and this list is constantly growing
SFML is extremely beginner friendly and even provides pre-built libraries for your IDE of choice on Windows. Besides the fact that it's extremely well documented, they also have a set of tutorials that walk you through every module.
Pro Modern C++11 implementation
SFML is one of the few good C++ frameworks out there to actually make full use of the language. It's extremely well optimized and it plays well with anything you throw at it.
Con Very bad terrain
Native terrain creates a lot of draw calls which is bad for performance.
Con Garbage collection can't be turned off
Given the use of C#, the memory control is out of the developers control, this can be good, but not controlling memory means that the garbage collector can trigger at any time and ruin performance.
Con Hard to maintain projects due to vendor lock
Unity3D is proprietary, closed source game engine. Unity asks money for features like basic version control support, etc. It is impossible to migrate a game from Unity3D in case performance does not satisfy growing requirements of a project.
Con Very self-centered engine
Unity3D uses very unique approach for doing things. Most of the knowledge acquired while using it, would be completely non transferable to other engines. Advanced Unity3D programming is really dealing with Unity3D bugs, and finding loopholes around engine issues - nothing to do with graphics, etc. Skills which would be valuable with other engines.
Con Weak memory management
.Net libraries are slowing it down, memory safety is compromised, classes have to be implemented to manage objects in memory, like object pooling.
Con Asset store is required to replace engine functionality
You will need to, for example, buy an input manager asset off their asset store in order to replace their own terrible inaccessible input manager.
Con Dark UI theme not available in the free version
Dark theme, which is a must for prolonged work without eye strain, is only available with one of the paid monthly plans.
Con Adds too many features without fixing earlier issues, rapidly increasing number of bugs that will never get fixed
Unity continues to add many new features without fixing earlier issues. Unity is either understaffed, overambitious, or both, resulting in a continual increase of problems and degraded experience across a number of platforms. Many bugs are reported daily and never get addressed, and there are many bugs from previous versions that are never looked at or fixed.
Con Moderators on forums are sometimes arrogant
Con Bad batching support
Draw Call Batching is done automatically and does not include Skinned Renderers (eg. characters). Also for dynamic batching, meshes need to have less than 900 vertices.
Con Increasing number of bugs
With each new version things may stop working ,for example with Android, some bugs are never getting fixed, like the freeze bug with adb.
Con Encourages bad coding practices
A lot of Unity code feels like a hacked blur of arguable coding practices. C# and .Net usage in Unity is questionable. A lot of the API is done in "C Style" (public static methods, available at all times), encouraging the use of public fields for everything, a lot of questionable implicit casting. The list goes on.
Con Mobile builds (Android, iOS) take about 18MB at least
Even a Blank Project, Needs 18MB for the APK file (on Android).
Con Bad UI tools
Way of creating UI is uncomfortable and inconvenient.
Con Asset bundles can be cumbersome
Asset bundles are a way to load external resources that are not packed with the game or application and offered as a separate, optional package. However, they may not be compatible between versions or even platforms (you have to create them separately).
Asset bundles need to be loaded and unloaded, avoid concurrent loads from web or cache or a naming collision can happen. You can find workarounds with static objects (load
obj files and textures by code), but for animated game objects you are pretty much stuck with this.
Con New il2cpp script backend is show stopper to some iOS projects
Il2cpp script backend is required to build arm64 app, but it's still very buggy and not production ready.
Con Price is very high
Cost is based on Revenue:
less than $100K = Free
between $100K and 200K = $35 a month per seat
greater thank 200K = $125 a month per seat
Con Docs have inconsistent choice of scripting languages
Con Comparatively high learning curve is putting it nicely. Expect to spend days upon days researching basic functionality.
Although C#, JS, and Boo have documentation available online, it can still be difficult to understand the library and Unity's component based system.
Con Waisted resources
Slow, buggy, expensive and 1000 other problems.
Con Bad model importing
Con Bad input
Their input manager cannot be accessed via code. If you want to update controls at runtime (which any PC game should be able to do), you'll have to roll your own. Except joysticks are also not available via code.
Con Bad raycasts
Con May take longer to learn and understand.
Con No GUI editor or IDE
Does not include any IDE or media editor. It's purely source code.
Con Messy sprite management
Sprites retain all of the operations applied to them, whether that be a new position or a rotation. This makes sprite management somewhat annoying.
Con Not specifically a 2D game engine
It isn't really an engine, more of a collection of modular, well designed libraries you can implement an engine or game on top of.