Race car positioning system?
Me and my fellow Lovedis2 are working on a racing game named dream for speed. we managed to make cars fun to drive, a competitive AI with different names and behaviours, a good looking track that can be run in a loop and post the best lap on the scoreboard.
But we want to go further and try to add a race option to the game with car names and positions. but unfortunately i am struggling for weeks now trying to accomplish this task ending with nothing accurate or nearly working.
So, here is my question:
Have you guys any idea on how to make a dynamically self updated on screen ladder (chart) of player and AI car names and position like 1st, 2nd, etc..?
Thanks!
-
I'm not totally sure if you're also talking about the UI part of displaying the ranks, but as far as tracking, I can only think of a really complex solution. You'd need a series of tags around the course, and laser scopes in each car that transmit the distance to that tag. You'd also need zones immediately after each tag to tell the cars to switch to the next scope.
Or alternately you could try a series of zones with falloffs. -
Yeah, I'd go with tags with zones and falloffs myself. Haven't tried implementing it yet; perhaps I'll try to make a tutorial of it at some point ^^
-
I just mocked up a test. For each stretch I had a zone with falloff, plus a wireless receiver sending a number for that leg. In the "car" I added those two together. So 75% through leg 3, I added 0.75 to 3 to get 3.75 as the progress through that lap.
As for displaying an ordered list, not entirely sure. People have done inventories that collapse items when there are gaps. Probably something to do with exclusive gates. Aecert may have an idea. -
If you always know how many cars there will be on the track then you can do this through Exclusive gates but it's mildly complex.
Essentially you want a named Gate for each position, lets say there are 8 cars. So each car is outputting its progress variable (however you determine it, fall-off zones or lasers or whatever combination you use) to an overall Ranking gate, and then also to First, Second, Third etc.
Initially, the car in front will overwrite all the gates. Then you have, with the IsActive on the cars 'First' gate, an output that turns off it's input to Second, Third, Fourth etc. So that way only the next 7 cars will be competing with their signal, and the front-most of those seven will then overwrite Second, Third etc. So then you make the output of the Second gate turn off the input to Third, Fourth, Fifth.. etc. and chain it all the way down.
The actual value that gets transmitted through the gate will be the cars ID (basically a number from 1 to 8). Then each entry on the ladder uses something like a Selector and reads the ID coming from each placing. So the top card on the latter will use the output from the First gate (so lets say its 3 for the third car) and go to the 3rd option on the selector, which will have the text for "NORWAY" or whatever it is you're using for your car.
الرجاء تسجيل الدخول لترك تعليق.