steve-m Posted August 22, 2005 Share Posted August 22, 2005 (edited) Been doing lots of testing with the water recently, and posting here and there, now it's time to collect all the info in a separate topic. The water.dat is a plain text file that defines the water tri- and rectangles in SA, the file water1.dat is old and not used by the game. The water.dat file starts with the word "processed" in the first line, followed by the water shape definitions, one per line. A water shape definition consists of 3 or 4 corner points, and a parameter Point1 Point2 Point3 [Point4] Param with the points consisting of 7 floats each and the parameter being an integer value. One corner point is built as follows: X Y Z F1 F2 F3 F4 X, Y, Z: coordinate F1: water current speed along X axis F2: water current speed along Y axis F3: unknown, influences waves, maximum is 1.0 F4: wave height The parameter at the end of each line defines the water type, and can have a value from 0 to 3: Parameter: 0 1 2 3 Visible: no yes no yes Shallow: no no yes yes Param 4 seemed to be identical with 0, I think they just repeat when higher than 3. Params 0 and 1 are used for ocean, which are infinitely deep, and 2 and 3 for pools, that are only a few meters. 0 and 2 have invisible water, so they can be used with own water textures, probably animated (like the stream). Water animals seem to appear for all 4. All values are separated by simple whitespaces, no commas or anything. Water shapes can be disabled by the use of a '#' character at the beginning of the line, just as in other map files. Water can only be defined for the normal map area (+/- 3000 on X and Y axis). This area is surrounded by a hardcoded, infinite ocean, with a water surface at 0.0 and a seabed at -70.0 (Z axis). If you define a water shape along the border, the outer corner points will automatically be moved to a level of 0.0, possibly resulting in odd water slopes. It it possible to define several layers of water, so theoretically a skyscraper with a pool in each floor wouldn't be impossible. You can even define water shapes at a level below zero, I've only tested until -80.0, but I guess -100 won't work anymore. Very important note: All X and Y coordinates of corner points must be even, rounded numbers (like 1234.0), otherwise the game will crash when you approach the water. The corner points should be defined in the order NE-NW-SE-SW, or also SW-SE-NW-NE: # 2---1 3---4# \ \ # \ \ # \ \ # 4---3 1---2 Hope this helps, awaiting your contributions. Edit: Updated, many thanks to JKM Edited August 22, 2005 by steve-m Rem Riddle, _onyx_, RyanDri3957V and 1 other 2 2 Link to comment Share on other sites More sharing options...
BenMillard Posted August 23, 2005 Share Posted August 23, 2005 I've just had a look at this file and it uses a weird character to seperate each water shape. It seems to be either a Carriage Return or a Line Feed character, instead of the normal Windows convention of both characters being used. It meant that CFG Studio crashed when I tried to open it. Does the file still work when these are replaced with the normal pair of characters for a standard Windows new line? Link to comment Share on other sites More sharing options...
DexX Posted August 23, 2005 Share Posted August 23, 2005 it uses 4 spaces, like this; " ", its not one character. @ steve excellent work, suprised you didnt pin it. Link to comment Share on other sites More sharing options...
steve-m Posted August 24, 2005 Author Share Posted August 24, 2005 @Cerb: I'm editing all text files with UltraEdit, and on opening the water.dat it asks me whether to convert to DOS format. And yes, they used a single line feed (0x0A) character to separate them. But I checked, normal Windows linebreak works as well. @dexx: Erm, because there are already way too many topics pinned? What we need would be an overview topic, with links to all the documentations, grouped by game. Or a wiki. Link to comment Share on other sites More sharing options...
DexX Posted August 24, 2005 Share Posted August 24, 2005 @dexx: Erm, because there are already way too many topics pinned? What we need would be an overview topic, with links to all the documentations, grouped by game. Or a wiki. This is a start- Maps -> Directory Link to comment Share on other sites More sharing options...
dertyjerzian Posted August 24, 2005 Share Posted August 24, 2005 This is a start-Maps -> Directory I second that, was wondering about a directory for this section. I'm still new here, but that lil page of links there would be very handy, especially when it expands and maybe gets some tables or another easier to rad format.. OT: Seems if you make a small, very small like 4x4, patch of water, the water is not solid. Well water isn't solid, but you know what I mean This also might be because I have an entire 6000x6000 square of water under it canceling the "physical" part, not sure. But my 4x4 cube is visible and pretty as hell, just not solid. (doesnt need to be, just an observation) Also, to affirm for stripped game users, the crash on unrounded numbers being used is in fact true. You might get a box of water there, and you might start game near it, but heading away from it will crash the game the moment you turn around. ( I was playing with my fountain, trying to find ways...) Link to comment Share on other sites More sharing options...
santehnik Posted November 16, 2005 Share Posted November 16, 2005 (edited) Hi. I have a problem.Im adding a layer of water but it are added on 0 Z cordinate but need on 6.362. Can somebody say me what's the problem ??? -3000.0 3000.0 706.362 0.0 0.00000 1.0 15.0 3000.0 3000.0 6.362 0.0 0.00000 1.0 15.0 3000.0 -3000.0 6.362 0.0 0.00000 1.0 15.0 -3000.0 -3000.0 6.362 0.0 0.00000 1.0 15.0 1 This is my code but water on 0 Z !!! Help me please Added at 21.13 (gmt +2) Sorry for troubeling im fix this bug via changing x & y cordinates to 2000 it's normal for me thanx to all Edited November 16, 2005 by santehnik Link to comment Share on other sites More sharing options...
mickarrow Posted July 23, 2006 Share Posted July 23, 2006 Sorry for bumping a very old topic, but since I don't see to see any maps around with small sections of water, I guess no-one really cracked this yet. I'm working on the water in the pools I made for my Myriad lots and I used this line: QUOTE processed -3000.0 -3000.0 0.0 0.0 0.0 0.0 0.0 3000.0 -3000.0 0.0 0.0 0.0 0.0 0.0 -3000.0 3000.0 0.0 0.0 0.0 0.0 0.0 3000.0 3000.0 0.0 0.0 0.0 0.0 0.0 1 -649.0 -174.0 8.0 0.0 0.0 0.0 0.0 -649.0 -157.0 8.0 0.0 0.0 0.0 0.0 -659.0 -174.0 8.0 0.0 0.0 0.0 0.0 -660.0 -157.0 8.0 0.0 0.0 0.0 0.0 3 The squares in those lines don't show 'cause I copy/pasted this from notepad. Now all I have is a surface (not a box) of water, without physical effects, that crashes randomly even though I used even numbers. I hope someone can help me... Link to comment Share on other sites More sharing options...
steve-m Posted July 23, 2006 Author Share Posted July 23, 2006 649 and 157 are even numbers? That's new to me. Also, the points don't seem to be in the right order. Link to comment Share on other sites More sharing options...
mickarrow Posted July 23, 2006 Share Posted July 23, 2006 euhm... ...oops I guessed by even you meant it should end 0, like 57.0 in stead of 57.2, but yeah, even... I got it. When you say the order should be NE-NW-SE-SW, do you mean the NE of the model,or the NE of the map? Also, what about when it's the NE of the model, but you had to rotate your model to fit it into the lot structure? Link to comment Share on other sites More sharing options...
steve-m Posted July 23, 2006 Author Share Posted July 23, 2006 Points are always in absolute world coordinates, there is no way to attach them to objects or anything. So yea, no matter how you rotate your lot, you have to know its final position on the map - in Max you'd rotate it, move it to the right position, and then find the coords for the water poly. Link to comment Share on other sites More sharing options...
mickarrow Posted July 27, 2006 Share Posted July 27, 2006 (edited) I hate even numbers Is there really no way around this? Now it looks like my pool has a leak somewhere . Also, even though I used parameter 3, it's just a surface. There's no depth. Edit:: I just checked parameter 1 (ocean) too, but still just a surface. Dertyjerzian might be right when he said that an undergoing ocean cancels out the physical effect. Next test: cutting a whole in the ocean where my pool is. ------------------------- Edit:: Test completed: Apart from missing 2 large chunks of ocean, I defenitaly got a hole where the pool water should be. An, idd, removing the underlaying water gives back the 'physical' effects of the above water. As for the skyscraper theory: It is possible to have different pools above each other, but they will use only a moving texture and have no swim-ability. (Maybe if the different levels of water are further appart?? But I doubt it.) --------------------- Edit:: I checked my code, and it seems I forgot 2 -'s, so it showed 3000 in stead of -3000. So now the 2 missing pieces of ocean are back. New problem: The different pieces of ocean I had to make to cut a hole in it, do not match. It seems only the 2 big ones (the previous missing ones) have got waves, while the 2 smaller ones don't ( the strip you see in the 2nd pic.) Can this be 'caused by the fact that I made them run right upto the point where my elevated pool is (+ 8 on the Z-axis)? Here's the code I use: processed 3000.0 3000.0 0.0 0.0 0.0 0.0 0.0 -3000.0 3000.0 0.0 0.0 0.0 0.0 0.0 3000.0 -206.0 0.0 0.0 0.0 0.0 0.0 -3000.0 -206.0 0.0 0.0 0.0 0.0 0.0 1 -572.0 -206.0 0.0 0.0 0.0 0.0 0.0 -3000.0 -206.0 0.0 0.0 0.0 0.0 0.0 -572.0 -224.0 0.0 0.0 0.0 0.0 0.0 -3000.0 -224.0 0.0 0.0 0.0 0.0 0.0 1 3000.0 -206.0 0.0 0.0 0.0 0.0 0.0 -560.0 -206.0 0.0 0.0 0.0 0.0 0.0 3000.0 -224.0 0.0 0.0 0.0 0.0 0.0 -560.0 -224.0 0.0 0.0 0.0 0.0 0.0 1 3000.0 -224.0 0.0 0.0 0.0 0.0 0.0 -3000.0 -224.0 0.0 0.0 0.0 0.0 0.0 3000.0 -3000.0 0.0 0.0 0.0 0.0 0.0 -3000.0 -3000.0 0.0 0.0 0.0 0.0 0.0 1 -560.0 -206.0 8.0 0.0 0.0 0.0 0.0 -572.0 -206.0 8.0 0.0 0.0 0.0 0.0 -560.0 -224.0 8.0 0.0 0.0 0.0 0.0 -572.0 -224.0 8.0 0.0 0.0 0.0 0.0 3 -------- Edit:: I was think it might have to do with the fact that now the different squares don't share points. Pffff....up tot the next test. If anyone wants to join in the fun, be my guest... Edited July 27, 2006 by mickarrow Link to comment Share on other sites More sharing options...
mickarrow Posted July 27, 2006 Share Posted July 27, 2006 (edited) Yeah, double post, I know I didn't feel like editing an overedited post even more, plus I got the test results. If you want to add, let's say, a pool with working (swimeable) water, you'll have to make sure there's no existing water running under your pool. You'll have to make a gap in the ocean where you want your pool to be. Now, for different pieces of ocean to work correctly (read: smooth transition between pieces) after you made the gap, you'll have to define each point of the grid you made. (It sounds harder then it is) Below is an example: (Don't mind the triangles, I only used Zmod as a reference example) Look at the points. Bad example: Good example If you use the Bad example, you'll get what I encountered in my 4th pic of my previous post. ----------------- UPDATE:: GREAT NEWS!! I just found out rounded numbers are NOT necessary on the Z-axis. However, the number before the comma still needs to be an even number. But seeing you can work after the comma now, that's not really an issue anymore. Good example: 20.0 16.0 6.415 Bad example: 20.0 16.0 7.0 Edited July 28, 2006 by mickarrow Link to comment Share on other sites More sharing options...
steve-m Posted July 28, 2006 Author Share Posted July 28, 2006 Well, Myriad will have no water below the landmasses of course, so people won't need to cut holes into the ocean. But I did test multiple layers of water, and they did work back then, maybe there's a minimum distance. And yes, rounded/even numbers only for X and Y, you should've read the first post more carefully. As for those illustrations of a water gap and 8 rectangles around it, I'm pretty sure you can also cut that down to 4 parallelograms. Link to comment Share on other sites More sharing options...
mickarrow Posted July 28, 2006 Share Posted July 28, 2006 But I did test multiple layers of water, and they did work back then, maybe there's a minimum distance. I guess so. 'Cause my water (8 on the Z-axis) didn't work while the ocean (0 on the x-axis) ran underneath it. It did so when I cut a hole in the ocean. Well, Myriad will have no water below the landmasses of course, Why not? If it's possible, and someone makes a lot that could use it, why not do it. It's not as if the water.dat is going to slow the game down. I was planning to cut out the ocean where the islands are, so people could in any case, mimimum distance or not, have swimable water. And yes, rounded/even numbers only for X and Y, you should've read the first post more carefully. You know, I really should have It would've saved me some testing. As for those illustrations of a water gap and 8 rectangles around it, I'm pretty sure you can also cut that down to 4 parallelograms. I know, but that wasn't the point of the illustrations. It was to show how to avoid my previous problem. Link to comment Share on other sites More sharing options...
ocram88 Posted July 28, 2006 Share Posted July 28, 2006 water.dat is a nice topic^^ here an old max script of me for the water.dat of SA Click Link to comment Share on other sites More sharing options...
steve-m Posted July 29, 2006 Author Share Posted July 29, 2006 Well, Myriad will have no water below the landmasses of course, Why not? If it's possible, and someone makes a lot that could use it, why not do it. It's not as if the water.dat is going to slow the game down. I was planning to cut out the ocean where the islands are, so people could in any case, mimimum distance or not, have swimable water. What I meant was, we would only have water where it's actually visible, not unnecessarily hidden under the landscape as in the test version (as you said in your last sentence). Just like in the original games. Link to comment Share on other sites More sharing options...
sueey Posted July 29, 2006 Share Posted July 29, 2006 good doc,let me see the doc!Support the poster! Link to comment Share on other sites More sharing options...
mickarrow Posted August 19, 2006 Share Posted August 19, 2006 @ Steve-M: I've been importing all the coordinates I wrote down into a new water.dat for MI, and I found out that the game only uses cubes, rectangles and triangles. Also triangles, but as far as I can tell, at least one corner must be 90°. I know you mentioned this in your first post, but afterwards you talked about parallellograms, but then none of the corners is 90° . I've also noticed that if you've written down a random 4-corner shape, the game tends to snap it to the outer world ocean bounderies, or at least make it fit the straight corner rule. Anyone knows if this is correct? Or am I totally missing something here? Link to comment Share on other sites More sharing options...
Gforce Posted September 15, 2006 Share Posted September 15, 2006 i recently decided to play about with how the water works ingame SA. i found that the water plane size must be in increments of 4. i tried numbers 38,42 and 46 and the game eventually crashed in the surrounding area of the water, sometimes (using the bad numbers) you can actually jump in the water and it acts just like any other alpha plane with a dummy col and the player will not swim but get close to one boundaries of the water and the game crashes out. one other thing i found out is that you can create a water plane directly over another water plane but you need to use a z-axis distance between the 2 planes above 10 on each corner of the upper plane. Link to comment Share on other sites More sharing options...
BenMillard Posted September 17, 2006 Share Posted September 17, 2006 (edited) Mickarrow, nice demos but please use [code] tags around data samples: processed3000.0 3000.0 0.0 0.0 0.0 0.0 0.0 -3000.0 3000.0 0.0 0.0 0.0 0.0 0.0 3000.0 -206.0 0.0 0.0 0.0 0.0 0.0 -3000.0 -206.0 0.0 0.0 0.0 0.0 0.0 1-572.0 -206.0 0.0 0.0 0.0 0.0 0.0 -3000.0 -206.0 0.0 0.0 0.0 0.0 0.0 -572.0 -224.0 0.0 0.0 0.0 0.0 0.0 -3000.0 -224.0 0.0 0.0 0.0 0.0 0.0 1... Makes the message easier to follow and makes any words used in the sample (such as "processed") clearly part of the sample. Since there's a few people happily playing with water effects, maybe someone would like to test if any cullzones affect water? Turning off the special effects when underwater would be very useful for the MISA tunnel system. (EDIT) The parameter at the end of each line defines the water type, and can have a value from 0 to 3: Parameter: 0 1 2 3 Visible: no yes no yes Shallow: no no yes yes The Parameter looks a lot like a flag value to me. The above could be written as:0 = (None) 1 = Visible 2 = Shallow 4 = (Undefined) 8 = (Undefined) So, a value of 3 is 1 + 2 which is why it produces Visible + Shallow water. A value of 4 wouldn't use 1 or 2, so it behaves like 0. Makes sense? (Strictly speaking, data tables should be written so their headers go across the tops of the columns.) Edited September 17, 2006 by Cerbera Link to comment Share on other sites More sharing options...
BenMillard Posted February 9, 2007 Share Posted February 9, 2007 Following up with more findings, so hopefully the bump is OK Comments You can have as many comment lines as you like between the processed section label and the first line of data. Comments at the ends of data lines are fine. Even putting a comment at the end of the final data line is fine. If you put commented lines between data lines you can get very, very strange side effects in-game. For examples, these rectangles which meet the game boundary got split into triangles: 1280 x 1024, 106kB. Removing the comment lines which were between data lines fixed the problem. So if you experience weirdness then check where your comments are. Water Types0 = Ocean: infinite depth, invisible surface. 1 = Ocean: infinite depth, visible surface. 2 = Pool: 6 units deep, invisible surface. 3 = Pool: 6 units deep, visible surface. If you stack pool water less than 4.6 units apart, you'll get a smooth transition when diving between them. This enables you to make deeper pools and lakes without making them infinite depth. The space beneath pool water does not get dark, unlike the space below ocean water. This means you can have tunnels beneath pool water right down to -100z and still have normal light levels. Cullzones As far as I can tell, cullzones have no effect on water. Link to comment Share on other sites More sharing options...
kal-el5676 Posted November 7, 2011 Share Posted November 7, 2011 Sorry for the super major bump here but has anyone ever experienced the water disappearing as you approach? I added 1 water plane to the default dat and whenever i approach the ocean it begins to disappear! I even tried deleting the ocean under my water plain to no avail. i have used numerous different codes and all the same result. Delete the line and the problem is gone. RyanDri3957V 1 Link to comment Share on other sites More sharing options...
ThePrince Posted November 7, 2011 Share Posted November 7, 2011 this should be on tutorial section .. Link to comment Share on other sites More sharing options...
kal-el5676 Posted November 7, 2011 Share Posted November 7, 2011 The prince! My hero!!!! There is a lot of good info. Whenever i add a water plane to my default dat the water develops this problem but if i delete one and then add mine it works fine. Link to comment Share on other sites More sharing options...
kal-el5676 Posted March 8, 2012 Share Posted March 8, 2012 (edited) Working with water dat is simply put a nightmare. Editing existing water now ALWAYS causes the water to disappear. Sometimes deleting other water box's is necessary. Edited March 8, 2012 by kal-el5676 Link to comment Share on other sites More sharing options...
ZAZ Posted March 8, 2012 Share Posted March 8, 2012 Working with water dat is simply put a nightmare. Editing existing water now ALWAYS causes the water to disappear. Sometimes deleting other water box's is necessary. Can't confirm. Maybe you lost the overview. Just take care by importing and exporting. And important is that the water plane size must be in increments of 4 like Gforce montoined Or do you think it have a limit for the inserted lines? CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
kal-el5676 Posted March 8, 2012 Share Posted March 8, 2012 Indeed. After adding a water box and getting glitches i played with the values to no avail. Afterwards i deleted a default water box and it works. Any number over the default number of water box's causes major glitches in my game. Link to comment Share on other sites More sharing options...
Captain Bigboss Posted April 19, 2020 Share Posted April 19, 2020 My game crash when i near. Please help me RyanDri3957V 1 Link to comment Share on other sites More sharing options...
ZAZ Posted April 19, 2020 Share Posted April 19, 2020 what have you done? CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now