02-09-15, 08:12 | #1 |
Moderator
Joined: Dec 2011
Posts: 4,881
|
TRNG - New collision features
From 1.2.1.5 version there are new features about the collisions. The main target of these new collision is to permit to Lara to walk, climb or monkey on statics and moveable items. Another usage could be the creation of collisions for the future modelling of 3d room geometry using meta2tr program. As we'll see the above target has been reached with some tricks based on invisible room collisions. Although it is easy apply this trick, in many circustances we'll have to work to limit the discordances between shape of the item and the shape of collisions. In this tutorial there are different suggestions about how adjusting these differences. The source problem is that the invisible room collision have only the same shapes we could give to sectors and therefore they are not very fine. Last edited by AkyV; 02-09-15 at 08:56. |
02-09-15, 08:14 | #2 |
Moderator
Joined: Dec 2011
Posts: 4,881
|
How walking on Statics or Moveables The trick to allow to Lara to walk over items is based on following simple rules:
|
02-09-15, 08:17 | #3 |
Moderator
Joined: Dec 2011
Posts: 4,881
|
The new Flipeffects for the Collisions The new flipeffects about collisions permit to move up or down, the floor or the celiling collision in similary way how we should do to build the room with [+] [-] floor/ceiling buttons. The difference is that with our collision flipeffects the visible shape of the room will remain the same and only the (invisble) collisions of the room will be changed. All collision flipeffects permit to move up or down the floor or the ceiling and some of them give you also the chance to create slopes or triangles normal or splitted. Fake Triggers Technically it's important understand that the flipeffect collision triggers are not true triggers. I used the flipeffects only to store in a given position of the room the changes to perform before building the level but these trigger will be not performed in game. The "fake" nature of these triggers means that:
|
02-09-15, 08:34 | #4 |
Moderator
Joined: Dec 2011
Posts: 4,881
|
Collision Trigger Groups Collision Flipeffects In the field "Text to find" you have a suggestion about the single words divided by spaces to type in white box at left of [Find <#>] button in Trigger Type window to locate fastly the wished group of flipeffects. Image Text to Find COLLISION FLOOR SLOPE Description Floor with Slope With this group of triggers you can move up or down the floor, setting or less a slope on the floor. Set North <&>Slope-Collision changing floor of (E)Clicks Set South <&>Slope-Collision changing floor of (E)Clicks Set East <&>Slope-Collision changing floor of (E)Clicks Set West <&>Slope-Collision changing floor of (E)Clicks The picture has been got with following trigger: ; <#> : Collision. Set West <&>Slope-Collision changing floor of (E)Clicks ; <&> : Slope Collision with height= 2 ; (E) : Increase floor collision by 4 clicks Image Text to Find COLLISION TRI FLOOR Description Floor with Triangle With this group of triggers you can move up or down the floor, setting or less a singe vertex to increase furtherly to create a triangular peak. Set North-West <&>Tri-Collision changing floor of (E)Clicks Set North-East <&>Tri-Collision changing floor of (E)Clicks Set South-East <&>Tri-Collision changing floor of (E)Clicks Set South-West <&>Tri-Collision changing floor of (E)Clicks The collision of the picture has been got with this trigger: ; <#> : Collision. Set North-East <&>Tri-Collision changing floor of (E)Clicks ; <&> : Triangular collision with height= 2 ; (E) : Increase floor collision by 6 clicks Image Text to Find COLLISION TRI SPLIT Description Floor with split triangle With this group you can move up or down the floor and then you can add a split triangle, where the break-line is in a different position respect to common triangle. (See the picture) Set North-West <&>Tri-Split-Collision changing floor of (E)Clicks Set North-East <&>Tri-Split-Collision changing floor of (E)Clicks Set South-East <&>Tri-Split-Collision changing floor of (E)Clicks Set South-West <&>Tri-Split-Collision changing floor of (E)Clicks The collision of the picture may be got with this trigger: ; <#> : Collision. Set North-West <&>Tri-Split-Collision changing floor of (E)Clicks ; <&> : Triangular Split collision with height= 3 ; (E) : Increase floor collision by 5 clicks Image Text to Find COLLISION CEILING SLOPE Description Ceiling with Slope This group moves down or up the ceiling adding a further slope in wished direction. Set North <&>Ceiling-Slope-Collision changing ceiling of (E)Clicks Set South <&>Ceiling-Slope-Collision changing ceiling of (E)Clicks Set East <&>Ceiling-Slope-Collision changing ceiling of (E)Clicks Set West <&>Ceiling-Slope-Collision changing ceiling of (E)Clicks The collision of image has been got with following trigger: ; <#> : Collision. Set North <&>Ceiling-Slope-Collision changing ceiling of (E)Clicks ; <&> : Slope Collision with height= 2 ; (E) : Decrease ceiling collision by 8 clicks Image Text to Find COLLISION TRI CEILING Description Ceiling with Triangle With this group you can move down or up the ceiling adding a further decreasing for a specific corner, getting a triangular speak. Remark: for the ceiling collision is not foreseen the split triangle. Set North-West <&>Ceiling-Tri-Collision changing ceiling of (E)Clicks Set North-East <&>Ceiling-Tri-Collision changing ceiling of (E)Clicks Set South-West <&>Ceiling-Tri-Collision changing ceiling of (E)Clicks Set South-East <&>Ceiling-Tri-Collision changing ceiling of (E)Clicks The collision of the picture has been got with this trigger: ; <#> : Collision. Set South-West <&>Ceiling-Tri-Collision changing ceiling of (E)Clicks ; <&> : Slope Collision with height= 2 ; (E) : Decrease ceiling collision by 8 clicks Image Text to Find COLLISION FLOOR Description Flat Floor Collision If you want move up or down the floor with no triangle or slope, just you select any collision floor triggers and set as triangle or slope 0 clicks. In this way you got only a movement of the floor preserving the flatness of the sector. For example the picture at the left could be got with one of following triggers: ; <#> : Collision. Set East <&>Slope-Collision changing floor of (E)Clicks ; <&> : Slope Collision with height= 0 ; (E) : Increase floor collision by 6 clicks or: ; <#> : Collision. Set North-East <&>Tri-Collision changing floor of (E)Clicks ; <&> : Triangular collision with height= 0 ; (E) : Increase floor collision by 6 clicks In fact, when you set 0 clicks for slope or triangle height is not important the facing (east, north, south ect.) and neither if it was a triangle or a slope. Remark: in spite of this speech I discourage to use a "split triangle" collision as flat collision, because the split triangle change some field in internal structures that could be modify something also if there is a null height about the clicks. So try to use slope or common triangle to have flat collisions. |
02-09-15, 08:45 | #5 |
Moderator
Joined: Dec 2011
Posts: 4,881
|
Adapting the Objects to the Collisions Apparently it should be better adapting the collisions to the objects but, unortunately the room collisions are very "raw" and for this reason it's not always possible change them to follow the precise shape of the object. For this reason it's better trying the opposite: modify a bit the shape or position of the items to overlap in better way the possible room collisions we could create. In above A picture we can see the items in first room of the collision demo, and in B picture the collisions created with collision flipeffects. Above it's only an exmple, of course, in the project you'll se nothing of alike but only the triggers placed in those sectors. Anyway, looking above pictures we can understand our problem: while some item have a shape very alike than room collisions (like the sarcophagus), other items (like the statue of the lion or the mummy ) are not so much alike and this situation could create some boring situation in game. For example if you try to go on the mummy you'll see that, in some position, lara will be hanging in the empty, although only with a little distance. Differently the sarcophagus is very good, becuase it was exactly 2 sectors for 1 sector, with an height of (exaclty) three clicks. Instead the lion statue is a bit disaster. When lara jump over him, she will slide down, and this it's ok, but at start of this swimming, her feet will be enter the lion's mane, for almost half leg. This is bad. But the worse is that the lion is too slim respect to sector width and lara will bang versus an invisible wall on lateral sides of the lion. Tips and tricks to solve some uncompatibilities When we found some of these problems we could try to fix them in following ways:
The main problem was about the enemy jeep. That shape seemed good to adapte it to room collision, but when I placed the jeep in the project I discovered this: The jeep was not correctly aligned with the sector grid. In these cases it's easy solve the problem: just you apply a trigger to move it in correct position. ; <#> : ANIMATING6 ID:15 in sector (2,4) of Room2 ; <&> : Move. Move to east <#>animating for (E)units (one sector = 1024) ; (E) : Units = 632 The enemy jeep is the animating 6, of course. With this trigger (performed at start of the level) the jeep had the bottom aligned with sector grid, but now there was another problem: The jeep was not enough big to fit two sectors of width. So I tried to place a collision with a slope in left sector but also in this way the problm is clear: lara remains in air closed to front of the jeep. To solve this problem I found an item with a shape compatible with the space to fit. Since that little guard-rail was too little to cover that click of empty I placed two items in same position, and then I used a flieffect to move one of them a bit to east to fit better the empty space. Now the result is enough good: Moving items to align them to collision grid The method of moving items to get the best alignment to collision grid has been used other two times in demo project. In above picture you can see the room where it has been used many times: to move the bridge and the giant a bit to east, because (look the project in ngle to understand) the bridge was not aligned with sector grid. Then it has been moved also the little column at right of lara in above picture. You can see in the ngle what was its original (and bad) position. Simulate rounding collisions When we use items with rounded shapes and "fill" them with transparent collisions we have many advantages: we can have shapes different by usual box-style and in same time we can walk, climb or monkey these new items, but there is also a disadvantage: the rounding shapes of these items is different than sqaured collisions we applied to them, so in some corners lara could be hanged to invisible walls. To understand this problem we could give a look to sarcophagus item: In above picture you can see the green zones where there is a transparent collision. This is not a big problem, since everytime we create rounded shapes it's normal there will be some of these litte zones with invisible collisions. Anyway we could try at least to avoid that lara was able to hang on those (missing) corners. We can realize this target using this special collision trigger: ; <#> : Collision. Set the <&>Side of closed sector as non-hangable from Lara ; <&> : West Side Playing the demo you can see the result. Lara will be able to hang on the sarcophagus where the shape is squared with real corners, while she will be not able to hang in the rounded sides of the object. Remark: differently by other collision triggers, this trigger is a real trigger and it could be exported. If you look carefully the first room, you see I placed also a condition trigger on sides of sarcophagus to forbid the hanging only in half sector where there is the missing corner, while in other west-side of the sector lara will be able to hang normally on the object. To round the Sectors The room collisions don't permit to round the shape of the sectors anyway you can round a bit the square moving up a triangle of that sector to stop lara in that corner. You can see the example of the hovel in the demo project where the four corners of the hovel are diagonal collisions created moving up the correct triangle of that sector. Another way is to use the set of collision panels you find in collis.wad file. See below. |
02-09-15, 08:54 | #6 |
Moderator
Joined: Dec 2011
Posts: 4,881
|
The Set of Collision Panels The collision panel are items having the only target to set an invisible collision in the level. They are not a full news, you saw invisible collision panels also in example of elevators to avoid lara falls down of the elevator floor. Anyway there are some news in this new version. You have a full set of collisional panel to have diagonals and invisble walls in different positions to cover all possible shapes. The panels now have their own slot name to avoid overlapping with other animating items. The engine applies to these collision panels a new collision procedure to be faster and to support also panel hight upto 8 clicks, while the common collision procedure didn't work fine with animating higher than 6 clicks. About the choice of usage wheter room collisions or level panel collisions, you should remember that it's not possible walk, climb or monkey the collision panels, but you can create horizontal collisions more detailed using the panels. My suggestion is to integrate these two methods to create invisible collisions, trying to prefer the room collisions when it's possible, since the room collision use less cpu time to be computed while the panles are new items in your map and it's better don't exagerate with their number. All collision panels have a max height of 8 clicks (2 sectors) but you can move donw them in the floor to use also collision with littler collisions. In above A picture you can see how a collision panel appears when you've just placed it: it has a one sector (four clicks) height. You can move up it upto 8 clicks (B picture), but you can also move down in the floor to have only one click of height (C Picture) if you wish. The Panels with full width These are the four panels with full width. You can have panels to cover each single click of the sector. PANEL_BORDER PANEL_MIDDLE PANEL_STRIP PANEL_DIAGONAL Little Panels These little panels permit to create more detailed shapes working on a grid with half sector of alignment. PANEL_HALF_BORDER1 PANEL_HALF_BORDER2 PANEL_CORNER PANEL_MIDDLE_CORNER Samples about Collision Panels I used two PANEL_CORNER to round the collisions of balcony. Since I prefered avoid a squared balcony, I had also to build collisions in according with this round shape. Another situation where I used collision panel has been in the room of the giant. To use the suitable bridge I had to use a bridge with half width, i.e. half sector. Since there is no way to create a collision at half of a sector using room collision, I used a serie of PANEL_MIDDLE items to build the collision in the half of the sectors following the bridge. Looking the project you can see that in other side of the bridge I've not always used the panel collision, because in that case it was possible using some room collisions, so, to save items in the level, I used the ceiling collision moved down to stop lara in that direction. Then I used also a PANEL_DIAGONAL item to avoid lara can jump on other half of collision other the bridge, because otherwise our trick will be discovered and lara will remain hanged in the empty. |
02-09-15, 08:56 | #7 |
Moderator
Joined: Dec 2011
Posts: 4,881
|
Limitations about the new Collisions If you need absolutely to have collisions on some item to move where lara was able to walk or climb, you can choose one of following tricks:
|
Thread Tools | |
|
|