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
0 votes
0 answers
32 views

What are some differences and similarities regarding software for augmented vs virtual reality? [closed]

I have just started a professional degree in XR (extended reality) and my first brief is to describe different types of hardware and software used in the field for a short presentation. I do not have ...
2 votes
6 answers
106 views

Modelling Two Way Relationship in Unity for Scriptable Objects

How does one model two-way relationships for scriptable objects? Let's say we have a number of items in-game, and each item can be obtained by different conditions. Some may require you to complete a ...
  • 53
0 votes
0 answers
26 views

Is it better to spawn an object after from same gameobject or handle the spawning in different gameobject?

So basically I am spawning the object lets say the enemy at random position on screen. Should I handle the spawning in a different gameobject or in enemy. So when enemy is destroyed it calls the ...
  • 7
1 vote
1 answer
58 views

How to handle duplicate logic in a state machine for a platformer player?

I'm trying to implement a platformer character using a finite state machine, but I have troubles understanding what kind of logic goes into a state and what logic goes into a main player class ...
0 votes
1 answer
49 views

How to build a system for ammunition being fired out of cannons when player characters and crewmates can also be ammunition?

I'm currently working in Unity building a game inspired by the niche DS game, Dragon Quest Rocket Slime. It's a Zelda-like forced-perspective top-down game where the primary combat mode is you ...
  • 1
1 vote
0 answers
46 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++ ...
0 votes
0 answers
52 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 ...
0 votes
1 answer
100 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: ...
0 votes
1 answer
61 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 -- ...
  • 427
0 votes
1 answer
132 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, ...
  • 145
3 votes
2 answers
384 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 ...
  • 145
2 votes
2 answers
249 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 ...
  • 137
3 votes
1 answer
190 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 ...
  • 145
2 votes
1 answer
264 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 ...
  • 145
3 votes
1 answer
100 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-...
0 votes
0 answers
99 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. ...
0 votes
2 answers
93 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 ...
2 votes
1 answer
171 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 ...
2 votes
1 answer
84 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 ...
0 votes
2 answers
956 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 ...
1 vote
0 answers
64 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 ...
2 votes
2 answers
465 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>. ...
0 votes
1 answer
214 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 ...
  • 67
0 votes
1 answer
74 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 ...
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 ...
0 votes
1 answer
183 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 ...
  • 3
1 vote
1 answer
3k 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 ...
  • 113
0 votes
2 answers
124 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. ...
  • 5,986
1 vote
0 answers
150 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 ...
  • 27
0 votes
1 answer
125 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 ...
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 ...
0 votes
0 answers
476 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 ...
1 vote
1 answer
46 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, ...
  • 330
0 votes
1 answer
142 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 ...
1 vote
1 answer
67 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 ...
0 votes
2 answers
78 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: ...
0 votes
1 answer
155 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 ...
  • 1
0 votes
3 answers
115 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?
0 votes
1 answer
43 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 ...
  • 145
0 votes
1 answer
275 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: ...
0 votes
0 answers
85 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 <...
0 votes
1 answer
133 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 ...
1 vote
1 answer
162 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 ...
  • 48
3 votes
2 answers
285 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 ...
2 votes
1 answer
277 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 ...
1 vote
1 answer
90 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 ...
  • 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 ...
0 votes
0 answers
538 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 ...
1 vote
2 answers
306 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) ...
  • 31
0 votes
1 answer
443 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), ...
  • 57

1
2 3 4 5
13