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 ...
89
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 ...
80
votes
Accepted
How do bullets work in video games?
I can certainly see why you would think that it would be hard to simulate those, but there are enough constraints on bullets (all projectiles, really) to make them easier.
They are generally ...
58
votes
How do videogames store information offscreen?
Usually you should separate the logical state of your game environment from the visual representation.
The player might only see a small part of it on their screen, but you still keep the state of ...
45
votes
How do bullets work in video games?
Probably one of the most efficient ways to implement bullets is using what is known as hitscan. It is rather simple in its implementation - when you fire, you check to see what the gun is aiming at (...
37
votes
How do videogames store information offscreen?
You are going at it backwards.
You start with the logical state of your game and model that. The whole logical state of the entire world will almost certainly be too much to be held in memory at once,...
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 ...
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 ...
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 ...
17
votes
Accepted
How likely will I be able to get a job in game design with a masters in computer programming?
You should notice that game design is nothing that is necessarily related to programming. It also applies to board games, card games and every type of game, computer games being one of these. It's a ...
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 ...
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 ...
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 ...
13
votes
What do I need to consider before making any class singleton?
Do you think you don't need more than one or do you think there must never be more than one?
The singleton pattern is mostly useful in situations where the existence of more than one instance of a ...
11
votes
AI multithreading
Implementing logic by threads is almost always a very bad idea. Multi-threaded programming is difficult! You will run into race conditions and deadlocks resulting in impossible to reproduce bugs.
...
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.:
...
10
votes
Accepted
Decoupling input from game states / entity behavior
Input is hard. Most of the simple patterns you see frequently in game dev just don't work well for input, at least at the low level.
Typically, for any kind of GUI, you need to have some concepts of ...
10
votes
Introduction to game engines for children
I found the good old rpg maker quite good when I was at that age myself. It's not that powerful compared to the big name engines but for a plain game it is more than enough. And it focuses more on ...
9
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 ...
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 ...
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 ...
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 ...
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 ...
7
votes
AI multithreading
Create a thread for each player is an overkill, 5000+ threads will trash your server performance.
My suggestion is to create a job queue where you put all your 5000 players state then you can launch ...
7
votes
Pointers in C# Unity
C# uses references to pass around objects that are not value-types. This means that everything is usually passed by reference. If you want to pass a value-type by reference you can use the ref keyword....
7
votes
How do bullets work in video games?
I'm by no means an expert, but to answer your question, yes, you would need many of those things you mention.
For your 2D example, you could have a position and velocity for a bullet. (You might ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
software-engineering × 625architecture × 92
c++ × 81
c# × 60
unity × 59
game-design × 43
java × 40
design-patterns × 30
2d × 29
game-mechanics × 25
mathematics × 22
3d × 21
graphics-programming × 21
algorithm × 20
graphics × 20
ai × 18
opengl × 15
physics × 15
multiplayer × 15
xna × 14
javascript × 14
entity-component-system × 14
networking × 12
android × 11
performance × 11