Tomb Raider Forums  

Go Back   Tomb Raider Forums > Tomb Raider Level Editor and Modding > Tomb Raider Level Editor > Tomb Raider Next Generation

Reply
 
Thread Tools
Old 13-04-20, 18:47   #1
Ranpyon
Member
 
Ranpyon's Avatar
 
Joined: Jan 2013
Posts: 276
Default Bridge custom collisions

It's been a long time that I try to follow the chapter about bridge collisions here https://www.tombraiderforums.com/sho...d.php?t=212038, but simply I can't get it.
Until now I've always catched the right depth collisions by chance, but now I want do understand.
Since I want to apply a depth of 4 clicks to a Bridge_flat (let's say I want a box), how can I set it?

Last edited by Ranpyon; 13-04-20 at 18:48.
Ranpyon is offline   Reply With Quote
Old 13-04-20, 20:17   #2
Krystian
Member
 
Joined: May 2010
Posts: 1,187
Default

Taken from above tutorial:
Quote:
Customizing the new Bridge Objects: the OCB values

All new Bridge objects can be customized with their OCB field.
The formula used to create an OCB value for these objects is this:

TiltFactor + NoSlidingFlag + EnableHangFlag + Depth*256

Where:

TiltFactor is the Tilt value, for example with TiltFactor = 0 you create a BRIDGE_FLAT, and with TiltFactor = 2 you create a BRIDGE_TILT2 slope.

The max allowed value is tilt 63.

NoSlidingFlag is the value 128. If you add this value in the OCB lara will be able to walk over this Bridge avoding the sliding.

EnableHangFlag is the value 64. If you add this value Lara will be able to hang of edges of current bridge. By default the hanging feature it has been been removed because it caused many problems on all new edges, i.e. those not matching with the standard game squares.

I suggest to let disabled the hanging feature with the only exception when you are using a bridge with a common squared shape (no fragmented triggers for it).

Depth is the height of the bridge object set in 1/4 of click. This means that, to have a bridge with height of one sector, you should use 16 as Depth.
The depth is important because a Bridge has also a function of ceiling when lara is belove of it.


The old bridges had all the depth of one click.

Remarks:

* The TiltFactor will be used only from the BRIDGE_CUSTOM object, while for other bridges the tilt is implicte in their name: BRIDGE_TILT2, BRIDGE_TILT4 ect.

* Above ocb description could be less updated than that you read in OCB section of the Reference panel of NG_Center program. So you should consulte that reference for the OCB values to use.
Krystian is offline   Reply With Quote
Old 14-04-20, 11:17   #3
Ranpyon
Member
 
Ranpyon's Avatar
 
Joined: Jan 2013
Posts: 276
Default

Unfortunately I still don't understand. But I've found that the OCB depth for one click is 1024, so for 4 clicks is enough to multiply 1024*4, so 4096. That's what I needed.
Thanks!
Ranpyon is offline   Reply With Quote
Old 14-04-20, 11:38   #4
Krystian
Member
 
Joined: May 2010
Posts: 1,187
Default

The "unit" of the depth is 1/4 of a click (64 "game units"), so for each click there are 4 "depth units". And for one sector there would be 4*4 = 16 depth units. However, as stated in the formula, the depth value must be multiplied by 256. So if you want a 4 click depth, you have 256*16 depth units, which gives 4096.
Krystian is offline   Reply With Quote
Old 14-04-20, 12:28   #5
SrDanielPonces
Member
 
SrDanielPonces's Avatar
 
Joined: Apr 2012
Posts: 10,346
Default

I know Krystian already answered, but:

Quote:
Depth of the Bridge (1/255 multiplied by 256)
---------------------------------------------
The depth of the bridge is important because it has the role to simulate the new ceiling when lara is belove of it, other to creare a wall with height between the up surface of the bridge and the down surface, set by depth.

By default (if you type 0 as depth) the depth is one click, like it was in old level editor.
Now you can set also values lower than one click, since the units for depth are 1/16 of game sector. This means that one click is 4 units.
In this way you can have very slim bridges, a nice chance for hanging footbridges, but also a very depth bridge, useful to simulate the collision of some big static objects placed on the floor, avoidin that lara was able to pass down of them.
SrDanielPonces is offline   Reply With Quote
Old 14-04-20, 18:59   #6
TokyoSU
Member
 
TokyoSU's Avatar
 
Joined: Mar 2019
Posts: 687
Default

in the game code, a click is 256, so if you want for example a pushblock size, you just need to set 1024 which is 4 click for a pushblock
TokyoSU is offline   Reply With Quote
Old 14-04-20, 19:05   #7
Joey79100
Member
 
Joey79100's Avatar
 
Joined: Mar 2012
Posts: 3,741
Default

Well it seems you haven't read the posts just above...
Quote:
Originally Posted by Krystian View Post
The "unit" of the depth is 1/4 of a click (64 "game units"), so for each click there are 4 "depth units". And for one sector there would be 4*4 = 16 depth units. However, as stated in the formula, the depth value must be multiplied by 256. So if you want a 4 click depth, you have 256*16 depth units, which gives 4096.
Joey79100 is offline   Reply With Quote
Old 14-04-20, 20:48   #8
TokyoSU
Member
 
TokyoSU's Avatar
 
Joined: Mar 2019
Posts: 687
Default

Quote:
Originally Posted by Joey79100 View Post
Well it seems you haven't read the posts just above...
i read it, it's just that the bridge is not using the game click, possibly for more custom way.
TokyoSU is offline   Reply With Quote
Old 15-04-20, 08:45   #9
Ranpyon
Member
 
Ranpyon's Avatar
 
Joined: Jan 2013
Posts: 276
Default

I've kinda of understood now, thank you.
But I still find it quite complicated: wouldn't it be easier if it was said that, as a starting point for example, the depth for one click is 1024? In this way it would be easier to calculate more or less deep depths. In fact in my level I also have a slim tilt1 bridge (about an half click): setting 512 was perfect for its depth. And, as I repeat, 4096 was perfect for a 1x1 sector cube.
Ranpyon is offline   Reply With Quote
Old 15-04-20, 09:40   #10
Krystian
Member
 
Joined: May 2010
Posts: 1,187
Default

Yes, it's true that 1/4 click would be 256 and to get just bigger depths you can multiply that value by how many quarter-clicks are in that depth. So for 1 sector it's 16, and 16*256 is 4096.

I was just trying to explain the formula, that's given for the bridges. Notice that aside from depth you can also specify some other flags, for example if you want to enable hanging from bridge, on top of the calculated depth value (like 4096) you must also add the 64 flag, so you would get 4096 + 64 = 4160. To you this may simply seem like adding two numbers together, but there is a particular reason why the depth value must be multiplied by 256 and can't be represented by the default "game units".
Without going into much detail, if going by the "game units" depth, to get 1/4 click, you would need to enter 64. But 64 Is already reserved for the "Enable hanging" feature. And if you add them, you get 128, which is reserved for "No sliding" feature. So to avoid this, the depth values have this strange calculation.

Last edited by Krystian; 15-04-20 at 09:43.
Krystian is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 18:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.