www.tombraiderforums.com

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

Reply
 
Thread Tools
Old 22-05-14, 11:02   #611
Gh0stBlade
Archaeologist
 
Gh0stBlade's Avatar
 
Join Date: Dec 2010
Posts: 2,268
Default

Quote:
Originally Posted by Lwmte View Post
I have been testing activation mask and meshswap scripting functionality...
Wow, that is awesome! Truly amazing work, looking just like the original!

Quote:
Originally Posted by Lwmte View Post
Jeez, it seems you have SOMETHING SERIOUS going on with your branch out there! Can't wait to play with it. I suppose, by GAMEFLOW you mean old, TR2-3 styled script format, which was a sequence of actual commands (rather than parameter-based TR4-5 script)? Things like default ambience track should be easy to implement (actually, you already can have it by adding "playstream" command to [levelname]_script.lua file in /scripts/trX/ directory).
That is correct, it is also written specifically so that if anyone were to parse the actual script itself, the sequence commands will all match up but I think it's best we stick with LUA because it's much easier to manage. I suspect the same type of scripting might be compatible with TOMB4/5 but I haven't actually checked the format to see how it works yet so I'm unsure at the moment. It's very basic how it was done in TOMB2/3, they just had sequences containing actions to be done and so on.

I was actually going to ask you about the PlayStream function, I have yet to try this feature out, is there anything specific I need to know as to where the audio files should be placed for each game?

Quote:
Originally Posted by Lwmte View Post
By the way, I'm currently thinking about script organizing... Since we now have extensive Lua usage in OpenTomb, we need to prevent script files from being a one big mess; so I'm looking at projects like CorsixTH, which rely heavily on Lua, and it has all its scripts neatly sorted in subfolders; I suppose we should come up with a similar scheme.
I definitely agree with this, it will also help find things much quicker. Even though it's not actually bad yet itself... yet

Quote:
Originally Posted by Lwmte View Post
Yes, it happens from time to time, it seems that something has broken not so long ago - most likely, it's something that doesn't get destroyed or erased properly after level reloading. Only TeslaRus can tell what's wrong, since he knows how OpenTomb's memory management system works.
That is a relief! I thought it may have been the gameflow code or some LUA script for it. But I did check the syntax and then entirely started writing them again from scratch I do hope it is fixed in the future because I can't commit anything that is pretty much "game breaking" cause it kind of looks bad

Awesome work so far everyone, we seem to be having a small team forming now
__________________
No longer accepting PMs due to abuse of the system.
Gh0stBlade is offline   Reply With Quote
Old 22-05-14, 12:32   #612
Lwmte
Archaeologist
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 1,074
Default

Quote:
Originally Posted by Gh0stBlade View Post
That is correct, it is also written specifically so that if anyone were to parse the actual script itself, the sequence commands will all match up but I think it's best we stick with LUA because it's much easier to manage.
Sure, since original script files are in binary format, they are hard to parse, and it's not a big deal to rewrite scripts for all 5 games in Lua anyway. We already have lots of game-specific scripting!

Quote:
I suspect the same type of scripting might be compatible with TOMB4/5 but I haven't actually checked the format to see how it works yet so I'm unsure at the moment. It's very basic how it was done in TOMB2/3, they just had sequences containing actions to be done and so on.
Actually, TR2-3 script system was much more advanced than TR4-5, because it has actual command sequences (or at least operands to do commands), while TR4-5 scripts were only a bunch of parameters that were passed to internal game structures. I don't know why Core decided to switch to this cryptic format after TR3.

Quote:
I was actually going to ask you about the PlayStream function, I have yet to try this feature out, is there anything specific I need to know as to where the audio files should be placed for each game?
To make audiotracks work, you must have two things.

First of all, you must update your script files from this archive. The ones that are shipped with last binary archive on SF are outdated, as I have recently modified secret track ID extraction - see last commit on SF.

Second, you must have all TR1-5 soundtracks in OGG format in corresponding /data/tr*/audio/ folders. You can simply download an archive with all soundtracks here. Simply unpack it into your OpenTomb folder, and it should do the job. Note that I have replaced TR1 and TR3 soundtracks with remastered ones, so if you want original music, you have to rip it to OGG and replace it back (for TR3, you can extract CDAUDIO.WAD directly to OGG with CdAudio Player utility by Turbo Pascal, and then simply put extracted files into data/tr3/audio/ folder without renaming it - just make sure you have changed USE_TR3_REMASTER = 0 in soundtrack.lua).

So, what soundtrack.lua does is: when engine asks for specific soundtrack ID, script refers to internal table for path, filename and track type. Track types can be either looped (usually it's background ambience), one-shot (music pieces) and chat (Lara and NPC voices, like Zip from TR5). All these properties are managed by the engine itself, so you shouldn't worry about it at all.

So, when it comes to playstream function, you need only one argument to pass to it, which is internal track ID - for example, if you want to play wind ambience in TR2, simply call playstream(33). Then it will continously play, until stopped by another looped audiotrack activated somewhere in the level.

Quote:
That is a relief! I thought it may have been the gameflow code or some LUA script for it. But I did check the syntax and then entirely started writing them again from scratch I do hope it is fixed in the future because I can't commit anything that is pretty much "game breaking" cause it kind of looks bad
It also tends to crash sometimes when simply changing level by map command in console, so I don't think your commit will break it even more! Anyway, TeslaRus is aware of crashing issue, so it'll probably be fixed soon.

Quote:
Awesome work so far everyone, we seem to be having a small team forming now
Absolutely!

Last edited by Lwmte; 22-05-14 at 12:48.
Lwmte is offline   Reply With Quote
Old 22-05-14, 16:41   #613
Gh0stBlade
Archaeologist
 
Gh0stBlade's Avatar
 
Join Date: Dec 2010
Posts: 2,268
Default

As we all know there are sound tracks set to be played as soon as a level is loaded via the gameflow scripts mainly on TR2/3. It appears that once this is called in OpenTomb, It looks like something causes the current audio track to be stopped? Possibly on map loading?

What do you suggest is done? I really don't want to modify the audio code unless it's really necessary, maybe there is another way around this?

Here's a little look at the console, it clearly shows the track is being passed properly:



Oh.. and awesome work on the audio implementation, it works very well!
Cheers
__________________
No longer accepting PMs due to abuse of the system.
Gh0stBlade is offline   Reply With Quote
Old 22-05-14, 17:44   #614
Lwmte
Archaeologist
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 1,074
Default

Quote:
Originally Posted by Gh0stBlade View Post
As we all know there are sound tracks set to be played as soon as a level is loaded via the gameflow scripts mainly on TR2/3. It appears that once this is called in OpenTomb, It looks like something causes the current audio track to be stopped? Possibly on map loading?
It seems that GF_SetTrack is placed before GF_StartLevel, which is obviously causes immediate track stop, because all audiotracks are forced to stop before level loading. It happens because user can jump between different versions of engines (hence different music), so we need to re-initialize audio after each level loading. In original TR2/TR3, it made no sense, so engine could safely send a track to playback and only then load a level itself (however, it was a weird decision from Core's side anyway, because it's better to load everything up, and then begin to make some other actions).

So, only reasonable solution is to move GF_SetTrack after GF_StartLevel, then it should work properly!

P.S.: By the way, another small feature I have implemented today is character lean. Now Lara leans left or right while running or sprinting, which gives a bit more realism. We can implement lean for other animations as well - I just haven't tried it anywhere else.


Code is already on SF!

Last edited by Lwmte; 22-05-14 at 21:43.
Lwmte is offline   Reply With Quote
Old 22-05-14, 21:52   #615
Gh0stBlade
Archaeologist
 
Gh0stBlade's Avatar
 
Join Date: Dec 2010
Posts: 2,268
Default

Quote:
Originally Posted by Lwmte View Post
It seems that GF_SetTrack is placed before GF_StartLevel, which is obviously causes immediate track stop, because all audiotracks are forced to stop before level loading. It happens because user can jump between different versions of engines (hence different music), so we need to re-initialize audio after each level loading. In original TR2/TR3, it made no sense, so engine could safely send a track to playback and only then load a level itself (however, it was a weird decision from Core's side anyway, because it's better to load everything up, and then begin to make some other actions).

So, only reasonable solution is to move GF_SetTrack after GF_StartLevel, then it should work properly!
I now understand that the engine is not set to load tracks as soon as a level loads, I guess the only solution would be to "Pause" the gameflow after all those types of commands have been done.

It works flawlessly now, I really like how the audio tracks automatically loop etc. Hopefully tomorrow, I will be pushing the changes to my repo and posting up the TR2/3 scripts only since I have not started the others yet and I think it's best to get everything looked at first to see if this is or not a good thing to do cause I'm having a few doubts actually

Edit: Gahh!! Awesome work on the leaning. And I see there have been new updates to the main repo, I will try these out asap!!!
__________________
No longer accepting PMs due to abuse of the system.

Last edited by Gh0stBlade; 22-05-14 at 21:54.
Gh0stBlade is offline   Reply With Quote
Old 23-05-14, 01:45   #616
laralives
Professor
 
laralives's Avatar
 
Join Date: Aug 2005
Location: Boston, MA
Posts: 4,097
Default

Quote:
Originally Posted by Gh0stBlade View Post
Awesome work so far everyone, we seem to be having a small team forming now
I'm so excited about this! I have continuously been lurking, and had been hoping for there to be a core amount of people working on this. I'm really glad its working out...

Although I am missing Cochrane that was helping with the Mac OS aspect of the engine and as well as whomever was working on the Linux/Ubuntu aspect of the engine.

But I am thrilled to see all this progress and continuous and daily progress that has been achieved by ALL of you. I can't wait until the 'finished' product.

Also if I understand 'correctly' this engine is essentially one that will replace the tr4 engine (as well as all the others) and one can manipulate as one pleases adding and changing whatever one wants so that level editor games can be improved immensely? Is that what's happening?
__________________
Bleh.
laralives is offline   Reply With Quote
Old 23-05-14, 17:59   #617
Cochrane
Gold Contributor
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,138
Default

Okay, I'll take a look again. Quick question: Should I only pull the main tree, or also the vobject fork? Right now I'm going to go ahead with the main tree only.
__________________
GŁter auf die Bahn!
Cochrane is offline   Reply With Quote
Old 23-05-14, 18:04   #618
Dustie
Relic Hunter
 
Dustie's Avatar
 
Join Date: Apr 2005
Location: Poland
Posts: 9,211
Default

Yes, with the leaning it's looking more and more like in the game, now she seems less "glued" to the camera
Dustie is offline   Reply With Quote
Old 23-05-14, 18:16   #619
Cochrane
Gold Contributor
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,138
Default

Okay, pulled it all in, tried to build it, get the "too many errors" message. I'll look at what it takes to build this again. Here's my short to-do list, if someone has better suggestions please voice them!

- OpenAL causes a lot of issues, because I use the version that's shipped with OS X, and that does not include any extensions. I'll think I'll switch to the version whose code is included with OpenTomb, if this is possible without major issues. If not, I'll rip the special effects out for the Mac version, but I'd really hate to do that.
- Lots of OpenGL function pointer weirdness in there; sadly necessary for Windows and Linux. There are some problems here because Mac OS X offers e.g. glBindBuffer for static linking, but does not have the version with ARB prefix at all. I'll try to find a solution that does not impact the code.
- There are code paths for computers that don't support VBOs. I'm going to throw them out, because I don't think there are computers like that anymore.
- There are thousands of warnings when I build it, most of them related to 64-bit stuff but not all of them (32 bit compilation is deprecated on OS X). I'll fix them where it seems easy, but I don't think we'll be able to get into -Werror territory for a long time.
- I think the coding style with declaring all variables at the start of the a function is plain wrong. I'm going to keep it where it exists, but I won't join this madness for new functions.

I'll post more things I'm planning on doing as I dive deeper through the code. If you think something is a bad idea, please tell me!
__________________
GŁter auf die Bahn!

Last edited by Cochrane; 23-05-14 at 18:22.
Cochrane is offline   Reply With Quote
Old 23-05-14, 18:27   #620
Lwmte
Archaeologist
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 1,074
Default

Quote:
Originally Posted by Cochrane View Post
Okay, I'll take a look again. Quick question: Should I only pull the main tree, or also the vobject fork? Right now I'm going to go ahead with the main tree only.
Main tree is the most recent one, while vobject fork contains AntTweakBar library, which was eventually removed by TeslaRus due to integration complications. So I suggest you to go with main tree anyway!
Lwmte 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 03:08.


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