text:
How do you efficiently place smaller textures into a larger texture?
(Edit - this seems to work now except trying to read render texture to Texture2D to save it does not seem to update with any of the overlays, just shows the base... i wonder if this is because the pixel size of the baseTexture may be larger than that of the screen size
Edit: this seems to be a Unity 2021 bug in writing render texture to texture2D)
How do you efficiently place smaller textures into a larger texture?
Approach so far (after being advised not to do the shader approach).
Trying to place (resized) smaller textures overlayTextures with positions specified in overlayPositions and resultant dimensions in overlayWH on top of a baseTexture
Using Graphics.Bilt generates a resulting gray texture. Swapping out to a GL.Clear white texture, yields a black texture...
TextureScale.cs is here.
using UnityEngine;

public class TexturePlacer : MonoBehaviour
{
    public Texture2D baseTexture;
    public Texture2D[] overlayTextures;
    public Vector2[] overlayPositions;
    public Vector2[] overlayWH;
    public Material material;

    void Start()
    {
        TextureFormat format = TextureFormat.RGBA32;

        // Resize each overlay texture and convert it to the same format as the first overlay texture
        for (int i = 0; i < overlayPositions.Length; i++)
        {
            TextureScale.Bilinear(overlayTextures[i], (int)overlayWH[i].x, (int)overlayWH[i].y);

            // Create a new texture with the same format as the first overlay texture
            Texture2D newt = new Texture2D(overlayTextures[i].width, overlayTextures[i].height, format, false);

            // Copy the pixel data from the original texture to the new one
            newt.SetPixels(overlayTextures[i].GetPixels());
            newt.Apply();

            // Replace the original texture with the new one
            overlayTextures[i] = newt;

            //overlayPositions[i].y = baseTexture.height - overlayPositions[i].y;
        }

        if (overlayTextures.Length == 0 || overlayPositions.Length == 0 || overlayWH.Length == 0)
        {
            Debug.LogError("Overlay textures, positions, or sizes are not specified.");
            return;
        }

        if (overlayTextures.Length != overlayPositions.Length || overlayTextures.Length != overlayWH.Length)
        {
            Debug.LogError("Each overlay texture needs a corresponding position and width/height.");
            return;
        }
        // Create a new base texture with the same format as the first overlay texture
        baseTexture = new Texture2D(baseTexture.width, baseTexture.height, format, false);

        // Create a temporary RenderTexture to work on
        RenderTexture rt = RenderTexture.GetTemporary(baseTexture.width, baseTexture.height);
         Graphics.Blit(baseTexture, rt);
        // Fill the render texture with a solid color
       // GL.Clear(true, true, Color.white);

        // Set the active RenderTexture to the temporary one we just created
        RenderTexture previous = RenderTexture.active;
        RenderTexture.active = rt;

        // Copy each overlay texture onto the base texture
        for (int i = 0; i < overlayTextures.Length; i++)
        {
            Texture2D overlayTexture = overlayTextures[i];
            Vector2 position = overlayPositions[i];
            Vector2 size = overlayWH[i];

            // Check if the overlay texture fits within the base texture
            if (position.x + size.x > baseTexture.width || position.y + size.y > baseTexture.height)
            {
                Debug.LogError("Overlay texture " + i + " exceeds the base texture boundaries.");
                continue;
            }
            // Check if the overlay texture has the same format as the first overlay texture
            if (overlayTexture.format != format)
            {
                Debug.LogError("Overlay texture " + i + " has a different format from the first overlay texture.");
                continue;
            }

            // Create a temporary texture to resize the overlay texture
            Texture2D tempTexture = new Texture2D((int)size.x, (int)size.y, format, false);
            Graphics.CopyTexture(overlayTexture, tempTexture);

            // Copy the resized overlay texture onto the base texture
            Graphics.CopyTexture(tempTexture, 0, 0, 0, 0, tempTexture.width, tempTexture.height, rt, 0, 0, (int)position.x, (int)position.y);
        }

        // Create a new texture and copy the RenderTexture image to it
        Texture2D newTexture = new Texture2D(baseTexture.width, baseTexture.height, format, false);
        newTexture.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0);
        newTexture.Apply();

        // Set the active RenderTexture back to the previous one
        RenderTexture.active = previous;

        // Release the temporary RenderTexture
       // RenderTexture.ReleaseTemporary(rt);

        // Use the new texture (for example, assign it to a material)
        material.mainTexture = newTexture;
    }
}


text:
Is it legal to published a game inspired by another?
I'm not asking as a question for legal advice for my own situation, I'm just curious.
One of my favorite puzzle games is Devil Dice, an old PS1 title that had one sequel and then I believe the concept has been unused for 20 years. If an independent developer made a game that has identical gameplay, but didn't use any iconography like textures, logos, characters, etc from the "source material", can they legally publish that for money?
I think on games like Tetris, it would be impossible to release a Tetris clone without approval, and TTC is known to be litigous about it. But what if you made a block stacking game but didn't use the same shapes, or the matrix was wider/thinner, change it enough mechanically but the concept is the same. What would the ramifications be?
There's a lot of older games, especially puzzle games, that never really left the console it was on. Some of which even have cult followings. I always wondered why no indie games ever came out to replicate their mechanics, so I wonder if it's a legal difficulty.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
SDL_RENDERER_ACCELERATED not working correctly in Windows
I am developing a 2D tile-based game and I have a series of transparent tiles which I use to simulate a fog of war effect. This seems to work well in Linux but I am having trouble understanding why it does not work in Windows.
The transparent layer is drawn on top of the map layer in Linux. If I set the rendering to SDL_RENDERER_SOFTWARE the issue does not crop up in Windows. But I am stumped as to why this happens. Does anyone have experience with this? The first image is that of the rendering in Linux, the second is in Windows 10.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Using Maps SDK for Android in Unity
I just started a project on Unity, where I'm a total beginner.
I want to use Google Maps road data from Unity for my mobile game, and I've first looked at using the Maps SDK for Unity. Unfortunately the service is deprecated since 2023.
Since I want the game to be on Android/iOS, how can use the Maps SDK for Android instead? The tutorials I found are only for Android Studio and I'm not sure how to make them works for Unity.
I've also looked at ARCore Geospatial Creator, but I only want road data and this seems a bit overloaded for my needs.

I would not recommend starting with a maps integration game if you are new to Unity, especially trying to staple together your own replacement for a deprecated service. You will be overwhelmed trying to learn both things at once. The engine is a big enough subject by itself. Start small, making offline games, and learn best practices.


text:
in UE5 How do I write shader keywords for me to toggle on and off on the c++ side in UE like Unity, e.g. Material.EnableKeyword(“NORMAL_MAP”);
I’m writing a custom shader node. How do I write shader keywords for me to toggle on and off on the c++ side in UE5 like Unity, e.g. Material.EnableKeyword(“NORMAL_MAP”);


text:
Сollision detection c++
In the cube class I have its position and rotation. Also I have a collision check function:
bool is_collision(voxel collis)
 {
     if (collis.position.x > position.x || collis.position.y > position.y || collis.position.z > position.z)
     {
         if (collis.position.x - position.x <= 1 && collis.position.y - position.y <= 1 && collis.position.z - position.z <= 1)
         {
             return true;
         }
     }
     else if (collis.position.x < position.x || collis.position.y < position.y || collis.position.z < position.z)
     {
         if (position.x - collis.position.x <= 1 && position.y - collis.position.y <= 1 && position.z - collis.position.z <= 1)
         {
             return true;
         }
     }
     return false;
 }

It accepts another cube to be collided with. But so far, this function does not take into account the rotation of the object.
I also use glm.
How do I need to change this code?


text:
SDL Frame Independent Movement Issues
I am using SDL2 with C to program a frame independent movement.
I have a struct that defines a position of a sprite (its top left corner):
struct _point2D {
    /* X coordinate */
    float x;

    /* Y coordinate */
    float y;
};

Then I have a sprite struct itself with multiple fields:
struct _sprite {
    /* ... */

    /* Sprite position */
    struct _point2D position;

    /* Sprite velocity */
    struct _vector2D velocity;

    /* ... */
};

Vector is defined as following:
struct _vector2D {
    /* X velocity */
    float x;

    /* Y velocity */
    float y;
};

Here goes the function than handles the movement:
int Sprite_move(const Sprite_t sprite, float delta_time) {
    /* =========== VARIABLES ========== */

    /* The operation result */
    int result = -1;

    /* ================================= */

    /* ================================================================== */
    /* ================= Make sure a sprite is not NULL ================= */
    /* ================================================================== */

    if (sprite != NULL) {

        /* Update a sprite X position */
        sprite->position.x += sprite->velocity.x * delta_time;

        /* Update a sprite Y position */
        sprite->position.y += sprite->velocity.y * delta_time;

        /* Success */
        result = 0;
    }
    else {
        printf("%s error: %s\n", __func__, "provided sprite is NULL");
    }

    /* ================================= */

    return result;

The way I compute delta_time:

const int VELOCITY = 10;

while (/* !quit */) {

    /* Frame start time */
    start = SDL_GetPerformanceCounter();

    while (SDL_PollEvent(&event)) {

        if ((event.type == SDL_KEYDOWN) && (event.key.repeat == 0)) {

            switch (event.key.keysym.sym) {

                case SDLK_UP:
                    sprite->velocity.y -= VELOCITY;

                    break ;

                /* ... */
            }
        }
    }

    /* Frame end time */
    end = start;

    /* */
    start = SDL_GetPerformanceCounter();

    /* Compute delta time */
    delta_time = ((start - end) * 1000.0 / (double) SDL_GetPerformanceFrequency());

    /* Move a sprite (Update its position) */
    Sprite_move(sprite, delta_time);

    /* render a sprite */
    Sprite_draw(sprite);

    /* ... */
}

The sprite motion seems not to be smooth, more like jumping from one position to another. The first frame it jumps immediately to some point. When I press and hold the button for the first time everything seems OK, in a fraction of a second sprite movement  looks to be smooth, after that period of time it starts to jump again.
Did I compute something wrong?

After the frame finishes ( below Sprite_draw(sprite); ) do you have a way to delay the current frame, before the next one begins? Or do frames happen as fast as possible ?


text:
Sequential Impulses in 3D with friction
I'm currently writing a physics simulation in 3D, that uses sequential impulses. I've managed to implement normal impulses, but I can't get friction impulses to work. As I understand I first get two tangent vectors, that are perpendicular to each other and the normal. Then I calculate the friction impulse and clamp it by total friction accumulator in the range of -FrictionCoefficient * NormalImpulse to FrictionCoefficient * NormalImpulse. I tried applying friction at the center of manifold, it seemed to work, but even with high friction coefficient values it slides a lot, so I don't consider it a solution.
Here's my code for tangents calculation:
glm::vec3 first_tangent{data.contactVelocity - collision_data.normal * glm::dot(data.contactVelocity, collision_data.normal)};
float lat_rel_vel{ glm::length2(first_tangent) };
glm::vec3 second_tangent{};
if(lat_rel_vel > 0.0f) {
    first_tangent *= 1.0f / glm::sqrt(lat_rel_vel);
    second_tangent = glm::cross(first_tangent, collision_data.normal);
    second_tangent = glm::normalize(second_tangent);
}
else {
    GetTwoTangential(collision_data.normal, first_tangent, second_tangent);
}

(GetTwoTangential function is the exact copy of btPlaneSpace1)
And here's my impulse calculation:
float frictional_mass1{ totalInverseMass +
        glm::dot(first_tangent, glm::cross(first->GetInverseWorldTensor() * glm::cross(data.relativeFirst, first_tangent), data.relativeFirst) +
                          glm::cross(second->GetInverseWorldTensor() * glm::cross(data.relativeSecond, first_tangent), data.relativeSecond)) };
float j1{ -glm::dot(data.contactVelocity, first_tangent) };
j1 /= frictional_mass1;

const float tempFriction1{ accumulatedFrictions[currentManifold].first_tangent };
accumulatedFrictions[currentManifold].first_tangent = glm::clamp(accumulatedFrictions[currentManifold].first_tangent + j1,
    -0.8f * accumulatedImpulses[currentManifold],
    0.8f * accumulatedImpulses[currentManifold]);
const float deltaFriction1{ accumulatedFrictions[currentManifold].first_tangent - tempFriction1 };
glm::vec3 fullFriction_1{deltaFriction1 * first_tangent};

first->AppyLinearImpulse(-fullFriction_1);
second->AppyLinearImpulse(fullFriction_1);

first->AppyAngularImpulse(glm::cross(data.relativeFirst, -fullFriction_1));
second->AppyAngularImpulse(glm::cross(data.relativeSecond, fullFriction_1));

float frictional_mass2{ totalInverseMass +
    glm::dot(second_tangent, glm::cross(first->GetInverseWorldTensor() * glm::cross(data.relativeFirst, second_tangent), data.relativeFirst) +
                      glm::cross(second->GetInverseWorldTensor() * glm::cross(data.relativeSecond, second_tangent), data.relativeSecond)) };
float j2{ -glm::dot(data.contactVelocity, second_tangent) };
j2 /= frictional_mass1;

const float tempFriction2{ accumulatedFrictions[currentManifold].second_tangent };
accumulatedFrictions[currentManifold].second_tangent = glm::clamp(accumulatedFrictions[currentManifold].second_tangent + j2,
    -0.8f * accumulatedImpulses[currentManifold],
    0.8f * accumulatedImpulses[currentManifold]);
const float deltaFriction2{ accumulatedFrictions[currentManifold].second_tangent - tempFriction2 };
glm::vec3 fullFriction_2{deltaFriction2 * second_tangent};

first->AppyLinearImpulse(-fullFriction_2);
second->AppyLinearImpulse(fullFriction_2);

first->AppyAngularImpulse(glm::cross(data.relativeFirst, -fullFriction_2));
second->AppyAngularImpulse(glm::cross(data.relativeSecond, fullFriction_2));

(0.8f is my friction coefficient, I use it as a placeholder for now)
So here's how my collision response works:

Get true normal impulse( using sequential impulse solver to get normal impulses at each contact point)
Get friction impulse( also using sequential impulses at each contact point)
(Normal and friction impulses are calculated separately, first normal then friction)
Integrate velocities


text:
Using Skyrim Creation Kit, how to have an NPC stopped by a guard?
I am making a mod using the Skyrim Creation Kit.
At some point in my quest, the Player must steal a statue that I created, then, as soon as it's done, the next stage begins, asking the player to place the statue in Hulda's inventory at Whiterun Bannered Mare.
As soon as I place the statue in Hulda's inventory, the next stage triggers to tell the player to attend Hulda's arrest.
Everything I said above works.
Also, I created an NPC who is Whiterun's guard, and I created a scene, between the guard and Hulda, during the arrest.
My problem is that as soon as I place the statue on Hulda, there is no my guard coming to stop it and Hulda or the other NPCs don't react, when Hulda should be prosecuted for theft, and thrown in jail.
How do I ensure the guard stops Hulda ?


text:
Bullet spawning at world origin instead of muzzle socket on static mesh
I placed a socket called "Muzzle" on the end of my static mesh as shown here

I have it so when I left click, my bullet should spawn on the muzzle socket, but for whatever reason, it spawns at the world origin instead.
This text shows where the bullet spawns when the mesh that supposedly contains the socket moves around. As you see, the bullets spawn in the same location, meaning the socket must not be moving, right?
Translation: X=0.000 Y=0.000 Z=0.000 Rotation: P=0.000 Y=0.000 R=0.000 Scale X=0.362 Y=0.362 Z=0.362
Translation: X=0.000 Y=0.000 Z=0.000 Rotation: P=0.000 Y=0.000 R=0.000 Scale X=0.362 Y=0.362 Z=0.362
Translation: X=0.000 Y=0.000 Z=0.000 Rotation: P=0.000 Y=0.000 R=0.000 Scale X=0.362 Y=0.362 Z=0.362

This is the part of the blueprint for the gun that I think might be the issue. The StartFire event triggers when I left click.

and finally this is the tutorial I'm following.


text:
How is it possible to create a texture atlas from a list of images?
Given a list of images how is it possible to place them on a square image, so they take up the least amount of space?


text:
three.js shader to keep moving vertices of points cloud inside sphere
I am trying to achieve the effect of having a points cloud with moving points while also keeping them confined within a sphere of radius X.
I have managed to do it without using shaders but I want to try and do it with shaders as well.
What I have so far is this
const uniforms = {
  u_time: { value: 0 },
  u_radius: { value: 1500 },
};

const vShader = `
uniform float u_time;
uniform int u_radius;

attribute vec3 velocity;

varying vec3 v_position;

void main() {
  v_position = position;
  vec3 vel = velocity * u_time;

  if(length(position) > float(u_radius)) {
    vel = vel * -1.0;
  }

  gl_Position = projectionMatrix * modelViewMatrix * vec4(position + vel, 1.0);
  gl_PointSize = 10.0;
}`;

const fShader = `
varying vec3 v_position;

void main() {
  vec3 color = vec3(1.0);
  gl_FragColor = vec4(color, 0.7);
}`;

The logic is that for each vertex, I am comparing its length based on its current position to the sphere radius and if it falls outside of it its velocity vector should be negated ,thus keeping it within the sphere.
Sadly what I have above does not seem to work, as the particles spread out to infinity over time.
I am new to three.js and GLSL so I must be missing something obvious and doing this wrong.
EDIT:
Shown in the gif: The effect as I have currently managed to implement it using Points, and an array of positions and an array of velocities (these are seeded once during initialisation with random values)
(it may be hard to see in the gif due to compression, but each particle is moving randomly but is always contained within the sphere)
On every tick I iterate over the array of particles and add their velocity vector to their position vector. If their position vector length is > than the sphere radius I negate the velocity vector and update the velocities array to the indices that correspond to that particle. I then mark the Points geometry position attribute as needing an update and that's it.


text:
Jittery and Jumpy camera movement with SDL2 and OpenGL
i have successfully been able to draw a cube using openGL and SDL2. To me the next natural step would be to add some basic forward/backward movement to the camera. I did so with this code here:
    // SDL Window init and GLSL setup ^^

    vec3 cameraPos = {0.0f, 0.0f, 3.0f};
    vec3 cameraTarget = {0.0f, 0.0f, 0.0f};
    vec3 cameraFront = {0.0f, 0.0f, -1.0f};

    while(!quit){

        vec3 cameraDirection;

        glm_vec3_sub(cameraTarget, cameraPos, cameraDirection);
        glm_normalize(cameraDirection);

        vec3 up = {0.0f, 1.0f, 0.0f};
        vec3 cameraRight;

        glm_cross(cameraDirection, up, cameraRight);
        glm_normalize(cameraRight);

        vec3 cameraUp;

        glm_cross(cameraRight, cameraDirection, cameraUp);

        vec3 cameraFrontPlusPos;
        glm_vec3_add(cameraFront, cameraPos, cameraFrontPlusPos);

        float cameraSpeed = 0.05f;

        while (SDL_PollEvent(&e)) {
            if (e.type == SDL_QUIT) {
                quit = true;
            }
            else if (e.type == SDL_KEYDOWN) {
                switch (e.key.keysym.sym) {
                    case SDLK_w:
                        {
                            vec3 scaledFront;
                            glm_vec3_scale(cameraFront, cameraSpeed, scaledFront);
                            glm_vec3_add(cameraPos, scaledFront, cameraPos);
                        }
                        break;
                    case SDLK_s:
                        {
                            vec3 scaledFront;
                            glm_vec3_scale(cameraFront, cameraSpeed, scaledFront);
                            glm_vec3_sub(cameraPos, scaledFront, cameraPos);
                        }
                        break;
                    case SDLK_a:
                        {
                            vec3 right;
                            glm_vec3_cross(cameraFront, cameraUp, right);
                            glm_normalize(right);
                            glm_vec3_scale(right, cameraSpeed, right);
                            glm_vec3_sub(cameraPos, right, cameraPos);
                        }
                        break;
                    case SDLK_d:
                        {
                            vec3 right;
                            glm_vec3_cross(cameraFront, cameraUp, right);
                            glm_normalize(right);
                            glm_vec3_scale(right, cameraSpeed, right);
                            glm_vec3_add(cameraPos, right, cameraPos);
                        }
                        break;
                }
            }
        }

        // Cube Rendering code down here

    }

because i am writing this in c i am not using glm but i am using cglm that is provided by this github page: https://github.com/recp/cglm.
The problem that i am having is that when i move left and right the camera seems to be jumpy and not smooth like when i move forward and backwards.
I have tried introducing a deltaTime variable that gets multiplied to my cameraSpeed, but that did not seem to have done anything. I then tried adding a delay to the game loop by using SDL_Delay(10) and that made the jittery thing worse. I also tried changing the Swap interval from 0 to 1 to -1 and 0 was the smoothest and 1 and -1 where really jittery.


text:
How would I go about making Pushboxes in a 2D fighting game?
I am working on a 2D fighting game engine in C++ and SDL2 and everything so far is going swimmingly. I have hitboxes, hurtboxes, and pushboxes as you would expect of a typical fighting game. How exactly would I make the pushboxes behave like they do in Street Fighter 3 or any other modern fighting game? By this I mean that if both people are pushing each other, nobody moves. If someone is moving and the other isn't, then the moving player pushes the idle player. So far I know that the system is more lax than correcting the position to be right outside of the other person's pushbox every frame, as there can be some overlap in SF3 and other games. I just don't know how to implement something like this and I haven't been able to find a satisfactory answer online. How should I go about implementing this? Thanks.

Can you quantity "some overlap" or the situations in which that overlap should be allowed to occur in your game? Right now, this question is somewhat under-specified, in that lots of different answers might fit the description in the text and still not be what you actually want.


text:
Fortnite files structure - how to find quest description?
Fortnite files can be discovered with FModel. This is unreal engine project.
I would like to understand how it works.
For ex., I found the following record at AssetRegistry.json:
{
  "ObjectPath": "/BattlePassS24/Items/QuestItems/PartyQuests/quest_s24_DailyPunchcard_Complete1.quest_s24_DailyPunchcard_Complete1",
  "PackageName": "/BattlePassS24/Items/QuestItems/PartyQuests/quest_s24_DailyPunchcard_Complete1",
  "PackagePath": "/BattlePassS24/Items/QuestItems/PartyQuests",
  "AssetName": "quest_s24_DailyPunchcard_Complete1",
  "AssetClass": "AthenaDailyQuestDefinition",
  "TagsAndValues": {
    "bNeverPersisted": "False",
    "DisplayName": "NSLOCTEXT(\"[11EF0A9E119F4D09A17AB91694C84970]\", \"C9C045254C186D23D570B0BBBDF258C9\", \"Complete 1 Daily Quest\")",
    "ItemType": "Quest",
    "PrimaryAssetName": "quest_s24_DailyPunchcard_Complete1",
    "PrimaryAssetType": "Quest"
  },
  "ChunkIDs": [
    10
  ],
  "PackageFlags": 2147754496
},

How can I find the translated description, picture, quest location and reward?


text:
How do you render a square texture2d to a square render target in unreal using c++?
How do you render a square texture2d to a square render target in unreal using c++?
or is there something in unreal similar to Graphics.blit in Unity?


text:
For the EOS Online Subsystem, can my player sign up for an Epic Games account from the game, or does he/she have to do it from epicgames.com?
I am working on an Unreal Engine 5 game that would support Cloud Save functionality. I plan to use the Epic Online Services (EOS) Online Subsystem.
I plan to publish it on iOS and Android for now, and possibly Windows in the future.
I have a simple prototype that allows players to log in from the game. So when I do, I get the Sign In / Sign Up page. If I use my existing Epic Games account (I can connect through the linked Steam or Xbox Live Identity Providers), it logs me in. But I cannot sign up for a new account.
It gives me the following error message:

"Application Access is Restricted"

"Unfortunately, you do not have access to use this application."

Then I tried signing up from a web browser on epicgames.com, then using that new account to sign into my game, and it worked.
Is it possible to allow the player to perform the entire sign up and sign in process from the game, without forcing the user to visit epicgames.com?
Thanks.
Code:
void UCti2EosGameInstance::LoginWithEos(FString Id, FString Token, FString LoginType)
{
    UWorld* World = this->GetWorld();
    if (World == nullptr)
    {
        return;
    }

    IOnlineSubsystem* SubsystemRef = Online::GetSubsystem(World);
    if (SubsystemRef == nullptr)
    {
        return;
    }

    IOnlineIdentityPtr IdentityPointerRef = SubsystemRef->GetIdentityInterface();
    if (IdentityPointerRef == nullptr)
    {
        return;
    }

    FOnlineAccountCredentials AccountDetails;
    AccountDetails.Id = Id;
    AccountDetails.Token = Token;
    AccountDetails.Type = LoginType;
    IdentityPointerRef->OnLoginCompleteDelegates->AddUObject(this, &UCti2EosGameInstance::LoginWithEos_Return);
    IdentityPointerRef->Login(0, AccountDetails);
}

Then from Blueprint when the "Login" button is called, I call this function and pass "accountportal" for LoginType, and empty strings elsewhere.


text:
C++ Qt Game Dev: How to instantiate game objects at a specific positions read from a txt file?
I am trying to add a functionality to a game. First, here's a description of what was the initial version of the game like:
What I Had at Hand
I had at hand, a simple baloon popping game where the balloons enter the screen from above at randomly generated x coordinates (and fixed y=60 y coordinate) and start moving downwards. If the player clicks on a balloon before the balloon goes out of bound, he scores. If the balloon goes out of bound before being clicked, the player misses. There is a time counter starting from 30seconds and if the counter reaches 0, the game shows a message screen displaying the hits, misses and the final score(hit-miss) of the player.

What Functionality I am Trying to Add
Initially, the game generates balloons always at:
y=60 and x=(a random x variable within the bounds of the game screen)
But I want the game to read a text file named konumlar.txt(tr:coordinates.txt) with two numbers in each of its lines, seperated by a space (' ') where the first number is an x-coordinate and the second number is a y-coordinate. Then the program should store each line's coordinate info as a tuple, and form a list from those tuples. This list of coordinates in my implementation is called coordinatePool. Whenever a balloon is to be generated, the program should choose one coordinate from this coordinatePool and generate it there. In my implementation, I stored the coordinates in QPoints and those QPoints in a QList.
What Problem Did I Encounter
Upon doing my implementation and running the program, I saw that balloons are not generated correctly. Namely, balloons seemed to be generated only from the top left corner of my game screen. And there were balloons here and there, visible for a split second then disappearing.

My Source Code
balon.cpp:
#include "balon.h"
balon::balon(QWidget *win,int x, int y)
{
    scrsize = win->size();
    balon_num = QRandomGenerator::global()->bounded(0, 7);
    label = new QLabel(win);
    path = QString(":/images/images/") + QString::number(balon_num) + ".jpg";
    pic.load(path);
    label->setGeometry(x, y, 50, 50);
    label->setPixmap(pic.scaled(50, 50, Qt::KeepAspectRatio));
    label->installEventFilter(this);
    label->show();
    timer = new QTimer(this);
    timer->setInterval(15);
    connect(this, SIGNAL(status(int)), win, SLOT(checkstatus(int)));
    connect(timer, SIGNAL(timeout()), this, SLOT(move()));
    connect(win, SIGNAL(focusin()), this, SLOT(start()));
    connect(win, SIGNAL(focusout()), this, SLOT(stop()));
    timer->start();
}
void balon::move() {
    scrsize = label->parentWidget()->size();
    if (label->y() >= scrsize.height() - 30) {
        emit status(0);
        delete label;
        delete this;
    } else {
        label->setGeometry(x, label->y() + 3, 50, 50);
        timer->start();
    }

}
bool balon::eventFilter(QObject *o, QEvent *e){
    if (o == label && e->type() == QMouseEvent::MouseButtonPress) {
        clicked();
    }
    return QObject::eventFilter(o,e);
}

void balon::clicked() {
    delete timer;
    emit status(1);
    label->removeEventFilter(this);
    pic2.load(":/images/images/patlama.jpg");
    label->setPixmap(pic2.scaled(50, 50, Qt::KeepAspectRatio));
    QTimer::singleShot(1000, this, SLOT(destroy()));
}
void balon::destroy(){
    delete label;
    delete this;
}
void balon::stop(){
    if (!stopped) {
        timer->stop();
        stopped = true;
    }
}
void balon::start(){
    if (stopped) {
        timer->start();
        stopped = false;
    }
}

part of the mainwindow.cpp where i read the txt file and generate balloons:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "balon.h"
#include <QMessageBox>
#include <QPushButton>
#include <QFile>
#include <QTextStream>
#include <QIODevice>
#include <QStringList>
#include <QString>
#include <QDir>
#include <QPoint>
#include <QCoreApplication>
#include <QList>
#include <QScreen>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{

    QFile file(QCoreApplication::applicationDirPath() + "/konumlar.txt");
    if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
        QTextStream in(&file);
        while (!in.atEnd()) {
            QString line = in.readLine();
            QStringList coordinates = line.split(" ");
            if (coordinates.size() >= 2) {
                int x = coordinates.at(0).toInt();
                int y = coordinates.at(1).toInt();
                coordinatePool.push_back(QPoint(x, y));
                qDebug()<< coordinatePool;
            }
        }
        file.close();
    } else {
        qDebug() << "Failed to open konumlar.txt";
    }

    ui->setupUi(this);
    ui->centralwidget->setLayout(ui->verticalLayout_2);
    this->showMaximized();
    this->setFocusPolicy(Qt::StrongFocus);
    timer = new QTimer(this);
    time2 = 30;
    timer2 = new QTimer(this);
    timer2->setInterval(1000);
    connect(timer2, &QTimer::timeout, [this](){
        time2--;
        ui->label_3->setNum(time2);
        if (time <= 0){
            endGame();
        }
    });
    connect(timer, SIGNAL(timeout()), this, SLOT(generate()));

    int index = QRandomGenerator::global()->bounded(0,coordinatePool.size());
    new balon(this,coordinatePool.at(index).x(),coordinatePool.at(index).y());
    timer->start(500);
    timer2->start();
}
void MainWindow::generate()
{
    if (coordinatePool.isEmpty()){
        qDebug()<<"No coordinates available";
        return;
    }

    int index = QRandomGenerator::global()->bounded(0,coordinatePool.size());
    QPoint coordinate = coordinatePool.at(index);
    new balon(this,coordinate.x(),coordinate.y());
    time = QRandomGenerator::global()->bounded(400,1000);
    timer->start(time);
}

}

Finally, konumlar.txt:
100 200
200 300
500 500
150 100
1000 100
1100 150
300 200
800 250
900 300
400 350
550 400
600 200
700 200
1200 150
800 300
100 100
150 100
200 100
250 200
350 200
700 230
300 100
1000 500
1000 550
1000 600
400 700
450 100
550 100
900 100
800 400

What did I Thought/Try?
Initially, I thought that the program couldnt form the coordinate tuples QPoints and the list of QPoints, QList incorrectly. But I wrote some debug code and here's the QList that my program creates:
QList(QPoint(100,200), QPoint(200,300), QPoint(500,500), QPoint(150,100), QPoint(1000,100), QPoint(1100,150), QPoint(300,200), QPoint(800,250), QPoint(900,300), QPoint(400,350), QPoint(550,400), QPoint(600,200), QPoint(700,200), QPoint(1200,150), QPoint(800,300), QPoint(100,100), QPoint(150,100), QPoint(200,100), QPoint(250,200), QPoint(350,200), QPoint(700,230), QPoint(300,100), QPoint(1000,500), QPoint(1000,550), QPoint(1000,600), QPoint(400,700), QPoint(450,100), QPoint(550,100), QPoint(900,100), QPoint(800,400))

Then, I looked at my gamescreen's size and try to find if coordinates in konumlar.txt were out of bound, but the size was something like 1580x850, so coordinates seem to be within the bounds. Then I created a QPoint with coordinates (750,750) and painted a circle around it to see what will happen. Oddly, only the part of the circle that falls outside of the backscreen game texture was visible, and the circle was formed on the up left corner of the screen.
Then I lifted the ui element that was the wooden background texture of my game and ran the game again, and no balloons were generated behind that ui element. But i suspect that my program tries to create the balloons behind that ui element. I must say, I am not good at explaining the details in a technical level.
What could be the problem? I am ready to share every file/screenshot required.
EDIT: I see that the y coordinates are generated well but somehow the x coordinates are always 0.
Thank you!


text:
How can I change MetaHuman pose and face expression without losing everything on autosave?
I uploaded a MetaHuman in a level.
Then, I want to do changes its face, body and so on, in the same fashion as if you load an animate sequence. I want to control its facial expression with face control. But, when I press Ctrl + Z or the auto-saving occurs, the whole MetaHuman pose changes to its default position and I lose all my work entirely.
So, how can I change the MetaHuman pose and control its facial expressions, without the trouble that every time I press Ctrl + Z or the auto-saving occurs, the whole pose changes, discarding my work entirely?
I want static poses, not animations!


text:
In unreal engine when using custom shader node how to enable alpha blend and its blend mode
In unreal engine, when using custom shader node how do you enable alpha blend and its blend mode?


text:
Ease Sequencer Keyframes
In Blender, the "Automatic" keyframe handle type creates smooth and natural animation transitions. It automatically adjusts handle positions based on neighbouring keyframes and curve shape.

In the image above the lower and upper set of keyframes are identical. The lower works much like the default in Unreal, but the upper set has 'automatic keyframe handling' to smooth it out. The keyframes are in the same positions but the curves around them are altered.

In the image above both cameras are animated the same. They move right with no 'forward' motion, and then move forwards with no 'right' motion. You can see how Blender (left) has eased its motion while Unreal (right) hasn't.

No matter what I do in Unreal I can't get the same result. The automatic 'smoothing' has these small pauses at each keyframe as the direction changes and there's no easing in some parts that need it. It seems to only care about smoothing every 'pair' of keyframes withotu caring about the overall context.
If anyone has any insights or workarounds to share, I would greatly appreciate your input. It's disappointing to encounter this roadblock for what feels such a fundamental feature.
Thank you for your time


text:
How to organize widgets in Unreal Engine for multiplayer
I am a beginner UI programmer working with UMG.
My question: are there ways to organize widgets other than, you know, the master widget that holds the rest of the widgets?
WBP_Master -> (SomeWidgets) -> (SomeWidgets)
Clarification: I would like to optimize my architecture for a project with a lot of players.
Can you advise something?


text:
Starting Event after some Conditions are met
I need to trigger an event with Playmaker that starts only if 3 conditions are verified (namely after the player has collided with 3 specific objects)
How can I trigger the event only when these criteria are met?


text:
Correct palette vs player color RGB combination
I'm trying to replicate a RTC game as a pet project. The thing is, the units have a .BMP palette. From index 0 to 63, palette colors will be combined to the player color, since that parts of the unit are the ones that make possible for us to distinguish the owner of the unit. I know the red color used for player 1 is (255, 32, 32). I have some values extrapolated from the game as the result. I need to find an algorithm that makes possibly to do the following transformation:
Palette (108, 68, 51)

Red player (255, 23, 23)

Result (115, 8, 8)

Palette (87, 85, 84)
Red player (255, 23, 23)

Result (214, 16, 16)

Palette (90, 69 ,67)

Red player (255, 23, 23)

Result (181, 8, 8)
I suppose the thing has to do with color Value/Saturation/Luma but I couldn't find the correct formula that, at least, gives us a nearby result.
Thanks in advance. I'll keep investigating, anyway I prefer to share this in advance because maybe there's some color expert here.

This would normally not be done with any kind of formula, but with a lookup table. You'd map palette index X to output colour Y, where each player can use their own version of the lookup table [for the ranges that differ between players]. In a modern GPU shader that doesn't use indexed colours, you could accomplish a similar thing using a colour grading lookup table - addressed with a colour rather than an index.


text:
How can I use TOctree2::FindNearbyElements to find static meshes that are near the target Static Mesh?
I successfully added all the static meshes to their nodes inside an Octree. But I can't seem to find the nearby elements.
When setting up a breakpoint at
UStaticMeshComponent* MeshComponent = OctreeElement.SubjectStaticMesh;
it says SubjectStaticMesh is a NULL.
What could I be doing wrong? Could something be wrong with my syntax?
USTRUCT(BlueprintType, Blueprintable)
struct FOctreeElement
{
    GENERATED_BODY()

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Octree Element Struct")
    UStaticMeshComponent* SubjectStaticMesh = nullptr;

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Octree Element Struct")
    FBoxSphereBounds BoxSphereBounds;

    FOctreeElement()
    {
        BoxSphereBounds = FBoxSphereBounds(FVector(0.0f, 0.0f, 0.0f), FVector(1.0f, 1.0f, 1.0f), 1.0f);
    }
    FOctreeElement(UStaticMeshComponent* InMeshComponent, FBoxSphereBounds InBoxSphereBounds)
    {
        BoxSphereBounds = FBoxSphereBounds(FVector(0.0f, 0.0f, 0.0f), FVector(1.0f, 1.0f, 1.0f), 1.0f);
    }
};

TArray<UStaticMeshComponent*> AllChildMeshComponents;
GetComponents<UStaticMeshComponent*>(AllChildMeshComponents);
TArray<UStaticMeshComponent*> ChildMeshComponentsToConsider;

for (UStaticMeshComponent* StaticMeshComp : StaticMeshComponents)
{
    FVector MeshPosition = StaticMeshComp->GetComponentLocation();

    // Call FindNearbyElements and pass the iterate bounds function
    OctreeData->FindNearbyElements(MeshPosition, [&ChildMeshComponentsToConsider](const FOctreeElement& OctreeElement){
        UStaticMeshComponent* MeshComponent = OctreeElement.SubjectStaticMesh;
        if (MeshComponent){
            ChildMeshComponentsToConsider.Add(MeshComponent);
        }
    });
}

for(int32 i = 0; i < ChildMeshComponentsToConsider.Num(); i++) {
    UE_LOG(LogTemp, Warning, TEXT("%s"), *ChildMeshComponentsToConsider[i]->GetName())
}


text:
ImGui errors when trying to make a game menu
I want to make a simple game menu, but I ran into a problem where ImGui cannot stop rendering and apart from that it throws shader errors. I initialize ImGui in this way:
IMGUI_CHECKVERSION();
    ImGui::CreateContext();
    ImGuiIO& io = ImGui::GetIO();
    (void)io;
    io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
    io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;

    ImGui::StyleColorsDark();

    ImGui_ImplSDL3_InitForOpenGL(window, gl_context);
    ImGui_ImplOpenGL3_Init("#version 300 es");

    while(is_running)
    {
        ImGui_ImplOpenGL3_NewFrame();
        ImGui_ImplSDL3_NewFrame();
        ImGui::NewFrame();

        ImVec2 mainWindowSize = ImVec2(SCREEN_WIDTH/4, SCREEN_HEIGHT/4);
        ImVec2 uiPos = ImVec2(SCREEN_WIDTH/4,SCREEN_HEIGHT/4);
        ImGui::SetNextWindowSize(mainWindowSize);
        ImGui::SetWindowPos(uiPos);
        ImGui::Begin("Break Out!");

        if (ImGui::Button("Start"))
        {
            show_ui = false;
        }
        ImGui::End();

        if(show_ui)
        {
            ImGui::Render();
            ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
        }
    }

ImGui doesn't stop rendering on button press, plus there are these errors from gl callback:
ERROR 1280 in glCreateShader
GL CALLBACK:  type = 0x8251, severity = 0x826b, message = type: 0, local: 0, shared: 0, gpr: 12, inst: 19, bytes: 304, cached: 1389
GL CALLBACK:  type = 0x8251, severity = 0x826b, message = type: 1, local: 0, shared: 0, gpr: 13, inst: 20, bytes: 320, cached: 1101
GL CALLBACK: ** GL ERROR ** type = 0x824c, severity = 0x9146, message = GL_INVALID_ENUM in glGetIntegerv(pname=GL_POLYGON_MODE)
GL CALLBACK: ** GL ERROR ** type = 0x824c, severity = 0x9146, message = GL_INVALID_ENUM in glIsEnabled(GL_PRIMITIVE_RESTART)
GL CALLBACK: ** GL ERROR ** type = 0x824c, severity = 0x9146, message = GL_INVALID_ENUM in glDisable(GL_PRIMITIVE_RESTART)
GL CALLBACK: ** GL ERROR ** type = 0x824c, severity = 0x9146, message = GL_INVALID_OPERATION in unsupported function called (unsupported extension or deprecated function?)
GL CALLBACK: ** GL ERROR ** type = 0x824c, severity = 0x9146, message = GL_INVALID_ENUM in glDisable(GL_PRIMITIVE_RESTART)
GL CALLBACK: ** GL ERROR ** type = 0x824c, severity = 0x9146, message = GL_INVALID_OPERATION in unsupported function called (unsupported extension or deprecated function?)

those errors do not appear when not using ImGui


text:
Navigation in a TileMap with 2 types of tile in 1 cell in Godot4
I'm stuck with the navigation in a TileMap based scenario in Godot 4. My intention is to make the enemy (boats) to chase the player while avoiding procedurally generated islands.
It's possible to have 2 types of tile in the same cell, one navigable, the other not, and make the not navigable one prevail over the other?
My TileMap node has a TileSet of cell size 16x16, 2 layers (water and ground) and 1 terrain (sand_on_water). They have 1 Navigation Layer painted in the water tiles, the only ones I want the enemies to go. Here's how it's generated:
func generate_map() -> void:
    var beach_tiles := []
    for y in range(-MAP_SIZE.y * 0.5, MAP_SIZE.y * 0.5):
        for x in range(-MAP_SIZE.x * 0.5, MAP_SIZE.x * 0.5):
            var current_coord := Vector2i(x, y)
            var water_tile_coords := Vector2i(0, 0)
            # water
            tile_map.set_cell(WATER_LAYER, current_coord, SOURCE_ID, water_tile_coords)
            # ground
            if noise.get_noise_2d(x, y) > 0.4:
                beach_tiles.push_back(current_coord)
    # terrain connect
    tile_map.set_cells_terrain_connect(GROUND_LAYER, beach_tiles, TERRAIN_SET_0, SAND_ON_WATER)

Basically put water tiles (WATER_LAYER) in all cells and then, if noise wants, add sand tiles (GROUND_LAYER) on top of the water ones from the terrain set so they conform corners and so.
If I launch the game with the debug mode on in the NavigationAgent2D, the enemies try to reach the player as if there was no obstacles in the way. Their paths go straight through islands and they get stuck by the physical layer. I think the bottom water tile says it's navigable, and the upper sand tile, which is not navigable, gets ignored.
The tileset (png) I've drawn has the sand tiles with transparent parts so, for example, if I change the color of the water tiles, I don't have to paint the new water color on the sand tiles.
If I don't place water tiles below sand tiles, the enemies behave like expected, avoiding obstacles. But I've designed my sand tiles to have water tiles below. If they don't, black parts are rendered.
Is there any trick in Godot4 to solve this problem? Or I just have to add water parts painted into my sand tiles and avoid placing water tiles below them?


text:
I'm new to Unreal, and I'm trying to make a physics based game using CableActor. However, my actors explode as soon as I start a simulation
Here's a video of what's happening:
https://youtu.be/5uckTbNTGHI
The cable starts swinging wildly, and the actors at the end of the cable fly off into infinity. Ideally when I start the simulation I want everything to be still at the start of the simulation.
I have tried to follow this guide:
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Physics/PhysicsAssetEditor/HowTo/FixCommonPhysicsErrors/
Ultimately I intend for the character to interact with the actor at the end of the cable component.
How can I resolve this explosion? Is it even an explosion?


text:
3D Ragdoll, skinned mesh + three.js + cannon.js
I'm trying to develop a ragdoll from a skinned mesh, in three.js using cannon.js as physics engine.
I'm struggling with a lookAt problem for bones. Let me explain the method I used.
I made a skinned humanoid mesh with a skeleton consisting of "chains" of bones for spine and limbs.

I parse the model skeleton, for every bone I define a Cannon body, let's call it a cube, I assign it the same position of the bone (first joint), and constrain it to the previous bone, at fixed distance.
Then if i animate the simulation, the cubes are correctly simulated, and the rotations are not constrained, so they move freely like they were a chain of cubes suspended to a wire.

To the first bones of every chain, i assign the position of the corresponding cube, so the bones chain are aligned to the simulation.
Then, for every chain, i cycle through every bone and lookAt the next one, with this function:
rotateTowardsTarget = (source, target) => {

    const up = source.up.clone(); // it's 0, 1, 0

    const p1 = source.getWorldPosition(new THREE.Vector3());
    const p2 = target.getWorldPosition(new THREE.Vector3());

    const direction = new THREE.Vector3().subVectors(p2, p1).normalize();
    const align_q = new THREE.Quaternion().setFromUnitVectors( up, direction );

    // subtract rotation of the parent
    if (source.parent) {
        const _m1 = new THREE.Matrix4();
        const _q1 = new THREE.Quaternion();
        _m1.extractRotation( source.parent.matrixWorld );
        _q1.setFromRotationMatrix(_m1);
        align_q.premultiply( _q1.invert() );
    }

    source.quaternion.copy(align_q);
}

this makes the bones correctly align towards the following one, but then i go through something related to the lookAt methods, that keeping the object aligned to the UP vector, makes it "spin" when pointing at north and south poles, so when their target is up or down.
https://youtu.be/7S37fhanFJg
I'd like a way to rotate the bones towards the following one, keeping their initial orientation, or maybe limiting the rotation so they don't "spin".
It would be the same for a flight simulator: if the camera looksAt a target that's right down or up, we don't want it to "spin", just keep rotating and even invert (upside down)
thanks in advance.
do you have any suggestions?


text:
Persistent Variable Issue: Incorrect Texture Index in C++/Opengl Rendering
I am attempting to render two different textures in C++/OpenGL. However, I am encountering an issue where the integer I pass as the texture index to my Fragment Shader always seems to be set to 0. In the Fragment Shader's commented code, you can see that I tried to retrieve the correct texture from the sampler2D by using the texture index passed from Vertex Shader. However, this approach did not work as expected, as it always displayed the texture bound to slot 0. To debug this issue, I added an "if" statement to check if v_textureIndex is assigned the correct values, but it appears that it is always set to 0, resulting in a red quads being displayed on my screen. I am unsure of what the problem could be. I'm really suprised by that as my all other values seems to work correctly. Initially, to fix this, I attempted to use a float variable for texture index, but it exhibited the same behavior.
I checked if

quadVertices array values with debugger to ensure that 2 quads (8 vertices) have proper value, especially the texture index
glEnableVertexArrayAttrib, glVertexArrayAttribFormat, glVertexArrayAttribBinding should be all correct, especially that other values that I pass right
Added glGetError() after every gl call but that didn't helped.
When I modified it to use float instead of int I tried to add flat modifier too, but that didn't changed nothing.

Vertex Shader
#version 460 core

layout (location = 0) in vec2 a_position;
layout (location = 1) in vec4 a_color;
layout (location = 2) in vec2 a_textureCoords;
layout (location = 3) in int a_textureIndex;

uniform mat4 u_transform;
uniform mat4 u_viewProjectionMatrix;

out vec4 v_color;
out vec2 v_textureCoords;
flat out int v_textureIndex;

void main()
{
    v_color = a_color;
    v_textureIndex = a_textureIndex;
    v_textureCoords = a_textureCoords;
    gl_Position = u_viewProjectionMatrix * u_transform * vec4(a_position, 0.0, 1.0);
}

Fragment Shader
#version 460

in vec4 v_color;
in vec2 v_textureCoords;
flat in int v_textureIndex;

uniform sampler2D u_textures[64];
out vec4 color;

void main()
{
    if (v_textureIndex == 0)
    {
        color = vec4(1, 0, 0, 1);
    }
    else if (v_textureIndex == 1)
    {
        color = vec4(0, 1, 0, 1);
    }

    //color = v_color * texture(u_textures[int(v_textureIndex)], v_textureCoords);
}

Draw method
void Renderer::draw(Reference<Sprite> sprite, int index)
{
    sprite->getTexture()->bind(index);

    m_sceneData->textureShader->bind();
    m_sceneData->textureShader->uploadUniformMatrix4("u_transform", sprite->getMatrix());
    m_sceneData->textureShader->uploadUniformMatrix4("u_viewProjectionMatrix", m_sceneData->viewProjectionMatrix);

    FloatRect textureRect = (FloatRect)sprite->getTextureRect();
    textureRect.x /= sprite->getTexture()->getSize().x;
    textureRect.y /= sprite->getTexture()->getSize().y;
    textureRect.width /= sprite->getTexture()->getSize().x;
    textureRect.height /= sprite->getTexture()->getSize().y;

    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 0].position = { 0.0f, 1.0f }; // bottom right
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 1].position = { 1.0f, 0.0f }; // top right
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 2].position = { 0.0f, 0.0f }; // top left
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 3].position = { 1.0f, 1.0f }; // bottom right

    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 0].color = { 1.0f, 1.0f, 1.0f, 1.0f };
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 1].color = { 1.0f, 1.0f, 1.0f, 1.0f };
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 2].color = { 1.0f, 1.0f, 1.0f, 1.0f };
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 3].color = { 1.0f, 1.0f, 1.0f, 1.0f };

    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 0].textureCoords = { textureRect.width, textureRect.y }; // top right
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 1].textureCoords = { textureRect.x, textureRect.height }; // bottom left
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 2].textureCoords = { textureRect.width, textureRect.height }; // bottom right
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 3].textureCoords = { textureRect.x, textureRect.y }; // top left

    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 0].textureIndex = index;
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 1].textureIndex = index;
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 2].textureIndex = index;
    m_sceneData->quadVertices[m_sceneData->quadVerticesCount + 3].textureIndex = index;

    m_sceneData->quadVerticesCount += 4u;
    m_sceneData->quadVertexBuffer->setData((void*)(m_sceneData->quadVertices.data()), m_sceneData->quadVerticesCount * sizeof(SceneData::QuadVertex));

    glBindVertexArray(m_sceneData->quadVertexArray->getRendererID());
    glDrawElements(GL_TRIANGLES, m_sceneData->quadVertexArray->getIndexBuffer()->getCount(), GL_UNSIGNED_INT, nullptr);
}

QuadVertex struct
struct QuadVertex
{
    Vector2f position;
    Vector4f color;
    Vector2f textureCoords;
    int textureIndex;
};

Draw calls (no, I'm not passing 'index' as 0 twice lmao)
Renderer::draw(m_sprite, 0);
Renderer::draw(m_sprite2, 1);

Current output with plain colors

Current output with texture (if I first render second texture, the second texture is displayed twice)


text:
Room re-drawn multiple times when player walks into door
Using Visual Studio with C#, I am trying to have another room redrawn after the player walks into a door. What I'm finding is it creates more than one room and the walls don't line up. The code is supposed to clear the screen first then redraw the room and randomly position the player, but it does this more than once.
class ScreenRectangle : MapProperites
{
    // the Height and width and edge of the screen inside the console window
    public int ScreenHeight { get; private set; }
    public int ScreenWidth { get; private set; }
    public int Edge { get; private set; }

    private char[,] m_buffer; // currently is not being used

    /// <summary>
    /// a function that sets up the parameters of the rectangle
    /// </summary>
    /// <param name="Height"></param>
    /// <param name="Width"></param>
    public ScreenRectangle(int Height, int Width)
    {
        ScreenHeight = Height;
        ScreenWidth = Width;
        Edge = ScreenWidth - 1;
    }
    /// <summary>
    /// a public function that makes up the display for the player to move around in
    /// </summary>
    public void TestDisplay()
    {
        Console.Clear();
        Console.CursorVisible = false;
        Console.SetCursorPosition(0, 0);
        StringBuilder mapDisplay = new StringBuilder();

        for (int y = 0; y < ScreenHeight; y++)
        {
            for (int x = 0; x < ScreenWidth; x++)
            {
                switch (x)
                {
                    case 0:
                        if (y == 0) // top left corner
                        {
                            mapDisplay.Append((char)9484);
                        }
                        else if (y == 29)// bottom left corner
                        {
                            mapDisplay.Append((char)9492);
                        }
                        else // the left veritcal edge
                        {
                            mapDisplay.Append((char)9474);
                        }
                        break;
                    case 99:
                        if (y == 0) // the top right corner
                        {
                            mapDisplay.Append((char)9488);
                        }
                        else if (y == 29) // the bottom right corner
                        {
                            mapDisplay.Append((char)9496);
                        }
                        else // right vertical edge
                        {
                            mapDisplay.Append((char)9474);
                        }
                        break;
                    default:
                        if (y == 0)// the top horizontal edge
                        {
                            mapDisplay.Append((char)9472);
                        }
                        else if (y == 29)// the bottom horizontal edge
                        {
                            mapDisplay.Append((char)9472);
                        }
                        else// a empty space within the overall zone
                        {
                            mapDisplay.Append(" ");
                        }
                        break;
                }
            }
            mapDisplay.Append("\n");

        }
        Console.WriteLine(mapDisplay.ToString());
        Interactables generatePickups = new Interactables();
        generatePickups.Item();

        Doors generateDoors = new Doors("D");
        Display display = new Display();
        display.DrawDoor();

    }
}

The next set of code shows the door as a pickup where the player walks into the door and clears the screen before redrawing
void CheckPlayerOnPickup()
    {
        foreach (Pickups pickup in displayedPickups)
        {
            if (playerOne.X == pickup.x && playerOne.Y == pickup.y)
            {
                if (pickup.mychar == 'O')
                {
                    playerOne.Score += 1;
                    displayedPickups.Remove(pickup);
                }
                if (pickup.mychar == 'L')
                {
                    playerOne.Inventory.Add(new Item(1, " 1 LaserSword           "));
                    playerOne.Score += 2;
                    displayedPickups.Remove(pickup);
                    OpenInventory();
                }
                if (pickup.mychar == 'G')
                {
                    playerOne.Inventory.Add(new Item(1, " 1 laserGun           "));
                    playerOne.Score += 3;
                    displayedPickups.Remove(pickup);
                    OpenInventory();
                }
                if (pickup.mychar == 'K')
                {
                    playerOne.Inventory.Add(new Item(1, " 1 KeyCard           "));
                    displayedPickups.Remove(pickup);
                    OpenInventory();
                }
                if (pickup.mychar == 'D')
                {
                    ScreenRectangle generateScreenRectangle = new ScreenRectangle(ScreenHeight, ScreenWidth);
                    Console.Clear();
                    generateScreenRectangle.TestDisplay();
                    Playerone();

                }
                break;


text:
Strange shadow artifacts from lighting when importing blender model in opengl
I'm trying to add model loading to my opengl/sdl2 renderer and I'm successfully loading meshes using assimp after following the tutorial at learn opengl, however when I make my own simple models and import them, the shaders seem to not work correctly and I get strange lighting artifacts in the form of lots of shadows and black areas.
I've tried to follow the advice of this
other question
to eliminate the problem, but it doesn't seem to work. I attached a picture of what a simple cylinder looks like when being rendered. Note that for the cube I calculated all of the normals and stuff myself and the lighting shader works just fine for it. it is only on blender meshes that the lighting is off. I attached the shader code as well
Edit:
I went and tested out a cube model made in blender and am having the same result where it seems to be calculating the normals incorrectly when exporting. I set the ambient light to black and put the light shining down on the corner of the cubes. My cube has light on both faces that it should , but blender's cube does not.

Also notably, the light changes depending on where I position my camera as well (only on the blender cube), even though it shouldn't matter where the camera is because the light source doesn't move.
Edit 2:
I went and retested the backpack model from the learn opengl site and I'm still getting strange shadows but to a much lesser extent, I add a pic and for context, the shadows look ok, but as you can see are much darker than they reasonable should be. I think one of my calculations is happening in the wrong space but I can't figure out which calculation it is.

Edit 3:
I've been playing around and have found that the issue lies in the specular part of my shader and I believe it is happening that way due to the specular map (or maybe lack of one) I'm not sure. I'm gonna play around with blender and see if there is a way to fix the export specular texture.
Vertex Shader:
#version 460 core
layout (location = 0) in vec3 pos;
layout (location = 1) in vec3 color;
layout (location = 2) in vec3 normal;
layout (location = 3) in vec3 tangent;
layout (location = 4) in vec3 bitangent;
layout (location = 5) in vec2 uvs;
layout (location = 6) in float opacity;

out vec2 tex_coords;
out vec4 out_color;
out vec3 frag_pos;
out vec3 out_normal;
out vec3 out_tangent;
out vec3 out_bitangent;

uniform mat4 model;
uniform mat4 view;
uniform mat4 proj;

void main() {
    frag_pos = vec3(model * vec4(pos, 1.0));
    out_normal = mat3(transpose(inverse(model))) * normal;

    out_color = vec4(color, opacity);
    out_tangent = tangent;
    out_bitangent = bitangent;
    tex_coords = uvs;

    gl_Position = proj * view * vec4(frag_pos , 1.0);
}

Fragment Shader:
#version 460 core
in vec4 out_color;
in vec3 frag_pos;
in vec3 out_normal;
in vec3 in_tangent;
in vec3 in_bitangent;
in vec2 tex_coords;

out vec4 frag_color;

uniform vec3 view_pos;

struct Material {
    sampler2D ambient_tex;
    sampler2D height_tex;
    sampler2D diffuse_tex;
    sampler2D specular_tex;
    vec3 ambient;
    vec3 diffuse;
    vec3 specular;
    float shininess;
};

struct Light {
    vec3 position;
    vec3 ambient;
    vec3 diffuse;
    vec3 specular;
};

uniform Material material;
uniform Light light;

void main() {
    // ambient
    vec3 ambient = (light.ambient * material.ambient) *
                   vec3(texture(material.ambient_tex , tex_coords)); // * vec3(out_color);

    // diffuse
    vec3 norm = normalize(out_normal);
    vec3 light_dir = normalize(light.position - frag_pos);
    float diff = max(dot(norm , light_dir) , 0.0);
    vec3 diffuse = (light.diffuse * material.diffuse) * (diff * vec3(texture(material.diffuse_tex , tex_coords)));

    // specular
    vec3 view_dir = normalize(view_pos - frag_pos);
    vec3 reflect_dir = reflect(-light_dir , norm);
    float spec = pow(max(dot(view_dir , reflect_dir) , 0.0) , material.shininess);
    vec3 specular = (light.specular * material.specular) * (spec * vec3(texture(material.specular_tex , tex_coords)));

    vec3 result = ambient + diffuse + specular;
    frag_color = vec4(result , 1.0) * texture(material.diffuse_tex , tex_coords);
}


text:
Scared enemies run into walls
I set up a basic pyramid shaped enemy kinematic body that runs away from the player when its health is too low and runs towards the player if the enemy has enough health. The enemy also turns to face the player if they are chasing the player or turn its back to the player when running away, so very basic.
But I realized that when the enemy is low on HP and running away, they can be chased into a wall. For some enemies that is ok as I wanted to let them be able to climb so once the climb function is done for the enemies that will be just fine.
But other enemies can't climb so they just run into walls like fools, which is fine for a horror movie but not for this game because it tries to have a minimum of realism and not even a chicken is that stupid.
How do I fix this? I see a lot of people mentioning 'navmeshes' but can I turn terrain made in blender into a navmesh? How does that even work? From the tutorials I've seen everyone who uses navmesh as a terrain is only dealing with boxes and planes.


text:
Trouble trying to use multiple rendertargetviews and viewports at the same time
I have worked on the GSCubemap demo for DX11 to obtain rendering to multiple rendertargets and modified it to render to a single RTV with multiple viewports with SV_ViewportArrayIndex. I'm now trying to mix the two is it possible? I'm facing a vertex-pixel shader linkage error (SV_RTVArrayIndex and SV_VPArrayIndex required for input and not provided by output stage.
Here's the code summarized
struct VS_INPUT {some VSData}
struct GS_INPUT {some GSData}
struct PS_INPUT
{
    some PSData;
    uint RTIndex:SV_RenderTargetArrayIndex;
    uint VPIndex:SV_ViewportArrayIndex;
}

GS_INPUT VSShader(VS_INPUT) {Calcul GS_INPUT;return it}

[maxvertextexcount 15] //5 VPs, 1 for RTV0, 4 for RTV1
void GSShader (triangle GS_INPUT input[3], inout trianglestream<PS_INPUT>, outstream)
{
   PS_INPUT output;
   output.RTVIndex = 0;
   output.VPIndex =0;
   for (v =0 to 3 v++) {output.Data = input.data;outstream.append(output);}
   outstream.restartstrip();
   output.RTVIndex = 1;
   for vp=1;v<5;vp++
    {
       output.VPIndex =vp;
       for (v =0 to 3 v++) {output.Data = input.data;outstream.append(output);}
       outstream.restartstrip();
    }
 }

 float4 PSShader(PS_INPUT input): SV_TARGET
{ return input.Color; }

Currently I see the content of the RTV0 only.
I have also tried with an output PS structure having float4 Color0/1 SV_TARGET0/1 but there's a problem with the COLOR semantics mismatched on the hardware.

I have forgotten to set the vertex format at GS shader creation. Now I see the viewport effect but it it only at the first target (VP1/VP2 draws overlapp bigger VP0).


text:
Problem with physics object tunneling using Nez and monogame
I was using the Nez engine with monogame to create a platformer, I made the player character an ArcadeRigidBody and the map collision shapes were handled by a TiledMapRenderer, but I noticed that when I leave the player falling, and move the window which severely decreases the FPS the player falls through the ground. Does anyone have any suggestions on how to fix this issue?


text:
Dolphin Error when playing custom NSMBW levels
I've been making custom NSMBW levels in Reggie! but whenever I try to play them, Dolphin gives three errors:

Invalid read from 0x0000000d, PC = 0x8008e3fc

Invalid read from 0x0000000d, PC = 0x8091fac0

Invalid read from 0x0000000d, PC = 0x80924b70

I have the XML file properly set up, my levels are in the path /nsmb/Stage. I can get NewerSMBW to work, but not this. Another thing to note is I can import the levels that came from NSMBW, edit them, and then it occasionally works (stopped working recently), but when I make my own from scratch, it doesn't work. How can I fix this?
Edit: I sort of got it to work. The editing preexisting levels works when the path is /nsmb/Stages. However, I still cannot make levels from scratch. I’ll have to stick with this for now. Still, let me know if you have ideas or potential fixes.
(I'm not super sure this is where to post this question, if you know where I should, please let me know!)

If edited files are working but not newly created ones, have you checked if they have the same file encoding?

Edited files occasionally work. I use the same .arc file type that the original game uses, still to no avail.

I mean encoding used of content, not file type. You can use still .arc but encode it in UTF-8, UTF-16 or ANSI (typical ones) or something completely different. Usually when you edit a file, you keep the encoding from before. But a new file has the encoding of your editor

That's a good point. However, like I said before, editing the original game files occasionally works. Something I did not mention is that if I edit them too much, they may have worked before, but then they don't. Recently they seemed to have stopped working entirely.

Just checked, the file encoding types are the same. They're both binary.


text:
How to deal with D3D12 live object caused by IDXGISwapChain::GetBuffer?
I get D3D12 WARNING if IDXGISwapChain::GetBuffer is called. I know that this incurs increase in ref count of swap chain, and the resource pointer retrieved by GetBuffer is not supposed to be manually released unless IDXGISwapChain::ResizeBuffers will be called. If the resource is released manually, SwapChain->Release() crashes at clean up.
Following is the D3D12 WARNING messages.
D3D12 WARNING: Process is terminating. Using simple reporting. Please call ReportLiveObjects() at runtime for standard reporting. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING: Live Producer at 0x0000015934682578, Refcount: 10. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x0000015934812870, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x00000159345B91E0, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x00000159345B9930, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x0000015934844730, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x0000015934844480, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593462E760, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x0000015934845420, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D1B5750, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D34D330, Refcount: 6. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D436630, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D4978D0, Refcount: 1. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D4FD330, Refcount: 2. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D436880, Refcount: 1. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D329400, Refcount: 1. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D282BD0, Refcount: 1. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D3CBF60, Refcount: 2. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D3B70A0, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D372910, Refcount: 2. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D3CC3C0, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D434CC0, Refcount: 2. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D328C80, Refcount: 1. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D327B00, Refcount: 1. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING:  Live Object at 0x000001593D291C30, Refcount: 0. [ STATE_CREATION WARNING #0: UNKNOWN]
D3D12 WARNING: Live                         Object :     23 [ STATE_CREATION WARNING #0: UNKNOWN]
DXGI WARNING: Live Producer at 0x0000015931BDA828, Refcount: 5. [ STATE_CREATION WARNING #0: ]
DXGI WARNING:   Live Object at 0x000001593D32AF40, Refcount: 1. [ STATE_CREATION WARNING #0: ]
DXGI WARNING:   Live Object at 0x000001593D3D4600, Refcount: 1. [ STATE_CREATION WARNING #0: ]
DXGI WARNING:   Live Object at 0x000001593D3A0390, Refcount: 1. [ STATE_CREATION WARNING #0: ]
DXGI WARNING: Live                         Object :      3 [ STATE_CREATION WARNING #0: ]

I've checked that device, command queue, and swap chain does not return ref count of 0 during clean up. However, releasing multiple times manually does not make sense.
I've tried,

Reordering of clean up.
Manual release of multiple times (crashes when ref count 1 -> 0)
Using ComPtr
Binding descriptor heap having null RTVs (suspected render target being bound to pipeline)

None of them could remove the warning. The only thing for sure is that IDXGISwapChain::GetBuffer is not called and command list recording is removed, the warning message does not occur. Anyone who has faced and fixed this issue helps, it will be really appreciated.
For further information, following is result of ReportLiveDeviceObjects with D3D12_RLDO_DETAIL just before releasing device object.
D3D12 WARNING: Live ID3D12Device at 0x000001C964F8C768, Refcount: 12 [ STATE_CREATION WARNING #274: LIVE_DEVICE]
D3D12 WARNING:  Live ID3D12RootSignature at 0x000001C96512FA50, Refcount: 0, IntRef: 2 [ STATE_CREATION WARNING #577: LIVE_ROOTSIGNATURE]
D3D12 WARNING:  Live ID3D12PipelineState at 0x000001C964ECD730, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #572: LIVE_PIPELINESTATE]
D3D12 WARNING:  Live ID3D12PipelineState at 0x000001C964ECB9F0, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #572: LIVE_PIPELINESTATE]
D3D12 WARNING:  Live ID3D12Resource at 0x000001C96515D150, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #575: LIVE_RESOURCE]
D3D12 WARNING:  Live ID3D12Heap at 0x000001C96DA52CD0, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #579: LIVE_HEAP]
D3D12 WARNING:  Live ID3D12Fence at 0x000001C964F46290, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #580: LIVE_MONITOREDFENCE]
D3D12 WARNING:  Live ID3D12CommandQueue at 0x000001C96515D5B0, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #570: LIVE_COMMANDQUEUE]
D3D12 WARNING:  Live ID3D12Fence at 0x000001C96DAB6990, Name: Internal D3D12 Debug Fence, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #580: LIVE_MONITOREDFENCE]
D3D12 WARNING:  Live ID3D12CommandQueue at 0x000001C96DCBDD20, Refcount: 6, IntRef: 0 [ STATE_CREATION WARNING #570: LIVE_COMMANDQUEUE]
D3D12 WARNING:  Live ID3D12Fence at 0x000001C96DD08000, Name: Internal D3D12 Debug Fence, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #580: LIVE_MONITOREDFENCE]
D3D12 WARNING:  Live IDXGISwapChain at 0x000001C96DCDAF60, Refcount: 1 [ STATE_CREATION WARNING #275: LIVE_SWAPCHAIN]
D3D12 WARNING:  Live ID3D12LifetimeTracker at 0x000001C96DC934E0, Refcount: 2, IntRef: 0 [ STATE_CREATION WARNING #1164: LIVE_LIFETIMETRACKER]
D3D12 WARNING:  Live ID3D12Fence at 0x000001C96DD05D50, Name: Internal DXGI Fence, Refcount: 1, IntRef: 0 [ STATE_CREATION WARNING #580: LIVE_MONITOREDFENCE]
D3D12 WARNING:  Live ID3D12CommandAllocator at 0x000001C96DBF9C10, Name: Internal DXGI CommandAllocator, Refcount: 1, IntRef: 1 [ STATE_CREATION WARNING #571: LIVE_COMMANDALLOCATOR]
D3D12 WARNING:  Live ID3D12GraphicsCommandList at 0x000001C96DB81E90, Name: Internal DXGI CommandList, Refcount: 1, IntRef: 0 [ STATE_CREATION WARNING #573: LIVE_COMMANDLIST12]
D3D12 WARNING:  Live ID3D12Resource at 0x000001C96DB310C0, Refcount: 2, IntRef: 0 [ STATE_CREATION WARNING #575: LIVE_RESOURCE]
D3D12 WARNING:  Live ID3D12Heap at 0x000001C96DFA26F0, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #579: LIVE_HEAP]
D3D12 WARNING:  Live ID3D12Resource at 0x000001C96DF23AF0, Refcount: 2, IntRef: 0 [ STATE_CREATION WARNING #575: LIVE_RESOURCE]
D3D12 WARNING:  Live ID3D12Heap at 0x000001C96DFA29A0, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #579: LIVE_HEAP]
D3D12 WARNING:  Live ID3D12Fence at 0x000001C96DD06690, Refcount: 2, IntRef: 0 [ STATE_CREATION WARNING #580: LIVE_MONITOREDFENCE]
D3D12 WARNING:  Live ID3D12CommandAllocator at 0x000001C96E1AAF60, Name: Internal DXGI CommandAllocator, Refcount: 1, IntRef: 1 [ STATE_CREATION WARNING #571: LIVE_COMMANDALLOCATOR]
D3D12 WARNING:  Live ID3D12CommandAllocator at 0x000001C96E1AA7E0, Name: Internal DXGI CommandAllocator, Refcount: 1, IntRef: 0 [ STATE_CREATION WARNING #571: LIVE_COMMANDALLOCATOR]
D3D12 WARNING:  Live ID3D12GraphicsCommandList at 0x000001C96DB86EB0, Refcount: 0, IntRef: 1 [ STATE_CREATION WARNING #573: LIVE_COMMANDLIST12]

ReportLiveDeviceObjects with D3D12_RLDO_IGNORE_INTERNAL.
D3D12 WARNING: Live ID3D12Device at 0x000001CD1238C768, Refcount: 12 [ STATE_CREATION WARNING #274: LIVE_DEVICE]


text:
VR Arms in Unity can't be seen through main camera
I am making my first VR game and when I put my arms out in front of me, the forearms and hands do not show or render. They can be seen through the in-game mirror that I have but not through the main camera or eyes. How do I fix this?
I'm using the Unity engine. The player model is imported into the Normcore Realtime VR Player prefab and the VR player goes underneath my player rig in the hierarchy. The camera is setup with its basic settings. I have tried adjusting the far and near values of the clipping planes and neither of those work

To improve your question, click the "Edit" link - do not delete and re-post the question. As I mentioned previously, we need your question to document all the steps needed to reproduce a Minimal Complete Verifiable Example. We don't just need to know the player model is "in a prefab" - we need to know every button click needed to reproduce that exact prefab in a new, empty project.


text:
In a Unity Camera Stack: how to grab a Camera's "view texture" (to be used inside of a shader)?
Here is the situation:

I have a URP Camera Stack; actually just two cameras: a perspective base & an orthogonal overlay.
I have some distortion shader (example, not mine) that "runs" only on
materials that the 2nd camera sees. This is just a side task of the
2nd camera: it's mostly for... overlay stuff that's related on top of
the 2.5 game (it's not just UI either).
These distortion shaders cannot not use _CameraOpaqueTexture because it, at least in my
project, doesn't capture transparent nor post    processing effects.
(And thus, I cannot use Shader Graph's SceneColor    Node either - as that is what it uses).
Fortunately, URP has another "sorta-hidden/undocumented"    GlobalTexture called
_AfterPostProcessing that is exactly what I    need. Hooray!
Unfortunately, it has come to my attention that this only works ifthe game has anti-aliasing! That's ultimately what the universal pipeline is using it for, and I just happen to be able to use it for my needs.

I figured I need to create a GlobalTexture myself, and I figured perhaps the way to do this is in a ScriptableRendererFeature. Here is the core of my (bad?) attempt to achieve this.
public class GetFirstCameraViewPass : ScriptableRenderPass
{ ...

public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) { Camera currentCamera = renderingData.cameraData.camera;

   RenderTexture renderTexture = new RenderTexture(3840, 2160, 0);
   currentCamera.targetTexture = renderTexture;
   currentCamera.Render();
   currentCamera.targetTexture = null;

   CommandBuffer cmd = CommandBufferPool.Get();
   cmd.SetGlobalTexture(GlobalTexturePropertyName, renderTexture);
   context.ExecuteCommandBuffer(cmd);
   CommandBufferPool.Release(cmd);

}

  ...

}

But I get this error when I do that:

Recursive rendering is not supported in SRP (are you calling
Camera.Render from within a render pipeline?).
UnityEngine.StackTraceUtility:ExtractStackTrace ()

How do I achieve this in a custom pass/feature?
Or is it possible to have _CameraOpaqueTexture capture transparent textures, in the settings somehow? It nearly does what I need it do in the scene view:

This is an example scene of my trying to figure out a solution. At least in the Scene view (Left) the Shader captures post processing! (Unlike in-gameplay: Right side)
Or is there another, smarter & completely different way to achieve what I am trying to achieve?


text:
I can't manage to get Instantiate USerWidget from c++ in unreal5
I have a c++ UserWidget like this (sorry for some naming I renamed stuff a bit for post clarity)
header
class MYGame ParentWidget: public UUserWidget
{
 // ...
protected:
    UPROPERTY(BlueprintReadOnly, meta = (BindWidget))
    class UCanvasPanel* ContainerPanel;
    UPROPERTY(EditAnywhere, BlueprintReadOnly)
    float DesiredSize = 32.0f;
private:
    void SyncDetection();
 // ...
}

cpp
void ParentWidget::ObjectEnteredRange()
{

        ChildWidget* Image = CreateWidget<ChildWidget>(this, ChildWidget::StaticClass());
        ContainerPanel->AddChildToCanvas(Image);
        ChildWidget->SetSize(DesiredSize);

}

which I use inside a UMG Blueprint with the following structure

Now, I have a child  object that is simple
header
UCLASS()
class MYGame ChildWidget: public UUserWidget
{
    GENERATED_BODY()

public:
    void SetSize(float size);
    virtual void NativeTick(const FGeometry& MyGeometry, float InDeltaTime) override;
protected
    UPROPERTY(BlueprintReadOnly, meta = (BindWidget))
    class UImage* Image;

};

cpp

void ChildWidget::NativeTick(const FGeometry& MyGeometry, float InDeltaTime)
{
    Super::NativeTick(MyGeometry, InDeltaTime);
    const FVector2D WidgetLocation = GetCachedGeometry().GetAbsolutePosition();

    const UCanvasPanel* ParentCanvas = Cast<UCanvasPanel>(GetParent());
    if (ParentCanvas  != nullptr)
    {
        const FVector2D CanvasSize = ParentCanvas->GetCachedGeometry().GetLocalSize();
        const FVector2D CanvasCenter(CanvasSize.X * 0.5f, CanvasSize.Y * 0.5f);
        SetPositionInViewport(FVector2D(CanvasCenter.X, CanvasCenter.Y),false);
    }
}

void ChildWidget::SetSize(float Size)
{
    if(Image != nullptr)
    {
        Image->SetDesiredSizeOverride(FVector2D(Size, Size));
    }
}

that simply looks like this

I am facing 2 problem that I do not understand.

Why I can never see my ChildWidget addeed to my ParentWidget. Even if the log run and it looks like it is properly called and the construct and setSize of child run, I am never able to see it on screen.

Why does

void ChildWidget::SetSize(float Size)
{
    if(Image != nullptr)
    {
        Image->SetDesiredSizeOverride(FVector2D(Size, Size));
    }
}

Image is always empty ? I tried renaming the variable, double checking that IsVariable is properly checked etc.. but it is NEVER defined in code and always null.


text:
Unity Preview from a specific blend tree animation to another animation
I have a blend tree that switches from Idle to Walk to Run animations via the run parameter (0 to 1).

In the preview I would like to see how works the transition between the Walk (or Run animation) and Jump animation, but the blend tree always stays on the Idle animation even if the run parameter is set to 1.
There is a solution ? or do I necessarily have to see it in playmode?
Thanks


text:
How to provide an array of positions to Create Points Node via Blueprint variables?
I wanted to use the Create Points node from PCG to align objects in a certain way. For this I've created a variable in my Blueprint ArrayOfPosition with type Array of Vectors. Now when I try to get this variable in my PCG using Get Actor Property it throws this error:

Error while creating an attribute for property 'ArrayOfPositions'. Either the property type is not supported or by PCG or attribute creation failed.

I think arrays of vectors are not supported... Is there a workaround available to assign an Array of Positions to Create Points using Blueprint Variables?


text:
Convex hull doesn't properly cover points
Recently I've been trying to create a sphere in my project. I start by creating a Fibonacci sphere through this code and draw with glDrawArrays
void create_fibonacci_sphere(int radius, int num_of_points, float points[])
{
    float golden_ratio = (1 + sqrt(5)) / 2;
    float angle_increment = 2 * M_PI * golden_ratio;

    for (int i = 0; i < num_of_points; ++i)
    {
        float t = (float)i / num_of_points;
        float angle1 = acos(1 - 2 * t);
        float angle2 = angle_increment * i;

        float x = radius * sin(angle1) * cos(angle2);
        float y = radius * sin(angle1) * sin(angle2);
        float z = radius * cos(angle1);

        points[i * 3] = x;
        points[i * 3 + 1] = y;
        points[i * 3 + 2] = z;
    }
}

Which successfully plots out these points

And then using this tutorial I implement the quickhull algorithm to perform a convex hull on the points to get a sphere, drawing using glDrawElements because the convex hull doesn't work with glDrawArrays, but all I get is
the convex hull looks wrong, considering that this is 1000 sample points that outputs this many convex hulls.  For reference, this is pretty much what I wanted / expected.
This is the code that implements the quickhull algorithm, performs the convex hull on the points and draws the sphere
typedef struct
{
    int x;
    int y;
} Point;

int find_side(Point p1, Point p2, Point p)
{
    int val = (p.y - p1.y) * (p2.x - p1.x) - (p2.y - p1.y) * (p.x - p1.x);
    if (val > 0)
        return 1;
    if (val < 0)
        return -1;
    return 0;
}

int dist(Point p1, Point p2)
{
    return (p1.y - p2.y) * (p1.y - p2.y) + (p1.x - p2.x) * (p1.x - p2.x);
}

int line_dist(Point p1, Point p2, Point p)
{
    return abs((p.y - p1.y) * (p2.x - p1.x) - (p2.y - p1.y) * (p.x - p1.x));
}

void quick_hull(Point a[], int n, Point p1, Point p2, int side)
{
    int ind = -1;
    int max_dist = 0;
    for (int i = 0; i < n; i++)
    {
        int temp = line_dist(p1, p2, a[i]);
        if (find_side(p1, p2, a[i]) == side && temp > max_dist)
        {
            ind = i;
            max_dist = temp;
        }
    }

    if (ind == -1)
    {
        printf("(%d, %d) ", p1.x, p1.y);
        printf("(%d, %d) ", p2.x, p2.y);
        return;
    }

    quick_hull(a, n, a[ind], p1, -find_side(a[ind], p1, p2));
    quick_hull(a, n, a[ind], p2, -find_side(a[ind], p2, p1));
}

void print_hull(Point a[], int n)
{
    if (n < 3)
    {
        printf("Convex hull not possible\n");
        return;
    }
    int min_x = 0, max_x = 0;
    for (int i = 1; i < n; i++)
    {
        if (a[i].x < a[min_x].x)
            min_x = i;
        if (a[i].x > a[max_x].x)
            max_x = i;
    }

    quick_hull(a, n, a[min_x], a[max_x], 1);

    quick_hull(a, n, a[min_x], a[max_x], -1);

    printf("\nThe points in Convex Hull are:\n");
}

int radius = 10;
int num_of_points = 1000;
float vertices[num_of_points * 3];
create_fibonacci_sphere(radius, num_of_points, vertices);
Point* point_list = malloc(num_of_points * sizeof(*point_list));
for (int i = 0; i < num_of_points; i++)
{
    point_list[i] = (Point) {vertices[i * 3], vertices[i * 3 + 1]};
    point_list[i] = (Point) {vertices[i * 3], vertices[i * 3 + 2]};
}

print_hull(&point_list[0], num_of_points);
glBindVertexArray(vao);
glDrawElements(GL_TRIANGLES, num_of_points, GL_UNSIGNED_INT, point_list);

Points on a sphere are their own convex hull - there's no concavity to bridge. So I don't think using a convex hull algorithm is appropriate here.


text:
Black space and incorrect lighting when capturing to Composure
I'm setting up a Virtual Production project and capturing from a camera to a Composure CG_layer. I then output this CG layer to a Render Target that I have assigned to a material on a virtual LED screen. The resulting image is too bright and shows a black bar along the horizon. Regarding the bar, I've tried messing with fog/light settings but haven't been able to find the answer. Also, as you can see in the second and third image, the blue cube's coloring looks quite different from what's in the viewport (almost unlit). I don't have these problems when using a SceneCapture2D actor/component to send to a Render Target, but I want to do this with Composure (since I need to combine layers). Any idea what settings I should look at?
OFF WORLD LIVE reports the same problem and recommends buying their plugin (of course), but is there no way to fix this natively?
EDIT: I've found you can get rid of the black bar going to the cg layer's SceneCaptureComponent2D and unchecking “Consider Unrendered Opaque Pixel as Fully Translucent”. Still working on figuring out the other lighting discrepancies.


text:
Why don't my controllers work in the VR game that I'm making?
I am currently starting with the development of a vr game in Unity. Now i've followed multiple tutorials on how to make hands by using the controllers. (I am using the Quest 2) I can't get it to work, does anybody know why?
(My controllers do work in normal games and everything)

"I've followed multiple tutorials" doesn't tell us anything about the code you're using, now what the issue might be. Can you provide a minimal set of steps you've tried?


text:
list of il2cpp breaking features
as you may know, il2cpp build does not work like mono build or playing just in the editor.
there are some c# features or libraries/plugins that make il2cpp doesn't work properly.
most of the time logger on Android or other platforms doesn't show the main reason.
is it possible to list the features that are highly probable that make problems for il2cpp builds?


text:
Conception of resolution between UI Builder, Simulator and code
I would like to understand and more master the concept of resolution with the aim to locate perflectly my GameObjects and UIDocuments (into a Canvas).
I have a issue betwwen many data declaration, interface and debug code which result to bad locate/put elements in my game.
To better understand you can view some screenshoot of my UI Builder, simulator and debug window and focus to resolution param et locate elements like this :

You can view that :

uxml file define size with game view that corresponding to simulator Apple Ipad Pro 12.9 (2732x2048)
the test2.uxml container is more heighter than simulator
the end of height of uxml is not the the end of canvas or device simulated by Unity

You can view that :

resolution is selected by choice of the iPad device
the buttons into my Visual Element container is on bottom of screen device whereas is in the middle into UI Builder

You can view that :

3 differents declaration of résolution (Screen.width and UnityEditor.PlayerSettings.defaultScreenWidth and UnityEditor.Handles.GetMainGameViewSize())

From reading this report can you tell me :
- Why locate of VisualElement is different between UI Builder and simulator ?
- Why I have 3 differents declaration of resolution value ?
- Why Canvas size (with match game View) do not match with simulator resolution ?
Thank you for your help and your advice !


text:
USS class color background not functional
Dealing with UI Builder for created interface button, I need to change properties background color with uss class stylesheet.
I created a class stylesheet .buttonControl which drag'n drop into button and I change properties of this class into inspector into : inspector > Background > Color
I try also to change this background color directly into button inspector properties but this result is the same.
Screenshoot exemple with background class

Screenshoot with object properties

All of those action never change background color button.
What's happen ? What is the trap ? Why background color never change in this context ?


text:
loading data without deleting the tree node?
for now I'm using this autoload https://github.com/Ceisri/Godot-Action-Combat/blob/main/scripts/SaveState.gd,
it's from a tutorial, to save the position of entities, it deletes the entire scene and then replaces it with a new scene where all the entities maintain their stats and saved data (including position) if they are in the group "Save" , it works but it's not compatibple with a main menu scene, if I simply make a button called "save 1" and you press it, it's supposed to call the func load_game() and instance the world, problem is... it doesn't work because pressing the button deletes the scene as it is created. however if you are already inside the scene, loading and saving works perfectly fine.

func load_game():

var save_file = File.new()
if not save_file.file_exists(save_filename):
    return

var saved_nodes = get_tree().get_nodes_in_group("Saved")

for node in saved_nodes:
    node.queue_free()

save_file.open(save_filename,File.READ)
while save_file.get_position() < save_file.get_len():
    var node_data = parse_json(save_file.get_line())
    var new_obj = load(node_data.filename).instance()
    get_node(node_data.parent).call_deferred('add_child',new_obj)
    new_obj.load_save_stats(node_data)


text:
What are the pros and cons of having assets in one file versus multiple files?
Some games have all their assets in one .pak file or something. Or have all their textures in a single atlas. Others have their different assets in different files.
What are the pros and cons of each approach?

I discuss some of these benefits and complications in an existing answer here, if that might be of some help.


text:
weird white outline on dropdown menu in unity
I have a dropdown and whenever I click it, this happens:

How do I get rid of these outlines?
It seems to be caused by the dropdown object that gets spawned not letting you set the background color for it — so how do I do that?


text:
How do you handle collision with a sprite?
I'm in the process of learning C++ and SDL2 and I'm trying to add a sprite to my player which is currently a rectangle. I've managed to get the sprite showing on the screen, however, I've run into a few issues such as the sprite not being positioned properly with the rectangle so it's like in the bottom right corner and going through solid objects and the sprite is positioned in the center, but the cube is a bit bigger so when colliding with walls or something above there is a bit of a gap. So I've been struggling a bit curious to see what I could do differently.
Player::Player(SDL_Renderer* renderer) : sprite(renderer, "assets/Spritesheet/Ninja Frog/Idle (32x32).png", 11, 32, 32) {
    printf("Player Ctor\n");
    position = Vector2(100, 100);
    velocity = Vector2(0, 0);
    size = Size(32 * 2, 32 * 2);
}

void Player::checkCollision(const std::vector<SDL_Rect>& rectangles) {
    for (auto rect : rectangles) {
        if (position.getX() < rect.x + rect.w &&
            position.getX() + size.getWidth() > rect.x &&
            position.getY() < rect.y + rect.h &&
            position.getY() + size.getHeight() > rect.y) {
            // Collision Detected

            // Determine which side the collision occurred on
            double leftCollision = std::fabs((position.getX() + size.getWidth()) - rect.x);
            double rightCollision = std::fabs(position.getX() - (rect.x + rect.w));
            double topCollision = std::fabs((position.getY() + size.getHeight()) - rect.y);
            double bottomCollision = std::fabs(position.getY() - (rect.y + rect.h));

            // Determine the minimum collision distance
            std::vector<double> collisions = { leftCollision, rightCollision, topCollision, bottomCollision };
            double minCollision = *std::min_element(collisions.begin(), collisions.end());

            if (minCollision == leftCollision) {
                // Collision on the left side of the player
                position.setX(rect.x - size.getWidth());
            }
            else if (minCollision == rightCollision) {
                // Collision on the right side of the player
                position.setX(rect.x + rect.w);
            }
            else if (minCollision == topCollision) {
                // Collision on the top side of the player
                position.setY(rect.y - size.getHeight());
                velocity.setY(0);
                isGrounded = true;
                jumpsLeft = totalJumps;
                coyoteTimeCounter = coyoteTime;
            }
            else if (minCollision == bottomCollision) {
                // Collision on the bottom side of the player
                position.setY(rect.y + rect.h);
                velocity.setY(0);
            }
        }
    }
}

void Player::draw(SDL_Renderer* renderer) {
    //SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
    //SDL_Rect rect = { position.getX(), position.getY(), size.getWidth(), size.getHeight() };
    //SDL_RenderFillRect(renderer, &rect);

    sprite.draw(renderer, position.getX(), position.getY(), size.getWidth(), size.getHeight());
}

void Sprite::draw(SDL_Renderer* renderer, int x, int y, int width, int height) {
    SDL_Rect dstRect;
    dstRect.x = x;
    dstRect.y = y;
    dstRect.w = width;
    dstRect.h = height;

    SDL_RenderCopy(renderer, texture, &frames[currentFrame], &dstRect);
}

Spatial/geometric problems are often easier to understand with a diagram or screenshot. Consider adding one to help attract better answers, faster


text:
How to apply avoidance to path following with root motion?
My Character Blueprint uses Root Motion to control locomotion (taking location and turning it into a direction to move).
However, root motion is not compatible with avoidance pathfinding such as Detour Crowd AI.
How can I obtain a navigable path which contains avoidance information? Avoidance which will navigate the Character around dynamic obstacles such as other Characters.

Here's something of a solution I've thought of. Constantly ray cast in direct of travel to as far as the Character will be in 1 second (depending on speed).
If it hits something, start checking at 45 degree angles (trying forwards diagonals, sideways, back diagonals, then backwards) for an empty space until it doesn't hit something.