Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

refreshing myself on the vehicle systems

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

    #76
    thanks.

    yes,mirrors are scenecapture2d and rtt.all cars reflect from the players mirror but its not really noticeable.they do push the framerate down considerably though.i will post an updated mesh with the mirror materials.

    when I built the lambo I wasn't planning on a racing game or inside views so I need to work on the interiors more.the next car I will build will be a Ferrari 458 spider.it seems to be a close rival.

    Comment


      #77
      Originally posted by tegleg View Post
      another vehicle was freezing udk on death, this time it was a bone that did not exist referenced in
      DamageMorphTargets - InfluenceBone
      thanks,will look at that.

      Comment


        #78
        Originally posted by gaz661 View Post
        the next car I will build will be a Ferrari 458 spider.it seems to be a close rival.
        Definitely, good choice! If this will be yet another generous community release and if isn't a huge amount of extra work, could you build the 458 coupe as well, for us die-hard fans? Cheers!

        Comment


          #79
          sounds like a plan.

          Comment


            #80
            Wow gaz661, the racing video was awesome. How did you get the other cars to behave. Was it a bot path, AI or something elts?

            Comment


              #81
              mostly what ive done is search the internet and found tuts and code snippets,mostly from tegleg as it happens.ive used his ai and racing pathnodes and tweeked it a little to include pitstops and some speed and target position variance.

              for the actual vehicle code,well,some of that is teglegs too,adapted to suit.

              I will post the ai and pathnode code later today when ive got more time.im sure tegleg wont mind as he posted it for the very reason ive used it.

              as far as I know there hasn't been too many udk race games,and its surprising as all the code needed has been freely available on the net for at least five years.

              Comment


                #82
                Code:
                class RaceAIController extends UDKBot;
                
                var array<Race_Pathnode> Waypoints;
                var int RaceNode; //declare it at the start so you can use it throughout the script
                var int CloseEnough;
                var Vector MyTarget;
                
                var bool bwantstopit;
                
                simulated function PostBeginPlay()
                {
                	local Race_PathNode Current;
                
                	super.PostBeginPlay();
                
                    //add the pathnodes to the array
                	foreach WorldInfo.AllActors(class'Race_Pathnode',Current)
                		{
                			Waypoints.AddItem( Current );
                		}
                
                }
                
                function wantstopit()
                {
                    bwantstopit = true;
                }
                
                simulated function Tick(float DeltaTime)
                {
                   //use local as its only needed in this function
                  local int Distance;
                  local vehicle car;  ///
                
                  car = vehicle(Pawn);
                
                  super.Tick(DeltaTime);
                
                	Distance = VSize2D(Pawn.Location - Waypoints[RaceNode].Location);
                	
                	if (pawn != none)
                	{
                
                	if (Distance <= CloseEnough)
                		{
                			RaceNode--;
                		}
                
                		if (RaceNode <= 0 && Pawn.health > 200)            ///558 is the first node on the track .0 is the last
                		{
                			RaceNode = 558;
                		}
                		
                		if (RaceNode <= 1 && Pawn.health < 200)           ///if health low at pit entrance make 590 the next node.590 to 559 is the pit lane
                		{
                			RaceNode = 590;
                		}
                		                                                 ///end of pits.rejoin track at 508
                		if (RaceNode == 560)
                		{
                			RaceNode = 508;
                		}
                		
                		if (RaceNode <= 1 && bwantstopit == true)
                		{
                			RaceNode = 590;
                		}
                		
                          }
                
                
                GoToState('Racing');
                }
                
                state Racing
                {
                
                local int OffsetX;
                local int OffsetY;
                
                
                
                Begin:
                
                
                
                if (Waypoints[RaceNode] != None)// make sure there is a pathnode to move to
                {
                //set the max speed
                SetMaxDesiredSpeed();
                //move to it
                ///MoveTo(Waypoints[RaceNode].Location);
                
                OffsetX = Rand(500)-Rand(500);
                OffsetY = Rand(500)-Rand(500);
                
                
                    MyTarget.X = (Waypoints[RaceNode].Location.X + OffsetX);
                    MyTarget.Y = (Waypoints[RaceNode].Location.Y + OffsetY);
                       //so it doesnt fly up n down
                      // MyTarget.Z = Pawn.Location.Z;
                
                
                
                // MoveTo(Waypoints[RaceNode].Location);
                   MoveTo(MyTarget);
                
                
                }
                }
                
                function SetMaxDesiredSpeed()
                {
                       local Vehicle V;
                       V = Vehicle(Pawn);
                
                       if (V != None)
                	{
                             V.AirSpeed = Waypoints[RaceNode].MaxSpeed;
                             V.GroundSpeed = Waypoints[RaceNode].MaxSpeed + Rand(430) -420 ;
                        }
                }
                
                //also give closeenough some velue in default properties
                DefaultProperties
                {
                CloseEnough=1600
                racenode=548
                
                
                
                bisplayer=true
                
                bwantstopit=false
                }
                Code:
                class Race_Pathnode extends PathNode;
                
                var() int MaxSpeed;
                
                DefaultProperties
                {
                   MaxSpeed=11000
                   
                   bBuildLongPaths=false       //this speeds up the build considerably and stops lots of interconnection which we dont need
                }
                place the pathnodes from the start of the track to the finish on the racing line about 2 car lengths apart.

                Comment


                  #83
                  Thanks for the Code gaz661. I want to make the cars drive around a small city block like in GTA.
                  Should I change the "MaxSpeed=11000" to a smaller number to make cars move slower?

                  Comment


                    #84
                    MaxSpeed=11000 was left over from tegs code.

                    the lambo has a max speed of 3150 and that equates to 240 something mph.

                    this setting is a default.when you place the nodes in the level,hit f4 and each node has a maxspeed var you can set individually.

                    Comment


                      #85
                      Originally posted by gaz661 View Post
                      im sure tegleg wont mind as he posted it for the very reason ive used it.


                      10 chars

                      Comment


                        #86
                        Hay gaz661 have you ever thought about making a rally sport race game?

                        Comment


                          #87
                          I hadn't even thought about making a racing game until halfway through this thread.

                          Comment


                            #88
                            ive had an abandoned racing game maybe 70/80% coded sitting around for ages but im not good enough at environment modeling ect to complete it on my own.

                            its a good experience making a game that has a pre-defined set of simple rules. i learned a lot from it.
                            best of luck wherever you take it gaz, and thanks for giving stuff away. its good to share the knowledge

                            Comment


                              #89
                              talk about leaving things till the last minute,but its done.

                              you can download the donnington demo from my website.see my signature below.

                              enjoy.

                              edit:sorry,looks like the download isn't working and nothing I can do for a week.i was up all last night trying to upload to my site but godaddy had changed all the servers since I last did anything and it kept timing out.thought I got it sorted this morning,but alas,not.

                              Comment


                                #90
                                download is fixed.

                                Comment

                                Working...
                                X