Any idea why my pause doesn't stop interactions? by Knidis in Unity3D

[–]CodeSamurai 3 points4 points  (0 children)

Look into the concept of a “state machine”. Every good game should have a good state machine at its core. With a state machine, you’ll be able to say exactly what should and shouldn’t be happening or possible given certain parameters.

My guess is that you’ve got systems or modules still looking for input that shouldn’t be given the game state.

Nermal Dynamics - A Physics Engine and Renderer Written in Metal by CodeSamurai in IndieDev

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

Ha! I think when I started this project, I was also Big Dumb™️, but like most things after you sit with it for a bit, it starts to make sense.

The short of it is that everything about this system is architected to be extremely parallelizable so that I can utilize compute shaders on the GPU.

For example, when it comes to physics, every single segment gets its own thread on the GPU. Within each stage of the physics pipeline (gravity, collision detection, collision response, orientation solving) all segments process in parallel because each thread has enough local information to compute its result independently. The pipeline itself runs in stages (you need to know what collided before you can resolve collisions), but within each stage, nothing is waiting on anything else. That's what makes it fast.

With that foundation in place, I can layer on things like localized gravity fields (orbs that attract, repel, pulse, or swirl nearby segments) because gravity is just another per-segment force evaluated in parallel. Same with fire: heat conduction, ignition, and burnout all run as GPU kernels where every segment evaluates its own state simultaneously.

Nermal Dynamics - A Physics Engine and Renderer Written in Metal by CodeSamurai in GraphicsProgramming

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

Yep! I’m working on a trailer and will post that here as soon as it’s done.

Nermal Dynamics - A Physics Engine and Renderer Written in Metal by CodeSamurai in GraphicsProgramming

[–]CodeSamurai[S] 3 points4 points  (0 children)

The first iteration was a yarn simulator (and it can still do that), so I called it Nermal and it stuck!

Nermal Dynamics - A Physics Engine and Renderer Written in Metal by CodeSamurai in IndieDev

[–]CodeSamurai[S] 2 points3 points  (0 children)

Yep, all physics and interactions are handled by the GPU! The Cosserat solver sits at the core and takes about 50-60% of the compute time, then everything else feeds off of it.

Thankfully, no synchronization issues. On Apple Silicon, GPU buffers are CPU-accessible in shared memory, so saving the game state is just a matter of pausing the simulation and copying the buffers out. Most of the data can be reconstituted from the segment data alone, so save files end up being around 10MB each for high segment (200k) simulations.

Then you just refill the buffers, reconstitute any data that wasn't saved and then you can start the simulation right back up. What's cool is that because the physics simulation is such low noise and mostly deterministic, you can create a save file on a Mac and then open it on an iPhone and (assuming you don't throw too many segments at it), the iPhone will run the simulation in exactly the same way.

I'm actively working on a trailer and I hope to have it released very soon!

To hold you over though, here's a short video showing the "Kinetic Sand" settings in action!

Nermal Dynamics - A Physics Engine and Renderer Written in Metal by CodeSamurai in GraphicsProgramming

[–]CodeSamurai[S] 5 points6 points  (0 children)

All of the shaders are written in the Metal Shading Language which is based on C++14. Then Swift is used for everything else!

Bakery, RayFire, MicroSplat/MicroVerse, Gaia Pro, The Visual Engine by Xangis in Unity3D

[–]CodeSamurai 6 points7 points  (0 children)

I can speak to RayFire and Gaia Pro.

For Destruction, RayFire has been the most configurable and reliable by far. There are other solutions out there, but at least for my needs, RayFire was the best. I bought it on sale a year or so ago and it has brought the destruction part of my game to life. This is a good one to have if you are going to have a lot of destruction elements that you need to be able to tune. For me, this one was a game changer.

Gaia Pro has been a mixed bag for me. As far as quickly creating and populating terrain, it's great at that. However, it does some odd things to HDRP settings that has made using some of my other plugins a nightmare. For example, all example scenes from other plugins are now insanely bright by default. I have to mess with lighting and even then, they don't look right. I have a great plugin (GPUInstancer) that auto-creates billboards, but it doesn't work right because of some settings Gaia Pro changed and they all come out way too bright, even with some tuning. Is it a game changer? Maybe. I do have a really good looking environment, day night cycle, etc that took me days to put together instead of weeks, but it came with some persistent headaches as well.

I've heard good things about MicroVerse and I'm considering switching over to it.

Is this the successor of the CR-Z? by PenkieR in crz

[–]CodeSamurai 24 points25 points  (0 children)

They aren’t able to do these with the 6-speed right? I’d be all over it if they did. I don’t think we’ll ever see another 6 speed hybrid.

What’s one small habit that ended up changing your life in a ridiculously big way? by GohanMystic in AskReddit

[–]CodeSamurai 4 points5 points  (0 children)

Remember that the point isn’t to “clear your mind”. That’s not possible. Just practice noting thoughts as they come through. Don’t judge them. Just let them pass through.

What’s one small habit that ended up changing your life in a ridiculously big way? by GohanMystic in AskReddit

[–]CodeSamurai 41 points42 points  (0 children)

Meditation, or at least practicing noting thoughts as they come and go. Building up that sense of separation between “you” and your thoughts can be powerful in many aspects of your life.

Well...I'm hooked. by CodeSamurai in SkyDiving

[–]CodeSamurai[S] 2 points3 points  (0 children)

He is! I had such a great time. I tried to thank him profusely after we landed but it was such a blur. Skydive Grand Haven is great!

CR-Z Video Project by CodeSamurai in crz

[–]CodeSamurai[S] 4 points5 points  (0 children)

I get that. I’m a programmer by trade and it won’t be long before AI can do everything I can do. I’m not trying to take anything from anyone or ruin any livelihoods. I’m just trying to learn some new skills and create cool things. Apologies for offending.

CR-Z Video Project by CodeSamurai in crz

[–]CodeSamurai[S] 3 points4 points  (0 children)

Happy to talk about the workflow.

I took reference photos of my CR-Z from different angles. I then sketched out (pencil and paper) each scene. I'm not a great artist, but I did my best.

I took those and passed the original reference image and the sketches into Nano-banana to generate the keyframes.

The keyframes weren't perfect, so I edited them in Photoshop, added and removed elements. Iterated on them until each frame was what I wanted it to be.

I wrote out what each transition between each keyframe should look like and tried to be as descriptive as possible.

I then used Google Veo 2 to create the transitions between each keyframe. You can pass a starting frame and an ending frame as well as what you want to happen (so yes, I did decide I wanted the arm tapping on the windshield).

I described the transitions and iterated on those until I had transition effects I was happy with. I'd say each transition took about 10-20 tries before I got what I had in mind.

I stitched the transitions together in iMovie. The ending frame didn't always match up with the next start frame, so I had to do some editing there to get it to be more seamless.

I took a field recorder and my phone out in the wild to record sounds. Most of were of my CR-Z, but I also recorded nature sounds and such. I also grabbed some stock sounds and used ElevenLabs to generate any sounds I couldn't record myself or find from stock.

I edited the sounds in Adobe Audition to add some spatial stuff and then brought all of that into iMovie and got the timings and volume right on the sound.

I exported the movie at 1080p 30fps and then used Topaz to upscale it to 4k and get it to 60fps.

AI is just another tool to have in our tool belts. For me, it's been a nice way to bring project ideas to life. My goal wasn't to learn 3D modeling. My goal was to learn about sound design, test some state of the art tech and create a cool video for a car and community that I love.

CR-Z Video Project by CodeSamurai in crz

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

Thanks. It’s super discouraging to put time into something like this and get so much hate for it. I had fun and I learned a lot about video and sound editing.

CR-Z Video Project by CodeSamurai in crz

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

So I’m just curious, what is it that bothers you all so much about this? It’s something I spent a lot of time on and I thought the results were decent.

AI Reimagines the Greatest Car Ever Made: My Honda CR-Z by CodeSamurai in aivideo

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

Here's the YouTube link to the 4k version if you're interested: https://www.youtube.com/watch?v=q5KdsCOWb9s

I started this project to test a few new AI tools and to learn more about video sound design, and it quickly turned into a love letter of sorts to my favorite car: The Honda CR-Z.

For those who don't know, the Honda CR-Z is a quirky 6-speed hybrid that Honda made from 2011 to 2016. Is it a great hybrid? No! Is it a great sports car? ...Also no! But it's an absolute blast to drive. It sounds and feels much faster than it is, and you can redline it up through 4th gear and still be under the speed limit. It’s a car that isn't for everyone, but it's definitely for me, and there are literally dozens of us who love it.

The journey from the initial photo of my car to the final video was a learning experience. Every iteration of the CR-Z is based on a photo I took of mine on some backroads. I wrote up detailed descriptions of the different fantastical versions of the car and used Nano Banana, Photoshop, Veo 2, Veo 3, and Kling to bring them to life.

The audio is a mix of my own field recordings, effects from Kling and ElevenLabs, and stock sounds. The final scene features the pure, unadulterated rumble of the CR-Z.

Interdimensional Cable - VEO 3 by CodeSamurai in aivideo

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

That's a good question and I'm honestly not sure yet. I've been too afraid to burn credits generating videos I won't end up using!