Water Brushes/Volumes

FehaFeha Join Date: 2006-11-16 Member: 58633Members
edited December 2012 in Modding
<div class="IPBDescription">A mod for mappers</div>This is a water mod for ns2, which makes it possible to create maps with swimmable water.
You can find it in the <a href="http://steamcommunity.com/sharedfiles/filedetails/?id=113181405" target="_blank">workshop</a>, or download it through svn from here <a href="http://fehastuff.googlecode.com/svn/trunk/NaturalSelection2/mod_water/" target="_blank">http://fehastuff.googlecode.com/svn/trunk/...ion2/mod_water/</a>

Using this mod, a mapper can place a water entity in their map. It shows up as a box they can move and re-size, meaning that it is pretty much like a water brush from hammer. When you play the map, you can enter this volume, and it will let you swim in it, with similar movement as source water.
Right now, changing angle of the water wont really work. Thinking of testing out the default trigger again to save me some time. Last time I used it, there was some weird behavior, but that was a few builds ago (2 years).

In-game you will see it as some cinematic (defined by mapper in map-editor, try "cinematics/water/water1.cinematic" for now if you cant make one yourself) on each face of the volume, making it possible to see where it is. Had to settle with this for now, as I have issues figuring out how to set models textures or similar.


It works really well for most classes, such as readyroom players, standard marines and a few aliens. While the other aliens work, they have slightly wonky movement in the water (skulk especially).
I made exosuits unable to swim as I really don't see how they could, but if people rather let them swim, it shouldn't be too hard to implement. Jetpackers swim as well as standard marines, except that the gravity might be a bit too low when you use the jetpack in water (and jetpacks doesn't use normal gravity until you landed, even if you turn them off). You still fall, just very slowly. I might change this behavior.
Lerks are also able to fly in water, like the penguins they are.

If you notice anything else, please tell me, as then I most likely have not noticed it myself.
I would also love any feedback if you think anything should be changed or have an idea on how to make it easier to use.


<b>Media:</b>
Here is some media showcasing this mod

Video recorded by phone.
Damn I hate to hear my voice from recordings :P
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/Sjr7OIwaZRQ"></param><embed src="http://www.youtube.com/v/Sjr7OIwaZRQ" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>

<a href="http://cloud.steampowered.com/ugc/884095665215883379/974FC365BE5D9F7FEF09F35AA2036100A2A0556E/" target="_blank">This forum doesnt like steam screenshoots?</a>
<a href="http://cloud.steampowered.com/ugc/884095665215880497/30ACA2730B6D0C2AAC6FAF4ADF3A7169D0BBC188/" target="_blank">Well here is some screenshoots of the mod anyway. Nothing to hang in your christmas tree, but its <i>something</i></a>



<b>Questions:</b>
I would appreciate help with figuring out how to either change texture of models, or in lack of that, paint textures mid-air. Currently the material path you set for water should point to a cinematic, which I spawn on every face so you can at least see where the water is located.
If its impossible to use textures like that, I am currently thinking of solving it by creating several small cinematic per face to cover it (laggy). Dont really want that...

I also wonder if anyone know how I can make my mod simply append stuff to the editor_setup.xml, so I can make the mod work with other mods affecting editor as well.

If anyone know how to open spark with a workshop mod enabled, please tell me how. Only way I know so far is to use launchpad to create a mod, paste the mod into that, and the launch spark with it selected.



As a last note, feel free to do whatever you want with the sourcecode. Just don't grab legal rights over it so you can sue or patent-troll others using it. Call that the copyright license if you wish.
«1

Comments

  • RamblemoeRamblemoe Join Date: 2010-12-21 Member: 75812Members, Forum Moderators, NS2 Playtester, Subnautica PT Lead, Retired Community Developer
    You should make a short video showcasing this. :)
  • JibrailJibrail Join Date: 2009-04-16 Member: 67200Members
    would be great to have a picture or short video to show it off.
  • killer monkeykiller monkey Join Date: 2010-02-26 Member: 70743Members, Reinforced - Shadow
    Water?! In spark?! How?
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=2051940:date=Dec 27 2012, 07:23 PM:name=killer monkey)--><div class='quotetop'>QUOTE (killer monkey @ Dec 27 2012, 07:23 PM) <a href="index.php?act=findpost&pid=2051940"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Water?! In spark?! How?<!--QuoteEnd--></div><!--QuoteEEnd-->
    <a href="http://2.bp.blogspot.com/-IIR-ePMq1vM/T2o1_vpft9I/AAAAAAAAAF8/ZwbMOr01kyU/s400/the+joker's+magic+trick.jpg" target="_blank">How about a magic trick?</a>
  • AngeluszAngelusz Harmonic entropist Join Date: 2003-07-10 Member: 18072Members, Forum Moderators, Constellation, NS2 Playtester
    Cool! Do you have any water animations yet? Would be lovely to see water in NS2, swimming stealth skulks inc! ;)
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    Usually the mid jump animation will work as a good placeholder right?
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    edited December 2012
    Due to popular demand I recorded a video using my phone, will post it here once its uploaded to youtube.
    EDIT: Check Main-post, the video is there now.

    Regarding animations, I suppose I could try to make the players play some non-walking animation while in water. Dont think I want to do ugly swimming animations ala GTA though (put player on stummick and make movement speed and such depend on where in animation you are), not to mention that I lack the know-how to create my own animations anyway :)
    Thanks for the suggestion though!

    Also thanks to Kouji, going to check out that particular animation.
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    *Bump*
    I implemented the animations, and they mostly look decent. Used jump animation as kouji suggested :)
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    Awyeah, now all we need is shiny water and shiny... Animated water!
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    How does one even animate water? :P Do you mean as in making it look as if its running/rippling water, or do you mean that it should be animated like cartoonish? Or maybe I should make it swim? :)
  • AngeluszAngelusz Harmonic entropist Join Date: 2003-07-10 Member: 18072Members, Forum Moderators, Constellation, NS2 Playtester
    I meant the water animation itself earlier, indeed rippling, waves etc. I imagine that's a bit more work though. At least the physics system exists already, it should be possible to code.
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    Well doing rippling and stuff is a bit beyond me, as I clearly cant even make it display textures properly yet. Why cant ppl be content with goldsrc graphics, if I even reach that? :P

    I plan to make a splash cinematic used on enter/exit, and when it comes to the water surface, my only option right now seems to be cinematic spam, or having a mapper create boxes with different textures for me. I dont really like either option though :P
    Using cinematics as surface will by itself cause surface animations though, but I dont really think they look good, and I highly doubt that they are cheap. Its what I have for now though...
    I also plan to check how to put an overlay on the screen, and muffle sounds. Taking damage does this I think, so it should be possible :)

    Creating waves is something I wont even try, unless giving proper tools created for stuff like surface generation.
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    Loving the work you've done here so far. Is your code hosted somewhere like github or google code, so that we can track it for updates?

    Regarding the water effect, you could use a material with a shader effect to make the water-rippling effect on the boundaries (once you work out how to render a material on the edges of the brush, that is). Something like this to start? Not sure how you get new shaders into the game but I think others have managed to edit them with some success, see the 'alien vision' threads on the forum.
    <center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/CesuoXYjSTE"></param><embed src="http://www.youtube.com/v/CesuoXYjSTE" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
    <a href="http://www.youtube.com/watch?v=CesuoXYjSTE" target="_blank">http://www.youtube.com/watch?v=CesuoXYjSTE</a>
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    edited December 2012
    It is hosted at googlecode, as a subversion repository. The link is in the main post, but i'll paste it here for you as well.
    <a href="http://fehastuff.googlecode.com/svn/trunk/NaturalSelection2/mod_water/" target="_blank">http://fehastuff.googlecode.com/svn/trunk/...ion2/mod_water/</a>

    And regarding shaders, yeah, sure that would look really good. Right now I would be satisfied if I managed to use textures though ;)
    Maybe I should add a planned-features section in the main post to ensure that I dont forget anything?

    Made some updates, now the cinematic scales with the water volume, and the mapper can scale the cinematic using a parameter as well. This is because a cinematics size isnt the same as a box models, and has to be adjusted if you want it to fit properly.
    Also changed my cinematic so it looks a bit different, think this looks better even if I increase its scale, as well as it outlines for the face.
    I also changed the image used by workshop to an in-game screenshoot!

    Apart from what you would notice as a user, I also split my swim mixin into three different mixins. This is so that if modders want to create entities affected by water, they can get the mixins for the specific parts they want it to do.
    The current mixins are InWater, Bouyancy (currently just applies accerelation in opposite direction of the gravity, will change later to something more proper), and Swim.
    Bouyancy and Swim currently depends on the mixins InWater and GroundMove, thinking of making Bouyancy use BaseMove instead.
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    edited August 2013
    A preview of the upcoming water filter. A "filter" that shows over the player's screen when they enter the water entity. The moving line of water thing meant to imitate going into the water is experimental, and still needs work. The water taking up the whole screen is most likely how it will look in the final version when you enter the water entity, made in the editor.

    At the top of the ladder looking over the CC, with the whole screen full of water, that is what it will look like when you enter the water entity. I just set a placeholder for now, just to experiment with the moving line of water to imitate going into the water. But I might end up scrapping that and just making the whole screen turn "watery" when you enter the trigger entity.
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    edited August 2013
    As samus said and showed, this mod is getting some work on it again.
    First, I want to give huge thanks and credits to Samus for whipping me into working on this now and then (mostly repairing it when a build breaks it) and not just drop it (feedback is crucial for me to continue a hobby-project, or I end up losing motivation).
    He also made something I have needed for a long time for this mod, a cube model with a water texture. So now I can create water with decent graphics!

    Recently, when he were working on the previously mentioned filter, I also stumbled upon something sweet looking into if the cloaked-filter could be used. I finally found a function to give models new textures! Sadly it seems to still be affected by the old texture, at least if the new is transparent, and I dont really know how to get rid of a models original texture.
    But all the more thanks to Samus awesome water model. Using a cinematic viewmodel for the filter rather than spending a lot of time figuring out how to do it in code was also a pretty nice idea he had, so credits to him for that as well.


    Currently the swimming movement is broken by the recent builds, I intend to fix it soon, but first I have been working on the appearances of the water since I finally have a model for it. I have patched up the code I use to detect stuff in water, so I now know how deep stuff is and such.
    When a player enter water, it plays a "splash" sound (currently using default ns2 sounds, so lets see if anyone can guess which sound it is without peaking in the code) and cinematic.
    In shallow water, if you walk around above a certain speed, it plays some "wading" sounds and splashes, while if submerged, the filter is applied.
  • JektJekt Join Date: 2012-02-05 Member: 143714Members, Squad Five Blue, Reinforced - Shadow
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    edited December 2013
    Very brief update until a much greater in depth information and instruction post.

    What's new?
    Working swimmable water, including angled water.
    Underwater screen effect to make it seem like you are really underwater.
    DSP sound effect to make it seem like you are underwater by muffling and making noises more deep and echoed. Toggleable suffocation damage. Structure damage, building underwater.
    A blank water model that can have configurable materials over it for things like sewer waste for example.
    A water valve that can fill or empty a pool, with configurable speed, scale from the editor. A water spout connected the valve that can be turned on and off playing a cinematic you can choose through the editor.
    Water splashes with footsteps and configurable sounds and cinematics though the editor for various things.

    Make it so that infestation grows on top.
    Add various inputs in the editor for different things.
    Make code more optimized if possible.
    Parameters to adjust the material properties like speed and scale done through the .material file, but through code.
    Make preview/tutorial/instructions on how to use it in detail.
    Get more people interested in Water mod :)
  • cooliticcoolitic Right behind you Join Date: 2013-04-02 Member: 184609Members
    Just wondering, does the water flow at all or is it's shape/size in a fixed amount?
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    Water does not "dynamically" flow, it's a box
  • IeptBarakatIeptBarakat The most difficult name to speak ingame. Join Date: 2009-07-10 Member: 68107Members, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow
    edited December 2013
    coolitic wrote: »
    Just wondering, does the water flow at all or is it's shape/size in a fixed amount?

    It should be possible to set it up so it pushes a player some direction, after that you could set up some moving texture or cinematic above the water 'box' to give the illusion that the water is flowing.

    That is how source does it.

    Edit: The water wouldn't be pushing the player, it would be a separate map entity.
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    I am pretty sure extraentitiesmod has a trigger_push entity.
    Mappers can use any material they choose, so changing to a "river" material should be possible.

    Also, the shape/size isnt really fixed. If you look at the vid, you can see how turning the valve scales it.
  • SolarisSolaris Join Date: 2003-05-11 Member: 16213Members
    First of all: this is very impressive!

    Is there any chance that, when this is closer to a "finished" state, it will be integrated into NS2 "core"? Some of the ExtraEntities mod stuff (weldables, push, etc.) works well (train/elevator sadly doesn't) but it has not been adopted into the core list. Very sad, we had those in NS1/hammer :/

    Also: If i want to use water in a map, how do I have to setup the editor? The launchpad doesn't give the option to define "dependencies", does it? So I can't set my map (which technically is a mod) to automatically require the water mod to be downloaded/installed/executed. And I can only load one mod, either the map or the water...

    Also, I got a couple of suggestions:
    - In addition to the displacement effect, let mappers define a "falloff" value, to simulate lower visibility in "thick" liquids like sewage or stale/muddy water.
    - adjust gravity so the players sink slowly, ascend slowly.
    - adjust "resistance" (movement speed) underwater. Maybe have the slowing effect kick in, when the model is partly in the liquid to a certain degree (like "more than knee-high"), so puddles of mud, etc. can slow down players.
    - a "breath meter" would be good to see how long until you drown. (Exos could be "immune" since they have a cockpit? Or you could have the exo cockpit slowly filling up with water that comes in through tiny openings :))
    - is it possible to modify the speed of a projectile after it has been fired? If so, bullets, spikes, spit and bilebomb should be slowing down significantly constantly, disappearing after a short distance. )

    If you want it to be more "interactive" with NS2's gameplay, have it negate the smoke grenade effect (the grenade just emits some bubbles), but have a pulse grenade effect the whole water entity; it's electric after all. I'm not sure about marine structures taking slow damage like in the video. I'd go for "water disables (but not destroys marine structures completly"; this way you could create maps where a key location could have two attack points for the Aliens - either kill the power node or make a pipe burst and disable the stuff until Marines can fix the pumps. Something along those lines. NS1 had a map (was it ns_agora?) where Marines had to weld a water pump so the commander could place structures in a previously flooded siege location.
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    edited December 2013
    Who said it wasn't in a finished state.... it's been "finished" since August. And it's not just as easy as "oh just integrate into official game it's so easy!" You literally do what you do with any other mod, you put it into your map folder, and load the map. You MUST MUST MUST run it through Launchpad or it won't work.
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    edited December 2013
    Solaris wrote: »
    First of all: this is very impressive!

    Is there any chance that, when this is closer to a "finished" state, it will be integrated into NS2 "core"? Some of the ExtraEntities mod stuff (weldables, push, etc.) works well (train/elevator sadly doesn't) but it has not been adopted into the core list. Very sad, we had those in NS1/hammer :/

    Also: If i want to use water in a map, how do I have to setup the editor? The launchpad doesn't give the option to define "dependencies", does it? So I can't set my map (which technically is a mod) to automatically require the water mod to be downloaded/installed/executed. And I can only load one mod, either the map or the water...
    Thanks, and as samus said, it is pretty much finished (as in, I dont think I will add any new feature to it) and has been so for a while.
    To use water in a map, you have to open spark editor from launchpad with this mod selected. Or more specifically, with the selected mod's editor_setup.xml edited to contain the bottom section of said file in watermod (comments in said file exist to clearly state where watermod starts).
    So if you want to map using both, say, watermod and extraentities mod, you would merge the editor_setup.xml files.

    If a map is loaded without the mod, but was modded to use it, all that spark does is that it skips the map-objects that doesnt have any linked lua entities. So in this case, you simply wont see or touch any water or valves.
    If a map was modded for more than one mod, and they use the built-in mod entry system (has a file "lua/entry/modname.entry)", all you should have to do is enable the required mods and load the map.
    However, I dont think you can make your map throw any errors to tell the user they need certain mods :(
    Solaris wrote: »
    Also, I got a couple of suggestions:
    - In addition to the displacement effect, let mappers define a "falloff" value, to simulate lower visibility in "thick" liquids like sewage or stale/muddy water.
    - adjust gravity so the players sink slowly, ascend slowly.
    - adjust "resistance" (movement speed) underwater. Maybe have the slowing effect kick in, when the model is partly in the liquid to a certain degree (like "more than knee-high"), so puddles of mud, etc. can slow down players.
    - a "breath meter" would be good to see how long until you drown. (Exos could be "immune" since they have a cockpit? Or you could have the exo cockpit slowly filling up with water that comes in through tiny openings :))
    - is it possible to modify the speed of a projectile after it has been fired? If so, bullets, spikes, spit and bilebomb should be slowing down significantly constantly, disappearing after a short distance.
    - With how I solved the cameras water-filter, things like a fall-off would not be very easy to do. It is currently a cinematic, and although the mapper can change which is used (to make it fit the water texture), it wont really make vision fall-off possible.
    - It already affects gravity and friction of submerged players
    - I made knee-high water do effects, so having it slow the player should be pretty easy. My own opinion however is that having water slow like that is more annoying than it gives depth to the gameplay. Instead, as it works now, short things like skulks will be slowed, while bigger things wont. Basically that means shallow water makes more sound (helps ambushes), while also punishing aliens that uses the floor.
    - A breath meter is not that awful of an idea, but I dislike doing GUI, and you could just count the seconds instead like in regular source games ;)
    - Projectiles that actually are projectiles (like the spit) could be slowed yeah. hit-scan weapons would not.
    Solaris wrote: »
    If you want it to be more "interactive" with NS2's gameplay, have it negate the smoke grenade effect (the grenade just emits some bubbles), but have a pulse grenade effect the whole water entity; it's electric after all. I'm not sure about marine structures taking slow damage like in the video. I'd go for "water disables (but not destroys marine structures completly"; this way you could create maps where a key location could have two attack points for the Aliens - either kill the power node or make a pipe burst and disable the stuff until Marines can fix the pumps. Something along those lines. NS1 had a map (was it ns_agora?) where Marines had to weld a water pump so the commander could place structures in a previously flooded siege location.
    I intentionally opted to have water by default not affect anything but players and things that corrode (such as marine structures. If you want to know more exact, check for stuff that uses "CorrodeMixin" in ns2 game files).
    Instead, is someone want to mod something to be affected by water in a specific way (such as slower projectiles), it would be as simple as loading the InWater mixin, then either use the submersion-hook-system or simply have an if-statement checking submersion status to run their desired modded code.


    Hope I answered every and any questions you had :)
  • AurOn2AurOn2 COOKIES&#33; FREEDOM, AND BISCUITS&#33; Australia Join Date: 2012-01-13 Member: 140224Members, Forum Moderators, NS2 Playtester, Forum staff
    edited December 2013
    @mouse
    Hydrocity here we go!
    Smash
    dryocity!
    So what's the bet spark can't take dynamic water? It'll sizzle away if you implement it.. hueh.
  • DC_DarklingDC_Darkling Join Date: 2003-07-10 Member: 18068Members, Constellation, Squad Five Blue, Squad Five Silver
    hmmmm.. water.
    If only they would implement this in core. :)

    well done so far.
    And no, I shant get my hopes up on the core thing. ;)
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    Is there any issue with me adopting the water mod into Proving Grounds? Water is another valuable option for mappers for sure.
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    As long as you update it when it's updated and give credit, and don't sue anyone over it, sure. You have to include the files in your map anyways so it works in game.
Sign In or Register to comment.