Announcement

Collapse
No announcement yet.

Race Placement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Race Placement

    I'm workin' on a racing mod for UT and was wondering if anyone had any ideas on how to keep track of what place the player is in. I'm mostly just looking for concepts, but if anyone was able to post any pseudo/sample code, they would be my hero.

    #2
    Is this for instance for a road radar thingy? Look at Onslaught, and also take a look at Team Radar which displays players, vehicles, their current weapon, shield, health, orders, name, etc. etc. Search for it on the user maps/mods section.

    Comment


      #3
      I think Thanos was looking more at position in the race, 1st, 2nd etc.  I'm also thinking about something similar but haven't found any suitable way to do it yet, lots of workman like ways to do it, but nothing elegant and reliable so far.

      You could always d/load Unreal Speed, decompile it, and look how they do it.  I've not started work on the project yet so have only been idly wondering how to solve this problem.

      Hope that helps.

      Comment


        #4
        Yeah, I did mean 1st, 2nd, etc. I was perusing through the anomely racing mod, but I haven't found anything so far, guess I'll keep looking.

        Comment


          #5
          You can classify the last players per number of checkpoints.
          And classify the players who passed the same number of checkpoint by date of passage.

          If your checkpoints are not too distants, the classification should be OK.

          Comment


            #6
            A more accurate way would be to measure their distance to the next checkpoint that no one has reached. Then you just place checkpoints at any major turns in the track. You'd still have to make sure they've reached all the checkpoints leading up to the target checkpoint to make sure someone doesn't get ranked higher due to course layout. If you are doing laps you'd have to make sure they've hit the checkpoints 'X' number of times as well to make sure they are on the lead lap.

            Comment


              #7
              That sounds like a pretty good idea. I'd imagine it could be done something like:

              Code:
              int i(0);
              int distances[10];
              
              foreach AllActors( class'Racer', tempRacer)
              {
                     distances[i] = nextCheckPoint.Location- tempRacer.Location
                     i++;
              }
              
              foreach AllActors( class'Racer', tempRacer2)
              {
                     tempRacer2.place = SomeDistanceSortingandPlaceReturningFunction();
              }
              I just slapped that together, but the only thing is could someone help me with the syntax in checking the distance between the racer and the checkpoint? I'm a little rusty in that aspect.

              Comment


                #8
                UnWheel does this by something similar to the above-mentioned solution - we measure each player's distance to the end of the lap they're on (from checkpoint-to-checkpoint all around the track), and how many laps they still need to complete, then assign places based on who has the shortest race distance remaining.

                Comment


                  #9
                  Maybe the following entry in my Dev Journal would interest you:
                  http://wiki.beyondunreal.com/wiki/El..._Journal#0.4.1

                  When I was working on UnrealKart I ofcourse also had to solve that problem. And the above writeup where my thoughts about the subject.

                  Note that my ideas are just one way to solve the issue.

                  Comment

                  Working...
                  X