www.tombraiderforums.com  

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

Reply
 
Thread Tools
Old 25-05-14, 12:37   #641
Cochrane
Golden
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,318
Default

Okay, it was a bit of work, but the current version compiles on Mac OS X!

@Lwmte, if you have the time, could you please update the first post? The Mac version is now at http://sourceforge.net/u/zcochrane/o.../default/tree/ (source only; there is no binary at the moment. I'll do a binary version once the Windows version releases one again).

Should I do a merge request on Sourceforge, or will you simply pull it in when you're ready? Either way works for me, I'd just like to know what you prefer.

For those who want to use it: You need Xcode to compile it. The project file is in the "mac" subdirectory. To run it, you need to set up a data directory with all the stuff just like for the current Windows version (there isn't currently one common instruction set for doing that). All this should either be in the same directory as the .app bundle, or, as a Mac-specific extension, you can put it in Documents/Open Tomb. The engine automatically switches there if it does not find config.lua in the same directory as the .app. I have not yet tested this much, so I'd be happy about any bug reports.

To everyone who worked on the PC version while I was lazy: Great work! This looks and runs a lot better than I would have expected. There are still some bugs, of course, but it's a major leap forward.
__________________
GŁter auf die Bahn!

Last edited by Cochrane; 25-05-14 at 12:40.
Cochrane is online now   Reply With Quote
Old 25-05-14, 20:36   #642
Gh0stBlade
Archaeologist
 
Gh0stBlade's Avatar
 
Join Date: Dec 2010
Posts: 2,293
Default

So, I have decided to shaft the original sequencing-like code idea which is similar to what was used on the original Tomb Raider1-3 games. I did this because there is possibly another way of keeping scripts between all the games more consistent and easier to understand...

I guess we should just use gameflow to link our levels together and load them (maybe cutscenes too). I know the gameflow script for TR2/3 contains very important information for level specific stuff like nofloor, larastartanim, and settrack. These are best off managed in the level specific lua files if you ask me, calling cutscenes, fmvs and stuff can be done within those scripts..? I think it will keep things a lot more cleaner and easier to manage.

Due to this, I have finished it up and have pushed the code to my repo. It *Should* work on TOMB1-5 fine, I have more of a concern for TOMB4 though since I didn't try it much but it kind of worked when I did so I don't know if there are bugs or anything... but as it is an experimental feature, you should take a look! I know there are some crash bugs due to Engine_LoadMap I hope this is fixed in the future

Personally, I don't like how I did it but feel free to give feedback and edit whatever you like!

You will need the scripts from here:
Download

And a new line to the config file:
cvars.game_script = "scripts/tr4/gameflow.lua";

I really don't like the word gameflow, maybe another word could be made up for that, I just couldn't think of one cause my brain isn't working very well lately, too much stuff going on...

I hope you all enjoy this new addition!
Let me know what you think!

Edit: I should mention, setlevel "levelid" will also change the level
__________________
No longer accepting PMs due to abuse of the system.

Last edited by Gh0stBlade; 25-05-14 at 20:51.
Gh0stBlade is offline   Reply With Quote
Old 26-05-14, 13:02   #643
Ado Croft
Historian
 
Join Date: Apr 2013
Posts: 274
Default

Great job, Gh0stBlade Finally Open Tomb engine has its own script which allow to use a lot of functions in various levels. I would like to ask you, is it possible to set all of these scripts to this engine? Without rewriting the current one? I mean you choose a level you want from all TR versions and finishing it without rewriting the config file because there is only one function: cvars.game_script = "scripts/tr4/gameflow.lua";

Last edited by Ado Croft; 26-05-14 at 13:03.
Ado Croft is offline   Reply With Quote
Old 27-05-14, 17:36   #644
Gh0stBlade
Archaeologist
 
Gh0stBlade's Avatar
 
Join Date: Dec 2010
Posts: 2,293
Default

Quote:
Originally Posted by Ado Croft View Post
Great job, Gh0stBlade Finally Open Tomb engine has its own script which allow to use a lot of functions in various levels. I would like to ask you, is it possible to set all of these scripts to this engine? Without rewriting the current one? I mean you choose a level you want from all TR versions and finishing it without rewriting the config file because there is only one function: cvars.game_script = "scripts/tr4/gameflow.lua";
It was great idea but I kind of preferred the old sequence style used with TR1-3 i just quickly slapped that together to allow compatibility across all the games whilst keeping the lua scripting style consistent. But I don't think it's a good idea anymore so It will probably get shafted... Decision making with something like this is tricky and I'm not sure what is best to do right now. I'm glad you liked it though Also confused with what you meant but you could just change the script cvar paths without having to overwrite them if that helps?
__________________
No longer accepting PMs due to abuse of the system.
Gh0stBlade is offline   Reply With Quote
Old 27-05-14, 20:08   #645
Ado Croft
Historian
 
Join Date: Apr 2013
Posts: 274
Default

Quote:
Originally Posted by Gh0stBlade View Post
Also confused with what you meant but you could just change the script cvar paths without having to overwrite them if that helps?
Yes, this is what I actually meant but how can I change these paths? Ok, problem solved, now it works as it should
And also is it possible to add various parameters to this script, such as rapids dying, cold water bar, no weapons for required level?

Last edited by Ado Croft; 28-05-14 at 13:28. Reason: Problem solved
Ado Croft is offline   Reply With Quote
Old 28-05-14, 10:44   #646
Lwmte
Archaeologist
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 1,129
Default

Quote:
Originally Posted by Cochrane View Post
Okay, it was a bit of work, but the current version compiles on Mac OS X!
That's super! Glad to hear it!

Quote:
@Lwmte, if you have the time, could you please update the first post? The Mac version is now at http://sourceforge.net/u/zcochrane/o.../default/tree/ (source only; there is no binary at the moment. I'll do a binary version once the Windows version releases one again).
Sure, I have updated all links!

Quote:
Should I do a merge request on Sourceforge, or will you simply pull it in when you're ready? Either way works for me, I'd just like to know what you prefer.
Honestly, I don't know how fork merging works in Mercurial. Beforehand, I have merged Gh0stBlade and Saracen forks easily, because Bitbucket allows generation of patch files for Mercurial. So I have to learn how to merge changes from another Mercurial repo!

UPDATE: Never mind, I have successfully merged your fork by hg pull -u command! But it gives me a lot of errors, firstly it throws me to a mysterious header file with c++11 warning in it, and then it complains about std::sort function (saying there's no such function in std). I haven't gone past that, I will try it a bit later, when I get home.

UPDATE 2: Ok, I have sorted out C++ 11 and std::sort things, I had to enable -std=c++11 flag in compiler options, for the sort thing I had to add #include <algorithm> in the beginning of bordered_texture_atlas.cpp file, but now it complains about UINT8_MAX. I have tried to explicitly include "stdint.h", where this is defined, but it seems to be blind and won't see it. Ok, replace this UINT8_MAX thingy with 255. Then funny part begins: suddenly it throws me into ogg/vorbisfile.h and says that fseeko64 was not declared.

Quote:
To everyone who worked on the PC version while I was lazy: Great work! This looks and runs a lot better than I would have expected. There are still some bugs, of course, but it's a major leap forward.
Thanks! There are surely lots of bugs, but I think it's normal at this moment!

Quote:
Originally Posted by Saracen View Post
I thought I should mention that yesterday I had some time to work on the directional lighting for moving objects implementation which I mentioned before
Hi, Saracen! I surely saw your update and merged it recently (although I have little time to work on it for a moment...). I see that only monochrome lighting is applied to movables, is this normal? I just have no idea how it was done in original... But for TR1/2 it surely looks great, especially because you now can clearly see an advantage over emulated lighting in originals. Even with fixed-function pipeline and vertex light it looks much better, imagine how it will look like with per-pixel lighting by shaders!
Quote:
The Last Revelation mostly works but is missing some features such as correct lighting falloff, spotlights, smooth cross fading, and also has couple of bugs where the colour is messed up on specific lights.
Yeah, I kinda miss TR4-like crossfade transition between rooms, but it may require additional fields for each entity to support it? Chronicles lights are sometimes working, although I got lots of bugs with certain lights (like Lara meshes suddenly colored all differently at certain angles, and so on).

By the way, how you have managed (or plan to manage) to overcome OpenGL's light limit of 8? You know, it's fairly possible in original levels when you simultaneously see lots of dynamic lights, and I guess some kind of workaround must be applied for OpenGL's limit (original games themselves also had a limit, for example, TR4 can't render more than 32 dynamic lights at a time - however, it was extended in TREP by 128).

Quote:
Originally Posted by Gh0stBlade View Post
So, I have decided to shaft the original sequencing-like code idea which is similar to what was used on the original Tomb Raider1-3 games. I did this because there is possibly another way of keeping scripts between all the games more consistent and easier to understand...
I think we'll return to sequencing idea after another features are implemented (like FMV, cutscenes, inventory, etc.), but it will be just wrapped around Lua syntax - since Core scripts were binary files anyway, they had to use their own interpreter, but in our case we simply can create a bunch of Lua functions and then feed them to level script.

Quote:
I know the gameflow script for TR2/3 contains very important information for level specific stuff like nofloor, larastartanim, and settrack. These are best off managed in the level specific lua files if you ask me, calling cutscenes, fmvs and stuff can be done within those scripts..?
I think that it could be achieved by calling part of the script before actual level playing (for settrack, larastartanim, etc.) and part after level playing (for forthcoming cutscenes and FMVs). We still have to figure out the best way to do it.

Quote:
I guess we should just use gameflow to link our levels together and load them (maybe cutscenes too).
Yes, I have modified your gameflow code in a way that it scrolls through specific game levels, and also you can specify the game version itself - everything else is done in global Lua script called "gameflow.lua". I have also removed GetNextLevel function from each game's script, as it is the same in each script and put it into gameflow.lua instead. And finally, I have organized all scripts in corresponding directories, so we don't have to dig into lots of scripts in the same directory.

See last merge in main fork!
Also you will now need re-organized script directory structure. To ease things, simply throw out your current /scripts/ directory and replace it with one provided in this archive.

IMPORTANT: Now you can use console to switch the game version to play. To do it, type setgame "TR*" in console, where * is the number for desired game. Please note that you now can launch TR1/2/3 Gold versions as well, just type setgame "TR3GOLD" in console to play Lost Artifact. Also, MAKE SURE YOU HAVE CORRESPONDING LEVEL FILES in data/tr*_gold/data/ (including specific MAIN.SFX files for TR2/3 Gold) to make gold games work.

Here is the demo (as you see, I'm missing MAIN.SFX in data/tr3_gold/data/ folder):


Last edited by Lwmte; 28-05-14 at 15:32.
Lwmte is offline   Reply With Quote
Old 28-05-14, 17:15   #647
Gh0stBlade
Archaeologist
 
Gh0stBlade's Avatar
 
Join Date: Dec 2010
Posts: 2,293
Default

Quote:
Originally Posted by Lwmte View Post
I think we'll return to sequencing idea after another features are implemented (like FMV, cutscenes, inventory, etc.), but it will be just wrapped around Lua syntax - since Core scripts were binary files anyway, they had to use their own interpreter, but in our case we simply can create a bunch of Lua functions and then feed them to level script.
Awesome, I still have all the sequencing style code kept so it's no problem at all to restore, it worked EXACTLY how it was done in the original TR2-3 (and possibly 1) games. Only issue was that sadly, I didn't like pausing the gameflow manually after a level was loaded since that had to be done so audo tracks could work correctly. I'm sure there are other ways around it. And those rather large if statements were annoying too!

We do indeed need to have more things implemented (FMVs, Cutscenes and whatever else the script depends on to work).. I slapped together a quick loadscreen test whilst I still had the sequencing method intact, it just displayed a picture before every level was loaded. Only real issue is most loadscreens are 4:3 and they look ugly when stretched and I think TR2 has none at all so I took the loadscreen paths from PS1! I'll see if i can sort this out though, it's pretty neat. We do need propper loading screens with loading bars, that would be awesome!

---

I had a nightmare with my repository last night and had to delete/restore everything. It just doesn't like me pushing code sometimes and the error messages aren't very informative lol.

Awesome work on the latest update as always! !! Very impressive!

Edit: Just saw your opcodes enum part, I have added all the unknowns and changed the names to match those extracted from the original GAMEFLOW.EXE, I took them from IDA Pro (:
__________________
No longer accepting PMs due to abuse of the system.

Last edited by Gh0stBlade; 28-05-14 at 17:29.
Gh0stBlade is offline   Reply With Quote
Old 28-05-14, 22:45   #648
Lwmte
Archaeologist
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 1,129
Default

Quote:
Originally Posted by Gh0stBlade View Post
We do indeed need to have more things implemented (FMVs, Cutscenes and whatever else the script depends on to work)..
Considering cutscenes for TR1-3... We already have working code in TRN which successfully parses and uses camera positions for cutscenes, I guess it should be easy to port it to OpenTomb? As for TR4-5 cutscenes, these are a bit more tricky, as it involves dealing with CUTSEQ.PAK format - but fortunately, it was recently deciphered by sapper and T4Larson.

Quote:
I slapped together a quick loadscreen test whilst I still had the sequencing method intact, it just displayed a picture before every level was loaded. Only real issue is most loadscreens are 4:3 and they look ugly when stretched and I think TR2 has none at all so I took the loadscreen paths from PS1! I'll see if i can sort this out though, it's pretty neat. We do need propper loading screens with loading bars, that would be awesome!
Check out latest SF changes!


Quote:
Edit: Just saw your opcodes enum part, I have added all the unknowns and changed the names to match those extracted from the original GAMEFLOW.EXE, I took them from IDA Pro (:
Thanks, very informative! OpenTomb code also begins to look more like encyclopedia of internal TR formats... there's already lots of info in comments. We should really export it to some kind of wiki some day.

By the way, about NOFLOOR opcode... It looks like I know what it means - Lara won't land after reaching lowest room floor, falling continously until health bar is at zero. It's something that level builders were emulating with ENDLEVEL pad trigger since ages.

ENABLESUNSET - this looks like another abandoned command like STARFIELD and PULSE in TR4. Perhaps, Core wanted to create some graphical FX for transition to night time in Opera House, but they didn't have time or skills for this.
Lwmte is offline   Reply With Quote
Old 29-05-14, 16:35   #649
Dustie
Relic Hunter
 
Dustie's Avatar
 
Join Date: Apr 2005
Location: Poland
Posts: 9,209
Default

There was supposed to be a starfield in the sky in TR4? Wow...
Dustie is offline   Reply With Quote
Old 29-05-14, 18:12   #650
noname
Student
 
Join Date: Sep 2005
Posts: 230
Default

This is really great! I have a couple of comments.

- This was mentioned before, but the default colour definitely needs to be black!


- I know making the waterfall semi-transparent is more realistic, but now you can see this tunnel which was probably not the developers' original intention. I think it should stay opaque.


- I think distorting the underwater sound effects is redundant, since the developers already took into account what things should sound like underwater.

- Would it be possible to implement an easy way of replacing sound effects? I've always wanted to make high quality replacement sound effects for TR1 (where the annoying static is gone) like I've done for TR2, but I can't because TR1 stores copies of the sound effects in each level instead of one central file (like main.sfx).

Anyway, keep up the good work!
noname 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 10:44.


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