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
2answers
24 views

Wanting to create Space Invaders like Enemy movement. How to do it efficiently

So like the title says I want my Enemys to move on a Grid like in Space Invaders. Say I have 8 rows and 12 columns. Now there are 10 Enemys in each row and there are 5 rows filled. In totale I have 50 ...
0
votes
0answers
20 views

Further improvement on algorithm A *

i have a game use A*, this algorithm find path is good in many case. But if I could not find the way to the destination, it would have to go through many nodes (my map is in gird format). I am ...
0
votes
1answer
19 views

Broken model matrix builder

I'm trying to setup basic render pipeline in Vulkan and am currently setting up the perspective, view and model matrices. The line that calculates the position in the vertex shader is this: ...
0
votes
2answers
38 views

C++ Generate random float values between a range

In my current situation I have a game world, in that game world I want to place loads of tree models. It is a waste of time for me to actually explicitly define the x y and z values of each tree model,...
0
votes
1answer
27 views

Box2d ContactListener function. Problem calling a function on the collided objects

I created a ContactListener class which derives from b2ContactListener. I am following the excellent tutorials found here: https://www.iforce2d.net/b2dtut/collision-callbacks Collisions are detected ...
0
votes
0answers
52 views

OpenGL viewport is stretched

For this project I am using GLFW, glad and glm. My window looks like this: The dimensions of the window are correct, but the viewport is stretched, making my square into a rectangle. How do I use a ...
0
votes
0answers
32 views

Frustrum culling without per-mesh positions

I am trying to implement frustrum culling in a C++ renderer im writing but I feel like I hit a brick wall. The plan is to load the Sponza level and per mesh create a collision box using Bullet ...
2
votes
1answer
123 views

How to generate random waves for a bullet hell game that feel balanced and natural

My game consists of 'waves' of objects called 'spawners', which once every certain amount of time (their firetime), move to a new place on the screen and spawn an enemy. Each wave has 4 important ...
0
votes
0answers
33 views

Tiled Map Editor. How is the correct texture chosen per tile? (tmxlite)

I am still a beginner, this question is probably quite silly. I made a map in Tiled Map Editor. It contains 3 layers 'sky, water, solids'. Right now, I am just trying to build my sky tiles. I had ...
0
votes
0answers
23 views

DirectX: MFC OnIdle limited to 60 fps

i have a very particular issue… i have directx classes for rendering to a window. I have created a GUI with MFC c++ and integrated my DirectX classes with it. I am initialising on OnInitDialog ...
0
votes
1answer
90 views

Is Windows window creation faster / more efficient than GLFW window creation?

Are there any benefits to using Windows window for OpenGL or Vulkan rendering, rather than using GLFW window? Is there any performance hits when using C++ Window creation over GLFW since it provides ...
0
votes
0answers
21 views

Rendering to framebuffer object not working

There is a problem when I am trying to render to texture from the framebuffer object. I get the message that the FrameBuffer Object is Complete but apparently all I get is a black texture. this is ...
0
votes
1answer
41 views

Box2d Raycast C++. Always returning false? (trying to check if player is grounded)

I'm trying to add Box2d to my C++/SFML platformer game. I have my ground tiles with a b2staticBody. And the player character is b2_dynamicBody. My usual method to check if player is grounded is to ...
1
vote
1answer
39 views

GLM conversion from euler angles to quaternion and back does not hold

I am trying to convert the orientation of an OpenVR controller that I have stored as a glm::vec3 of Euler angles into a ...
1
vote
0answers
34 views

SFML Separating Axis Theorem collision detected outside shape

Trying to implement the SAT in SFML using SFML's ConvexShape. Some shapes, like rectangles, seem to work but others trigger the collision outside the shape. I tried drawing the normals, or the axes ...
0
votes
2answers
60 views

Forward declaring in SFML C++ . How to know whether to #include in .h or .cpp?

Hello I am trying to teach myself about the how's and why's of OOP in C++. So I am trying to seperate most of my code into specific classes and methods that do specific things. I've also been reading/...
1
vote
0answers
74 views

Generate road mesh from a graph

I want to generate a mesh for the entire road network(later I'll probably want to split it into chunks but for now this will do). My road network is stored as a ...
1
vote
1answer
93 views

SDL2 C++ How to make enemy move in random directions

How do i make an Enemy move in random directions? I tried this but it doesnt work how i want it to.. thats why im asking what i need to do, to achieve that? (Pseudo code would be cool) ...
0
votes
1answer
24 views

GLFW window becomes unresponsive when asking for input!

I am trying to write a simple C++ game using OpenGL. In my render loop i ask for text based input from the user but this causes the GLFW window to become unresponsive. I suspect that this happens ...
0
votes
0answers
46 views

Tube model imported from Blender getting stretched vertically when rendering

I'm actually working on a 3D game engine with OpenGL 4 and C++. The problem is that, I don't know why, my geometry isn't well renderered except for primitives. At the right you can see a cube, it is ...
-1
votes
0answers
23 views
-2
votes
0answers
47 views
-1
votes
1answer
43 views

Can't get basic example working with Bullet 3 (haxebullet port)

Example of my code: ...
0
votes
0answers
60 views

C++ SFML Performance

I have recently started a project using SFML in C++. So far I haven't done much but I noticed an issue. Inside of the while(window.is_open()) loop I made a tick ...
0
votes
1answer
69 views

Bullet Physics Invalid Pointer on Free

I'm writing a game engine in C++ with Irrlicht and Bullet Physics. All of my Irrlicht code works perfectly, but upon creating Bullet Physics objects with new, and later freeing them, my program throws ...
1
vote
0answers
46 views

How to place the origin of an isometric map at the top, not the left

I have an isometric diamond-shaped map. Currently my map origin is to the far left, instead of the top. The green circle at the top-center of the map is where I want the origin point to be, however ...
0
votes
1answer
59 views

Authentication for LAN Multiplayer Games

I'm working on the authentication scheme for a multiplayer game using only C++ and SLD2. It's an RPG with a kind of complicated character-group/permadeath scheme, and world-instances are intended to ...
1
vote
1answer
67 views

How to apply linear drag to a velocity vector?

I have built my own movement code for my character as I want to make smooth movement. (This project is just a character and a floor/wall for testing). The code seems to work fine, but I of course ...
0
votes
0answers
23 views

MSAA on raytracing output

In DirectX Raytracing, I see that the results are typically written to a UAV. What if I want the output antialiased (specifically MSAA)? For draw call outputs, I would create multisampled render ...
0
votes
1answer
61 views

Bullet Physics Step Simulation Crash when maxSubSteps is not 0

I am using Bullet physics along with Irrlicht. My program consistently crashes when maxSubSteps is not set to zero when calling ...
0
votes
1answer
98 views

Performance cost of creating local variables just for 'readability'?

I am learning C++ and Unreal Engine. I'm wondering if creating local variables inside functions purely to help me read the function later will cost my game/code in performance (assuming if I carry on ...
1
vote
1answer
47 views

Set the LineTraceByChannel to use my custom created channel? C++

I want to use LineTraceSingleByChannel function for my SightRay component which will be used for my adventure game. I want to mark certain objects in game as 'Viewable' in Trace Channel. Then the ray ...
1
vote
1answer
46 views

Why is the timer not calling the function?

I am trying to call a function every 30 seconds. I have used this before without issues so I'm not sure why it isn't working now. Any ideas? Has something changed in 4.24 maybe? .h I have tried both ...
1
vote
0answers
65 views

Unique_ptr game state vs shared_ptr game state

I have this (typical) base class: ...
3
votes
2answers
179 views

String storage in game engine

I've been designing the memory management module for my game engine, including things like custom allocators and when it came to allocating memory for strings I kinda got stuck. What I mean by strings ...
0
votes
0answers
21 views

Handling metallic roughness maps colour channels

I'm trying to use a metalness/roughness workflow and I'm not sure how to translate the colour channels into the different metalness and roughness attributes. I'm not sure if there's a standard on how ...
0
votes
0answers
29 views

Why here does my use of GetOwner() make UE4 crash editor?

I am new to Unreal Engine. I am following a tutorial where at the end he challenged me to build some extra features to the game. Basically. This code crashes UE4, but I found out if I remove "...
0
votes
1answer
24 views

Ways to track login/loading progress dynamic?

Lets say we want to add a dynamic "loading bar" to our server-client game... the player presses on "login", a bar appears and shows the percentage of loaded assets and configurations from the server. ...
0
votes
1answer
69 views

How do i writing timing function for lightning flash in C++?

I need to write a horror scene with lightning flash. Unfortunately I am new to both C++ and OpenGL and I am looking for efficient way to mimic lightning timing in C++/OpenGL? I don't need graphical ...
0
votes
0answers
23 views

Wrong Bone deformations using assimp

Hi I'm trying to animate a skinned mesh in my game using assimp and OpenGL. this question is a follow up of this one : OpenGL Strange mesh when animating Assimp But I'm having diffuculty ...
0
votes
0answers
22 views

OpenGL call glDetachShader after linking program

Im currently working on my ShaderProgram class for my simple OpenGL Renderer. I am passing and attatching my Shader objects like this: ...
0
votes
1answer
80 views

OpenGL Strange mesh when animating Assimp

I'm trying to animate a skeletal mesh. The mesh loads with no problems and all is set up correctly. My problem is that when I calculate the matrix for a given keyframe the mesh go nuts. Here is na ...
0
votes
1answer
105 views

Creating A UDP Game Server

I am currently creating a game in need of networking i.e. server and clients. I have basic experience with socket programming and am able to transfer data between two machines via UDP sockets using ...
0
votes
1answer
134 views

How can I structure in-game menus?

I'm working on a multiplayer RPG using only C++ and SDL2. I've already made the main menu and a map editor, and I'm preparing to make the actual game. The main menu and map editor were easy to ...
0
votes
0answers
36 views

How can I perform synchronisation between two Directx 12 processes? [closed]

I have created two applications. One application is rendering a texture off-screen with unlimited frame rate present option. The second application is reading what APP1 is rendering from graphic ...
0
votes
1answer
77 views

UE4 Multiplayer how to replicate Player name in lobby

I've been working on a little 1V1 snipper project to try and get a better grip on the replication and the game framework of unreal engine. So after the core gameplay, I'm trying to make a lobby ...
1
vote
1answer
49 views

Rotate Sprite towards mouse cursor SDL

I have trouble to make my sprite(Arrow) to point at the position of my mouse cursor but i don't get the Right results. I've tried this: ...
0
votes
1answer
83 views

VAO not showing

My VAO is simply not showing up and i'm not sure if my matrices are wrong or if the shader is wrong… Please have a look a see what is wrong… My code is big so i'll post the essential. ...
0
votes
1answer
136 views

Programming Test for a job in Game Dev - expected levels of documentation etc

If this is the wrong place to be asking this - please let me know and I'll happily ask it somewhere else! I am completing a C++ Proficiency test for a "Junior Engine Programmer" role at a game studio ...
0
votes
1answer
51 views

Execute Timer Events of another Blueprint from the C++ UE4

I am having problem and it's about a week now that I still can't figure out how to get it right. It seems that I can't run any functions from the blueprints that contain timers at all. I have a ...

1 2 3 4 5 76