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
1answer
38 views

Unreal MouseWheelAxis negative axis does not work

Would like to avoid using separate action mappings i.e. MouseWheelUp and MouseWheelDown for a system I'm developing. I noticed <...
4
votes
1answer
212 views

How can I create a templated function to add components to their necessary containers using an ECS system?

I had implemented a basic ECS system and was then informed that it should be changed as each system should not directly store their required components. I have created a ...
0
votes
0answers
25 views

Numerical errors in Player collision offset causing player to fall through the ground the next frame, how to avoid?

I'm trying to implement player physics with arbitrary objects, in this case, a bunch of cubes. I wanted to add a "floor" so in my cube collision function, I added the following following lines: <...
0
votes
0answers
32 views

UE4. Reload CDO default values?

My aim is make difficulty system that will edit Class Default Object values for any specified class. It's fastest way to make any properties that will dependent to difficulty by game designer (Class. ...
1
vote
1answer
39 views

Passing by pointer-reference in blueprints with C++ definitions

MyFunction( Class *& foo ) Inside a derivative BP of the above C++ class: foo shows up as an output rather than an input. Why?
1
vote
1answer
50 views

How do I access a struct that resides within a struct in blueprints?

I have a struct: "FOuterStruct" This is defined in code such that it contains another struct type: ...
2
votes
0answers
74 views

Using shared memory instead of marshalling for C++ native plugins in Unity?

So I'm a C++ developer who has been playing with C# for a week or two in order to get acquainted with Unity, and I'm curious about the marshalling process used to transfer data for use in C++ native ...
0
votes
0answers
80 views

Best practices for interaction between game objects

I’m in the process of developing a game. My problem is this.. I’m going to implement the observer pattern to have my game objects “subscribe” to events that happen. For instance one character shoots ...
0
votes
1answer
43 views

Why can't a blueprints project edit BPs derived from c++ classes?

I am working in a relatively small team. Now, because our IT guy is incredibly unhelpful, we don't yet have VS on all the machines (as I know this would solve the error). However, I'm still curious ...
0
votes
1answer
32 views

Directx11 batching verticies to draw later

I have several draw functions in my renderer to draw primitives e.g.: Drawing a Quad: ...
0
votes
0answers
71 views

How to support JS/Python scripting a C++ game engine

I'm currently writing an Entity/Component/System architecture game engine in C++, and I have the beginnings of a lua scripting system in place, which seems to be quite popular, but I feel Javascript ...
0
votes
1answer
46 views

Is it bad to store other memory in a system, alongside the components buffer using an Entity-Component-System architecture (ECS)?

I'm currently writing a simple ECS architecture for an engine and I have the fundamentals in place but after reading up on this architecture, it is designed in such a way that the memory is contiguous ...
3
votes
1answer
128 views

Quadtree for AABB collision boxes

I have a whole bunch of entities constantly being processed and testing for collisions. I've tried to optimize this by stopping certain entity types from checking each other, dead entities not being ...
1
vote
1answer
83 views

How to stop scrolling of text in OpenGL

I want to set a time limit for scrolling text in OpenGL & GLUT. How can I stop scrolling at 250? Here is my code. I try with the if condition but it's not working. The scrolling is not stopping in ...
0
votes
2answers
55 views

C++ Passing Functions to Objects/Projectile system woes

I am new to C++ development and I am trying to create a more flexible projectile system. In my current system I apply a equation to move the point down the bullet path. ...
2
votes
3answers
96 views

Centralized ResourceManager Class for every type of Asset in an Game Engine

I am trying to Implement resource manager for my hobby game engine. The problem I am trying to solve is that I want one centralized resource manager, which delegates resource loading to a bunch of "...
3
votes
2answers
144 views

C++ Object management/deletion

I am working on a game with a lot of bullets, currently every second it loops through a vector of bullet objects and checks if its marked for erasure or not. ...
1
vote
1answer
59 views

Problems implementing shadow maps in directx

I am trying to implement shadow maps in my Dx11 rendering engine. I created a shadow map texture2d, a shader resource view, a depth stencil, a viewport, and a rasterizer state, as recommended by ...
0
votes
4answers
150 views

What is the best way to implement the story functionality (dialogue and cutscene management, etc.) in an RPG?

I would like to know what the best way to implement the story functionality of an RPG would be. I am writing the game in C++ using the SFML library for graphics, and I have implemented drawing tiles, ...
0
votes
1answer
67 views

Unreal modular character tutorial errors

I'm trying to follow the modular character tutorial for Unreal from this link Specifically the mesh merge portion. How ever the code that is provided seems to not be working. For example when I add ...
0
votes
1answer
36 views

How to correct obtain HWND from SDL2?

I use Urho3D which uses SDL2 as a window system. I want create another window as GUI and make it child for main window of Urho3D. What I did is: ...
0
votes
1answer
32 views

How to make changes to Pawn.cpp Unreal?

I am trying to figure out a problem related to CableComponents. As part of my learning and problem identification I'm trying to place some UE_LOGs/Debug Messages within Pawn.cpp and CableComponent....
1
vote
2answers
75 views

2D game with collision detection, and I need help with how to resolve a collision

At the moment I have built a custom Vector2 class and have a character object that has an acceleration vector (modified by vector forces), a velocity, and a position as well as bounding boxes for ...
0
votes
1answer
50 views

Box2D Weird collision behavior

I'll let the gif speak first. As you can see, the small cube just kinda floats there like it has a forcefield. This weird glitch only happens with small cubes, smaller than 60 pixels for some reason. ...
0
votes
1answer
62 views

How does the deployment of server look like

I´m kinda new to these networking stuff, but basically managed to finish server to handle client requests(wan´t it to handle connections to game and help the clients update the game and stuff). I got ...
-1
votes
1answer
33 views

What is the intended usage of FDetachmentTransformRules in Unreal

There seems to be little to no documentation on this part of Unreal functionality and I was wondering whether anyone here had any examples to share with the community or information regarding ...
0
votes
2answers
461 views

Should my game's entities use global variables?

I have a base class called Entity and several sub classes like Player and Goblin. They all ...
0
votes
1answer
71 views

Update vs events

i would like your opinion on two different coding styles to solve the same problem, namely, react to user input actions. To do this, two solutions. Subscribe to events (usually "when"). Real time ...
0
votes
1answer
23 views

How to use the Object parameter in UInputComponent.BindAction?

What is the purpose of the Object parameter here? UInputComponent.BindAction(..., UserClass* Object, ...) What information should I pass here?
0
votes
1answer
56 views

What is the most efficient way to trigger an action based on proximity?

I am developing a 3rd person platformer that entails a grapple hook system. This grapple hook system relies on a series of 'grapple-able' points. I would like these points to shine every so often. ...
1
vote
1answer
37 views

Storing transformations in game objects. (GLM, C++)

I'm currently writing a game engine from scratch for learning purposes. I just started implementing transformations. I know how they work in general but I'm not sure how to implement them efficiently ...
0
votes
1answer
44 views

How to properly scale from natural coordinates to screen coordinate system in OpenGL?

I am working on a Physics Engine, and I have been using opengl to visualize what it's doing. I think I have a scaling issue when going from natural coordinate system to the opengl screen coordinate ...
3
votes
1answer
105 views

C++ Assimp - Transformation Hierarchy

I have a question regarding model imports using ASSIMP. I've been working on an Entity and Component (e.g. unity gameobject component) based game engine for fun and to learn in my spare time. I've ...
1
vote
1answer
62 views

Memory tracker allocates while outputting results

I've written a memory tracker for use in my game engine. I based it on this slide in a talk by Nicolai Josuttis. One problem I'm having is that, during reporting, the implicit string conversion and ...
0
votes
0answers
79 views

What is wrong with my collision detection?

I am trying to create a collision detection system between block using this code: ...
0
votes
1answer
108 views

What to do with collision detection?

I am able to get collision detection (CD) into my game but... what do I do with it? Do I push the player back to the last location? Something else? I am programming the game in C++ using the Irrlicht ...
0
votes
0answers
134 views

Jittery / stuttering motion when using SDL2

I've been using C++ and SDL2, but can't seem to get smooth motion when I have objects moving in the window. I was originally using SDL_GetTicks() and SDL_Delay() in my game loop, but one of the posts ...
2
votes
2answers
102 views

How to update the value of all owners of shared_ptr?

I’m writing a render, there is a class that shaders should store, something like a shader manager. These shaders are stored as ...
1
vote
2answers
55 views

How to store ever-expanding maps with top-bottom, left-right hierarchy?

I'm writing a game that will largely take place on only a screen-worth of hexagons, but which will require map to expand in every direction. Also the way I want to display those hexagons requires that ...
0
votes
1answer
39 views

How to use CreateGridMesh in RuntimeMeshComponent

I don't know to pass on the 5th parameter. I'm still new with C++ so if someone could help me with the pointer ...
0
votes
0answers
32 views

Animated texture from movie file for pre-rendered custcenes

I'm at a point with my game/engine where I need to be able to display pre-rendered movies as cutscenes onto a plane as an animated texture, say something I rendered as an animation in a raytracer that ...
0
votes
2answers
155 views

Implementing a main loop with rendering in a Windows Desktop Application

I'm writing the beginnings of a small game engine in Visual C++. What I have so far doesn't seem to be updating the rendering each frame, but I don't understand where I'm going wrong with it. The ...
0
votes
2answers
45 views

In Unreal Engine 4, how do I get the component's “game object” via C++?

I have an ACharacter instance with a weapons component that inherits from UActorComponentattached to it. I'm currently writing ...
0
votes
1answer
166 views

Why separate data from logic?

I don't understand the purpose of separate SystemClass for functions. My composition looks like this: ...
0
votes
2answers
91 views

How to load assets into the game engine editor fast?

I am making a game engine with C++ and OpenGL. Currently I'm stuck making the asset explorer. I would like to be able to import assets into an engine project and then when I open the project just use ...
0
votes
1answer
60 views

Problem with IsKeyPressed 2 times [closed]

i tried to make thing to show menu up by doing VK_MULTIPLY and close it by doing VK_MULTIPLY, but this does not work.. Anyone can help :) ? ...
1
vote
1answer
224 views

Do I need a rendering system in my engine?

I am planning to create a cRPG game engine that would allow to easily create games like Baldur's Gate. I already tried to do that once, but my knowledge was vastly insufficient at the time. I settled ...
0
votes
0answers
51 views

Box2D with SDL2 not working properly (Collision without rotation and problems with MKS)

I already have some expirience using SDL2 so I thought I will add a Physic Engine to my game - I chose Box2D. I managed to setup everything and to build a small program using SDL2 and Box2D. But now ...
-2
votes
1answer
67 views

Can't initialize array in C++ using const int value? [closed]

I am making a text based game. I want to make a 2d array of 'Rooms' in my 'GameWorld' class. I'm used to using C#, but am using C++ in order to learn it. The code I wrote I expected to work, but it ...
2
votes
1answer
143 views

How to preserve Arcball rotation in c++ OpenGL?

Firts of all want to say that I've already searched for other people's answers here as same as Google and didn't found anything about it there. Also tried some others arcball implementations but none ...