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

c++ sdl2 : how to pass renderer through classes

iam making a game with SDL and c++ iam trying to render simple image to the screen but i can't iam not getting any ERROR but i see only black screen here is my code i think because the renderer in ...
0
votes
0answers
26 views

'namespace “std” has no member “string”' error in a C++/SFML project(Visual Studio 2019): [on hold]

I'm recently learning to make a 2d game in SFML using a tutorial series on youtube by Suraj Sharma(currently at video 57): https://www.youtube.com/watch?v=kwd_AVCkvXE&list=PL6xSOsbVA1ebkU66okpi-...
0
votes
1answer
80 views

Parsing “pick up” action in a text-based RPG

I’m coding a text-based RPG and I have my controls working: I have a string checking what you write in against an array of if statements. It can get it right with ...
0
votes
0answers
40 views

Can't load textures to the game

I am making a game with SDL and C++. I am trying to render simple image to the screen but I can't. I don't know why, I am not getting any ERROR but I see only black screen. Here is my code: game.h <...
0
votes
0answers
23 views

OpenGL object load in reverse

I am trying to load a model and it is loading it in reverse. When I am trying to rotate it 180 degrees it changes the lightning as well. I am not sure what I need to do to change the position that eh ...
0
votes
0answers
10 views

UE4.23 - Cast of child of GameUserSettings fails

I've derived GameUserSettings to add a bunch of custom properties to it. I tried making accessible in blueprint by creating a static method that returns the current GameUserSettings cast to my Child ...
0
votes
0answers
4 views

Pixelshader required for mip mapping to work, DirectXTK

For a C++ .dll project of ours, I am trying to work my way towards understanding the rendering pipeline in conjunction with the DirectXTK...quite a long and rocky way. I came so far as to being able ...
0
votes
2answers
55 views

C++ inheriting functions problem

So I am creating a game with C++ and SDL. I have a "gameobject" header file and no cpp (I do not need it) the game object has 2 functions void render() & ...
0
votes
0answers
24 views

Grappling hook force resolution

Our team is creating a 3rd person adventure platformer in Unreal 4.22. One of the mechanics is a grappling hook. Think less-so a 'pull-to-point' grappling hook (Widowmaker, Just cause etc.). However ...
0
votes
1answer
73 views

Identify an object currently selected in the game

I am making a 2D isometric game that uses the mouse. When I left click on an object, this object should be selected, but how do I determine what object that's currently selected and show a halo around ...
0
votes
1answer
43 views

Only one triangle drawn

I am trying to render a quad with gl render mode GL_TRIANGLES with using element array buffer. Here is some code to explain process. Only the first 3 elements of indices array are drawn as expected. ...
1
vote
2answers
48 views

Parts of 3D model disappear during animation

I'm trying to properly play an animation done in Blender 2.8 inside my OpenGL application. When the animation is running, it happens that at some particular frames, some parts of the 3D model "...
0
votes
1answer
43 views

Add impulse and torque to a cube

I would like to spawn a cube if I press space and apply a short impulse of force and torque to make the cube rotate. I have some calculations for the impulse but I think they are wrong since the cube ...
0
votes
1answer
56 views

How is tile offsetting accomplished in 2d side scrollers?

The idea is to work with tiles that together make up a larger image, or world so to speak. but im confused as to what the methods used are to offset the tiles, and whether is a good idea to draw ...
0
votes
0answers
25 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
21 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
21 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
65 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
85 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
13 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
16 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
67 views

In a MovementComponent, where should I initialize member variables?

I have a MovementComponent derived from CharacterMovementComponent MovementComponent, ...
0
votes
0answers
20 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
30 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
41 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
37 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
29 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
59 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
34 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
195 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
24 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
20 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
34 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
48 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
50 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
77 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
40 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
29 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
64 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
43 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
120 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
82 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
94 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
137 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
56 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
139 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
47 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
29 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
30 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....