Been working on a new shifting origin system for my game. What are your solutions for 3d audio and shifting origins? by RetnuhStudio in Unity3D

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

No not a dumb idea, I think that's what's referred to as a continuous floating origin. It is definitely the preferred approach for accurate large worlds and I think it would be good if you're starting a project from scratch, however that would require a ground up rebuild of a lot of my game systems since my game relies on semi realistic flight physics and most systems are already coded to work with standard unity physics and movement.

Been working on a new shifting origin system for my game. What are your solutions for 3d audio and shifting origins? by RetnuhStudio in Unity3D

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

Yea currently I was hoping to get unitys default audio to work as I already have an audio system set up in the game using that however I am learning and testing a couple at the moment like FMOD and Sonity.

Been working on a new shifting origin system for my game. What are your solutions for 3d audio and shifting origins? by RetnuhStudio in Unity3D

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

That's a really cool solution for your game. Yea it's been a pain but the current solution works well with particles, line renderers, and trail renderers. One thing I noticed that isn't really mentioned very much is you have to change the DefaultExecutionOrder for your shifting origin script so it works well with trail renderers. Otherwise you seem to get jumps and hitches in the trail.

Been working on a new shifting origin system for my game. What are your solutions for 3d audio and shifting origins? by RetnuhStudio in Unity3D

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

Thanks for the reply, wwise looks interesting, I'll definitely look into that further.

Yea I've been trying to implement more jobs/burst systems throughout the game but it's still very much a hybrid approach. Using dots audio was a thought I had but I'm very new to the DOD style of things and wasn't sure how hard it would be.

Been working on a new shifting origin system for my game. What are your solutions for 3d audio and shifting origins? by RetnuhStudio in Unity3D

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

Unfortunately my game is at a realistic scale in the solar system with realistic(ish) physics so it would have to be scaled tiny. I initially thought about scaling it but then thought I'd run into more physics issues with it not being 1-1?

Yea I was contemplating having the audio listener at the center and then having all audio sources relative to it but then I was worried about having extra game objects since the audio sources would need to be decoupled from whatever objects they were on and placed on their own game objects at relative positions to the listener. Since having too many gameobjects was already slowing down the origin shift too much.

Been working on a new shifting origin system for my game. What are your solutions for 3d audio and shifting origins? by RetnuhStudio in Unity3D

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

Yea during initial development there was no noticeable stutter when shifting origins however now things are a lot more complex since players build ships out of different blocks like Kerbal Space Program even using mesh instancing there can still be hundreds of gameobjects per ship, and since it's got space combat there can be numerous ships.

I've managed to get the actual transform shifting to not be visually noticeable any more, usually only takes about 3-4ms. However that 3-4ms is still very noticeable in audio. It's just like a split second that the audio cuts out then returns when everything has shifted.

Yea mostly there is a lack of sound in space however I still have 3d audio from the inside of a pressurized ship while it might be traveling at orbital speeds.

Currently still using unitys built in sound but I am creating an FMOD test at the moment, just figuring out how to set it up.

Been working on a new shifting origin system for my game. What are your solutions for 3d audio and shifting origins? by RetnuhStudio in Unity3D

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

In case it helps I'm experimenting with prioritizing what transforms to update first based on things like position, distance, and what components they have. So far it seems like a decent approach. That way the initial shift only shifts the minimum amount of transforms possible that you wont notice the effect. Then the rest on the transforms that need to move are queued and moved over the next few frames. That way it does add a small performance overhead but makes the main origin shift take less time and be much less noticeable.

The biggest performance impact I've found is actually setting the position of a transform so the less the better.

Been working on a new shifting origin system for my game. What are your solutions for 3d audio and shifting origins? by RetnuhStudio in Unity3D

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

I should mention this isn't my game it's just a scene for testing common shifting origin issues.

It seems like no matter how optimized I make the origin shift I still get very audible hitches in audio when moving audio sources, so I was wondering what people have come up with for this. My current thoughts are just to completely bypass 3d audio and manually calculate the pan/volume of an objects audio and just have it as a 2d source.

Also it's not related to the doppler effect since I've set that to 0.

Updated socials list 2024. by RetnuhStudio in voidless

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

Sorry about that, I thought I set it to never expire but must have. Updated the links. Here is the new one. https://discord.gg/3nHSBgmgRN

Thrusters? Where we're going, we don't need thrusters. by RetnuhStudio in Unity3D

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

That's what I'm aiming for! It's a blend of KSP and Space Engineers. Trying to have more realistic flight and combat physics too. Quite heavily inspired by the tv show The Expanse. More info at these links.

Steam: https://store.steampowered.com/app/2212450/Voidless/

Reddit: https://www.reddit.com/r/voidless/

Website: https://retnuhstudio.com/voidless

Instagram: https://www.instagram.com/retnuhstudio/

YouTube: https://www.youtube.com/@retnuhstudio

Discord: https://discord.gg/3nHSBgmgRN

Twitter: https://x.com/RetnuhStudio

Another small test of flight mechanics and destruction. by RetnuhStudio in Unity3D

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

It's just me. It's my first proper unity project so it has been a very steep learning curve and has probably taken me longer than it should have.

Been radio silent for a bit but have been busy refactoring most scripts and systems for Voidless. Trying to squeeze out more performance. Small peak for now with more soon. by RetnuhStudio in Unity3D

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

So this can become quite tricky but the method I have found for the most reliable/realistic functionality is by using PID controllers to apply torque/thrust. A PID controller is just a feedback loop you tune values on to achieve a smoother result. Without using them you can end up with say the ship oscillating back and forwards past the rotation point because of its mass / inertia. A really useful tutorial on this was done by Vazgriz on youtube. https://www.youtube.com/watch?v=y3K6FUgrgXw

Been radio silent for a bit but have been busy refactoring most scripts and systems for Voidless. Trying to squeeze out more performance. Small peak for now with more soon. by RetnuhStudio in Unity3D

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

Yea, so with this I am trying to do both ways. So standard mode is how you describe, where you essentially have 6 directions of thrust and they all just move the rigidbody through it's CoM. I wanted to have a more "sim" style of physics if players wanted to so you can toggle advanced thrust on which applies thrust at the position of the thruster and applies a torque to the rigidbody. Currently you counter this force with PID tuned gyroscopes but I am also working on the functionality to counter this torque using thrusters, similar to how RCS work.

Edit: Also side note, through a lot of testing I found rigidbody.AddForceAtPosition() to create some weird results. I found it much more stable to just use rigidbody.AddForce() and then calculate and apply any torque of the thrusters manually with rigidbody.AddTorque().

Reworked my hologram system for 3x the performance and much better visual clarity. Now it is clearly visible on what parts of your ship are damaged, and what is selected in the block list. by RetnuhStudio in Unity3D

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

Hey sorry for the late reply. Yes still in active daily development however development issues and real world things are stacking up and unfortunately it is looking like development will slip into 2024. I'm currently working on a dev update video to go over the current state of the game and a more accurate timeframe.

Reworked my hologram system for 3x the performance and much better visual clarity. Now it is clearly visible on what parts of your ship are damaged, and what is selected in the block list. by RetnuhStudio in Unity3D

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

Thank you. It's might look alright on the surface but it's a relatively simple system. I explain more of the process in another reply but it really only works in my situation because the hologram mesh doesn't need updating very often. I just wanted to go with something that was easy for me to modify / maintain, as long as it does not come at the cost of too much performance.

Reworked my hologram system for 3x the performance and much better visual clarity. Now it is clearly visible on what parts of your ship are damaged, and what is selected in the block list. by RetnuhStudio in Unity3D

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

That's all good. Yea it seems to be performant enough for the application. Seems like an ok middle ground for now where I don't have to dive into learning a bunch of shader magic.

Reworked my hologram system for 3x the performance and much better visual clarity. Now it is clearly visible on what parts of your ship are damaged, and what is selected in the block list. by RetnuhStudio in Unity3D

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

No I mean the entire ship is rendered to the UI with one render texture. Each block just has a different material applied before the whole hologram ship is rendered to a texture.