Download

Math, Please Help :P

Hi, Sorry if this is in the wrong section I didnt know where to put it :o

I am currently trying to compute a racing line(I have allready baked the centre line and have a array of points equally spaced along the track)
To compute the racing line from this centre line I am following this article
http://game.itu.dk/cig2010/proceedings/papers/cig10_048_083.pdf
The problem is my math is simply not up to the task and I am completely out of my depth :(.
Can anyone help explain or dummify some of the formula’s?
I am currently reading the ‘Shortest Path’ section(Page 389 Section B). I understand everything untill the matrix and 1xn vector variables are introduced, and then i get even more confused when the quadratic function is introduced.:stuck_out_tongue: (Formula 2 and 3, Below is a screenshot).
f8baa76e50ad40e9d91dcb43a01b6cddb5057eaa.png
Any help understanding quadratic’s and matrix’s or just these forumlea in a general(links, tuts) or anything would be great :stuck_out_tongue:

I’m not sure about the math, but could you use navigation? Have an actor on the car and use the navigation to calculate the distance to each point on the track and use that to determine which point to use.

Sorry, I don’t think i was clear in my explanation. I have no problem getting the AI to follow the points, my current problem is baking the ‘racing’ line based on the ‘center’ line and the track bounds.

I’m sorry, here is a bit more explanation. Get the all the points on the track near the player and use https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/AI/Navigation/UNavigationSystem/GetPathLength/1/index.html to get the point with the shortest length. Then, using a spline or however you draw the line, connect it from the player to that point.

Imgur

You will need to guess your alpha value in order to obtain the best possible SP. You might want to start with a value of 0, with a step size of 0.01 or lower if you want higher accuracy, or 0.1 if you want faster computation. Keep in mind that you will need to do this guessing for each segment of the race track, since there is a different alpha value at every row of the matrix.

Interesting problem, and good luck further! :slight_smile:

Thank you for the replies! Pretty sure I can get this done now, well the shortest path at least :stuck_out_tongue:
I don’t pretend to fully understand the math now(Few more days or reading) but I at least can now read the sums :smiley:
Any more information anyone has would be great!