Questions tagged [c++]

C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

Filter by
Sorted by
Tagged with
0 votes
1 answer
35 views

Sanity Check on my Idea for an Event System for game

So, I recently started making a small game from scratch, with no engine used(I'm a beginner at this) and I want to create an event system of my own. I want to check if my general idea for it is okay(...
HavocKid's user avatar
0 votes
1 answer
63 views

encapsulation, structs and global variables?

I have worked on creating a gameloop and so far all of the code was inside a main.cpp file and I want to separate it into different files. Which caused several problems: My code is separated into 3 ...
snow_owl's user avatar
1 vote
0 answers
44 views

Old color attachments being used after resizing window

I have the following deferred rendering setup: The first render pass renders the scene to a fixed size image (2048x2048) from the directional light's point of view to one color attachment as a shadow ...
Symlink's user avatar
  • 133
0 votes
0 answers
28 views

How can I properly deallocate my assets and prevent memory leaks? SDL2

First I declare some global variables ...
Manifest's user avatar
0 votes
0 answers
63 views

How do I create a build from a custom Game Engine?

I have an custom Game Engine, made in C++ and made in Microsoft Visual Studio 2019. Currently, this Game Engine has a .sln with the following projects: TheGameEditor, which is the current entry point ...
JonathanCacay's user avatar
3 votes
5 answers
3k views

Is there any performance penalty to unsigned integer underflow?

Is there any performance penalty to unsigned integer underflow? Suppose I have a computation subtracting two unsigned integers (so underflow can happen if b > a),...
Qwert Yuiop's user avatar
0 votes
0 answers
28 views

CircleShape crashing program when defined as an instance variable

I am encountering a perplexing issue in my SFML game development where my program crashes instantly during runtime when I add a CircleShape as an instance variable ...
Julian42_74's user avatar
0 votes
0 answers
69 views

How to continue with Unreal engine after crash?

I know that it is possible to do it so that when the engine (and maybe the game) crashes, it does not close, and continues to work. Who knows how to do it? I know there are many ways to do something ...
grouptout's user avatar
  • 101
2 votes
2 answers
97 views

How do materials and shaders work in graphics programming?

I stumbled upon a few videos about shaders and materials from The Cherno and my understanding is that materials are this sort of input that a shader takes to calculate an output instead of hard coding ...
Konjointed's user avatar
0 votes
0 answers
75 views

Cmakelists.txt with sfml/glew/glm .exe doesn't work

I am working on a game in c++, i want to make a Cmakelists.txt file for build a .exe file. ...
Gaëtan S's user avatar
0 votes
0 answers
49 views

How to render two different meshlets at two different LODs in a Mesh Shader?

I would like to know how to render two different meshlet at two different LOD values. So, for example, I render the meshletA at LOD1 and I render the mesheletB at LOD2. Please let me know if this is ...
Giuseppe's user avatar
0 votes
1 answer
82 views

How do real time cutscenes work?

I want to code a real time cutscene editor in my engine but I couldn't find any pdf documents or websites explaining it in detail. Is the cinematic scene file loaded with instructions like ...
user23344561's user avatar
0 votes
0 answers
16 views

DirectX 9 specular component of vert and alpha channel

Suppose I locked DX9 mesh vertex buffer, and took one vertex: ...
black4's user avatar
  • 165
0 votes
0 answers
26 views

Absolute and Relative matrix translation

...
black4's user avatar
  • 165
0 votes
0 answers
35 views

Camera (View) in Euler angles

This is code (below) from original game project (90s years), I it study now. Used fixed point math. ...
black4's user avatar
  • 165
1 vote
2 answers
141 views

Bullet Physics Multi-threading Rigid Body transform jittering issues across threads

I've been working on a game using Bullet Physics for C++ as well as SDL for the windowing (with OpenGL) I've recently threaded the game, so that a separate while loop runs the Physics Simulation, ...
jasonmzx's user avatar
0 votes
0 answers
50 views

How to make calculating the inverse matrix more robust?

When I calculated the inverse matrix, I found that the error in using the float data type would cause the inverse matrix calculation error. Is there any good solution? ...
noodle_run's user avatar
0 votes
0 answers
23 views

Workaround to bind templated functions to lua?

I'm trying to add Lua for scripting to my C++ game engine, which is based on ECS, and I have a rough idea of what I want to do (is it good? probably not) but trying to actually execute it has been ...
Konjointed's user avatar
0 votes
0 answers
73 views

How to compile .obj files into final executable?

I have created a .obj model in Blender. I am writing a screensaver, so, I can have only one file(.scr)?
Praveen Kumar's user avatar
0 votes
1 answer
43 views

How to go about executing lua scripts in a ECS engine?

I'm trying to add scripting with lua to my C++ game engine, and I'm pretty stumped on how to tackle the executing/processing part. I started by creating a ...
Konjointed's user avatar
0 votes
1 answer
69 views

Software rendering - compose View matrix

There is function compose View Matrix, it's software rendering project. Used fixed point math. phd_sin() and phd_cos() user defined functions implement sin() and cos(). Please explain this ...
black4's user avatar
  • 165
0 votes
1 answer
108 views

Implementing a Fixed Time Step?

This has been bugging me for few days now. I'm trying to stop movement jittering in my game. I've looked towards semi and fixed time steps - moving towards the latter below so I can really understand (...
tisolo's user avatar
  • 1
0 votes
1 answer
25 views

Camera code in polar coordinates

I have OpenGL code for camera: ...
black4's user avatar
  • 165
0 votes
0 answers
33 views

How to add Input Modifiers in C++

I have a blank Input Mapping Context to which I add the Input Actions that I require at specific times during my game. For example, when I make a roll, I simply add the camera movement Input Action ...
afarre's user avatar
  • 111
1 vote
0 answers
31 views

3D transform hierarchy rotation applied in wrong order

I'm following in the footsteps of this blog in implementing a transform hierarchy to my game engine scenes. I have a fairly similar implementation for a 3D transform: ...
Boyfinn's user avatar
  • 11
1 vote
1 answer
82 views

Infinite jump issue

I am currently making a game in c++ using sfml, I encountered a problem where if I jump in my game, the jump mechanic allows the player to jump repeatedly in mid-air which is something I do not want. ...
Cheez's user avatar
  • 11
0 votes
0 answers
52 views

How to implement events with ECS?

I'm transitioning over to an ECS architecture for a small C++ graphics engine I'm working on and I'm a bit stumped on how to tackle events. One solution I came across was from this Reddit post ...
Konjointed's user avatar
1 vote
0 answers
53 views

What does a "non viable function" error mean?

I am trying to use a websocket and some C++ code in order to trigger a function toogleLight every time Unreal connects with a server. But I have the following error:...
Nicolas Osorio Bustos's user avatar
21 votes
7 answers
17k views

Do real game developers use blueprints, or do they always use C++?

I'm starting to learn Unreal Engine 4. Every time I use blueprints, I think "that's not right" and I need to use C++, but there are not as many tutorials with c++ code. So, is it ok to use ...
mendzek 's user avatar
0 votes
1 answer
140 views

How to develop a game on a 2015 MacBook Pro without learning Metal?

I'm on Mac and OpenGL and Vulcan are not supported. Even worse, I'm on a 2015 MBP 13". Yeah, can't do much with that. I spent a full year learning C++ and I have no patience to try and learn ...
BeardlessDev's user avatar
0 votes
1 answer
55 views

Setting up perspective projection in OpenGL

I'm trying to set up perspective projection in OpenGL but it doesn't work ...
DDD's user avatar
  • 1
2 votes
0 answers
44 views

How does non ECS parts work with ECS parts?

I incorporated ECS to my graphics engine and I have a problem with my Renderer needing the camera which is an entity and the process is a bit bizarre. Originally, I ...
Konjointed's user avatar
0 votes
2 answers
66 views

What happens with global/singleton objects when using ECS?

As I've been learning about ECS one thing that gets me confused are things like input which in my case has usually been some singleton that gets polled or in one project was event based where code can ...
Konjointed's user avatar
1 vote
0 answers
30 views

Physics interpolation given an asynchronous physics thread

I've followed https://gafferongames.com/post/fix_your_timestep/ to do interpolated physics. I have a separate thread entirely from my graphics thread. I use vulkan which allows me to do asynchronous ...
Krupip's user avatar
  • 1,763
1 vote
1 answer
108 views

What is a "controller"?

I'm in the process of refactoring my camera code the goal is to try and simplify things using a struct instead of a class or at the very least try something new since I always jump straight to classes/...
Konjointed's user avatar
0 votes
0 answers
35 views

Full Unreal engine API support in Python?

I'm a newbie to the Unreal engine, and I've seen that there is very little documentation and examples of Python in the Unreal engine, so I'd like to ask if, leaving out the gameplay functionality, we ...
Haitao Xiao's user avatar
1 vote
0 answers
78 views

Good practices for making a manager class?

I found this post for designing a camera system the post mentions having a manager where you could register and set different cameras such as debug, player, script, etc and I kind of like this ...
Konjointed's user avatar
1 vote
0 answers
36 views

How could I build components for a composable loot system like one in RuneScape without using OOP?

I looked at some entity component systems, and noticed that they sometimes list static polymorphism as a feature, and ECSs and data oriented programming seem to be touted as holy grail of modern game ...
shinyoi's user avatar
  • 11
0 votes
1 answer
79 views

Should I care about appropriate variable/integer literals in C++?

I'm developing a C++ game engine. A question has popped to my head. Let's imagine this constructor: Vector2f::Vector2f(float x, float y) : x(x), y(y) {} We can ...
DDD's user avatar
  • 1
1 vote
1 answer
113 views

How to use handles for asset management?

The way I've learned to implement an asset manager is having unordered maps for each asset type (textures, shaders, meshes, etc.), each with a string key and object value and then having methods ...
Konjointed's user avatar
1 vote
2 answers
178 views

Seam visible on sphere or torus made in Blender when using a texture atlas

I'm making a game in OpenGL with C++. I have a problem with my vertices or texture coordinates - there's a seam visible on the sphere where the texture wraps around: If I use "nearest" ...
Gaëtan S's user avatar
0 votes
1 answer
81 views

What is this jitter caused by moving at high speed?

I used jumping real high as an example to show the jitter. what is causing the jitter issue? I can provide code for various parts of my engine if requested.
ZeunO8's user avatar
  • 699
0 votes
1 answer
29 views

Difference of angle by Y value

This code from game 90s years. For example on scene there is tiger as "item" and main character as "enemy". This code calculate vector or direction of attack tiger to main ...
black4's user avatar
  • 165
-1 votes
1 answer
105 views

What this code do?

I investigate source code old game for 90s, dont understand math stuff. ...
black4's user avatar
  • 165
2 votes
1 answer
69 views

Vulkan shadow map artifacts

I am experiencing some weird shadow artifacts. I suspect it to be some sort of self shadowing/depth bias thing. My shader for the shadow map is quite simple: ...
Symlink's user avatar
  • 133
0 votes
0 answers
38 views

Specular lighting does not appear

I'm struggling to add specular lighting on-top of diffuse lighting and not entirely sure where I'm going wrong. I've followed the instructions given in our lecture but it just doesn't seem to be ...
Skoosh's user avatar
  • 1
0 votes
0 answers
32 views

clion.sh does not exist

I have Unreal Engine in Linux launched with ./UnrealEditor This file here ...
Idriss's user avatar
  • 1
0 votes
1 answer
41 views

3D Impulse based collision resolution not behaving correctly, what could be wrong?

I've implemented a collision resolution system based on Ian Mellington's System Cyclone and afterwards based on the Game Physics Cookbook. Currently the last one is implemented. For some reason the ...
Martin's user avatar
  • 1
1 vote
0 answers
48 views

Separating axis theorem implementation results in limitless extending colliders along the Z axis

I am trying to implement SAT and it works except for the fact that colliders extend infinitely along the Z axis and I can never get past them. I also have confirmed that ...
Jakob Tadej Vrtačnik's user avatar
0 votes
0 answers
42 views

Clarification on scene graph implementation. Adding object/node to a root node or container?

I learned about scene graphs from this chapter on learnopengl and using this I'm trying to make a simple imgui window that can display the scene graph, but one thing that wasn't made clear/I'm having ...
Konjointed's user avatar

1
2 3 4 5
86