Skip to main content
158 votes
Accepted

Why are games built on cross-platform engines sometimes exclusive to Windows?

Technical Reasons: Game-code made platform specific: When some developers are making their games, they can sometime rely on platform specific functions. While the game engine might be able to build ...
user3797758's user avatar
  • 3,651
88 votes
Accepted

When is the best time to consider performance?

Engineering for Performance Follow vendor recommendations. Use the correct data structures. Implement the correct usage patterns. Don't do anything stupid. Optimization When already written code is ...
Maximus Minimus's user avatar
31 votes

Why are games built on cross-platform engines sometimes exclusive to Windows?

Because being available doesn't mean being free & instant. Supporting one more operating system, in its most simplistic form, means one more platform to provide technical support for. The more ...
starikcetin's user avatar
  • 5,335
22 votes

When is the best time to consider performance?

If you want to do optimization at the right times, have slow machines and use them. For a small shop, a good option is to use a slow laptop on the commute and a fast desktop in the office. As an ...
Peter's user avatar
  • 9,945
19 votes
Accepted

Is it a good option to simultaneously work on a game and a game engine?

Consider using a framework, like MonoGame. It is a kind of a middle ground between "nothing" and a full-blown engine like Unity or Unreal. It saves you from the really finicky implementation details ...
htmlcoderexe's user avatar
16 votes

Is it a good option to simultaneously work on a game and a game engine?

You, of course, can use a third party solution. You can develop C# games with (in decreasing complexity) Unity, Godot, Monogame, OpenTK, among other solutions. Making a game without a third party ...
Theraot's user avatar
  • 28k
15 votes
Accepted

How do you determine what order to process chained events/interactions?

I don't think I'd put all of these effects into a single container at all, because as you show, any one container behaviour is unlikely to fit every use case you care about in your game. Instead, I'd ...
DMGregory's user avatar
  • 139k
14 votes

Why are games built on cross-platform engines sometimes exclusive to Windows?

The other answers here are good, but here is one that wasn't mentioned. I'm having this problem right now - my team is about to release a game made in Unity for Windows/Mac. We've gotten lots of ...
Cody's user avatar
  • 241
14 votes
Accepted

When or why would someone use a programming language (Swift, Java, C++, Rust etc...) over an engine like Unity?

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 ...
Philipp's user avatar
  • 122k
11 votes
Accepted

Should items in an RPG be hardcoded or loaded in some other way?

Weapons are data. You shouldn't really ever keep data hardcoded. Your structs / classes should accommodate all necessary parameters to build a weapon's data from scratch, e.g.: ...
Engineer's user avatar
  • 30.4k
10 votes

Do retail games use "inversion of control" and "dependency injection"?

I'm writing this at a time when the accepted answer is by a contributor who strongly opposes the concept and I wish to provide a different view: Dependency injection is indeed not widely used in game ...
Cygon's user avatar
  • 232
9 votes

When is the best time to consider performance?

No, you don't have to check after every line because not every line is performance-relevant. It mostly depends on how often a line is executed. A code section which takes 1 ms to be executed is ...
Philipp's user avatar
  • 122k
9 votes
Accepted

Which parts of Doom (1993) are open source and which are not?

Doom is divided into two components: The game engine. The game data. Of these, the source code which was released is for the game engine only, and as the readme notes, only for the Linux version, as ...
Maximus Minimus's user avatar
9 votes
Accepted

What should be an entity/component, and what shouldn't?

A lot of systems in a game that needs to be updated are things that are not rendered and don't need any input, they simply need a call to their update function every frame. They don't have any ...
DMGregory's user avatar
  • 139k
8 votes
Accepted

Are there technical reasons to use short variable names in shader code?

I've noticed the same trend, I've found the following reasons apply: Shadertoy in particular is just that a toy. You will often find people don't bother with good coding standards and do what ever ...
Krupip's user avatar
  • 1,793
7 votes
Accepted

Is an ECS viable in garbage collected languages?

The Garbage Collector (GC) is not really an obstacle to implement an Entity-Component-System (ECS) architecture. All you need is a root object for your ECS. It would hold references to the containers ...
Theraot's user avatar
  • 28k
7 votes
Accepted

Decouple game entity from its owner when logic depends on it

The crux of the issue appears to be that you are tying the identity of an object to the implementation. In it's simplest form a players ID could just be an integer (player 0,1,2,3...). Hence instead ...
DavidT's user avatar
  • 783
6 votes

Solutions for maintaining importers and exporters when chaning file formats

Naughty Dog seems to use scheme for describing both the data and how it should be read. However, my knowledge of scheme is non-existent so I have no clue how that would work. This would however, solve ...
Ferreira da Selva's user avatar
6 votes

Are there technical reasons to use short variable names in shader code?

Some possible reasons for using short variable names are: Brevity: short variable take less time to type. Following Textbooks: similar to the discussion in this software engineering SO post on short ...
Pikalek's user avatar
  • 13.3k
6 votes
Accepted

endless Thorn (deal damage when taking damage) effect

One option is to create a damage type called Reaction Damage, and construct your rules so that Reaction Damage does not trigger Reaction Damage. The Thorn effect then becomes "When another player ...
DMGregory's user avatar
  • 139k
6 votes
Accepted

Is it a good idea to use a hash table in an ECS?

If you want to know what is faster, measure. That is the engineering approach. Thus, write your code in a way that you can swap the implementation (e.g. behind an interface) and benchmark. With a ...
Theraot's user avatar
  • 28k
5 votes
Accepted

How do I program attacks and combos in a fighting game?

This advice is more general, rather than being specific to fighting games, but typically player behaviour in games with any reasonable level of complexity will be coded as a finite state machine, ...
Bryan Robertson's user avatar
5 votes
Accepted

The number of shaders a large game or game engine has

It depends in part on how you count them. Many games & engines use large shaders, called "ubershaders," that try to cover many different material effects and rendering techniques, with ...
DMGregory's user avatar
  • 139k
5 votes
Accepted

Multiplayer Game Server Input vs Tick

so ... I can probably speak to your example, since I'm the primary author of the Jackbox Games multiplayer server, which as it turns out ... is written entirely in Go! Since there's no simulation to ...
jorelli's user avatar
  • 166
5 votes

When or why would someone use a programming language (Swift, Java, C++, Rust etc...) over an engine like Unity?

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 ...
lilKriT's user avatar
  • 436
5 votes
Accepted

How to get the source code for a game?

Getting access to a game's sourcecode can be anything between trivial to impossible. Factors which decide that are: What technology was used to create the game? Decompiling executables to readable ...
Philipp's user avatar
  • 122k
5 votes
Accepted

How to implement a function that normally returns a float, but can sometimes fail?

You are correct in that you can't return null, which is because you have declared in your method that it returns a float. So, ...
Theraot's user avatar
  • 28k
5 votes
Accepted

Programming Singletons vs Static classes

In Game Programming Patterns, Robert Nystrom lays out that there's a few common reasons we like to reach for singletons: Ease of global access Only takes resources if used (if no one uses the ...
DMGregory's user avatar
  • 139k

Only top scored, non community-wiki answers of a minimum length are eligible