opponent pathsWhile working on the Necropolis port I had to put together an opponent path convertor from TDR2000 to C2.

TDR uses a hierarchy of splines with various transformation matrixes and rule files. These don't translate too easily to list of nodes and paths that C2 uses.

I thought I'd best brush up on my C2 knowledge by reading C2Scientist and Econobrick's awesome Track Tutorials (Original here, Mirrored HERE (767KB)) and discovered they quote me on the subject of opponent paths! So - assuming that I was wrong - I've decided to reinvestigate opponent paths.

Here is an excerpt from JunkYard.txt (the first Junkyard Race):
  40,   5,   0, 255,   0, 255,    1.0,    0   // Section #51
  17,  98,   0, 255,   0,  30,    1.0,    1   // Section #52
   3,  46,   0, 255,   0, 255,    0.5,    1   // Section #53
  47,  46,   0, 255,   0, 255,    1.0, 1000   // Section #54
  46,  48,   0, 255,   0, 255,    1.2,    1   // Section #55
  49,  48,   0, 255,   0, 255,    1.0,    0   // Section #56
See the final digits? 0, 1 and 1000? I'm pretty sure that 1 defines the main race, 0 are shortcuts or routes back to the main race. But what does 1000 mean? I knocked together a little visualiser (2D) for opponent paths, here's a peek:The dashed, bisque coloured lines are 0.
The solid light blue lines are 1
Thin, solid, orange are 1000
And thin, solid, red are 1001.

What do these last two path types mean?!

If you have read this far hoping for some sort of answer you're out of luck. I have absolutely no idea what they do but I'm going to find out!

Hopefully this will lessen the pain of no recent TDR ports. I am still working on them! Catch you soon, Errol out.UPDATE May 27th, 20:49

I'm pretty certain that 1001 does nothing special, it is only used in three files (junkyard.txt, junknet.txt and junkyard_mission.txt) and is replaced by 1000 in the other two junkyard maps. Replacing every path type with 1001 causes C2 to crash though.

1000 is weird. It has the same crash issue that 1001 has but it is used quite happily otherwise. Based on its usage in the various maps it seems to signify some sort of jump/gap. A node that requires the AI to have a specific speed before attempting it? I'm going to shelve this for now and will revisit it later once I have some projects out of the way. Errol out!5 comments11:53pm - Wednesday, May 25th, 2011 - Errol
Harmalarm10:45am - May 27th, 2011I often wondered what the flags might mean, but your visualisation makes it all much more clear. It is good to know that 1 defines the main path and 0 are for getting back to the main track. No doubt about that any more.

I was thinking that perhaps the 1000 and 1001 paths are used for different kind of opponent difficulties. A better opponents uses these paths perhaps?

Perhaps they also change the behaviour of the opponent, for instance that it cannot catch any air and will stick to the ground ( see that yellow corner there near the large open sewer)

it could also be that these were used for the position of the cops, although they never made it to the final game.

Maybe if you use the same technique for different tracks there is something to be derived? I sure am interested
Toshible2:48pm - May 27th, 2011Very interesting matter! So many people rush the opp paths part when making a track, while it's like a big part of the gameplay. You must find out about 1000 and 1001! I always thought one of them helped the ai to "cheat" if stuck etc. Doesn't seem logic when looking at that minimap.
C2S6:38pm - May 27th, 2011It would be great to know if those two have any function at all, although I don't know what it could be.

And since we're talking about opponent paths, perhaps you can also shed some light on the other unknown settings, such as the first three "0, 255, 0", if they work at all. The lone "30" in the code is a speed limit value and it works for sure.

The "path width" I'm not sure about. I once tested it for some time, and I'm 80/20 inclined to say it does nothing, since the opponents seemed to just rush towards the dead center of each node. Any turn they made seemed to always have a fixed radius regardless of the current path width value(s). Or, perhaps there's some special (rare-ish?) scenario where it does actually matter.

By the way: I have a command line program written by a fellow named Dan L'Ecuyer, which outputs complete opponent path code. It likely won't help you here, as the program expects small triangles (placed around the map) to form the paths from, but let me know if you want to check it out. It does not only support basic paths, but also junctions/intersections, speed limits, and can create drone paths as well. Quite useful if you're working in 3DSMax, where you have several kinds of tools for easy object placement.
C2S6:41pm - May 27th, 2011Gah, where's mah line breaks?
Errol7:25pm - May 27th, 2011Hehe, fixed the line breaks being broken ;)

I'm pretty sure that 1001 is a red herring, it actually only appears in junkyard, junknet and junkyard_mission. An opponent path of only 1001s causes the game to crash but if they're mixed in with regular nodes they seem to function as a 1.

1000 on the other hand is weird. Again a path made purely of 1000s will cause the game to crash. I think they function as a "fast" path. The AI needs to be going at speed before that section otherwise it should find a different route. They tend to be set up where a jump is going to take place.

I'll do a follow up article on opponent paths at a later date but I really don't think there's anything left to learn.
Commenting is now closed
all rights reserved © toxic ragers 1998 - 2019