Jump to content
Sign in to follow this  
TheChief

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

Recommended Posts

TheChief

@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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Sluicer

@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)?

Share this post


Link to post
Share on other sites
TheChief

@Sluicer: Great. I'll start to get curious, starting now. :)

Share this post


Link to post
Share on other sites
Sluicer
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.

Share this post


Link to post
Share on other sites
TheChief

@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.

 

 

Share this post


Link to post
Share on other sites
Sluicer

@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

Share this post


Link to post
Share on other sites
Sluicer
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?

Share this post


Link to post
Share on other sites
TheChief

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

Share this post


Link to post
Share on other sites
Sluicer

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?

Share this post


Link to post
Share on other sites
TheChief

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 :).

Share this post


Link to post
Share on other sites
TheChief

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.

Share this post


Link to post
Share on other sites
Sluicer

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.

Share this post


Link to post
Share on other sites
mumboking

OCTAGON![/JackBlackandElmo]

 

Impressive. Are there any collisions?

Share this post


Link to post
Share on other sites
Sluicer

Impressive. Are there any collisions?

​Yes, you can't leave the track. This is my colliding map:

large.COLLIDE.png.8192b82eaea4e968f33909

 

Share this post


Link to post
Share on other sites
TheChief

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...

 

Share this post


Link to post
Share on other sites
Sluicer

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:

Share this post


Link to post
Share on other sites
supercoolguy32

someone needs to make a video tutorial for this!

Share this post


Link to post
Share on other sites
Xir

someone needs to make a video tutorial for this!

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

Share this post


Link to post
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 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.