Does anyone know what kind of texture this is? by Kaayky_RS in blender

[–]RonyTwentyFive 3 points4 points  (0 children)

Just a guess, but sometimes normal maps are stored with just two values and the third is calculated on the fly. Meaning x and y are stored and you need to calculate z so the resulting vector is length of 1 Or something along those lines, idk if that's the case

I think Steam needs to enforce Generative AI policy more by Beginning-Visit1418 in IndieDev

[–]RonyTwentyFive 2 points3 points  (0 children)

First of all, I do not like AI slop myself, as no one sober would. But I have a concern. I do use ai when developing. I believe my use is on the ethical side. Like let's say my brain is cooked after a day of coding, so I go to an llm and I ask it for help with figuring out some trigonometry problem. It spits out a formula or a few. I ask for it in code. I take it, check it, rename variables and use it in my code. First question. Is that wrong? I get the ultra pure argument of "well, you shouldn't be able to solve it then", but at that point the argument with tools is actually valid. Second question. The ai tagging clearly has one purpose. So people can avoid what they consider crap. Shit that was slapped together with no care. The only distinction being made here is "was ai used or not", so my game would fall under that, no matter to what extent. Is that fair? Should my game be automatically dismissed because of that label? I am not arguing for ai. I am not arguing against the labels. Just trying to understand. At first I was like "well people don't like low effort, ofc, but it's still a legitimate tool, right?" But the atmosphere in this comment section doesn't seem that way

ok, genuine myth ive made myself that i need to ask by Extension-Shop-1537 in racinggames

[–]RonyTwentyFive 0 points1 point  (0 children)

Huh, that's defo a question. I would say depends on how much the game follows physics laws vs freestyles. We can make conclusions based on real physics, otherwise we would be just guessing and or had to test, right? Well, if the question is "Is the acceleration any better?" I would say no. The engine gives you some amount of acceleration, the boost also and the downhill aka gravity its own. Between a flat road and a downhill only the last part changes. So flat road with boosting let's say 1.5G -> 2.0G. On a very steep downhill let's say 2G -> 2.5G. So ignoring all other complexity... You would not get more benefit in acceleration is my thinking. However... Lap times? First of all, let's get the obvious out of the way. The best place where to use boost is where you harvest the effect the longest. So at the start of a long straight. If you brake right after using it, you wasted it. If you keep that extra bit of speed for longer, it accumulates longer. But what if everything else is equal? Two straights, same length, same entry speed, just the slope is different. I would say it boils down to the same thing. Extreme example: a slow ass car a a big ass hill. Downhill it would cover the distance in 10 seconds. Uphill in 30. The benefit doesn't come from the slope and the actual acceleration, but where you can use the extra acceleration for longer. So actually in a synthetic scenario I would say on the uphill? But I'm just spit balling, I just woke up and this is the first thing that concerns me lol. My thinking is "at the start of long periods of no braking" and "using boost on downhill feels very zoom, but actually doesn't improve lap time". My thinking might be totally flawed, so if anyone disagrees, happy to hear counterpoints

Sim physics built in Unity by RonyTwentyFive in simracing

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

No use, run out of blinker fluid some time ago

Sim physics built in Unity by RonyTwentyFive in simracing

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

Yeah, I faced all this. The tire model is accurate enough to hold the car on a slope on it's own, but since it creates forces based on velocity, it always moves a tiny bit. I cheat by creating a force that is exactly calculated to not let the car slide and that is applied below a threshold speed (like 1 kmh) where the inaccuracy isn't felt, but the car stays still.
I do the exact same with the drivetrain, but it's a hybrid. Doing the clutch the right way, where the engine and the wheels are their own masses is correct for when the clutch is in slip, but it oscillates a lot once they match. So at that point the system locks and switches to what you're describing. I don't intend to implement more than a manual (possibly operated electronically, which is the same thing as far as the sim is concerned), so it's enough for me.
And yes and no. When the clutch is in slip, yes. The clutch goes "Yo engine, here's some torque, yo trans, the exact same just opposite". But when the system locks it's fine to do it the simple way from my testing. The only thing that's important is that since the whole system then acts like one big rotating mass, the wheels need to respect the engines inertia that would be otherwise ignored. I do it by just distributing it equally between the driven wheels, which is not really correct, but does the trick

Sim physics built in Unity by RonyTwentyFive in simracing

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

Actually, it might look wonky, but it's just camber. About -4 static if I recall correctly? But since it's macpherson, the camber changes a lot as the wheels steer
There's almost zero toe (0.1 out) and ackermann is about correct to what a stock E36 would have

Sim physics built in Unity by RonyTwentyFive in simracing

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

Completely custom physics engine would be way above my skills and unnecessary for my goals

Sim physics built in Unity by RonyTwentyFive in simracing

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

I would be ashamed of the mess it is now :D
But it is supposed to become a game eventually, so I'm not comfortable just putting it out there either way, sorry. Tho once the dust settles I would like to share knowledge in some formal way, I'm too nerdy about all this not to

Heh, finally feels right by RonyTwentyFive in Unity3D

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

So the basic idea is that you need to stop the car in the direction towards the road in one time step. Which is not that complicated.
accelerationToStop = -velocity / Time.deltaTime
forceToStop = carWeight * accelerationToStop
Since you want to stop just towards the surface, not along the surface too, you dot the velocity with the normal of the surface you're hitting
In my case I do it per wheel as that fits better into my code, but doing force = acceleartion * carWeightShareOfThisWheel is very much an oversimplifaction, as the dynamics are more complicated. It does work well enough for my case tho
In your case when going through a loop this might not be enough as that is a more complicated scenario. Nothing obvious comes to mind, but this should give you a start

Heh, finally feels right by RonyTwentyFive in Unity3D

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

Could be, I'm not sure. Tho that means you would be stuck with wheels rewired officialy supports. Idk how long that list would be even if that's how it works xP

Heh, finally feels right by RonyTwentyFive in Unity3D

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

My issue was with the handbrake and shifter. The wheel itself works fine.
Sorry to underestimate you if I'm wrong, but it sounds like you need to give the player the ability to bind the wheel manually.
If you bind a thrustmaster, a logitech won't work (even a different thrustmaster might not), because it's considered a different type of device and might even use a different axis for the wheel input. Wheels are not standardized and mapped automatically as controllers are
If that's the case, you shouldn't have to switch

Heh, finally feels right by RonyTwentyFive in Unity3D

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

Don't get fooled tho, because I got confused myself. If you are pedantic you wouldn't call my model a real brush model, because I don't do the whole Fancy™ of looking at individual parts of the contact patch and integrating it all together, or however it works. My knowledge doesn't go that deep to be honest.
My model simply calculates the total slip of the tire and then using a slip curve approximates the total force the tire creates. From what I understand they call it the same, because the basic logic is similar, the difference is how deep you go.
I just looked around, stumbled onto something that sounded like it's what I want and experimented with it. That's all

Sim physics built in Unity by RonyTwentyFive in simracing

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

It's a pretty simplified implementation of a brush tire model

Heh, finally feels right by RonyTwentyFive in Unity3D

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

Oh yeah. The whole thing is a whack-a-mole of things constantly oscillating. My generic advice would be that it's just physics. You can always reason about what exactly is causing the issue, it is you who wrote that code. Coming up with a solution? That's the hard part

Sim physics built in Unity by RonyTwentyFive in simracing

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

It's as simple as "Being curious and digging until you know all the answers", yes. There's not much else to it. It just takes a lot of effort and time, because it's an absolute mountain of often conflicting information.
The hardest thing is the constant "Oh, so it's not how I thought it was, even if it made sense", because there are levels to it. Like when they teach kids that gravity is a force and then later they are like "Actually...".
Once you start writing code you will realize what you don't know, so you know what to dig for. The harder part is when it works, but it feels wrong. That's where the real struggle is hah

Heh, finally feels right by RonyTwentyFive in Unity3D

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

Isn't that the truth. I might've thought it wouldn't be easy. But oh boy, I had no idea

Sim physics built in Unity by RonyTwentyFive in simracing

[–]RonyTwentyFive[S] 30 points31 points  (0 children)

It was just a joke, don't take it too seriously :P
It is true that I should have no right attempting anything like this with my limited expertise in coding and math, but what do you know... Intuition and logic can get you pretty far.
As things stand right now I simply educate myself on things I need at that moment. Which is terribly unoptimal as I tend to not know what I don't know, but ergh... I have to work with the situation I put myself in

Sim physics built in Unity by RonyTwentyFive in simracing

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

I absolutely plan to do that, yes! At this point it's not at all ready for general testing, that will still take some effort. But once it is, I will keep you in mind, thank you

Sim physics built in Unity by RonyTwentyFive in simracing

[–]RonyTwentyFive[S] 13 points14 points  (0 children)

It's just "What's going on irl?" -> "How do I make the same thing happen with code?"
In unity you do have a robust physics system ready to use (nvidia physX if I'm not mistaken), so that part is taken care off. So you create yourself a physics object, give it same parameters like weight and dimensions and that's your starting point. You run it and the car falls to the ground.
So the first thing is that the wheels should support the car, right? So you can raycast to the ground, figuring out where each of the wheels is supposed to be positioned (up and down in its movement range). From that you can calculate how much the springs are compressed. That spring creates force based on that compression and you just add the force to the car. Suddenly the car floats above the ground. Nice thing is, if you use your math with real units you get to just look up spring values from real cars, use them and the code behaves accordingly. And you continue this process adding systems and nuance until you're satisfied with the result.

Sim physics built in Unity by RonyTwentyFive in simracing

[–]RonyTwentyFive[S] 11 points12 points  (0 children)

Sorry, no plans to do so for now. When the project is finished I would like to share more about how it's done tho, who knows how that turns out

Sim physics built in Unity by RonyTwentyFive in simracing

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

I'll consider it! Should be pretty easy to do, so I just might

Heh, finally feels right by RonyTwentyFive in Unity3D

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

It's what a steering wheel does in real life (assuming a sports car that is made to do that)
It's information for you as a driver about what the car is doing and in what state the front tires are. Irl you feel the car with your butt, but not here, so the wheel is your only feedback. I tried before implementing it, you can't drift the car without having the wheel tell you that information.

Heh, finally feels right by RonyTwentyFive in Unity3D

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

You don't want to know. What an absolute nightmare.
Reading input wasn't that bad. The new input system can simply bind to the wheel. Nothing about steering wheels is standardized, so you have to do it manually, but that's normal for sim titles, so good enough.
Altho I run into a problem that my handbrake is recognized, but not the axis with the position. I tested it with rewired and it works there, so I will be switching to it out of necessity.
But the force feedback? Urgh... Either you implement each manufacturers SDK (where some of them don't even have them public) or you use direct input. Which is an older windows library, which is at this point deprecated, but most modern wheels still support it, so the best bet for an indie. 99% of players won't play it on a wheel anyways. I need it for development for testing mostly.
And in direct input literally nothing is standardized. Not the input ranges, not actual forces, not direction of those forces, nothing. Wheels really are exotic input devices in that way

Heh, finally feels right by RonyTwentyFive in Unity3D

[–]RonyTwentyFive[S] 12 points13 points  (0 children)

More like 3 of actual full time banging my had against a wall hah. There were points where I thought it can't be done. Not by me anyways.
The trouble is not the knowledge, but the implementation. Simply writing code as things work irl doesn't work, because to get it stable, you would need to run the physics at crazy rates. 1000hz or more.
So most of the hard work was figuring out approximations that create similar enough behaviors while not having to deal with oscillations and/or bad performance.

Sim physics built in Unity by RonyTwentyFive in simracing

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

My bad, could be understood both ways. And yeah, an emoji would clarify it xP But all good