Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

151 Neutral

About WhateverMan

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I Did some GeoGebra magic today and found some usefull information, tho I'm not entirely sure on how to get the same information in Coding wise. ?As I thought I have to make use of DotProduct and CrossProduct. With DotProduct I can easly create scalar projections of Perpendicular points Using this formula:   ap = p - a ?ab = b - a sp = dot(ap,ab.normalized)   where: ap is the vector from a to p ab is the vector from a to b sp is the scalar projection of p on ab (float)   to get the actual normal point on ab we can write normalPoint = a + (ab.normalized * sp)   Now the Cross product is the bit I dont quite get yet, it always seems to be zero or simmilar to the normalPoint, any tips? ?On the chart, my simple questions are, how to find A1, B1 and T. (Basically they would be mapped on the waypoint node as "RacingLinePoint" but first the magic... ?Edit: The radius of the racing line comes from this formula: ArcR_radius =? (C1T / 2) + ((A1B1 * A1B1) / 8 * C1T) The variables are on the graph..
  2. I have an interesting idea, could Projectile Trajectory do the trick?
  3. ?This is something that I do at the moment, I'm making the AI to look ahead to get the next waypoint and then set the steering with a small offset factor that is calculated with the sections angle to get some more precise "racing line" feel, but this method actually makes the same mistakes for every driver at same corners, because there is no actual racing line to follow.   i yh?And OT. w Exactly, why is the forum doing such tricks??? I press enter go to a new line, write something and boom, it's back on the start of the line, you dont imagine how many times I have rewriten my posts because of this bug. In case what i ment with "i yh?And OT. w", it was ment to be And OT.(Off topic) why i... this is just stupid, what ever is refreshing the forum, make it stop lol. I want to speak about AI not the bugs of this forum
  4. ?I'm down to find something similar to this. As far as my mind can figure, is that the raceline is calculated from current and next waypoint, not entirely sure how that's the reason I posted here. Neural network seems interesting, but I like to keep the code as simple as possible.
  5. So the aproach I', creating my track at the moment is simmilar to 3d lofting, the track is a list of Segments, each segment has sideA, sideB and a center node.   ?I created an AI algorythm that almost mimics the racing line behaviour, but at straights it centers  to the track which is not that "ideal". So I figured why not add an ideal line node to the segmet aswell, so the AI can actually follow these points. ?In real life I know how a raceline is formed, but I would like to create a script that auto populates these "ideal nodes". So ideas are welcome. ?Here's an image of showing what I'm after. So according to the image, to draw the racing line, it needs to start from the outside of the track, go inside near apex and exit outside again. I've got a feeling that this is achievable with a DotProduct trick. Am I right?
  6. And here's a quick example of the "working" method. As you can see it's far from perfect, the reflections jump from time to time, because of the ray checking for the road beneath. And the main problem with the normals, sometimes the reflections get "cut" from their original reflection direction.
  7. This is what I did and I got some awkward results, I'm thinking it's because of some normal's are not properly calculated in the shader. This is my result:   As you can see the reflections are quite messed up by the normals  
  8. Hello, I recently played NFS U2 and noticed that the road reflections are quite accurate, compared to SSRR methods. It's mighty fast aswell, since I can play the game maxed out on a laptop, while SSRR is quite impossible on a laptop. I'm writing code(C#) and shaders in Unity 5 if thats important to point out. So here is a video I found on youtube wich describes the reflections quite well: My personal guess is that there is a small mix of screenspace rendering and a cubemap going on? Because I tryed a mirrored cubemap rendering method and the results were not as good. Infact they were terrible. I had 2 different results, one of where the reflected ground was hanging way beyond the reflection plane and the other had some normal issues, but was more accurate. Both required a cliping point input wich I calculated with a raycast under the camera. Not the best way to do it, but it worked for testing. Here is a Unity3d link for the mirrored cubemap renderer method (not mine but the basics are the same): http://twiik.net/projects/realtime-reflection-example-scene Here are some screenshots I took from the video, on the left is the original and on the right is the mirrored view, for comparsion.   Another guess would be that there is some sort of a rendering matrix, and the rendered image is wisely placed along the surface?! And exucuse me for my bad descriptions, english is not my natural language and my grammar might be of.
  9. WhateverMan

    [Car Physics] Turbochargers and friends

    That is correct, but how do you but all of this in code where you have basically "baked" data. There are no ignition timing or air-fuel-ratio. You have a Dyno curve for power and a the opposite for engine braking.   It would be really interesting to see if someone can combine the real theory with programming ways!
  10. WhateverMan

    [Car Physics] Turbochargers and friends

    As far as I know backfire occurs when there is a significant change in engine compression(friction torque for programmers), lets say from -60 to -120. Such a change is critical and causes the engine to pop flames through exhaust. I use this method, but theres also some logic and timing into it otherwise you get mad explosions every now and then. In my GTR35 video, where the backfire sound is to loud, you can hear when it occurs. I'm not saying this is the way its done, but this is how I think it works. I've been watching alot of race material for reference and serious backfire only occurs on down shifts and sometimes while coasting all of wich lead to a conclusion that it's caused by the change of compression. As for rFactor, I only played with the values and did tests and thats how I figured it out, also there is some info around the net that confirms that this is how they did it. If I'm wrong (I think I'm not...) then id like to hear the truth. Atleast what I figured out, works for me perfectly.
  11. WhateverMan

    [Car Physics] Turbochargers and friends

    Thanks! Well in my case I'm using Unity3d as the game engine but I did a complete overhaul on the shaders and physics. Once Unity dies, I'll be ready for a custom game engine. About the job, was this ment for the thread author or both of us?     I think I did my diffs the same way as Kunos. Also I'm not completely locking the diff, I'm doing what rFactor did, pumpTorque as the locking torque and poer/coast ratios to define the locking ammount in the specifyed direction. If it helps then the way I deffined wich way the diff is locking was quite simple. If driveTorque>0 then it was power locking and otherwise it was coast locking. I'm pretty bad in english when it comes to really detailed sentences, so I hope you understood what I was trying to say. Also about pacejka combining, Beckman's method is the best. And SAE low peed friction model at 400hz or 1000hz works perfectly well, this is how I got my simulation stable now. But what I did notice is that something gets lost when doing the simulation through a .dll lib. Its funny because the code in my C# version and C++ version are identical in every aspect, but the C++ version works with a small bug. Some small, really small values wobble making the car unstable at some point. And the funny thing is that I dont know which values they are, is it the differential or the tires... but what I do know is that at high speed when going straight the car wants to do a long repetive S on the road, going from left to right and back like a sine wave. I tryed to trace down the values in debug mode, but the numbers are really really small. ALSO about drift cars, what I said earlyer, 52/48 was 52% on the front and 48% on the back. Drift cars are Front Rear Layout cars. You need more weight on the front because you controll with your wheels and lighter rear to get more wheel spin. Later you use rear wings aerodynamics to balance the angles with speed requirement.  
  12. WhateverMan

    [Car Physics] Turbochargers and friends

      Oh man, yes you are drift cars are mostly 52-48 balanced. As for diffs, I'm not sure If you got everything right here. I'd recomend over check things, I dont remember exactly how they were working, but the reference material I used thought me somethign different. Tire model, belive it or not, I'm using the old pacejka89 tire model. And it gets driftign done pretty well. You can try out my demo if youd like, https://www.dropbox.com/s/h69ochlmqdxbgwr/MoDyEn%20Bryce%20Canyon.rar?dl=0 If you want I can provide a quick drift setup to it aswell, or watch forza4 drift setup videos on the tube and apply the same to my physics. Your video is awesome!!! I really love your work, it feels natural and youve got the tire sounds pretty nicely done. Heres my video on the same track I'll add a drift video to to show what the tire model is capable of.
  13. WhateverMan

    [Car Physics] Turbochargers and friends

        Exactly, you can have different ratio, I actually call it bias and it's only used for awd differentials where you have a central diff that splits more of the torque to the back or front, as required. Lets say an Audi R8 AWD has  30% on the front and 70% on the back, making it a bit oversteery and well balanced for the required situation. Basically you never want a 50/50 split AWD sports car, it will end up in a tree eventually. You always want some oversteer on sportscars to have the abilty to "play around". Wich imo reminds me if Audi R8 had an upen diff in the front and limited slip in the back, can somebody correct me? As for turbos, I'm using a supercharger method at the moment, the same method that is used in rFactor1. It's about the same as you described, but I have some factors to define how much it spools for its power per rpm and how much torque it produces or decreases. If you didnt allready know then with turbos you can sometimes actually take power  when you want to add power, usually heavily boosted cars have les torque on the lower rpm but as the turbo kicks in you gain more hp's ebcause the action happens at high rpm's. But this also adds torque after the turbo is spooled up. Turbos are really fun and if you do them right then you get a huge improvement. I for example made a drift car and once I added my boost script it instantly made it a better drift car because you get a lot more action on engine output. I hope this info was usefull, also how have things gone with your sim? I'm glad to see that you're still working on it!
  14. WhateverMan

    Planar reflections on non planar surfaces... help

    Thanks for the reply! As for the method I use, I'm actually rendering a cubemap not a single mirror camera. The cubemap is rendered at the oposite direction of the camera making non planar reflections possible, but they can still only be aplied to planar surface, because the cubemap requires the transforms pivot center. there also is one bug with the reflection normals, but with a material that has roughness it's barely noticable. The only problem I encounter currently is that when the cameras tranform position is changed by position and rotation, the render gets distorted, so I just need to figure out the math to translate the variables correctly.
  15. Well I ran into a simple problem, where I'm rendering planar reflections and I need to find a value that probably requires trigonometry. Why did I not take the trigonometry classes when I was at school... So my question is how to I calculate the rendering cameras height offset, If I know the cameras angle of rotation and the radius of its orbital movements? This formula seems to give quite promissing results, angle * sin(radius) but still quite not the same thing, theres some minimal height movement that messes up the visuals pretty baddly if the cameras angle of raotation gets to high.   I suspect it'sa simple formula of trigonometry Any ideas?   Oh and this is a planar reflection for non planar surfaces, banked roads for example. It works ok if the camera rotation angle is 0. But as soon as the cameras rotation angle get changed, the camera gets an offset.     Heres a screen of how the reflections currently work: [attachment=25438:planar realtime.JPG] The theory behind this is quite simple. There is a realtime cubemap rendering camera under the scene camera, so it renders the mirrored reflections.  
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!