Unity Engine overview - TechnionYP5779/SimuMole GitHub Wiki

Unity

Unity is a cross-platform game engine that can be used to create both three-dimensional and two-dimensional games as well as simulations for its many platforms. The engine offers a primary scripting API in C#, for both the Unity editor in the form of plugins, and games themselves, as well as drag and drop functionality.

To have convincing physical behaviour, an object in the application must accelerate correctly and be affected by collisions, gravity and other forces. Unity’s built-in physics engines provide components that handle the physical simulation for us. With just a few parameter settings, we can create objects that behave passively in a realistic way (ie, they will be moved by collisions and falls but will not start moving by themselves). However, working with molecules we will probably encounter forces on a scale that was not considered by the built in physics engine, but is relevant to us. This is where scripting comes to the picture. By controlling the physics from scripts, we can give an object the dynamics of a vehicle, a machine, a piece of fabric, or in our case - a molecule.

The initial, basic contents of a script file will look like this:

using UnityEngine;
using System.Collections;

public class MainPlayer : MonoBehaviour {

    // Use this for initialization
    void Start () {
    
    }
    
    // Update is called once per frame
    void Update () {
    
    }
}

Anyway, as it is build for games, applications, and simulations, creating a custom physics engine is a great part of Unity. I believe it will be great for our purpose. In addition to it, I've compiled a list of pros and cons:

Pros:

  1. The engine is highly preferred for its extended support to 27 platforms. The app developed and deployed can be easily shared between PC, web and mobile platforms.
  2. Has a free version
  3. Allows for rapid prototyping using agile methodology, which enables speedy prototyping and constant releases, which in turn speed up the game development.
  4. Ease of Use – compared to other engines, such as Unreal and CryEngine, Unity’s learning curve is rather low and the engine can be picked up by anyone, although it is recommended that they have some prior knowledge in programming and/or game making, and C# is an expressive and powerful programming language that is relatively easy to learn.
  5. Community – Unity has one of the largest – if not the largest – community when it comes to game engines. There are resources all over the web, ranging from simple beginner-friendly tutorials to more advanced and complete tutorials. If you ever stumble across a problem you can’t solve, there are tonnes of places online where you can ask.
  6. Extremely robust asset store has many useful add ons and content and also is a potential revenue stream for developers.
  7. Full feature set totally free until you earn $100K revenue in one year.
  8. Documentation – There is also the support of experienced developers and the Unity documentation is detailed enough to allow you to easily interpret solutions and get the right actions launched. With this clear support, you are able to easily come up with solutions to the problems you encounter while developing. There is no need to rush to other platforms to look for assistance since many things you want are included in the documentation provided.
  9. The debugging and tweaking is amazingly easier with Unity game development because all the game variables are displayed during gameplay, which in turn allow the developers to debug the process at runtime.

Cons:

  1. The documentation of several features is quite out of date and in some cases it is completely non-existent.
  2. If you make more than $100k gross per year, you need to purchase a Unity Plus license (Up to $200k gross) or a Unity Pro license (Unlimited gross).
  3. Some claim that the engine lags behind from a graphical point of view. It does not offer an array of tools to create stupendous graphics as opposed to other game development engines.
  4. The code is stable in Unity as opposed to other engines and packed with a great architecture that improves the game app performance. But, unavailability of the source code makes finding, addressing and fixing the performance issues difficult.
  5. The game developed leveraging Unity engine consumes more memory, which in turn creates OOM errors and debugging issues in the apps.

Conclusion:

I find Unity engine to be the best solution. With it's crossed platform support, we don't need additional tools to import the application to other platform, and his highly appreciated physics engine capabilities are just what we need for our simulation.