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

What's the maths behind checking line of sight

I understand in unity there is Phsyics.LineCast(Vector A, VectorB). What's the maths behind doing that, the only thing i can think of is going along the line at small intervals and seeing whether it ...
2
votes
2answers
7k views

Calculating vertex normals in OpenGL C++

Does anyone knows a simple solution for calculating vertex normals? I've been looking for this on the internet but i cant find a simple solution, for example, if I have some vertices like this: ...
78
votes
11answers
32k views

Is UDP still better than TCP for data-heavy realtime games?

I know that UDP is usually recommended for real-time multiplayer games with high data usage. Most articles are serval years old, and since ~80% of all data transmitted on the internet is TCP, a lot ...
0
votes
1answer
293 views

Design patterns for effects between actors and technology [duplicate]

I'm working on my first game, and taking the opportunity to brush up my C++ (I want to make as much of it as portable as I can.) Whilst working on the technology tree and how it affects actors (...
1
vote
1answer
2k views

c++ RPG - Handling buffs / equipment stats [duplicate]

I'm trying to develop a character calculator for a RPG, and it could evolve into a turn based combat / text based RPG. One of my concerns is how to handle the equipment stats / buff system. ...
10
votes
3answers
6k views

How to implement buffs / debuffs / temporary stat changes in an RPG? [duplicate]

Possible Duplicate: What’s a way to implement a flexible buff/debuff system? In the context of creating an engine for a RPG I want to implement a generic way to give effects / buffs / debuffs to ...
69
votes
9answers
27k views

What's a way to implement a flexible buff/debuff system?

Overview: Lots of games with RPG-like statistics allow for character "buffs", ranging from simple "Deal 25% extra damage" to more complicated things like "Deal 15 damage back to attackers when hit." ...
0
votes
1answer
54 views

Difference between shader input element classification between D3D12 and Vulkan

I'm confused about the difference between the shader input element classifications in D3D12 and Vulkan. For example, in Vulkan I could have the following declarations: ...
0
votes
1answer
24 views

Unsure where to right click to delete Unreal C++ class

Trying to delete a c++ class (this should not be this difficult!) and I have deleted the .h, .cpp, and binaries. Next everybody says "now, right click on your .uproject file and select Generate ...
1
vote
1answer
2k views

Creating a real loading screen between levels in Unreal Engine 4

I'm trying to create a loading screen to pop up between levels in Unreal Engine 4. I want to have a traditional loading screen such as the loading screen in Skyrim, where the player presses play and ...
0
votes
1answer
54 views

JoyStick::GetInfo(JoyStick::id1).dwButtonNumber always returns 0x1

I am using an XBox 360 gamepad for Windows. I am having an issue with the following legacy code base, which relies on JOYINFOEX, ...
0
votes
2answers
49 views

Should a game object class contain the information for how to render it?

If I have a class called Enemy: // Simplified version class Enemy { float xPosition_; float yPosition_; int hp_; }; Should this class also contain the ...
0
votes
0answers
16 views

Having problems with making a button class (checkIfClick) opengl

Just basing how sfml does it, I get the globalbound of the object and then check if the mouseposition is within the object. I ...
0
votes
1answer
29 views

Get black bars with framebuffer and glViewport

I have read several tutorials and answers regarding framebuffers and glViewport, but I can't seem to resolve this issue I have. I want to take a low resolution framebuffer (400x225) and place it in a ...
0
votes
1answer
88 views

I can't figure out whats wrong with my .obj file reader

I'm just loading a simple textured cube but it always has missing bits or warped textures. This is for directx 11 rendering by the way. Updated with more information. I think my problem is with ...
0
votes
1answer
131 views

I can't make the cube map to use shadow mapping - or it seems so

Basically, I'm following tutorials as I'm very new to OpenGL. I managed to perform shadow mapping towards just one direction, meaning I created 2D texture depth map. Now with omnidirectional shadow ...
0
votes
0answers
24 views

Having trouble with 2d projection (Opengl)

I need to change the normalize coords from -1 to 1 to the width and height of my application. The reason why I want to change the normalize coords is because i think it would be a easier set position ...
1
vote
1answer
42 views

Multithreaded callback

I'm making a multiplayer game where players fight in vehicles, and I am doubting my server architecture. As it will be physics, network and AI intensive I would like to split these 3 topics into their ...
0
votes
1answer
127 views

Collision between a player and a solid block C++ SDL2

I am trying to implement a collision between a player and a solid e.g. a solid box. ...
0
votes
1answer
54 views

Attempt to fix sprite sheet pixel bleeding in OpenGL 2D causing sprite distortion

While working on a project, I encountered the common problem of pixel bleeding when trying to draw subregions of my sprite sheet. This caused sort of "seams" to appear at the edges of my ...
0
votes
0answers
52 views

Game loop implementation

I'm implementing simple Windows game. Here is my game loop, which I've written based on some tutorials found on the Web: ...
1
vote
0answers
34 views

How do I render halfspace fog?

How do I render halfspace fog? From my interpretation, I have a transparent plane in the scene. Then I use a function that returns a fog color in my shader. Do I render the transparent plane by itself ...
1
vote
1answer
43 views

How do I stop a moving object when colliding with a static wall or falling to a static ground

I'm writing my very first 2D game engine in C++ and SDL2. I wrote a very simplistic RigidBody class that computes the resultant force, applies forces and simulates ...
1
vote
0answers
30 views

Direct State Access (DSA) is Failing, but pre 4.3 OpenGL works [closed]

I currently have an OpenGL project in which I am using GLFW for the window and context creation, and GLAD for loading OpenGL functions. The GLAD version I am using is OpenGL 4.6, compatibility profile,...
0
votes
1answer
45 views

Translate code to DIRECTX directxmath

How can i translate the code to directxmath code? ...
0
votes
1answer
34 views

how to move a 2d shape in opengl 4.6 (glfw)

Class Button So from my understanding in order to move a 2d shape you need manipulate the vertices and then update???? If i do need to update the buffer how i would go by doing that? float xpos = 150 ...
0
votes
1answer
66 views

Typical Point Light Flow?

A Quick Note This question assumes you have some knowledge about the overall rendering process and do not need clarification on rendering objects with HLSL and a <...
0
votes
0answers
76 views

is there any different solution for different buildings different behaviours

I'm trying to make different behaviours for workers of different buildings, let's say an agricultural worker would need to sow wheat seed and collect the wheat grain when it's grown. let's call that <...
1
vote
1answer
111 views

How to update indices for dynamic mesh in OpenGL?

So I am making a 3D batchrenderer for my engine, and the basic concept is that we make large enough VBO and IBO to accompany all the vertex data(positions, normals, uv etc.) and update the VBO using <...
0
votes
2answers
236 views

Game movement in 2D SFML game

I am making simple 2D game, imagine it as 2D Minecraft where you can dig blocks and build other things. Currently I am struggling with movement. I have none experience in game development, but I am ...
8
votes
4answers
28k views

How to draw 2D images using OpenGL, in SDL?

After everything, I managed to find a simple piece of code that shows how to draw a 2D image with openGL: ...
0
votes
2answers
76 views

Need help with gravity simulation in 2D game engine

I'm writing a 2D game engine using C++ and SDL2 and started implementing a rigidbody component similar to that of unity to my game objects. I have a method in the <...
7
votes
1answer
423 views

Why isn't my cbuffer updating?

I am really frustrated because my cbufer isn't updating. This is my VS: ...
3
votes
1answer
716 views

Specular Light not working (Phong Lighting)

There seems to be a problem with my current Phong Shading implementation. I have been using the per fragment approach. The specular highlight aspect of the technique is not rendering as it should, as ...
0
votes
1answer
42 views

Memory Usage Issue with declared variables (when swapping between states)

So my problem is that When I make a Shader variable and I swap between mainmenustate and gamestate really fast I notice my memory usage increase alot but as soon I switch my Shader varaible into a ...
0
votes
1answer
45 views

Get BP FollowCamera Rotation and Location

I'm accessing my FollowCamera https://imgur.com/a/vbFagxg from my BluePrintCharacter class in my C++ code, with this following line : ...
0
votes
1answer
217 views

Offset on camera following object that accelerates

I have camera a that is actively following an object (a plane) from behind. This object can accelerate or decelerate. I would like to have a camera offset when I move the plane, so it doesn't look so ...
0
votes
0answers
41 views

I want the game over screen on this super mario bros C++ remake to trigger arduino/batch file

I found a someone who has listed the source code in C++ for their remake of Super Mario and I would like to know how I could edit the code for the "Game over screen" to trigger my Arduino or ...
0
votes
1answer
53 views

Update TTF Texture for Score

I have a little problem with Updating my Score with TTF. Im a neewbie so dont blame me :P I Try to Update my Score But the Buffer Get too small after a while and my Game Crashes. ...
0
votes
1answer
31 views

Multiplayer game with differently screen size

I am making a classic ping pong 2D multiplayer and its run on full screen, but i have a problem that the ball touch the limits of screen to one player and other no. Any idea how to solve this ?
0
votes
1answer
257 views

DirectX 11 Sprite Alpha (Invalid? + Bad Quality)

I have a bug with a texture font. This is the texture file in photoshop: This is the result I am getting: The alpha from 0 and 1 shows weird artifacts as the final result, alongside the low quality ...
1
vote
2answers
176 views

How to keep same aspect ratio in different devices with cocos2dx?

I have been making a board game and I am using cocos2dx. There are two scenes for now, One is main menu and the other is gameplay scene. When I run the apk on tablet with EXACT_FIT resolution policy ...
0
votes
1answer
82 views

How to correctly reset vertex attributes after modification

I am trying to use the same vertex shader for two different use cases to preserve memory, but I am having issues where the modifications of one shader run are passed on to the next run, even after ...
-1
votes
1answer
73 views

What is the best way to approach a multi pass rendering system?

I am trying to code a new feature in my engine but I can't find a way to implement my idea, which is the next one. I am trying to get multi pass rendering with more than two passes. I know how to do a ...
4
votes
1answer
1k views

SDL render surface from byte array efficiently

In my current project I need to fill a 256x224 screen with the pixel values from an array. The array is declared this way: uint8_t *vram = new uint8_t[7168]; So as ...
0
votes
1answer
30 views

same 8bit created surface resulting in a different pitch value

Given: ...
1
vote
1answer
163 views

D3DXLoadSurfaceFromResource failed to load bitmap image

I'm working on a small DX9 game project for learning purpose. I'm current dealing with resources manager file (*.rc) which I'm not used to (I have only worked with direct file until now). If I use <...
4
votes
2answers
1k views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen. I am using Projection, View and Transformation matrices but am unable to get anything to the screen. Main loop ...
0
votes
1answer
935 views

Is there a plugin example for SKSE Special Edition?

I'm having trouble creating a skse plugin for skyrim special edition. For the old version there is a example plugin: https://github.com/xanderdunn/skaar/releases/tag/plugin3 I've tried to do it by ...

1
2 3 4 5
80