Airikita Posted March 6, 2014 Share Posted March 6, 2014 (edited) So I had a theory, and ran a quick test... I'm not 100% on everything, but I've figured out 2 things: 1.Water texture animation is based on what scene you're in (based on scene index), so a map that has water will work 2. Water (animation) flow/direction is fixed on what scene you're in (or just based on a fixed direction) ----------------------------------------------------------------------------------------------------------------------------------------- **EDIT NOTE: the direction is not fixed for water textures on map mesh, but it seems like the animations for ToT, and maps with water, have similar scene table values, but ToT animations seem to have an apparent different animation. Likely based on a scene check in code? ** ** Some scene-specific things still occur, but both theories are proven otherwise. I still hold the fact that there's a possible DA command in the zmap display list that dictates which textures animate a certain way ** ----------------------------------------------------------------------------------------------------------------------------------------- I figure if you make a map for a level with water, you have to add the texture to the map, and possibly give it a special value and rotate the map so that the water flows in the direction you want it to. Might be a DA command in the display list (which needs to be confirmed). So when you have a map with water, you have to add the mesh to the map with the water texture, and give it a special value for it to work. Some maps might not have a fixed direction since it's possible the Water Temple has special properties for some parts, like the whirlpool chamber. Anywho, Lake Hylia is special in that it seems to generate the texture automatically, so you will have to figure out the rest on it. *Test was done rotating the river texture/mesh in Gerudo Valley.* Edited March 7, 2014 by Airikita 1 Link to comment Share on other sites More sharing options...
Jason777 Posted March 6, 2014 Share Posted March 6, 2014 Strati has already figured out how water direction works. As for using texture animation, that has to do with branching to special ram segments (DE 00 00 00 08 00 00 00); these segments are set up beforehand using DB commands and whatnot. As for the code that animates the texture, that is actually what sets up these special segments and is entirely scene based. Things to read... https://www.the-gcn.com/topic/600-xdaniels-random-junk/?p=10695 https://bitbucket.org/ottehr/z64-tex-ext/wiki/Home http://z64.spinout182.com/index.php/topic,424.0.html Page 4 of "xdaniel's random junk" contains a few good posts to look at. EDIT: We really need to stop losing information like this... Link to comment Share on other sites More sharing options...
xdaniel Posted March 6, 2014 Share Posted March 6, 2014 Water texture animation is based on the "scene configuration" byte in the scene's entry in the scene table, not exactly the scene index number: http://wiki.spinout182.com/w/Debug_ROM:_Scene_Table That byte also affects camera effects, multi-texturing, etc. For example, change Hyrule Field's 0x01 to 0x02 0x00 (the default for many house interiors, but not exclusively them) and the water animation stops. Edit, Jason was faster Edit 2, why'd I write 0x02...? Link to comment Share on other sites More sharing options...
petrie911 Posted March 6, 2014 Share Posted March 6, 2014 My work in the water temple indicates that the current is part of the collision of the underlying polygons. There's a value in the collision type data that specifies its direction Link to comment Share on other sites More sharing options...
Jason777 Posted March 6, 2014 Share Posted March 6, 2014 Yup, it's as you said, petrie. Here's Strati's documentation which includes current movement: https://www.the-gcn.com/topic/2544-oot-polygon-types/?do=findComment&comment=40617 Link to comment Share on other sites More sharing options...
Airikita Posted March 6, 2014 Author Share Posted March 6, 2014 My work in the water temple indicates that the current is part of the collision of the underlying polygons. There's a value in the collision type data that specifies its direction Collision? Perhaps.. although how would that explain just moving the mesh? (Unless I moved the collision without realizing?) EDIT: also waterfalls are just the mesh, and not part of any collision. So what about that? EDIT2: kk, I assumed this wasn't posted since JSA agreed with me. Link to comment Share on other sites More sharing options...
Arcaith Posted March 7, 2014 Share Posted March 7, 2014 I actually think water flow direction is calculated based on texture co-ordinates, specifically which direction is 'up' and which is 'down' (or 'right' and 'left', depending on which values are checked); basically positive and negative UV co-ords. It either shifts it toward positive or negative on one (or both) U and V axes by a factor of 0.9999 (a full repeat being 1.0) (or 1023 (full repeat being 1024) in the case of OOT, since it doesn't use floats for texture co-ords) and then resets the co-ordinates back to their origin as it's shifted it once along the length of the texture. The process repeats, creating the illusion of a moving surface. This also explains how the water in Hyrule Field is able to change direction, rather than using hardcoded pointers. Unless it's using the waypoints in the moat itself. Link to comment Share on other sites More sharing options...
Airikita Posted March 7, 2014 Author Share Posted March 7, 2014 I actually think water flow direction is calculated based on texture co-ordinates, specifically which direction is 'up' and which is 'down' (or 'right' and 'left', depending on which values are checked); basically positive and negative UV co-ords. It either shifts it toward positive or negative on one (or both) U and V axes by a factor of 0.9999 (a full repeat being 1.0) (or 1023 (full repeat being 1024) in the case of OOT, since it doesn't use floats for texture co-ords) and then resets the co-ordinates back to their origin as it's shifted it once along the length of the texture. The process repeats, creating the illusion of a moving surface. This also explains how the water in Hyrule Field is able to change direction, rather than using hardcoded pointers. Unless it's using the waypoints in the moat itself. No, because I rotated the mesh, and the water still flows one straight direction. It's not restricted to the mesh or mapping. That's why I said rotating the map to your liking will control the water direction when importing maps. Link to comment Share on other sites More sharing options...
Arcaith Posted March 7, 2014 Share Posted March 7, 2014 You mean the texture still moves vertically? Link to comment Share on other sites More sharing options...
Airikita Posted March 7, 2014 Author Share Posted March 7, 2014 You mean the texture still moves vertically? Well idk now... it did go in one direction, but rotating the map did something else. Still, I'll be digging through the map to see. I'm pretty sure there's a value for the mesh. And no, this isn't about water collision. There is no collision on the mesh for the texture. I think we all ended up talking about something different altogether. Link to comment Share on other sites More sharing options...
Jason777 Posted March 7, 2014 Share Posted March 7, 2014 Did you look at the collision doc I linked to? It talks about how setting the collision polygons types underneath the waterbox will cause the waterbox to follow a vector. Link to comment Share on other sites More sharing options...
Airikita Posted March 7, 2014 Author Share Posted March 7, 2014 Did you look at the collision doc I linked to? It talks about how setting the collision polygons types underneath the waterbox will cause the waterbox to follow a vector. What does that have to do with the mesh animating? JSA just rotated the map to test, and the water texture is attached to the map for one thing, and it was still flowing in the proper direction. We're still talking about COMPLETELY different things here!!!!!!! Go look at Gerudo Valley in a map editor, and you tell me that the water mesh ON THE MAP is the bloody waterbox. Okay? I'm done trying to respond to this. Link to comment Share on other sites More sharing options...
Jason777 Posted March 7, 2014 Share Posted March 7, 2014 Oh dear, excuse me for trying to be of some help. I know how you keep on apologizing to people for the way you act, but do you ever read the way you reply to some people before posting? IT TAKES A REALLY INTELLIGENT BEING TO REPLY IN ALL CAPS AND ASDFASDFASDF THE SHIT OUT OF SOMEONE FOR BEING SOOOO INFERIOR TO YOU. In case you haven't noticed, you're starting to tick off a lot of people on practically a weekly basis. I normally try to steer away from drama but I constantly find myself thinking "Oh damn, this Airikita is pretty smart"... and then the next day I think "Goddamn, what an ignorant ass." And I really doubt that you'll be "done trying to respond to this." Seriously, learn how to talk to people or deal with others calling you out on your immature little rants. Link to comment Share on other sites More sharing options...
Airikita Posted March 7, 2014 Author Share Posted March 7, 2014 Jason777: you didn't even read my previous posts, and kept going about collision. It was way off from what I was talking about. I am trying to help people with water animations, and you're talking about the water box pushing Link down stream. 2 different things. I'm not being an ass, I'm trying to point out that you people keep talking about something else from my topic! Call it drama, but you completely ignored the topic, and everyone started talking about the water boxes. I was talking about water ANIMATIONS, not the current to the water box. I already know collision dictates things with game elements, but the mesh is a display list, and I was saying there's probably a DA command attached to the texture. I'm pissed off because everyone is talking about something else making me sound like an idiot in this topic! I already know about water boxes and collisions, which was not what this topic was about. The title even says "water animations", and I was trying to explain how it was attached to the map mesh, and how that would work with scenes. When I swapped ToT with Gerudo Valley, I noticed how the floor of the map moved like water. There is the value for ToT like Gerudo Valley and other maps with water, but the animations for ToT are not water. So, the values for the map are irrelevant as I have found. Even swapping with Hyrule Field resulted in different results. The triforce animated like water, and the floor in the Master Sword room moved like water. When I swapped the scenes, it didn't matter, ToT still animated like water. So yes, it's scene-specific, but possibly more so for ToT. That is what I'm trying to explain here. So call me an asshole, but I keep trying to explain it, and everyone is trying to debate me on a completely separate topic! Link to comment Share on other sites More sharing options...
Arcaith Posted March 8, 2014 Share Posted March 8, 2014 Okay guys, settle down. 1- If the entire map was rotated on one axis and the orientation of the texture scrolling remains unchanged, then that seems to support my theory that it follows the UV co-ordinates, not a fixed direction hardcoded into the map. 2- I'm assuming that whatever is done with the scene table, it's related to loading the 'macro' that causes the water to flow, as there would be no point in loading it in a scene that doesn't need it. 3- If swapping the scene table entries is causing particular surfaces to move like water, it stands to reason that the 'macro' targets a specific texture definition, or group of polygons by a numbered value and animates it at a fixed speed as defined either in the table somewhere, or in the 'macro' itself, which may be elsewhere in the ROM. Link to comment Share on other sites More sharing options...
Recommended Posts