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
0answers
34 views

Need help with a Lnk2019 error in an SFML/C++ project

I'm currently making a 2D video game using the SFML library on Visual Studio 2019 community with the help of a Youtube tutorial series by Suraj Sharma: https://www.youtube.com/watch?v=IdKZpv6xqdw&...
0
votes
0answers
30 views

Need help with sluggish sprite movement in an SFML-C++ project:

I've recently bought an SFML course on Udemy.The course is teaching me to make a game where you are chopping a tree while avoiding falling branches. Right now i'm learning to animate moving clouds ...
0
votes
0answers
24 views

D* lite optimized: what is wrong in my implementation of Search() function?

I'm trying to implement the D*-Lite pathfinding algorithm, as described in the 2002 article by Koenig and Likhachev for grid-based navgraph. But I stuck with problem. My ComputeShortestPath (in my ...
0
votes
1answer
138 views

Projection Matrix Causes Clip Cuttoff Problem

I'm trying to setup my renderer and I'm configuring the matrices. I currently have a View Matrix and a Projection Matrix which I then multiply and send to the shader(there's no need for model matrix ...
0
votes
1answer
260 views

Need help with an 'Exception thrown:write access violation:this was nullptr' in a c++ - SFML project

I'm currently learning how to program a 2d game with SFML using a tutorial series by Suraj Sharma.This's his channel: https://www.youtube.com/channel/UC2i39AOpDSlO1Mrn1jQ8Xkg The tutorial series: ...
0
votes
0answers
22 views

Implement a scale factor to apply to UCharacterMovementComponent::JumpZVelocity in Unreal Engine 4

I'm creating a my own movement component inherited by UCharacterMovementComponent. I should implement a scale factor (I called it JumpZVelocityScale) to apply the JumpZVelocity (and I don't want ...
1
vote
1answer
24 views

How do the PhysWalking and similar functions actually handle input?

As the title may suggest, I'm developing a CustomMovementComponent and I'm on the stage where I am developing my own PhysCustom ...
1
vote
1answer
92 views

In a MovementComponent, where should I initialize member variables?

I have a MovementComponent derived from CharacterMovementComponent MovementComponent, ...
0
votes
0answers
33 views

How to use a derivative of CharacterMovementComponent

I'm developing a 3rd person platformer. My Character class (the default third person template class): PlatformerCharacter : ACharacter My MovementComp class: <...
0
votes
0answers
44 views

Retrieving shader byte code using D3D11

I have a shader as an 'ID3D11VertexShader' (or generally any 'ID3D11*Shader') instance. For my application I would like to read the shader byte code that is associated with this instance. The goal is ...
-2
votes
1answer
45 views

Models /textures/music corrupted!

I'm making a 3d rpg game. Everything seems to work on other computer. But when I open my game in my computer, the polygons gets crazy everywhere filled with random polygons. Textures will get rainbow ...
0
votes
0answers
46 views

How does CharacterMovementComponent::PerformMovement work?

I'm developing an adventure platformer. As such, the manipulation etc. of the CharacterMovementComponent is going to be crucial to the game. I have seen the more ...
0
votes
1answer
67 views

How can I scale my window in SDL 1.2?

I'm trying to scale my window, for example from 440*420 to 320*240. How can I easily do this?
0
votes
1answer
247 views

Need help with a C26495 warning and E0513 error in a C++ SFML class

I'm currently learning to program a game with the SFML library.I dugged up a bunch of SFML tutorials on Youtube and found a really good one by 'Suraj Sharma': https://www.youtube.com/channel/...
0
votes
1answer
63 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
245 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
26 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
55 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
68 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
61 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
136 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
51 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
36 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
93 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
50 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
176 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
87 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
58 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
103 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
156 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
83 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
205 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
2answers
136 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
75 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
39 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
82 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
58 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
64 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
39 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
471 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
73 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
77 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
2answers
85 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
44 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
48 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
143 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
80 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
118 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 ...

1 2 3 4 5 76