Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [software-engineering]

Software engineering is the design and development of software as it applies to the game development field. Questions using this tag should be about theoretical concepts and practices as relates to the task of creating or designing software. This tag should not be used simply because a question involves programming or contains code.

Filter by
Sorted by
Tagged with
1 vote
0 answers
35 views

Is it worth creating engines for simple projects? [closed]

I know, this question has already been answered in several places on the internet and the answer is NO. But there are some points, I probably don't have the experience of half of you but I love C++ ...
user avatar
0 votes
0 answers
50 views

What is the best approach for achieving DI / testability in Unity development?

Sorry for the fairly open-ended question, but I'm hoping I can get some insight on how to tackle automated testing in Unity. I've been quite surprised to not find a "definitive" approach on ...
user avatar
0 votes
1 answer
82 views

Is there a good practice for defining names programmatically?

In my use of Unity so far, I've been defining element names programmatically with classes like this: ...
user avatar
0 votes
0 answers
27 views

Draw a graph as a world map in UI?

What's a good way to take a graph of nodes and draw it in your UI as a map? I already have a graph and I'm happy with how it's generated. However, it doesn't have any positional data for the nodes -- ...
user avatar
  • 397
0 votes
1 answer
85 views

How do you use configuration files to describe the contents of an entity in an ECS-system?

One of the advantages that's often brought up when talking about ECS-systems is that they allow a higher degree of flexibility in regards to Data vs Code. Without the limitation of hard-coded types, ...
user avatar
  • 135
3 votes
2 answers
304 views

How do different compositions/types of entities interact in an ECS-system?

I have a working ECS-system set up, largely inspired by this brilliant article (not at all required reading to be able to answer my question) on https://indiegamedev.net/ showcasing an ECS-system with ...
user avatar
  • 135
2 votes
2 answers
137 views

How to program different types of monsters

I'm working with a group of programmers and I'm trying to program different types of monsters in Unity. I want to make it so that all the monsters have values like attack power, attack speed, moving ...
user avatar
  • 137
3 votes
1 answer
124 views

Should you avoid memory allocation and deallocation while the game is running?

I recently read this answer on this site, which says the following: making sure no allocation/deallocation is being done while the game is running is a golden rule of thumb. I interpret this as ...
user avatar
  • 135
1 vote
1 answer
190 views

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

I've recently been reading the book Game Programming Patterns by Bob Nystrom, and one chapter I've found a bit hard to grip is the chapter about the Component pattern. In the example he uses (which ...
user avatar
  • 135
3 votes
1 answer
90 views

Storing stateful function-based actions in a JSON

System: My game uses an "ECS + event queue" architecture where every tick, various events change the state of JSON-able data. Plain JS objects. Problem: I want to be able to save the game-...
user avatar
0 votes
0 answers
80 views

How can I efficiently and safely represent and query game state in the logic programming paradigm?

After learning Dialog, I've discovered representing game logic using the logic programming paradigm is a lot of fun; the composability and non-locality makes it feel like some kind of superior ECS. ...
user avatar
0 votes
2 answers
82 views

Naming convention for loop modules

Question about game engine object oriented design. Let’s say I have an engine with a main loop, and many handlers that will be executed by the main loop every time on next iteration of main loop. So ...
user avatar
0 votes
0 answers
92 views

How do you model status effects in a turn based combat system without coupling them with the units' code?

I'm trying to write a program to model turn based combat à la Slay the Spire, Darkest Dungeon in C#. I'm struggling with implementing status effects, because different status effects trigger certain ...
user avatar
  • 111
2 votes
1 answer
136 views

Is it better design to store event effects within an Entity itself, or within a system?

I'm developing a 2D roguelike with an Entity Component System (ECS) and I've been struggling with this question a lot the past week. For example, let's say you have various effects that occur when an ...
user avatar
2 votes
1 answer
81 views

Should ammo limitations be controlled by the game class or the weapon class?

I have a simple shooter game with a GameLevel class and a Shooter class. The shooter has a set amount of ammo, and every time the ...
user avatar
0 votes
2 answers
745 views

What data structure do I use to store Archetypes in ECS?

I am implementing an ECS with "archetypes" similar to how they are defined in Unity: A unique combination of component types is called an Archetype. For example, a 3D object might have a ...
user avatar
1 vote
0 answers
60 views

How to reduce code duplication in a cross-platform renderer without tying the interface to one specific API?

I'm working on a game engine as a fun project over the spring+summer. I've decided that to allow myself to explore rendering APIs I'm unfamiliar with, and force myself to write reusable code, I'd ...
user avatar
2 votes
2 answers
396 views

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

I've had an idea for optimising my ECS engine. Instead of storing components in an array, store components in a hash table as <id> => <component>. ...
user avatar
0 votes
1 answer
169 views

How to pass data between game states?

Lately I've been using game state stack implementation from a book SFML Game Development and I've stumbled upon a problem with passing data between states. In this implementation State constructors ...
user avatar
  • 57
0 votes
1 answer
71 views

How to deal with data that needs to be accessed by all objects?

I have a World class that currently only has one instance. It has data and methods that need to be accessed by all other game objects. Right now I'm hardcoding a ...
user avatar
4 votes
3 answers
2k views

Is an ECS viable in garbage collected languages?

I've done some research on Entity Component System architectures. Right now I have a convoluted OOP implementation which I'm planning on rewriting, so I was considering switching to a different ...
user avatar
0 votes
1 answer
172 views

Refactoring fighting game Movement class responsibilities

I'm a web developer, new to C# and trying to learn Unity. I've learned the C# syntax, I understand how to write working code, although I'm having a hard time understanding when and to what classes ...
user avatar
  • 3
1 vote
1 answer
2k views

How to get the source code for a game?

I read here a spectacular story of someone (scrappily) fixing some things in a game's source code, making it load 4 times faster! How did the developer get the source code in the first place? Is there ...
user avatar
  • 113
0 votes
2 answers
123 views

How to replace if/else/switch with polymorphisim

For a long time Robert Martin has been advising against if/else/switch branching logic and instead rely on the polymorphic behavior of different types. ...
user avatar
  • 5,986
1 vote
0 answers
119 views

How to design a character damage system with ECS architecture?

I am developing an game with ECS architecture and trying to design a character damage system. Does the following design fits into ECS conception and will it be extendable in future? I have an ...
user avatar
  • 27
0 votes
1 answer
101 views

It is possible to process data on relay servers?

I have a small game engine done in Java, and re-creating it on C++. While re-creating it i've decided on adding basic p2p online multiplayer. However, after reading more about networking, there are ...
user avatar
6 votes
2 answers
1k views

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

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 ...
user avatar
0 votes
0 answers
384 views

Supporting multiple graphics apis

I would like to provide support for switching between both OpenGL and Vulkan in my game (and potentially DX12 later). Currently I only know OpenGL so I am working on that. I have read a lot of posts ...
user avatar
1 vote
1 answer
45 views

Translating conditions ("If A has B, then true") into objects that satisfy them ("A has B")

I have a system where I'm sifting through a large number and variety of objects in my game, looking for objects that match an arbitrary search criteria that can be simple or complex. For example, ...
user avatar
  • 330
0 votes
1 answer
125 views

Should a server run all maps in one loop, or a thread/game loop per map?

I'm working on a real time multiplayer browser-based game. The game is top down on variable size tile based maps. There is no central map where all players come together, the entire game plays out in ...
user avatar
1 vote
1 answer
65 views

How to manage in-game factions, alliances, federations, etc

So this question is code or engine agnostic but, I’m looking for ideas on how a game can keep track of a pre-determined number of factions or alliances. For example, say I made a space game that has 2 ...
user avatar
0 votes
2 answers
60 views

Best practice where to store Projectile Damage amounts?

I have a projectile and an enemy, both with colliders. On the projectile script, I'm destroying the projectile OnTriggerEnter: ...
user avatar
0 votes
1 answer
153 views

How can I avoid coupling between units and their environment?

Currently in the process of making a game like Dwarf Fortress, so without graphics. I'm mostly thinking about how I want to implement everything. While writing code I keep stumbling on general game ...
user avatar
  • 1
0 votes
3 answers
102 views

How do I show only the level in monogame? [closed]

How do I remove the blue background shown here So that only the level is visible without making the sprites/map larger or the window smaller?
user avatar
0 votes
1 answer
37 views

Is it okay to update the graphical handlers in the same function where you render them?

I have a class called 'GraphicalHandler' that all my graphical handlers inherit from the main game loop. The class manages a static vector of pointers to all instances of itself. I can then call the ...
user avatar
  • 135
0 votes
1 answer
250 views

Animating from json file in pygame?

I have got a json file and I am trying to load the single sprites from that file but I gives this error after a few loops and also the animation is not smooth(gets stuck) error: ...
user avatar
0 votes
0 answers
83 views

is there any different solution for different buildings different behaviours

I'm trying to make different behaviours for workers of different buildings, let's say an agricultural worker would need to sow wheat seed and collect the wheat grain when it's grown. let's call that <...
user avatar
0 votes
1 answer
119 views

Building a unified interface for a swap chain in both DirectX 12 and Vulkan

Most objects in DirectX 12 have natural analogues in Vulkan, e.g. VkInstance = IDXGIFactory ...
user avatar
1 vote
1 answer
146 views

Instantiating GameObjects in Custom Game Engine

So,i'm having a bit of an issue with instantiating my gameobjects into to universe(My Scene object). I can create an empty object from scratch and populate it from there with ease,my problem starts ...
user avatar
  • 48
3 votes
2 answers
283 views

Game Architecture: Class leaking into almost all files

We currently have the problem that our main class GameController is being pulled into every backend file in our game. We're wondering what are common solutions to this problem. Here's a bit more about ...
user avatar
2 votes
1 answer
246 views

Handling complex selection mechanics in RTS-style game

When we look at complex RTSs where a simple left button mouse click can mean twenty or more different things, depending on the game and UI state, the code handling this interaction and assigning the ...
user avatar
1 vote
1 answer
89 views

What does it mean to develop a VR game from the ground up?

Some virtual reality games are advertised as being created from the ground up for virtual reality. What does this mean exactly? What are some of the differences between developing a 3d pc game and a ...
user avatar
  • 113
0 votes
0 answers
24 views

Formula to calculate Level and Current Experience from Total Xp [duplicate]

So I'm building a mobile game where I have simple XP progression system that goes like this: Level1: 0-399 Total XP Level2: 400-1199 Total XP Level3: 1200-2399 Total XP So basically for the first ...
user avatar
0 votes
0 answers
440 views

How to load a PNG in pure C

PNG loading: I've been creating a game engine for almost a year, and since the start of the development, I have been using stb_image for loading images. It ...
user avatar
1 vote
2 answers
258 views

Why do we have to use a fractional numbers in the graphic engines (2D/3D)? Why integers are not enough?

Maybe it'll be a super beginner question but can someone explain me why do we have to use a fractional numbers (floats, doubles) ...
user avatar
  • 31
0 votes
1 answer
390 views

How do I connect Unity to a server backend developed in .net core?

I'm currently running to a wall in my game development and I need now some discussion to clear my mind... In my mind I have a plan for some little online game (focused around clicking and idling), ...
user avatar
  • 57
1 vote
1 answer
94 views

How to choose what to use in Java: Enums or Objects?

I'm in a dilemma over using Enum Types or using class objects in that particular part of my java project. Let's suppose I have an array where I constantly add and remove things from it, but I also ...
user avatar
  • 23
-1 votes
1 answer
72 views

Security in Unity

I have a public int variable in my game for number of coins. It's public because it must be accessed in other scripts and scenes (for when you want to buy levels, character,etc). I want to use anti-...
user avatar
  • 19
0 votes
1 answer
142 views

Managing large amounts of data and processes for an economy management game

I'm making a management game in the vein of Anno or Stellaris, but I'm unsure how to manage all my data efficiently. Short example: the player controls multiple islands. Each island has factories on ...
user avatar
  • 11
4 votes
2 answers
2k views

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

As the original publication of the source code states, you still need an original copy of the game: https://www.doomworld.com/idgames/idstuff/source/doomsrc What exactly do you need from those ...
user avatar

1
2 3 4 5
12