Author Topic: Wreckfest track tutorial 06 - alternative paths  (Read 917 times)

The Very End

  • *
  • *
  • Posts: 1726
In this tutorial we will focus on alternative routes, and how you should name them and how to use them.


First out, in this example we will have two alternative routes, where one crosses the start / finish line. See picture:

Basically, alt routes are named the same as the original routes, only different is that instead of “main” we’re using “alt”. Remember that it starts on 1 and not 0 when it comes to alt routes (meaning you would never do “ai_route_alt0”).

Also, an alternative routes has to be connected to the main route at its start and its end, and usually it’s rather easy to just use the snap tool in 3ds max to snap the vertexes of the alt route onto the vertex of the main route it is connected to, like this:

Also keep in mind that the safe area and the race (the red and the green lines) have to overlap the sector a bit. They do not need to be connected to their counterpart main route twins, but it is usually a good idea to place them roughly the same to prevent AI from going ballistic when changing routes.

Every alt route need a checkpoint, and can be named like “#checkpoint01_alt”. You can have several checkpoints on same alternative route, and if so I suggest to use ““#checkpointxx_altxx” where x is the number of the checkpoint. However, there is no actually need for this, so you can name it the same as the first one if you like. A crucial part here is that the checkpoint must not overlap the main route sectors. If it does this the game will much likely crash upon loading of the track. See this picture if unsure:

Also note here that it’s not really that important to place the checkpoints close to each others, usually doing alt routes causes a bit of confusion on place in race, but as soon as you re-join the main course the game will keep track of your position again.

Now, how do we go about making an alternative route that crosses a start / finish line? Well, first out, make a new alternative AI path, and make sure it’s not re-joining the first sector of the main route, as that causes a bit of issues from time to time. Additionally, you will have to add a custom property to this route, by adding the custom property “crossstart = true” without the “.  See picture on how it looks in Max:

Note those triple S’s.
And lastly, you will have to make a proxy checkpoint. A proxy checkpoint is the route’s alt checkpoint (so you do not need both an alt checkpoint and a proxy checkpoint here) and it works like the start / finish line of the alternative route. That means you can have two routes which has their own finish lines. As for naming of this checkpoint it seems a bit buggy, so my best advice is to just call this proxy checkpoint the same as the other alt checkpoints, like “#checkpoint01_alt”, but after you have exported the track you will have to change this option:

Basically, changing that option makes the checkpoint a proxy checkpoint.
Also be aware that sometimes the alt routes might be backwards, if so try adding “otherway = true” as a custom property to the alt route.

This concludes my findings on alternative routes. It’s a bit of a mess from time to time, and it is really not fun to have the game crashing on your time after time just to realize one of the checkpoints overlapped an other route. So, trial and error and a huge amounts of testing is needed. Also you will have to tweak the AI paths in the in-game editor afterwards, as the joining’s of routes usually cause a bit of confusion for the AI (they usually will break as they see the joining as a sharp turn, but it’s fast fix in the editor). 



« Last Edit: June 08, 2017, 11:42:15 PM by The Very End »

Purple44

  • *
  • Posts: 7143
Thanks End for doing this post. Will help me a lot when I try my first alt route. I got suicide track that going need a couple of alt routes.

I do have couple of questions:

1. I see #checkpoint01_splt and see in your Bagedit pic there a "is a split point" option. End what a split point? Can't remember reading about split points. Do know about loop point.

In this pic:



Show alt and splt checkpoint. So would the splitpoint be the checkpoint for main track?

2. The first checkpoint for alt and split will always be  “#checkpoint01_alt” and  “#checkpoint01_splt” even if I'm at checkpoint #5 when track reaches where alt route fork off?

3. When alt route come back to main track, is next checkpoint on main track, checkpoint #6?

4. Is there a limit how many different alt routes a track can have? I doubt I would use more than 2 or 3 different alt routes for a track.

4. So if I add a second different alt route, then alt and split checkpoint for second alt route would still start with “#checkpoint01_alt” and  “#checkpoint01_splt” checkpoints?



I'm thinking it be best for me to do the main track aisectors and checkpoints and make sure they all work, then start adding alt routes?



Your Lupines Hill track has 2 alt routes, End could you post a link to the scne track file? Would be nice take a look how the checkpoints look in Bagedit.

Again, thanks for doing up this post. page is bookmarked.  :D
« Last Edit: June 10, 2017, 02:34:02 AM by Purple44 »
Flatout Joint, where the mods were.

i5 2500, 8GB, Nvidia 660 960, SB Recon, Win 10 or Win7 64bit, DFGT Wheel

The Very End

  • *
  • *
  • Posts: 1726
Sure, will upload the scne file tomorrow and edit post :)

1: Split checkpoints are like timed checkpoints, when passing them you get an indication on screen like distance to cars.

2: The alt checkpoint should be named the same as the last or next main route checkpoint. But again, from testing most names works, but try to name it aprox. the same as the current main route checkpoint. When rejoining the main route the game sorts out the positions :)

3: Think of checkpoint numbering as something more important on main routes. Regardless of checkpoint numbering on the alt route, have the checkpoint number increase by one after the alt route. A good practise is to have an checkpoint before the split, one in the split and alt route, and one after the merge. When you pass the checkpoint on either the main or alt route in a split you will be tied to the route the checkpoint you passed belongs to btw.

4: Not that I know of, I have tried with five and thst worked perfectly :)

5: Let's say that main route has four checkpoints, one at start, one in the split with the first alt route, one after the merge and one in the split with the alt 2 route. First alt route should have one checkpoint named "#checkpoint02_alt", while the other alt route should have "checkpoint04_alt". But you could also call them 1 and 3, as mentioned alt routes seems a bit strange from time to time, but it is allways solved when rejoining main path.

Sorry for all typos as I am on a phone, and feel free to ask if unsure :)

Purple44

  • *
  • Posts: 7143
Thanks for your answers End. Got another one now.  :P

You get use 3D Max to do your checkpoints, so get use “#checkpoint01_alt” and  “#checkpoint01_splt”. But I have to use Bagedit to add checkpoints to a track:



So how do I make a checkpoint an alt route checkpoint in Bagedit? Do I change Alt Route Proxy for main route Checkpoint to "1", instead of "-1"? When I get to look at your track scne file, that will help me see how Bagedit does it.
Flatout Joint, where the mods were.

i5 2500, 8GB, Nvidia 660 960, SB Recon, Win 10 or Win7 64bit, DFGT Wheel

The Very End

  • *
  • *
  • Posts: 1726
"Alt Route Proxy for main route Checkpoint" is the proxy checkpoint, aka the checkpoint that counts as start / finish line on the alternative route :)

"Route Index" is the one you are looking for :) Main route is -0, and then alt routes starts from 1 and upwards. Here is the Lupines Hill scene file:
https://mega.nz/#!BgYyWQRL!NeO_beQcYciXQmaWRvaI5jSFu8cK46E5oUqq0b2DmG0

Purple44

  • *
  • Posts: 7143
Thanks End for link to lh,scne track file. That help me a lot. :)

Going to post what I learn looking at the lh.scne track file with Bagedit so I can come back and remind myself what I learned, when I get started on this suicide track in a month or 2. Tell me End if I get this right.



Looking at lh.scne file in Bagedit

pic #1


Here in pic #1, I see 3 separate AI sector routes. 0 is the main track route, 1 is first alt route aisector routes and 2 is second alt route aisector routes.

pic #2


In pic #2 using Mazay visualizer, I can see where the checkpoints are and figure out which are main checkpoints and which are the alt route checkpoints.

pic #3


In pic #3, then I look in Bagedit and can see which checkpoints are which.

main track checkpoint " Route Index 0 "
alt route checkpoint  " Route Index -1 "

pic #4


pic #5


Now if look at pic #1, you see Airoutes section 1 has:

Start Index of Mainroute Sector
  >  6
End Index of Mainroute Sector  >  34

So I checked the coordinates of aisector #6 in  0 main track section, pic #4 and they match with the first aisector ( #0 ) in 1 first alt route aisector routes, pic #5.

So if just using Bagedit to add alt route, not 3D max, need to take coordinates from the aisector where you want alt route to start off of main track and uses these coordinates for your first aisector ( #0 ) in new sector ( 1 ) for alt route. And do the same where you want alt route to join back to main track route.


End, you think I posted things correctly?

End, in pic #2, I don't see a main track checkpoint to match with alt route checkpoint #5. That don't cause a problem?
Flatout Joint, where the mods were.

i5 2500, 8GB, Nvidia 660 960, SB Recon, Win 10 or Win7 64bit, DFGT Wheel

The Very End

  • *
  • *
  • Posts: 1726
I think you got it right, but I must admit it is a bit complicated when doing all the work just from Bagedit. I am usually spoiled and just places the CPs where I want them in Max :D
As for pic #2, it works without having checkpoints on main route, however, if you take the alt route and passes the checkpoint there you will have to follow that alt route until it's done or the red ring of doom will appear.

As for route indexes, seems you are right. 0 is main while -1 is alt, and it seems it's allways 0 or -1, and not -2, -3 etc. as I first though. Wonder what will happend if you have an sector that splits into three alt routes at same time... hmm, got to try that out sometime :)

And as for alt routes, the AI chose randomly, so there is no way to force them to take the alt route.

Purple44

  • *
  • Posts: 7143
End got a question for ya or Janne or Andrei if they are lurking, can a proxy checkpoint be used as a start\finish checkpoint for an alt route?  Here pic of why I ask:



If can't use proxy checkpoint as a start\finish checkpoint, maybe this possible?



I move the 12 alt route startpoints to the right of yellow start\finish checkpoint. Move the main route startpoints to the the left of yellow start\finish checkpoint. Now start of race, both groups of cars move through checkpoint #0.

That make main checkpoints #1 and alt checkpoints #1, good. Then when cars cross start\finish line checkpiont again, should count lap. The trick will be getting alt route to work. Question is can I do alt route aisectors in reverse order?

Start Index of Mainroute Sector  >  34
End Index of Mainroute Sector  >  6

That would let the alt route cars go in reverse direction around the oval.


End, do you think any this is possible? Or should I stop now and not waste time trying get this Oval suicide track to work?




Flatout Joint, where the mods were.

i5 2500, 8GB, Nvidia 660 960, SB Recon, Win 10 or Win7 64bit, DFGT Wheel

The Very End

  • *
  • *
  • Posts: 1726
Alt proxy cps can be used as finish line yes :D But as far as I know it must connect to the main route, you cannot have two completely separate routes. But never tested having startpoints on an alt route, not sure if AI will try to find main route first and cause issues... But worth trying :) One work around is to have an route which splits into different directions of the oval, but then you would have to start on the infield and split on the section where infield connects to oval. A bit messy reply sorry, on phone :D Ask if unsure and I will draw it when I get home :)

Purple44

  • *
  • Posts: 7143
I can live with AI being confuse, this will be for online, just would like avoid triggering red circle and have lap count for reverse alt route.
Flatout Joint, where the mods were.

i5 2500, 8GB, Nvidia 660 960, SB Recon, Win 10 or Win7 64bit, DFGT Wheel

The Very End

  • *
  • *
  • Posts: 1726
Yeah, not sure if the RoD will be there if you have startpoints on the alt route or not. If it's very complicated to test for you by doing it in Bagedit, just ask and I'll try to do some quick tests on my part :)

Purple44

  • *
  • Posts: 7143
Yeah, not sure if the RoD will be there if you have startpoints on the alt route or not. If it's very complicated to test for you by doing it in Bagedit, just ask and I'll try to do some quick tests on my part :)

Just rereading first post, will this be a problem for me if I'm just using Bagedit,  Additionally, you will have to add a custom property to this route, by adding the custom property “crossstart = true”  ? This can only be done with 3D Max?

Or need alt route to rejoin main track just before finish\start checkpoint?

Going take a look at Speedway 1 and see if I have any luck adding an alt route.

But would be nice to know if doing alt route in reverse direction is possible. If it not, then this not going work.
« Last Edit: June 12, 2017, 11:29:01 AM by Purple44 »
Flatout Joint, where the mods were.

i5 2500, 8GB, Nvidia 660 960, SB Recon, Win 10 or Win7 64bit, DFGT Wheel

The Very End

  • *
  • *
  • Posts: 1726
Not home so not sure how it looks in Bagedit, but I am sure it should be possible to add that crossstart statement somewhere on the alt AI route.

The alt route can re-join the main route before, after or any other place on the main route, it just has to connect somewhere :) But it's possible to make it so that it's only one sector on the mian route it connects on and on the one after that it splits again.

Purple44

  • *
  • Posts: 7143
K, I tried to add a chunk of reverse alt route to Speedway 1 and was unable to get game to stop crashing.

I place the alt route checkpoint and did Route Index -1:





I used sectors 27-21 and used 27 coordinates for alt aisector #0 and 21 coordinates for alt aisector #7.





(  visualizer won't show main and alt aisectors together. Had to paste alt aisectors into main ( section 0 ) to get visualizer to show them )

I started car next to start of alt route and I get red circle and make a lap, but when I get back to the alt route start, game crashes. But if look at the checkpoints in-game, alt checkpoint ( cp #3 ) is place at start of alt route, not half way around the turn.



I'm thinking this what causing game to crash.

So I will leave suicide oval to Bugbear if they want to make track or you can give it a try and see if you have better luck End.
Flatout Joint, where the mods were.

i5 2500, 8GB, Nvidia 660 960, SB Recon, Win 10 or Win7 64bit, DFGT Wheel

The Very End

  • *
  • *
  • Posts: 1726
Usually when the game crash it's 90% of the time due to an alt checkpoint reaching the main route (overlap) or that there is no checkpoint on the alt route.
I will do a quick test one of the following days and see if it works at all :)