GameDev

Developing a Game Engine from Scratch: Pros and Cons

Developing a Game Engine from Scratch: Pros and Cons

Who are you in the world of game development? Find out in this free course ➞ You'll try out three professions in practice: game designer, 2D artist, and Unity developer. Create your first Mario-style game. Click here for details.

Learn more

In today's world, many indie developers prefer to use ready-made game engines, such as Unity or Unreal Engine, to implement their projects. At the same time, only a few of them turn to developing their own technologies. The idea of ​​​​creating a unique engine can be perplexing to a wide audience. Why waste time and resources on developing a new tool when there are many ready-made solutions on the market, including free options?

However, developing your own game engine can offer unique advantages. A custom-designed engine allows for complete control over functionality and optimization for the specific requirements of a project. This can lead to more efficient resource utilization and the creation of unique gaming experiences that cannot be achieved with standard engines.

Thus, while using ready-made solutions remains a popular choice among indie developers, creating your own engine can be a profitable alternative for those seeking originality and maximum customization.

Programmer David Graham, known by the nickname Rez, is confident that the video game industry requires the implementation of new technologies, a niche that indie developers can successfully fill. In his talk at GDC 2024, he discussed in detail the pros and cons of creating your own game engine. This process requires certain technical knowledge, so Graham's talk is primarily aimed at programmers. However, game designers will also benefit from his presentation, making it relevant to a wider audience in the game development field.

Skillbox Media's GameDev editorial team presents key points from this gaming industry expert's presentation.

We invite you to subscribe to our Checkpoint Telegram channel, a valuable resource for aspiring developers. In our channel, you'll find helpful articles on game design, practical guides on using software, and interviews with experienced developers who have already created and released their games. Join us to stay up-to-date with important materials and tips that will help you grow in game development.

Briefly about the speaker

Rez, an experienced game developer, has over 28 years in the gaming industry, from Rez spent 19 years programming at both indie studios and large companies such as MicroProse, Planet Moon Studios, and Electronic Arts. He became known as the lead AI programmer on the popular game The Sims 4. Rez has now retired from the AAA sector and is focusing on indie game development. He has also been teaching programming for 11 years, passing on his knowledge to new generations of developers. In his free time, he enjoys playing tabletop role-playing games, which also inspires him to create unique gaming content.

Links play a key role in the structure and functionality of the internet. They are hypertext pointers that allow users to navigate from one web page to another. Links can be internal and external. Internal links point to pages within a single website, which helps improve navigation and link equity. External links direct users to other resources, which can increase a website's authority in the eyes of search engines.

Link optimization is important for SEO. Proper use of anchor text that contains keywords helps improve a website's visibility in search engines. It's also important to maintain the quality and relevance of links to avoid broken links, which can negatively impact a website's ranking. Creating a link strategy is an important step for increasing organic traffic and improving search engine rankings. Proper distribution of links within content, using different types of links, and regularly updating their content contribute to a better perception of the website by users and search engines. What is a Game Engine? The term "game engine" is ambiguous and open to various interpretations. Some developers consider SDL to be a game engine, while others include technologies such as Unity or Ogre3D. In a general sense, a game engine is a set of code and tools designed for developing applications related to games. These assemblies can be classified into several types, allowing for a better understanding of their functionality and application in the game development industry.

  • Mathematical libraries. These include Zlib, TinyXML, TinyXML2, Box2D, GMTL, and others. They contain a large number of functions and classes that a programmer can call and use to solve various problems.
  • Frameworks. These perform almost the same function as libraries, but are designed only for specific tasks, such as playing audio or processing keyboard input. Examples include SDL (Simple DirectMedia Layer), SFML (Simple and Fast Multimedia Library), pygame, LÖVE, or even Microsoft XNA. Support for the latter has officially ended (although patches for version 4.0 are still being released), but it still has followers—FNA and MonoGame.
  • General-purpose engines. This category includes Unity, Unreal Engine, and Godot—ready-made technologies with a wide range of tools for various tasks. They are familiar even to casual gamers.
  • Specialized engines. Designed for a specific type of project, such as RPG Maker (role-playing games), Ren'Py (visual novels), and Construct (2D and HTML games).

The range of development tools available is truly vast. While most developers prefer general-purpose engines, Graham emphasizes that certain frameworks are also worth considering. In the next section, we'll take a closer look at these frameworks and their advantages during development.

Why a Ready-Made Game Engine Isn't Always the Best Solution

To answer this question, we need to look at game development from a programmer's perspective. This process typically comes with a variety of issues that require quick solutions. For example, rendering triangles on the screen or playing sound effects can be real challenges. If your chosen game engine lacks the functionality to handle specific tasks, workarounds are unlikely to be effective. It's important to choose an engine that has the necessary tools to address the issues that arise to ensure a smooth and high-quality gameplay experience.

Graham shared examples from his experience. One project, implemented in Unity, involved numerous objects, which significantly increased the load on the code of the parent MonoBehavior class. This negatively impacted the game's performance. To optimize the process, the team abandoned the standard GameObject system and developed a custom solution. This allowed the large number of objects in the scene to be treated as a single unit. As a result, the team also redesigned other systems, retaining only the rendering technology and audio input system from the original Unity toolset.

Graham faced an interesting challenge during a technical interview for the position of Lead AI Scientist for a game developed in Unreal Engine. The project involved creating a powerful networking component that required a significant redesign. Initially, Graham didn't understand the need for this approach, as Unreal Engine already supported networking. However, the project's developers explained that their concept exceeded the engine's standard capabilities and that they needed to not just adapt, but completely extract and rewrite the networking technologies. This task proved particularly challenging due to the unique features of Unreal Engine.

These examples demonstrate that lack of functionality in an engine can significantly delay the development process due to the need to find workarounds. While it is possible to extend the engine's functionality in most cases, this is not always the optimal option. Therefore, it is important to choose a platform with the necessary built-in capabilities to avoid additional time and resource expenditures.

Main Disadvantages of General-Purpose Engines

Many game engines are available for free or as shareware, but financial costs may arise for specific licenses, additional plugins, and assets on marketplaces. To evaluate the benefit of a purchase, simply subtract the time saved from the licensing fees. If the costs outweigh the potential benefit, then acquiring a license makes no financial sense, and it is more practical to develop your own technology. However, this approach is not universal for all engines; for example, Godot and Ren'Py offer significant advantages due to their open source nature, allowing for licensing savings and expanded functionality without additional costs.

Another important, but less obvious, reason than the financial outlay is design limitations. Some game engines are optimized exclusively for certain genres, which can be a barrier for developers. Other engines may have graphical issues, such as specific shaders in Unity or incorrect lighting in Unreal Engine. If a developer plans to create a 2D game, they are unlikely to choose an engine from Epic Games, as Unreal Engine is primarily focused on 3D graphics. While this is theoretically possible, in practice the results will be less efficient than using an engine specifically designed for 2D development. Choosing the right engine is crucial for achieving high-quality graphics and optimizing your workflow.

When developing a game, it's important to consider technical limitations, such as the maximum number of objects your game engine can handle. You should also determine whether it supports the platforms you plan to launch your game on. If it does, it's important to understand how it's implemented in practice and what potential limitations may arise during development.

Off-the-shelf technologies have serious drawbacks. One of these is that developing a project based on an off-the-shelf engine or third-party code makes its success dependent on changes within the vendor. The terms of use for such technologies can change at any time, jeopardizing the stability and development of your project. Therefore, it is important to consider the risks associated with using ready-made solutions and explore alternatives that provide greater independence and control over the project.

The scandal surrounding the introduction of the Runtime Fee from Unity Technologies became a landmark event in the game development industry. This decision was reversed in response to a negative reaction from the community, which did not support such changes to the pricing plans. The main reason for the failure of this initiative was the lack of a monopoly on the game engine market. Developers have the opportunity to switch to alternative platforms, which makes them less dependent on the solutions of a single company.

Epic Games has updated the licensing terms for film, television, and other industries using Unreal Engine to create projects unrelated to video games. Previously, studios could use this technology for free, but now, upon reaching annual revenue of $1 million, they are required to pay $1,850 per seat per year. These changes are aimed at adapting Unreal Engine licensing to a growing number of projects in various industries, which underscores the importance and popularity of this technology in modern content production.

Engine manufacturers make such decisions based on commercial interests. Their primary goal is to profit from their technology. Therefore, it is critical for them to achieve their own success, not the success of the developers, which is a completely reasonable approach.

Graham decided to develop his project using his own code instead of a ready-made engine. This allowed him to avoid dependence on other companies and their technologies, as well as to ensure complete control over the development of his product.

How to "Start" Your Engine

Unless you intend to develop a AAA-level game, there is no need to waste time creating a general-purpose game engine. Your new technology should include only the features necessary for a specific project, avoiding unnecessary complexity. This will allow you to streamline development and focus on key aspects, which will ultimately lead to a more efficient and high-quality result.

A variety of libraries and frameworks can be used to effectively solve key problems in game development. In this context, it is important to become familiar with the main components that make up a game engine.

  • platform abstraction layer;
  • rendering;
  • physics (if necessary);
  • audio;
  • input system;
  • world representation (in the format of scenes, levels);
  • in-game object system;
  • user interface;
  • resources (data, scripts, logic);
  • in-game editor (essentially the heart of the future game).

You can start building your project by integrating frameworks and libraries. Graham recommends paying attention to popular and easy-to-use frameworks, such as the free and open-source SDL. This framework has proven itself to be stable and feature-rich: it includes its own operating system, as well as support for rendering, sound, and input. It's important to note that developers can select only the features needed for their projects, without cluttering the application with unnecessary tools. SDL is also widely used in commercial projects, including game development, confirming its reliability and efficiency.

The pixel action RPG Into the Necrovale is based on SDL. Screenshot: Into the Necrovale game / Casey Clyde / Poysky Productions

If you're developing applications in C#, SFML is an excellent choice for working with 2D graphics. For projects involving 3D graphics, consider Ogre3D. This tool is a cross between a framework and a game engine and is also open source, allowing for flexible customization and adaptation to your needs. Using tools like SFML and Ogre3D provides high performance and extensive capabilities for creating graphics applications.

If physics is essential for game development, Box2D is worth considering. Tiled is an excellent editor for creating maps. The lack of a level editor is one of the main reasons developers prefer general-purpose game engines. Tiled offers a solution to this problem, especially for 2D games, allowing you to quickly and easily create high-quality game levels. Using Box2D in combination with Tiled can significantly simplify the development process and improve the quality of the game product.

Frame: Tiled / YouTube

Data is exported in XML format, which requires a tool to read such files. The TinyXML library is ideal for this purpose. Furthermore, the SOL framework simplifies the process of porting code from C++ to Lua. Graham developed his own build that provides integration between C++ and Lua, and it is available on GitHub. Using these tools allows you to effectively work with XML data and integrate various programming languages.

In the programming world, there are many libraries that can be combined and customized to suit your needs. This allows you to create software that meets specific requirements and tasks. By using these libraries, developers can significantly speed up the development process and improve the functionality of their projects.

With the right tools and technical skills, a developer can create their own framework with a basic structure in a weekend and integrate it into a game loop. A test level can be developed in a week. Graham achieved a similar result, completing a small test level with a moving object in just a week.

It's important to note that Graham's approach is intended for developers looking to create a simple game without the intention of developing complex projects like Unity. This approach is ideal for beginners looking to quickly implement their ideas and master the fundamentals of game design.

Advantages and disadvantages of custom engines

  • Cost-effective (in the long term). By creating your own engine, you invest in your own studio and technology. It is important to note that costs depend on the game format. The larger it is, the more funds will be spent on maintaining technology in the future. This is why large studios such as CD Projekt RED are starting to develop new projects not on their own engine, but on Unreal Engine 5.
  • Nothing superfluous. You create only what is needed, integrating all the necessary systems into the technology.
  • Making certain types of games becomes much easier. The developer has a set of necessary tools and a clear idea of ​​​​how to use them to implement a particular idea.
  • Independence. As noted above, you are not dependent on the terms of another company.
  • High costs at the start of development. Creating technology from scratch will require effort, time, and financial investment.
  • New technology will require documentation for those who will work with it. Graham faced this need when hiring specialists for his indie studio. For obvious reasons, new colleagues did not know how the game object system worked in Graham's custom engine, so accompanying documentation had to be created.
  • A basic level of C++ is required. Even if you do not need to program in this language, at least a basic level of knowledge is required. For example, it is much easier to track down programming errors in Unity using C++ than using C#.
  • Not always convenient in terms of tools. Graham had the opportunity to work on an adventure game in a point-and-click format. Tiled was used as the basis for the main editor. To assemble a level in a general-purpose engine like Unity, simply drag and drop assets into the editor and arrange them in the scene. In Graham's project, the content had to be transferred first to Tiled, then run the export script, and then the game itself. The catch is that the game didn't launch through the framework's user interface, so the developers had to switch to another window and run the executable file. Convincing a publisher or investor of the project's success is more difficult. Many potential partners refuse to collaborate with developers working with custom engines, fearing the risks. Graham admits to having encountered this attitude in the past, which forced him to self-publish. In such cases, Graham recommends emphasizing professional experience during negotiations. In Graham's case, his experience working on projects at Electronic Arts inspires confidence—it's clear that he has the technical expertise to release a game on his own engine. It's also important to showcase finished content, such as a demo, that can showcase the technology's potential.

Developing a custom game engine has both significant advantages and tangible disadvantages that must be addressed. Despite this, Graham believes that developers shouldn't shy away from creating a custom engine, especially when developing simple games. A custom engine allows for greater control over all aspects of gameplay, tailoring technology to specific needs, and implementing unique mechanics. This can significantly improve the quality of a game and its appeal to users.

The gaming industry boasts numerous successful projects developed using custom engines. These examples confirm that using custom technologies can lead to the creation of high-quality and competitive games. Among them, there are several notable representatives, each of which demonstrates unique capabilities and features available only when using their own game engines.

  • Don’t Starve;
  • Into the Breach;
  • FTL: Faster than Light;
  • Starbound;
  • Factorio;
  • Darkest Dungeon;
  • Shovel Knight;
  • Prison Architect;
  • This War of Mine;
  • Banished;
  • Pixel Dungeon;
  • Bastion;
  • Stardew Valley;
  • Legend of Grimrock;
  • Crypt of the Necrodancer.

Results

Graham, based on his experience Working on AAA projects, Graham notes that sometimes it seems like the main innovation in this field is simply inflating the numbers in the titles of established franchises. He emphasizes that this doesn't diminish the value of this segment: AAA games do generate many creative ideas, and significant effort is invested in their development. However, significant new inventions in this field are quite rare.

While working on The Sims 4, Graham emphasized that the core gameplay mechanics retain similarities to The Sims 3, which, in turn, was based on The Sims 2. The latter installment adopted many elements from the first game in the series. Despite changes and innovations with each new game, the fundamental principles remain unchanged. This demonstrates the continuity and stability of the concept, allowing players to easily adapt to new versions and enjoy familiar elements that make the game recognizable and attractive.

Screenshot: The Sims 4 game / Maxis / Electronic Arts

Graham left AAA and moved into indie development because he was tired of implementing other people's ideas. At events like GDC, he pays special attention to the booths of indie studios. In his opinion, it is in these projects that one can find the most interesting and innovative solutions that are lacking in the large AAA industry. Indie development provides the opportunity to implement one's own ideas and experiments, which makes it attractive to creative professionals.

Currently, the gaming industry is experiencing a clear lack of technical innovation. Two leading game engines – Unity and Unreal Engine – dominate the market. Epic Games and Unity Technologies are actively developing their technologies, attracting many developers eager to create games on these platforms. However, using ready-made solutions and following already established paths leads to a lack of novelty and creativity in game development. It's important to explore new approaches and experiment with technology to breathe new life into the industry and create unique gaming projects. Creating your own technology opens up unique opportunities to realize bold and unconventional ideas. Indie developers often strive for innovation and originality, which makes their projects truly unique. This desire to push the boundaries of traditional solutions and create something unusual is a characteristic feature of the indie scene. So, if you're willing to take a risk and try your hand at developing new technology, you could create something amazing and memorable.

Who are you in the world of game development? A mini-course for those who want to make games.

In this free mini-course, you'll try yourself as a game designer, 2D artist, or Unity game developer and choose the profession that's right for you.

Find out more.