6
\$\begingroup\$

Everytime I've read about people asking whether they should write their game in C++ or Unity, Unity is usually the default answer, unless they want to go through the hassle of creating an engine by themselves when Unity already does everything for you. If that's the case is there ever a case where writing a game in C++, Java, Rust etc... is better than using Unity? If so what are these cases?

\$\endgroup\$
7
  • \$\begingroup\$ It's a pretty open ended question (expect this to be closed since it's a matter of opinion, you may want to check the rules to avoid this happening again), but for it usually comes down to do I need a custom engine. Custom engines usually excel at specific features like crazy particles, custom physics, 2d graphics, hexagon grid worlds, etc. you basically design it around the features you are planning on. General engines like Unity don't really excel at anything but can kind of do everything to some degree. Most people pick Unity since they just want to test stuff or don't need extra power. \$\endgroup\$ – Benjamin Danger Johnson Feb 23 at 6:39
  • \$\begingroup\$ @BenjaminDangerJohnson - I disagree regarding the meta part. There are good answers to this question (including yours), which implies that the question in itself is likely good as well. It is also not a matter of opinion - there are objective reasons to do X, and he asked for them. \$\endgroup\$ – Battle Feb 23 at 11:54
  • \$\begingroup\$ I suppose it depends on whether you feel more productive or curious today. \$\endgroup\$ – user253751 Feb 23 at 13:39
  • \$\begingroup\$ Languages are free, engines cost money? \$\endgroup\$ – Mazura Feb 23 at 14:16
  • 1
    \$\begingroup\$ @Mazura Languages may be free, but developers aren't. Time is money, and developing a custom engine is certainly time-consuming. \$\endgroup\$ – Jared Smith Feb 23 at 14:21
14
\$\begingroup\$

You need to write a game without an engine when you have a game with very unique technical challenges which are not sufficiently covered by general-purpose game engines.

General purpose game engines like Unreal, Unity or Godot are optimized for running any kind of game people can come up with. But a one-size-fits-all solution often has problems with handling unusual edge cases. When your game idea is such an unusual edge case (most are not), then you might have to create your own engine in order to perform the low-level optimizations you need in order to run your game with satisfying performance.

A couple games which would not have been possible (or at least very difficult) with a general purpose game engine are:

  • Minecraft, with its millions of blocks in a single scene. Which runs so well on low-budget hardware due to the simplistic graphics and well-chosen data-structures.
  • Factorio, which does a lot of micro- and macro-optimization to make sure it can process a huge amount of entities (their development blog is a treasure trove of interesting programming tricks).
  • Flappy Bird. Yes, I am serious. What, you say you could do that in your favorite game engine in a couple hours? Sure, but could you squeeze it into an APK of under a MB? Game engines tend to add runtimes which are several MB in size to every game. Which hardly matters for a large project but seems pretty excessive for a tiny one. Filesize is also an important factor for web-based games, where every additional second of loading time will cause you to lose a couple players.

However, game engines do keep developing and become able to cover more specialized use-cases they couldn't before. Like Unity's DOTS initiative which allows to create games which require highly optimized game systems and its scriptable render pipelines which can be used to optimize for unusual render performance requirements.

\$\endgroup\$
2
  • \$\begingroup\$ Does Flappy Bird need a whole MB? It shouldn't. Though I seem to recall Android Studio trying to forcibly add a 6MB library that I don't use, into my 0.015MB application, because Google knows what's best for me. \$\endgroup\$ – user253751 Feb 23 at 13:37
  • 2
    \$\begingroup\$ @user253751 I actually tried to do some research to find out how large the original Flappy Bird APK was, but all I found was clones ranging between 600 kB and 12 MB (that one likely used an engine). So I decided to go for a generous estimate of "under 1 MB". I would estimate that it could be done under 100kB, but I didn't want to deal with nitpicking comments of someone who actually managed to find the real filesize and that happened to be something like 112kB. \$\endgroup\$ – Philipp Feb 23 at 13:40
5
\$\begingroup\$

The main reasons I can come up with are:

  • the challenge / bragging rights / language practice. Some people just get bored when things get too easy, or they want to see what is possible without an engine.
  • not knowing any better - most people are guilty of doing that at least once.
  • not being dependant on an engine. That's a very ambitious thing and most of the time it's attempted by companies that want to make their own engines... either to save the money in the long run, or to make something very specialized for games they are making
  • making a game for very specific environment, like certain machines that might not be able to run common engines. I think that doesn't happen very often lately though.
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.