Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Tutorials and Resources

Closed Thread
Thread Tools
Old 07-11-15, 16:03   #1
Join Date: Mar 2012
Location: France
Posts: 2,751
Default Lara's Collision Box: how to calculate it fastly

Every animator know about one big problem in WadMerger: you can't calculate a correct collision box for Lara.

Actually, this is not really the fault of WadMerger:
The LARA object is composed only of dummy meshes (you see those legs in RoomEdit?), replaced in game by the meshes of LARA_SKIN (and the joints).
While WadMerger displays LARA with LARA_SKIN's meshes, it actually works with the dummy meshes when calculating the collision... That's why the box doesn't correspond to Lara's real meshes.
There are really simple tricks to calculate a correct collision box for Lara, but I noticed some people didn't know about them, so I'm sharing them here.

1. Calculate a correct collision box entirely with WadMerger

The first solution is the most simple and faster without doing any modification to Lara.

The thing is really simple to understand: you need the collision calculated from LARA_SKIN's meshes, and not from the dummy LARA's meshes, right? So what we're gonna do is actually calculating the collision with LARA_SKIN's meshes.
  • Open LARA
  • Copy the animation and close the Animation Editor
  • Open LARA_SKIN, and paste your animation (by replacing the existing one),
  • Calculate the collision (menu Collision > Calculcate Collision (animation))
  • Copy the animation and close the Animation Editor (don't save the changes)
  • Open LARA, and paste your new animation over the old one.
  • You're done!

This is kinda time consuming if you have a lot of animations to polish, but it's still much faster than doing it in another program.

2. Trick for those who animate in 3DS Max

There's another solution for those who animate in 3DS Max or whatever external program that require the use of 3DS files with TRViewer. It's actually really simple. Let me explain:
You know that before exporting your animation from the TR4 file, you need to import LARA_SKIN's meshes over LARA's meshes so you have something correct in your program.
Then, to import your animation in your Wad, you have to reimport it in the TR4 file first, then open the TR4 file in WadMerger, get the animation from here, then copy it, open your Wad, and paste it here.
There's something that can be done when importing to make several things at once (importing the animation and recalculating its collision).
  • In TRViewer, import your animation (the 3DS file) into LARA.
  • Don't close it for now! Instead, also import LARA_SKIN meshes like you would normally do before exporting.
  • Now save the TR4, close TRViewer, and open your TR4 in WadMerger.
  • Open Lara, but before copying the animation you've imported, calculate the collision box now.
  • Now close the animation editor, load your Wad, and paste your new animation.

Why did it work?
Simply because LARA had real meshes when you calculated the collision this time, instead of the usual dummy meshes.

3. The ultimate solution

I'm sure Michiel could have implemented a way to use LARA_SKIN's meshes when calculating the collision of LARA if he could have continued WadMerger, but unfortunately that didn't happen. So we can't simply select our animation and use the Calculate collision feature... Or, maybe I should say: we normally can't.

The ultimate solution would be to eventually replace LARA's dummy meshes by LARA_SKIN's meshes. This way, you'd be able to calculate a collision box just with two clicks.

I don't know a solution to directly replace LARA's dummy meshes. However, I've done it in an "accidental" way.
I had accidentaly replaced my Wad with another one, and the only way to get back my animations was to copy them from the TR4 file over a clean Lara (or the last backup). But I already had a lot of modified animations so I couldn't copy/export them one by one and write down every StateID change... it would have been too long, and I was quite lazy.
So I decided to be faster: use directly LARA object from the TR4 file: I replaced her meshes with real meshes in TRViewer (the way I showed just before), and then I copied the complete LARA object from the TR4 file.

I used TRWad to TRWest compatibility tool to repair the possible errors in the new Wad and show the possible evil random frames at the end of an animation that WadMerger doesn't normally see. I removed every of these "extra" frame, checked for every possible error in the animations (Next Frame number is often messed up fom animations that are 1-frame long), and then my Lara was back healthier than ever: now I can directly calculate her collision on every animation without any extra step! And it saves a lot of time.

Warning: It is not really recommanded to use something coming from a TR4 file, especially Lara because it could bring some problems. I advise you to do it only if you know how to solve the possible errors.
Basically what I've explained should be enough to correct them, but maybe there could be more problems to solve that I haven't encountered.

Hope this helps.
Joey79100 is offline  
Closed Thread


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 23:21.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.