www.tombraiderforums.com

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Software Development

Reply
 
Thread Tools
Old 27-06-16, 19:49   #1
zdimension
Hobbyist
 
zdimension's Avatar
 
Join Date: Feb 2016
Location: Somewhere in France
Posts: 66
Default TRLevelUtility



TRLevelUtility (formerly TRLevelConverter is a program written in C# for converting TR levels between game versions (ex: play The Great Wall with TR5), and it can also work with script files (TOMBPC.DAT or SCRIPT.DAT), so that it could maybe replace CD's Gameflow program. It's made in C# (so it'll be cross-platform).
Currently, the internal name is TRLevelUtility.CLI because it's a command-line program (actually it doesn't contain a lot of code, it's more like an interface for FreeLoader.Loader, which is the library that handles all the file I/O and which contains the conversion code), but I'm currently working on a cross-platform GUI equivalent that will eventually provide more features, related to graphics (viewing/editing level textures, rooms, meshes, eventually a complete level editor, etc).

GitHub repository: soon

EDIT 2017-06-07: Lost lots of code, made a quick working release. Currently it only supports editing TOMBPC.DAT files. Sorry.
Requirements: Mono or .NET 4+, Gtk# (http://www.mono-project.com/download/)

Download links (.zip file, 273 KiB):

Last edited by zdimension; 07-06-17 at 06:18.
zdimension is offline   Reply With Quote
Old 27-06-16, 19:55   #2
SrDanielPonces
Relic Hunter
 
SrDanielPonces's Avatar
 
Join Date: Apr 2012
Location: Portugal
Posts: 8,601
Default

good luck
SrDanielPonces is online now   Reply With Quote
Old 27-06-16, 20:34   #3
sackboy123
Tomb Raider
 
sackboy123's Avatar
 
Join Date: Jul 2012
Location: Rockfort Island
Posts: 16,402
Default

This will actually be useful, good luck
__________________
Playing all Custom Levels. Current Level: The Wall
sackboy123 is offline   Reply With Quote
Old 27-06-16, 21:45   #4
Cochrane
Gold Contributor
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,047
Default

Sounds good! If I may make one suggestion: Unless you have a good reason not to, put it on Github. There are so many awesome useful TR tools lost to the ages because the developer moved on and never bothered to release the source code.
__________________
GŁter auf die Bahn!
Cochrane is online now   Reply With Quote
Old 27-06-16, 22:00   #5
laracroft1997
Archaeologist
 
laracroft1997's Avatar
 
Join Date: Dec 2014
Location: Somewhere
Posts: 2,449
Default

it would be really useful For Tomb Raider Mod Launcher , Good Luck
laracroft1997 is offline   Reply With Quote
Old 27-06-16, 22:30   #6
zdimension
Hobbyist
 
zdimension's Avatar
 
Join Date: Feb 2016
Location: Somewhere in France
Posts: 66
Default

Quote:
Originally Posted by Cochrane View Post
Sounds good! If I may make one suggestion: Unless you have a good reason not to, put it on Github. There are so many awesome useful TR tools lost to the ages because the developer moved on and never bothered to release the source code.
Yup, I will put it on GitHub, but I don't know if I create a separate repository or if I put it on FreeRaider's repository (as it uses OpenTomb level loader code)
zdimension is offline   Reply With Quote
Old 27-06-16, 22:42   #7
Boobandie
Professor
 
Join Date: Jul 2012
Posts: 3,709
Default

Would it be possible convert data files from the Alpha's to the final level structure so we can open them with Wadmerger and such with this? I'm dying to dig into the TR1 beta's.
Boobandie is offline   Reply With Quote
Old 27-06-16, 23:00   #8
b122251
Explorer
 
b122251's Avatar
 
Join Date: Aug 2013
Posts: 560
Default

Hi, I'm working on a similar thing. Though I intend to convert between PC and console versions as well. And I'm writing in C, not C#. How are you going about it? Did you write separate routines for every format to convert to every other format, or did you invent some separate format that you can easily convert any format to and from?
b122251 is offline   Reply With Quote
Old 28-06-16, 00:12   #9
zdimension
Hobbyist
 
zdimension's Avatar
 
Join Date: Feb 2016
Location: Somewhere in France
Posts: 66
Default

Quote:
Originally Posted by b122251 View Post
Hi, I'm working on a similar thing. Though I intend to convert between PC and console versions as well. And I'm writing in C, not C#. How are you going about it? Did you write separate routines for every format to convert to every other format, or did you invent some separate format that you can easily convert any format to and from?
oh hey b122251 in fact it's your video about city of vilcacamba in tr2 which inspired me of this project ^^

In fact I've been porting OpenTomb (yup) to C# for around 6 months (still doesn't work) but the loader code is finished and completely working (although not compliant with TRosettaStone 3.0), so I am planning so create something called for example "LibTR" which can create TR level files.
To answer your question, no, the OpenTomb loader doesn't really work like that. There is a file called DataTypes.cs (data_types.cpp) which contains every single struct used in the levels (even the levels themselves are structs composed of other structs), but if a struct is used in multiple TR versions, I make it only once (no need to make tr1_room_info, tr2_room_info, tr3_room_info, etc). Sometimes, there are some little differences. So in the Read() function I added a parameter called 'ver' in which I put the TR engine version (TR1, 2, 3, 4, 5).
Each of these structs has a method called Read() (ported from OpenTomb), and will soon have a a method called Write() (that I'm writing right now). If some struct has the fields Intensity and Intensity2, but Intensity2 is only in TR5, the Read() and Write() methods will automatically calculate the missing values according to TRosettaStone (most of the time these values are equals).
I think the main difficulty will be to convert between "Classic" room structure and TR5 room structure (the one with weird layers stuff).
Also, I don't think that the console level formats are very different from the PC ones, so I think I will support them too.
Sorry if I didn't explain well, English isn't my native language.
zdimension is offline   Reply With Quote
Old 28-06-16, 11:32   #10
b122251
Explorer
 
b122251's Avatar
 
Join Date: Aug 2013
Posts: 560
Default

Quote:
Originally Posted by zdimension View Post
...I am planning so create something called for example "LibTR" which can create TR level files.
To answer your question, no, the OpenTomb loader doesn't really work like that. There is a file called DataTypes.cs (data_types.cpp) which contains every single struct used in the levels (even the levels themselves are structs composed of other structs), but if a struct is used in multiple TR versions, I make it only once (no need to make tr1_room_info, tr2_room_info, tr3_room_info, etc). Sometimes, there are some little differences. So in the Read() function I added a parameter called 'ver' in which I put the TR engine version (TR1, 2, 3, 4, 5).
Each of these structs has a method called Read() (ported from OpenTomb), and will soon have a a method called Write() (that I'm writing right now). If some struct has the fields Intensity and Intensity2, but Intensity2 is only in TR5, the Read() and Write() methods will automatically calculate the missing values according to TRosettaStone (most of the time these values are equals).
I wish you the best of luck with that. I hope you will succeed, but to be honest, I've been hacking Tomb Raider level formats for about two years now, and I know what a difficult job it can be to keep track of everything.
Quote:
Originally Posted by zdimension View Post
I think the main difficulty will be to convert between "Classic" room structure and TR5 room structure (the one with weird layers stuff).
Also, I don't think that the console level formats are very different from the PC ones, so I think I will support them too.
Trust me, they are very different. The Sega Saturn formats consist of several files, and are Big-Endian. The TR2 PS1 format has some weird quirks like the fact that after NumRectangles there are two NULL-bytes, but only if NumRectangles is an even number.

Still, I have some experience with TR level formats. If I can ever be of any help, feel free to ask me anything. (Though there is a chance that I don't know either).
b122251 is offline   Reply With Quote
Reply

Bookmarks

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 19:08.


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