Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (93,064 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

steve-m

[SA|DOC] water.dat

Recommended Posts

steve-m

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 biggrin.gif

Edited by steve-m

Share this post


Link to post
Share on other sites
BenMillard

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. sad.gif

 

Does the file still work when these are replaced with the normal pair of characters for a standard Windows new line?

Share this post


Link to post
Share on other sites
DexX

it uses 4 spaces, like this; " ", its not one character.

 

@ steve excellent work, suprised you didnt pin it.

Share this post


Link to post
Share on other sites
steve-m

@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. tounge.gif

Share this post


Link to post
Share on other sites
DexX
@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. tounge.gif

This is a start-

Maps -> Directory

Share this post


Link to post
Share on other sites
dertyjerzian
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 tounge.gif 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...)

Share this post


Link to post
Share on other sites
santehnik

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 smile.gif

 

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 smile.gif thanx to all

Edited by santehnik

Share this post


Link to post
Share on other sites
mickarrow

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...

Share this post


Link to post
Share on other sites
steve-m

649 and 157 are even numbers? That's new to me. tounge.gif Also, the points don't seem to be in the right order.

Share this post


Link to post
Share on other sites
mickarrow

euhm... blush.gif ...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?

 

 

Share this post


Link to post
Share on other sites
steve-m

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.

Share this post


Link to post
Share on other sites
mickarrow

I hate even numbers sneaky2.gif

 

user posted image

 

Is there really no way around this? Now it looks like my pool has a leak somewhere smile.gif .

 

 

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. suicidal.gif

 

-------------------------

Edit::

 

Test completed:

 

Apart from missing 2 large chunks of ocean, I defenitaly got a hole where the pool water should be.

 

user posted image

 

 

An, idd, removing the underlaying water gives back the 'physical' effects of the above water.

 

user posted image

 

 

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:

 

user posted image

 

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 by mickarrow

Share this post


Link to post
Share on other sites
mickarrow

Yeah, double post, I know turn.gif

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:

 

user posted image

 

 

Good example

 

user posted image

 

 

If you use the Bad example, you'll get what I encountered in my 4th pic of my previous post.

 

 

-----------------

 

UPDATE::

 

GREAT NEWS!! biggrin.gif

 

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 by mickarrow

Share this post


Link to post
Share on other sites
steve-m

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. tounge.gif

 

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.

Share this post


Link to post
Share on other sites
mickarrow

 

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 suicidal.giftounge2.gif 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.

Share this post


Link to post
Share on other sites
ocram88

water.dat is a nice topic^^

 

here an old max script of me for the water.dat of SA

 

Click

Share this post


Link to post
Share on other sites
steve-m
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.

Share this post


Link to post
Share on other sites
sueey

good doc,let me see the doc!Support the poster!

Share this post


Link to post
Share on other sites
mickarrow

@ 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? biggrin.gif

Share this post


Link to post
Share on other sites
Gforce

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.

Share this post


Link to post
Share on other sites
BenMillard

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. smile.gif

 

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 by Cerbera

Share this post


Link to post
Share on other sites
BenMillard

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:

    user posted image

    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. smile.gif

Water Types
  • 0 = 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.

Share this post


Link to post
Share on other sites
kal-el5676

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. sad.gif

Share this post


Link to post
Share on other sites
ThePrince

this should be on tutorial section .. icon14.gif

Share this post


Link to post
Share on other sites
kal-el5676

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. tounge.gif

Share this post


Link to post
Share on other sites
kal-el5676

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 by kal-el5676

Share this post


Link to post
Share on other sites
ZAZ

 

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?

Share this post


Link to post
Share on other sites
kal-el5676

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.