Jump to content

2015: What is keeping us away from creating custom tracks?


TheChief
 Share

Recommended Posts

@Xiron: Thanks, but I have seen the model in 3DSMax myself, I could just not find the word to describe the set of objects in the middle. I was wondering to what extend Sluicer is able to drive on top of it. It looks like its not connected at two sides in the game, while I see it should be that way according to your model.

Link to comment
Share on other sites

polipo100

Maybe, the original file is .ASE. I've used .ASE file to convert 3D models in level with unwrapped textures for another game.

I don't know how lego racers work with 3d models, but this is only my opinion.

P.S. Sorry for english

Link to comment
Share on other sites

@Sluicer: Yes, that would make more sense to do. I know about the binary editor, it gave me a first insight into the Lego Racers files. Pretty ossem tool. I already thought it would be because of your first test simple box track. Since you are able to drive on the whole blue area, are you able to drive up to the, ehm, whatever for an object that is I see in your second picture?

Looks pretty good, nice work.

​Ah, no. I am sorry for beeing unspecific. I can only drive on one level (almost the groundfloor). When I drive through the ramp, I am driving through it -.-.

I will try to explain the tree from the bvb files during the next week. But I am afraid it will take some time.

Maybe, the original file is .ASE. I've used .ASE file to convert 3D models in level with unwrapped textures for another game.

I don't know how lego racers work with 3d models, but this is only my opinion.

P.S. Sorry for english

​I do not know the .ase file format. Does there exist a file format specification (I did not google yet)?

Link to comment
Share on other sites

I will try to explain the tree from the bvb files during the next week. But I am afraid it will take some time.

​To make it a little more simple I describe the tree in a 2D sample. Just imagine that you have a track that is only a quad.

 012345678
0+-------+
1|       |
2| a     |
3|       |
4|       |
5|       |
6|       |
7|       |
8+-------+

To detect if you are in the track or if you are at a wall you can compare like the following:
x>0 ? y>0 ? x<8 ? y<8 ? ok : nok : nok : nok

In the game the question x>0 is represented by a plane (triangle) and a normal (direction).

You can also visualize this in a tree:

              |
          +--x>0--+
          |       |
      +--y>0--+  nok
      |       |
  +--x<8--+  nok
  |       |
+-y<8-+  nok
a     |
ok   nok

At each node there are additional informations/calculations. If you are exactly at the value the game will test if you are at one of the
corresponding triangles (here lines). If you are, you are at a wall. If not you have to go on. For the first node in the example:
 

if x == 0
{
  if on line
  {
    we collide with a wall
    exit
  }
  else
  {
    go left
  }
}
else if x > 0
{
  go left
}
else
{
  go right
}

The entry in the bvb file would look something like (ok=-1; nok=-2):

left right normalX normalY normalZ triangleStart triangleAmount
   1    -2       1       0       0             0              1 (one 'line' from 0,0 to 0,8 with direction  1, 0)
   2    -2       0       1       0             1              1 (one 'line' from 0,0 to 8,0 with direction  0, 1)
   3    -2      -1       0       0             2              1 (one 'line' from 8,0 to 8,8 with direction -1, 0)
  -1    -2       0      -1       0             3              1 (one 'line' from 0,8 to 8,8 with direction  0,-1)

Lets look at a more 'complex' track:
 

 012345678
0+-------+
1|       |
2|       |
3|  +-+  |
4|  | |  |
5|  +-+  |
6|       |
7|       |
8+-------+

You can create a tree that looks like this:

            |
         +-x<3----------+
         |              |
      +-y>0---+      +-y<3----------+
      |       |      |              |
   +-x>0--+  nok  +-x<8---+      +-x>5---------+
   |      |       |       |      |             |
+-y<8-+  nok    +-y>0-+  nok  +-y<8--+      +-y>5--+
a     |         b     |       |      |      |      |
ok   nok        ok   nok   +-x<8-+  nok  +-y<8-+  nok
                           c     |       d     |
                           ok   nok      ok   nok

By this the track will be devided in sections:
 

 012345678
0+-------+
1|a |b   |
2|  |    |
3|  +-+--|
4|  | |c |
5|  +-+  |
6|  |d|  |
7|  | |  |
8+-------+

The additional analysis would look like this (again only first node)
 

if x == 3
{
  if on line (y = 3 to 5)
  {
    we collide with a wall
    exit
  }
  else
  {
    go left
  }
}
else if x < 3
{
  go left
}
else
{
  go right
}

But it would also be possible to use a tree like this:
 

     |
  +-x<0--+
  |      |
 nok  +-x<3---------+
      |             |
   +-y>0--+      +-x<5-------------+
   |      |      |                 |
+-y<8-+  nok  +-y>0---+         +-x<8---+
a     |       |       |         |       |
ok   nok   +-y<3--+  nok     +-y>0--+  nok
           b      |          |      |
           ok  +-y>5--+   +-y<8-+  nok
               |      |   d     |
            +-y<8-+  nok  ok   nok
            c     |
            ok   nok

This would devide the track in:

 012345678
0+-------+
1|a |b|d |
2|  | |  |
3|  +-+  |
4|  | |  |
5|  +-+  |
6|  |c|  |
7|  | |  |
8+-------+

A thrid possibility might be:       

    |
 +-x<0--+
 |      |
nok  +-y<0--+
     |      |        
    nok  +-x>8--+
         |      |         
        nok  +-y>8--+     
             |      |         
            nok  +-x<3--+     
                 a      |         
                 ok  +-x>5--+     
                     b      |         
                     ok  +-y<3--+     
                         |      |         
                         ok  +-y>5--+     
                             |      |
                             ok    nok


This would devide the track also in:

 012345678
0+-------+
1|a |c|b |
2|  | |  |
3|  +-+  |
4|  | |  |
5|  +-+  |
6|  |d|  |
7|  | |  |
8+-------+

And now you have to portate this in a 3D space. I hope I made no errors and it is understandable.

Link to comment
Share on other sites

@Sluicer: Yeey, Math comes in :). Nice explanation of the tree. I imagine that in 3D space, z-coordinates would come in and your tree would get a bit larger because it also needs to take in account z-coordinates, so that we can't be pushed through the ceiling and out of a track. I can see those z-coordinates working when I play RocketRacerRun with only red bricks and the MXPMX cheat, which is a pretty ossem race, by the way.

Maybe a silly question, but if you have a track model that can be simplified into these schemes that you have shown, can you now predict a track's tree? That would be a next step towards an algorithm that creates one for in the collision meshes. Or are there still unpredictable parts and differences between different trees from different tracks that we need to cope with first?

Again, great work. I'd love to see where we are with this in a month or so.

 

 

Link to comment
Share on other sites

@Sluicer: Yeey, Math comes in :). Nice explanation of the tree. I imagine that in 3D space, z-coordinates would come in and your tree would get a bit larger because it also needs to take in account z-coordinates, so that we can't be pushed through the ceiling and out of a track. I can see those z-coordinates working when I play RocketRacerRun with only red bricks and the MXPMX cheat, which is a pretty ossem race, by the way.

Maybe a silly question, but if you have a track model that can be simplified into these schemes that you have shown, can you now predict a track's tree? That would be a next step towards an algorithm that creates one for in the collision meshes. Or are there still unpredictable parts and differences between different trees from different tracks that we need to cope with first?

Again, great work. I'd love to see where we are with this in a month or so.

I am not sure if the tracks can be simplified. Each track is unique. I will give you a few additional pictures of the test track. The gray areas are the triangles that your position is compared to.
First node:

XuhXGUx.png

So the track is splitted into two sections. When we go to the right in the tree we will get the following:

bIdQbwe.png

A next split may be:

tKLHWOV.png

And one more:

xcXf8h6.png

And so on...

QWOp1DL.png

And so on...

os6h58f.png

And so on...

The choise of the triangles where your position is compared to will influence the whole tree! And from my point of view it will not be easy to calculate the 'best' triangeles for this (at least for the first nodes).

Edited by Sluicer
Link to comment
Share on other sites

  • 2 weeks later...
Attached you can find my test track.

TEST.zip

​We still don't have permission to view/download attachments right now, only upload, it seems.

I found out, that we can still deposit ore. So if there is still anyone interested in: Test.zip

@Sluicer: Yeey, Math comes in :). Nice explanation of the tree. I imagine that in 3D space, z-coordinates would come in and your tree would get a bit larger because it also needs to take in account z-coordinates, so that we can't be pushed through the ceiling and out of a track.

​Any idea for an algorithm?

Link to comment
Share on other sites

I'm actually having a few ideas of how the z-coordinates could fit in those trees, but no time to explain it all now. I will get back to you.

 012345678
0+-------+
1|a |b|d |
2|  | |  |
3|  +-+  |
4|  |e|  |
5|  +-+  |
6|  |c|  |
7|  | |  |
8+-------+

The case with the test track is that at the sections b and c, you can drive up till the point e. Your value of z will increase there. Now you can seperate the e section with walls to make sure that b and c are the only ways to reach the e section, but that might not always be possible. When playing a track with only red bricks and MXPMX cheat, getting hit by nine torpedos at one time could make u fly and reach that section anyway. When flying, you should not be able to fly through the ceiling of a track and get, well, lost.

What about the situations where you can stand at different positions with the same x,y-coordinates but with different z-coordinates, like with shortcuts?

Let's say that at the ground state is z=0, and at b and c you could linerally climb up to section e, where z=3. When driving normally, reaching z={0,1,2} is not possible on (xe,ye), because there would be walls on the a and d side of the section.  Then you are left with two options: z=3, where you are standing at e, and z>3 where you are flying over e. When flying, you can't get too high, let's say 0 < z < 10, where 0 is the ground and 10 is the "ceiling" of the track.

Then, you need to define that there is a collision at the xy-plane at z=3 and z=10 at (xe,ye).

if x == 4 and y == 4
{
  if z == 3
  {
    we collide with the ground
    exit
  }
  else if 3 < z < 10 or z = 10 (collision with ceiling)
  {
    go down
}
...
}    

I'm not an experienced programmer, I need some programming for my study and that's all.

Your z-coordinate specification will probably come in your tree after the specification of the x,y coordinates.

    |
 +-x<0--+
 |      |
nok  +-y<0--+
     |      |
    nok  +-z<0--+
         |      |
        nok  +-x>8--+
             |      |         
            nok  +-y>8--+     
                 |      |
                nok  +-z>10-+
                     |      |       
                    nok    etc.

 

At etc. You start assigning parts for the track where you should assign z-coordinates to x,y-coordinates or planes. This makes the tree much longer and much more complicated.

We said that (x,y)=(1,4) , z=1. At (2,4) z =2. At (3,4), you have reached section e and z=3. At (1,4); you will have z<1: nok, because you can't be sinking though your hill. That means that you have to assign that to the particular combination of (x,y)=(1,4). And that is where my current knowledge ends. For now.

 

When creating an algorithm for 3D, it should be taking into account those z-coordinates, and it should be able to assign certain z-coordinates, known from the models, to (x,y) combinations. It's a damn difficult job.

Maybe you can give a short explanation of how the exact code in the .bvb file section corresponds to this tree? Then I may know what exact options there are for this tree Because if u continue in the tree with a) nok and b) another option and u have assigned y=4, what y are u going to assign after that, y<4 or y>4? What if u need to assign more to exact y-coordinates? Etc. When I know where to start and in what order to assign stuff, I can do some puzzles and fit in some z-coordinates. I would be glad to offer my help.

 

Edited by TheChief
Link to comment
Share on other sites

Maybe you can give a short explanation of how the exact code in the .bvb file section corresponds to this tree? Then I may know what exact options there are for this tree Because if u continue in the tree with a) nok and b) another option and u have assigned y=4, what y are u going to assign after that, y<4 or y>4? What if u need to assign more to exact y-coordinates? Etc. When I know where to start and in what order to assign stuff, I can do some puzzles and fit in some z-coordinates. I would be glad to offer my help.

​Here is a preparation of the first tree entries from the TESTCOLLIDE.BVB file:

00000045 678  // number of positions
00002017 1182 // number of triangles (with area type)
0000451c 873  // number of unknown (7 numbers)
//      left        right        x        y        z  start trian number trian
           1            2 40000000 00000000 00000000            0            8 
           3            4 00000000 c0000000 00000000            8            2 
         460          461 c0000000 00000000 00000000           10            8 
           5            6 c0000000 00000000 00000000           18           12 
         234           -2 00000000 00000000 40000000           30           36 
           7           -2 00000001 00000000 40000000           66           63 
         212          213 c0000000 00000000 00000000          129            6 
           8            9 00000000 e360da3b 393e4b8b          135            2 
          10           11 0b450fc0 f4baf040 3dfbd6a2          137            1 
[...]

The file contains 678 positions and 1182 triangles and than the tree (873 nodes). Each node consists of a pointer to the left child, a pointer to a right child, a normal and the offset and amount of triangles that belong to the node.

If you enter the tree (root; node 0), you have to compare the position of the car with the first 8 triangels (gray in the first image of thr previos post). If your position is on one of them you are done. If you are on the side of the triangles where the normal is pointing to (here 1 0 0) you have to go to the left child (node 1), otherwise to the right child (node 2).

Lets imagine you are 'behind' the triangles of the first node. Due to this you have to go to the right node (2nd node, 3rd entry). Now you have to compare your position with the 8 triangles that start from the 10th entry in the trangle section (gray in the second image of thr previos post). If your position is on one of them you are done. If you are on the side of the triangels where the normal is pointing to (this time -1 0 0) you have to go to the left child (node 460), otherwise to the right child (node 461).

And so on. Does this help?

Link to comment
Share on other sites

Let me see if I am understanding this correctly (correct me when I'm incorrect about something):

Those triangles can be seen as combinations of coordinates right? So when comparing your position with the triangles, you will see an inequality in the tree; a question that needs to be answered. Then you have three options:

You are on one of the triangles / Inequality is correct (like with x < 3, your x = 2,1,0): Do nothing

Inequality incorrect, you are pointing with the normal: Go to the left child.

Inequality incorrect, you are pointing against the normal: Go to the right child.

 

When moving on to a second node, you will keep the above structure. Then I am wondering: How can the trees not have tree options then? I can see how the first option fits in: either ok or nok for the boundary specifcation. Then there is a possibility that defining the position with respect to the normal is done with y-coordinate specification after x-coordinate specification, which could make sense but then you would probably see that any x-specification will always be followed by a y-specification, thus dividing your whole tree in small groups x,y. So how did they do it, then?

Know that your explanation is not too hard to understand, yet the exact relation with the tree needs to be known before we can predict such a tree with known sets of triangles. And I'm curious, I just want to know and understand it :).

Link to comment
Share on other sites

  • 3 weeks later...

So, ehm, any progress on that tree (or anything else) yet? I regret not having progress, but these last few weeks before holiday are really busy for me, I will have more time when the summer holiday starts in three weeks and hope to do something useful by then, if not earlier.

Link to comment
Share on other sites

So, ehm, any progress on that tree (or anything else) yet? I regret not having progress, but these last few weeks before holiday are really busy for me, I will have more time when the summer holiday starts in three weeks and hope to do something useful by then, if not earlier.

​I was able to generate a small tree. There are many things that are not stable. My progress is very slow currently (no time D:|). Here are two images of my current test track:

large.ChrystalRun1.png.e42ea313fd2a09ed7

 

large.ChrystalRun2.png.12ca6033f6e86d3f3

It is a flat octagon.

Link to comment
Share on other sites

Pretty ossem!

Ye, I know about the no time problem, sadly enough I am way too familiar with that.

Anyway, nice work. One question: Ur collision map shows nothing in the center, does that mean that the height of the surrounding walls is infinite? Or that you would enter the world of nothing if you fly just high enough...

 

Link to comment
Share on other sites

One question: Ur collision map shows nothing in the center, does that mean that the height of the surrounding walls is infinite? Or that you would enter the world of nothing if you fly just high enough...

​You would enter the world of nothing if you fly just high enough. :af:

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...
Fluffy Cupcake

someone needs to make a video tutorial for this!

Yeah sure someone will, it will happen when this gets out of discovery mode.

Link to comment
Share on other sites

supercoolguy32

someone needs to make a video tutorial for this!

Yeah sure someone will, it will happen when this gets out of discovery mode.

oh ok :D 

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.