www.tombraiderforums.com

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

Reply
 
Thread Tools
Old 08-12-13, 13:58   #421
Lwmte
Explorer
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 951
Default

Finally, it is done!


I have implemented only "classic" TR frame animation, UVRotate mode should be a bit more complicated. But - good news - there are two new modes for classic framed mode - backward and reverse (continous forward-back movement).

I have a problem with non-alpha-blended faces, however... They are not animating - I suppose it's because solid faces are stored and processed differently than transparent ones?

All changes on SF, if you want to check it out.
Lwmte is offline   Reply With Quote
Old 08-12-13, 14:44   #422
Ado Croft
Historian
 
Join Date: Apr 2013
Posts: 265
Default

Great news! I'm so happy that animate textures work And also I noticed Tesla Rus implemented climbing ceiling.
You are very clever guys
Good job again and looking forward to another updates such as ladder climbing, interaction of objects, etc
keep it up
Ado Croft is offline   Reply With Quote
Old 08-12-13, 15:05   #423
Cochrane
Gold Contributor
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,093
Default

Nice!

Quote:
Originally Posted by Lwmte View Post
I have a problem with non-alpha-blended faces, however... They are not animating - I suppose it's because solid faces are stored and processed differently than transparent ones?
Yes, they are stored and processed differently. Specifically, they're stored in vertex arrays (which are usually stored in vertex buffers). You need to update the vertex array and if used the vertex buffer to the new UV coordinates. This will require some additional data to know which parts of the vertex buffer to change.

The UV rotate mode… I won't lie, this could well be painful with the texture atlas, but that depends on how the UV coordinates are implemented specifically.
__________________
Güter auf die Bahn!
Cochrane is offline   Reply With Quote
Old 08-12-13, 21:42   #424
Lwmte
Explorer
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 951
Default

Indeed, UVRotate is a special case of animating textures, but in my opinion, there is nothing special about it. UVRotate animated texture is easily determined by checking animation sequences which contain only one frame - that's the ones UVRotating. The point is, actual UVRotate texture's height is half a height of specified TexInfo tile, while another half is used while texture is rotating from bottom to top (I call this half-height tile "coordinate window").


Here you can see standard TR4 waterfall texture. It is 64x128 in size, upper 64x64 part (clone) is equal to lower 64x64 part (original). Coordinate window is actual UV coordinates used to map texture onto polygon. When texture is animated, coordinate window is gradually shifted upwards, in the "rotation direction". When top is reached, engine resets rotation back to bottom, and everything repeats all over.

It is worth noting that TR4-5 engines used different workarounds to identify UVRotate animated textures for room and waterfall objects geometry. For rooms, UVRotate tiles were identified by animation sequences with one frame, while speed of rotating was specified in script. For waterfall objects, behaviour was strongly hardcoded: engine simply took first mesh polygon's TexInfo and animated it in the same manner as with room UVRotate (all other faces were not animated, until they refered to the same TexInfo). Speed was also hardcoded, and needed a patch to be modified.

I hope this explains well. And for me, making opaque faces animate is much harder than adding UVRotate mode!
Lwmte is offline   Reply With Quote
Old 09-12-13, 07:30   #425
Boobandie
Professor
 
Join Date: Jul 2012
Posts: 3,754
Default

Quote:
Originally Posted by kaufi-lc View Post
Well when it comes to geometry you already can simply build basic rooms in LE/NGLE and after that use meta2tr on your level and change/add geometry as you like. Lara will react to the new geometry as she is supposed to, she doesn't treat her environment as squares anymore, some videos the programmers uploaded, showed that actually
A while back I changed some TR4 levels with meta2tr and tested them with this engine and it worked like a charm. (except extruding faces on the x and z axis, lara would walk trough the walls and fall) Of course this is just something to play around with ATM, so I guess we will have to wait what the programmers are gonna do.
While it's true that we can simply meta2tr our levels to have smaller squares, its a very round-about way of doing it and pretty much an after effect as far as the building process goes. Not to mention all the theoretical work you have to do when creating rooms to try and accomodate for the cosmetic changes you'll make later on.

It would be far easier for building and texturing to have a new roomedit with smaller squares and diagonals. Perhaps features like being able to grab and pull vertices around too, making more interesting rooms without having to go through sideprograms. Also, with a new roomedit the limitations are up in the air. 18x18 is rather small for the largest single room size with our new PCs. So is the arbitrary stacking rooms to get ledges, it wouldnt be needed if we can just pull squares out of walls.

I want to be able to build massive and detailed worlds like this without having to jump between the editor and meta. Without having hundreds of vertically stacked rooms just to get different roof and window heights. Without headache-inducing workarounds and objects just to get buildings that are just that little bit more detailed.



Minecraft has it's blocks as 1m in size, and it is perfect for building cityscapes and jungles. It's blocky so its easy to work with, but its small enough that there is enough variety to look interesting. Imagine what it would look like with the level editor's slopes and diagonal walls.
Boobandie is offline   Reply With Quote
Old 09-12-13, 13:09   #426
Lwmte
Explorer
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 951
Default

UVRotate is done! I just modified BorderedTextureAtlas_GetCoordinates function a bit to allow shifting vertical coordinates and splitting resulting coordinates in half.


@Boobandie: OpenTomb allows any complexity of geometry, it all depends on level editor. Current winroomedit (even heavily patched NGLE) have no possibility of reducing block size, as it's depending on TR floor data format. So, we either need new level editor written from scratch, or somehow get the source code for existing tools to modify it. While there's no chance of getting sources for official tools, we still can try to ask Turbo Pascal to release sources for Dxtre3d 2.0, but today it's mostly ignored by level builders in favor of Paolone's toolkit.
Lwmte is offline   Reply With Quote
Old 09-12-13, 20:30   #427
Lwmte
Explorer
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 951
Default

So now we have fully working UVRotate, which is much more advanced than TR4/5 one. Unlike native TRs, OpenTomb's UVRotate doesn't depend on tile size (i. e. tile of ANY size could be UVRotated one), and all parameters could be of course specified per each texture individually. One thing to note is that you also have different types of UVRotate - normal (forward), backward and reverse (forward-back).

Also I have implemented combo type of UVRotate and classic framed animations, known as "river-rotate" by TRNG builders. You can also combine any classic framed type with any UVRotate type to get interesting effects!


I'll upload code to SF, when we rule out differences with TeslaRus version - oh, and by the way, he told me that he already fixed opaque animated textures!

OK, code is now on SF - no opaque animations yet, gotta do it tomorrow!

Last edited by Lwmte; 09-12-13 at 20:47.
Lwmte is offline   Reply With Quote
Old 09-12-13, 22:07   #428
raiderromero
Archaeologist
 
raiderromero's Avatar
 
Join Date: Jan 2012
Location: Coatzacoalcos veracruz in Mexico
Posts: 2,090
Default

wow very nice
__________________
Coder in progress...
raiderromero is offline   Reply With Quote
Old 12-12-13, 17:33   #429
FairFriend
Student
 
FairFriend's Avatar
 
Join Date: Mar 2012
Posts: 107
Default

You guys rock!
FairFriend is offline   Reply With Quote
Old 13-12-13, 06:32   #430
Lwmte
Explorer
 
Lwmte's Avatar
 
Join Date: Aug 2010
Posts: 951
Default

Thanks!

Ok, TeslaRus managed to enable opaque animated textures working, but we've faced another problem - the way UVRotate works in TR4. It seems that UVRotate is hardcoded for certain levels, because in Angkor Wat we have 2 animated sequences which are UVRotated, while in Desert Railroad we have single (first) sequence with lots of frames, each one representing single UVRotate texture.

Well, if UVRotate script line specifies that FIRST animated sequence is an array of UVRotated TexInfos, then why we have SECOND sequence UVRotated in Angkor Wat? Moreover, second sequence contains 64x16 tile, which seems to be dependent on "parent" TexInfo from first sequence, because rotating its coordinates results in completely wrong texture application...

Maybe UVRotate line script enables BOTH first sequence as UVRotate array and ANY animated sequence with single frame as UVRotated texture? Seems so. One thing for sure - single-frame sequences are NOT always treated as UVRotate sequences - to be sure, load alexhub2.tr4 level, and you will see that certain grass textures on the coast are UVRotating! This is the level builder's fault (perhaps he accidentally assigned these textures to a single-frame animation range in winroomedit), but it wasn't noticed by anyone because UVRotate wasn't assigned for this level. Funny that only now we learn such Core Design's level building mistakes.
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 02:47.


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