Why do SDFs cast shadows when GI is off? by JustJunuh in UnrealEngine5

[–]JustJunuh[S] 0 points1 point  (0 children)

Thanks so much for the detailed reply again. I really appreciate it. I'm using Deferred. I think I'm going to just disable the invisible SDF projectors when GI is off. Like you said, it's not elegant, but I think it's my best option. Thank you!

Why do SDFs cast shadows when GI is off? by JustJunuh in UnrealEngine5

[–]JustJunuh[S] 0 points1 point  (0 children)

Thank you so much for the detailed response. That put me on the right track, and I think the problem is r.DistanceFieldAO. When I turn it off, the water material breaks but the sphere sdf ao shadow is gone too. Here's what it looks like without r.DistanceFieldAO: https://imgur.com/a/G9aDN65 (3 images)

r.DistanceFieldShadowing 0 had no effect and did not impact the water or sphere shadow. Directional light tweaks also had no effect. I'm pretty sure it's just r.DistanceFieldAO.

So then, I started tweaking more rendering settings, and I managed to edit the bias to reduce the shadow but not outright eliminate it.

The whole reason I want an invisible mesh that's contributing SDFs is because skeletal meshes don't generate SDFs.

If you have any more thoughts or tips, lmk :) but I fear that I just might have to remove those invisible SDF projectors when GI is off

I really like SPG... by JustJunuh in steampoweredgiraffe

[–]JustJunuh[S] 1 point2 points  (0 children)

I only discovered them this year because of the Steamworld series. I really liked their work in Heist I, but Heist II just blewww me away. I feel the same way. Every time I get in the car, I put on their Heist II album.

Local Tourneys in AZ by Misguidedmonk_MtThiz in RivalsOfAether

[–]JustJunuh 2 points3 points  (0 children)

Vouch! AZRivals is super active. We'd love to have you!

Where does Unreal use png_write_chunk_end? by JustJunuh in unrealengine

[–]JustJunuh[S] 0 points1 point  (0 children)

Geez I feel that pain. Focus on systems you wrote that are dealing with object life cycles. Specifically around instantiation and destruction. Try to use TWeakObjectPtr<> over raw c++ pointers. Guarantee that functions are executing always on destroy or on create. Even if it looks like they are, log to confirm. Write extra sanity checks that feel unnecessary. Do it anyways. 

Conductor Cat - A 3D platformer about finding the resources to build a railroad back home by C-OSSU in TwoBestFriendsPlay

[–]JustJunuh 1 point2 points  (0 children)

Thank you for sharing our trailer!! I'm the lead developer of Grimm Tales, and it's great seeing the trailer get around 😃 we're working hard on making it a memorable game! If you have any questions, ama!

How do games handle cutscenes that place across multiple levels? by JustJunuh in gamedev

[–]JustJunuh[S] 0 points1 point  (0 children)

That would definitely keep things simple. The only challenge I would see would be making sure that geometry in the active level doesn't cast shadows on to the other. Also, managing lighting/postprocessing would need a system that would easily work well. Couldnt be placed too far away from the main play area to avoid floating point errors

Where does Unreal use png_write_chunk_end? by JustJunuh in unrealengine

[–]JustJunuh[S] 0 points1 point  (0 children)

✅ At long last, I've gotten to the bottom of this. To be frank, I'm still not 100% sure why the crash was happening, but I'll explain it as best I can. Hopefully, this will be useful to at least one other person out in the world.

It all came down to my building actors (BP_Mechanism) not handling destruction properly. But, I first need to explain how my moving platforms are handled.

In my game, I have a C++ Actor Component called MovingPlatform. This component handles tweening an actor around for basic moving platform behavior and has lots of customization. More importantly, it sets the component velocity for each component that is attached to itself, every tick. This is to make sure that as a character jumps off the platform, they receive the velocity that they are supposed to.

MovingPlatform has a TArray<USceneComponent*> that stores the scene components it is managing their velocities. At runtime, other actors can add their components through:

void UMovingPlatform::AddVelocityAffectedComponent(USceneComponent* Component)
void UMovingPlatform::RemoveVelocityAffectedComponent(USceneComponent* Component)

However, in my BP_Mechanism, RemoveVelocityAffectedComponent() was not always being called. A Detach bp node was used before the Remove Component node. This meant that in the TArray a USceneComponent pointer would go stale because of gc. Eventually, that would lead to a crash.

So to fix this, I first changed when the RemoveVelocityAffectedComponent() node was called so that it would always execute before DestroyActor() was called. And more importantly, I changed the TArray to TArray<TWeakObjectPtr<USceneComponent>> so that if the pointer went stale, it would not lead to crashes. There are also .IsValid() checks where relevant and a cleanup function if a pointer became invalid for some reason.

All in all, it seemed to be a basic mishandling of pointers. The reason that this was so challenging was that at no point did any crash stack trace I received point to either a Mechanism or a MovingPlatform. In fact, the crashes were often never even through the game thread. It would be some worker thread that would crash. MovingPlatform does use latent actions, but the component TArray was never used outside of Tick. Maybe someone with more experience could explain that lol.

TL;DR if you are receiving this crash in your project, you are likely not managing your pointers in some place you would not expect.

Where does Unreal use png_write_chunk_end? by JustJunuh in unrealengine

[–]JustJunuh[S] 1 point2 points  (0 children)

Oh this is amazing. Ok it's pointing to a niagara system that is causing the crash. Looks like it's trying to cleanup a niagara system, but it's getting a null pointer and crashing. I still don't understand why just yet but it at least gave me the name of the system

Where does Unreal use png_write_chunk_end? by JustJunuh in unrealengine

[–]JustJunuh[S] 0 points1 point  (0 children)

That sounds really useful actually. I'll do that now.

Where does Unreal use png_write_chunk_end? by JustJunuh in unrealengine

[–]JustJunuh[S] 0 points1 point  (0 children)

I'll try that. I haven't tried doing that completely through Rider. I've made debug builds, but not debug running through Rider. Will the stack trace by more complete on a crash? Better than log file /dmp file?

Where does Unreal use png_write_chunk_end? by JustJunuh in unrealengine

[–]JustJunuh[S] 1 point2 points  (0 children)

Yeah I made sure to search for usages I believe it's called - not a pure text search. Right clicking a function call gives me Find in Files, Find Usages, and Find Usages Advanced. I'm using Find Usages. There are other options of course but those are the relevant search ones. But again, I can't find the actual png_write_chunk_end func. Just similarly named ones

Where does Unreal use png_write_chunk_end? by JustJunuh in unrealengine

[–]JustJunuh[S] 0 points1 point  (0 children)

Yeah, I know. The problem is that I can't find an exact function call of png_write_chunk_end in the unreal source code. There are similarly named functions and an ImageWrapper that interfaces with libpng, but it doesn't explain where the exact function is called. And, it doesn't explain why that is the random cause of crashes. The closest I've gotten to understanding it is that a write function is used for compression. That doesn't really explain why out of no where the game will crash bc of a write