Jump to content
Sign in to follow this  
Feint

Diving Under Water

Recommended Posts

I'm still working on this module, just in case some of you were getting scared. I'm dividing my time between this and the aerial refueling module. But this module is my higher priority at the moment so I'm going back to it.

And what do we have here? BUBBLES!

Working with particles is a whole subtle art. Tiny changes have huge impacts. So I'm very happy that tpw did so much hard work on his foggy breath particle values and shared his sqf. I used them as a starting point just to get me in the right ballpark and I'm using his idea of attaching an object to the inside of a unit's head to use that object as the source of the emitter. I made a lot of changes for my own personal preferences, but this script was a huge help! And it works for the AI as well. The bubbles emit from a space just in front of the unit's chin, so even if you turn your head, it still looks like it's coming out of your regulator. The bubbles tend to stay close to the starting depth of the diver with a slight rise. I like the effect, but I'm thinking of giving them a little less weight so they float up a little faster. I also plan to synchronize the bubbles with the sound effect of each breath which should be easy to do. And I have to do some testing to make sure the bubbles aren't too effected by the prevailing winds so I'm going to change the rubbing value and see what I get.

So far, the feeling like you are underwater is much better now that there are some bubbles!

On to the screenies:

bubbles-01_LR.jpg bubbles-02_LR.jpg

bubbles-03_LR.jpg

Share this post


Link to post
Share on other sites

Awesome ! Tine for some real Navy Seals Action ... go on with this great Mod ! :yay:

Share this post


Link to post
Share on other sites

haha nice job!!! this was the only good thing that ArmA 3 is going to have

Share this post


Link to post
Share on other sites
me want rubber duck and mod is complete :D

+1

Looks awesome, this'll be fun!

Share this post


Link to post
Share on other sites

Thanks for the support everyone! I've actually added a second particlesource which throws out tons of super tiny bubbles, the kind you get when the big bubbles pop and reform into smaller bubbles, like when you hit them with your constantly moving arms. Haha. Looks pretty sweet and much better than the above screenshots. I love working with these particles. I want to do so much more like make an underwater flare and improve a strobe light with a spark which will help it look more realistic, but I also want to release this. So maybe those things will wait until 2.0 release.

QUICK UPDATE:

For those who saw the video where I used a fake dry deck shelter and a CRRC, I improved that script to slowly surface the CRRC. You can get into the CRRC either before it surfaces or after. Tonight, I'll work on recovering the CRRC back into the DDS, hopefully using the same script.

haha nice job!!! this was the only good thing that ArmA 3 is going to have

Thanks. But I'm not sure I agree. It looks like you will be able to customize weapons, so instead of a box full of 48 almost identical weapons only with different attachments, you'll have 12 weapons which you can each attach 4 different things to. Also, it looks like you can change clothes and add and remove equipment for the bodies of your unit. Right there, those two things will be super awesome. And I'm sure Arma3 will have even more new and exciting commands which will make modifying it even more powerful. I'm excited to see the stuff they haven't shown us yet like the night lighting, NV goggles, new and improved physics and how it relates to what's possible in the game, improved flight models for aircraft which you know will come based on TOH, etc.

Share this post


Link to post
Share on other sites

okay, i have to admit, i didn't think this would go far with this engine but this is amazing, really shows what the community is capeable of, keep up the good work.

Share this post


Link to post
Share on other sites

So this is something I've been working on for a long time and I'm proud to say that I think I've figured out (barring some horrible unforseen thing). The ability to walk up to something, and attach something to that thing. In this case, I wanted to be able to walk up to (or swim up to) a boat, pull out a mine, line it up, and then attach to to the hull of that boat. That way, if the boat drives away, the mine stays attached. I finally got it to work. I've even used a call for the bounding box of each ship vehicle so that you have to be relatively close to the vehicle before you can attach a mine.

It works no matter what direction the player or the boat is in. I haven't tested it on other maps yet, but so far it is working great. I had to use some math to get this done. Luckily, others in the community and BIS have done a lot of the heavy lifting for those of us who aren't interested in relearning what an arcTangent is. I'll post a video of it soon, I think. It's very satisfying. :)

attachable_limpets_LR.jpg

I also spent a lot of time working on the bubbles. Unfortunately, when you attach anything to the AI onto their heads like lights and bubbles, they seem to get freaked out almost as if they are trying to avoid running into the bubbles. At first, I thought the AI suddenly lost the ability to swim under water after the official 1.6 update from BIS. But it was the bubbles making them swim in endless circles and off into the far reaches of the ocean. So I placed the particle emitter down into their back/stomach area and they have regained a lot of intelligence. Without any bubbles, they seem to swim fine underwater. With bubbles enabled, they are a little dumber, but it might be OK. So the way it is now, they take a slight hit in intelligence with bubbles enabled. So now I'm torn as to what to do about it. :(

The good news is that the bubbles are synchronized with the breathing counter that I've created. When you take a breath, you exhale and bubbles are made and a bubble sound effect is played. At the same time, the amount of air you breathed at that depth is taken out of your scuba tanks. It feels pretty cool when it's all working together.

Here are some updated shots of me with my AI dummies:

bubbles-04_LR.jpg

This is an AI swimmer

bubbles-05_LR.jpg

This is me with an AI in the distance off to the right. In these shots, you can also see the updated dive computer which now displays "AIR" or whatever gas mix you are currently using.

bubbles-06_LR.jpg

I've also played around with making underwater flares which last about 2 minutes each. You get an inventory of 5 of them that you can replenish at any refilling station where you can also recharge your scuba tanks or change gas types. I haven't enabled an inventory item (yet), so there's a little break from convention there, but enabling inventory will be a lot more work that I'm not sure I want to get into right now. We'll see.

underwater_flares_LR.jpg

I liked the idea of the flares but they weren't the easiest things to work with in terms of getting the brightness tweaked. I later realized that some parts of some maps don't show lights under water until you set the brightness past 1, which is pretty bright. So I have to go back and tweak them again on a different part of the map. It seems to be a game bug that I can't work around at the moment other than setting the brightness to supernova levels which I don't want to do.

How did I figure that out? I wanted to make a better PLB (personal locator beacon) for the emergency inflation vest. So I created a headlamp that has three settings (strobe, constant on, and off). I was testing it on land, got it perfected and then headed into water where it promptly didn't work. So I moved to a different spot in the water and it worked. Here are some pics of the headlamp when it's just on the player:

You can see the AI on the right side of the pic. He's not too over-lit.

headlamp-01_LR.jpg

Here's a pic of mine and my AI swim buddy with our headlamps on. The light level is good. Not too bright, not too dim. Works great on land too as a visible light strobe. The light strobes twice for about 0.2 seconds and then is off for 1 second. Repeats until you get to the next mode or turn the lamp off.

headlamp-02_LR.jpg

headlamp-03_LR.jpg

Edited by Feint

Share this post


Link to post
Share on other sites

Wow, nice, now i really can't wait, i can see people attaching Mines and driving into tanks already :P

Share this post


Link to post
Share on other sites

I was holding a mine and walked over to that F35 in the above screenshot. By the way, an F35 will set off a mine. Scared the bajesus out of me.

Share this post


Link to post
Share on other sites

Question:

How much FPS does this take from game?

I do we all get huge FPS drops if we add this in a full multiplayer game?

Share this post


Link to post
Share on other sites
So I'm very happy that tpw did so much hard work on his foggy breath particle values and shared his sqf. I used them as a starting point just to get me in the right ballpark and I'm using his idea of attaching an object to the inside of a unit's head to use that object as the source of the emitter. I made a lot of changes for my own personal preferences, but this script was a huge help!

Wow, thanks for the props Feint, I appreciate it mate. I'm really glad that my little script, which I thought no-one would give a @#$% about, has ended up contributing to something as mindblowing as your mod.

Share this post


Link to post
Share on other sites

Feint: I'm really glad you managed to synchronise the breathing to bubbles. As a diver myself, I can't wait to try this!

tpw: did you ever release your "foggy breath" script? the reason is that Rube has just released an amazingly detailed weather system which sounds like it could really benefit from your script, i.e. when the temperature and humidity are low enough your script could activate?

Edited by domokun

Share this post


Link to post
Share on other sites
tpw: did you ever release your "foggy breath" script? the reason is that Rube has just released an amazingly detailed weather system which sounds like it could really benefit from your script, i.e. when the temperature and humidity are low enough your script could activate?

It's all here domokun: http://forums.bistudio.com/showthread.php?113653-Simple-Breath-Fog-Script

Falcon_565 looks like he's done a bit more with it, too.

I'd be rapt to see it incorporated into something like Rube's weather. Let him know.

Feint, sorry to go offtopic on your thread!

Share this post


Link to post
Share on other sites

@domokun, thanks! I hope everyone likes it.

@tpw, right now I'm in the middle of converting all of the old sqs files to sqf files and along the way I'm getting rid of all of the global variables and stuff which would prevent this from working in multiplayer. Before I knew about the setVariable and getVariable commands, I did everything with global variables and names. Works fine for singleplayer, no AI, no team shifting, but I might as well improve things with my new knowledge gained while doing other things along the way. So before, multiplayer wasn't possible. But now it is a possibility.

In answer to your direct question regarding fps hits, honestly, I don't know. I have a pretty good system (knock on wood) that I'm using for gaming right now and I've not seen any performance hit at all. Now that I'm rewriting everything, I'm doing quite a few things more efficiently with less scripts. For example, I used to have one script which attached an invisible pond to you. Then a separate script that detached the pond from you. A third script kept track of your breathing and underwater status. When reaching the surface, the detach script would be called. Or if the ascend key was pressed, the detach script would be called over and over and over. The detach script would have another check to see if you were still underwater and would exit if yes. Complicated. Now I have one script that attaches and detaches a caller. But it doesn't stop running. It has a loop that checks your underwater status until you are above water and then detaches. Less scripts, but more checking. So I inserted a sleep of a half second in there so that people's computers would not get slowed down with that script checking your depth all of the time.

Sorry for the complicated answer, but my point is that I'm actively keeping a close eye on keeping everything as simple as possible with as few commands to run as possible. That should keep the commands going to a user's CPU as low as possible. As for video memory being used by the bubbles, I've decided to add a line to the userconfig that will allow a user to turn bubbles off just in case it is causing a performance hit. I'll also do some testing with the Arma2 -fps switch which hopefully will give me some feedback as to fps hits.

By the way, your foggy breath script is cool. Thanks for sharing it. :)

:confused: Is there some sort of reference somewhere of the names of memory points on basic BIS soldier models? Or, is there a common place in a config where I can search for all contained memory point info? I'd like to know the names of things on models.

:confused: More specifically, is there a name for the point at the end of a flashlight or laser, the point that intersects the ground or an object where that disk of light is drawn, like its centerpoint? Does that point have a name I can attach something to? Like a lightpoint? To create spilling light? So flashlights can be more useful?

Edited by Feint

Share this post


Link to post
Share on other sites

Great stuff.

Really looking forward to this. I saw this diving insertion in Arma 3 Presentation and missed it in Arma 2 whit your Module it offers many new aspects of Gameplay. Can´t wait for it. Keep up your good Work :).

Share this post


Link to post
Share on other sites

hey Feint,

which kind of object are u attaching to the heads as particle source? it sounds like it has a geometry lod or a fire lod. atleast that's what i think would influence AI movement. this may be obvious and u may be totally aware of it already. just trying to help. an object without these lods shouldn't influence their behaviour. or maybe it's the fact that u put it inside of the head where it collides. maybe try putting it infront of the face. should be invisible though;)

just some thoughts i had reading your latest posts.

Share this post


Link to post
Share on other sites

Hi Feint.

1. Binkowski released this great sample soldier where u can have an overview: http://forums.bistudio.com/showthread.php?94538-US-Soldier-Template&highlight=Soldier+Template

2. This is c+p from the "weapons_e\ca\scar.pbo":

class SCAR_L_CQC_Holo: SCAR_L_CQC

{

scope = 2;

model = "\Ca\weapons_E\SCAR\mk16_short_holo_lamp";

modelOptics = "-";

displayName = "$STR_EP1_DN_staticSCAR_L_CQC_Holo";

picture = "\Ca\weapons_E\data\icons\mk16_short_holo_lamp_CA.paa";

UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";

handAnim[] = {"OFP2_ManSkeleton","\Ca\weapons_E\SCAR\Data\Anim\SCAR.rtm"};

class FlashLight

{

color[] = {0.9,0.9,0.7,0.9};

ambient[] = {0.1,0.1,0.1,1};

position = "flash dir";

direction = "flash";

angle = 30;

scale[] = {1,1,0.5};

brightness = 0.1;

};

guess "flash dir" is the point you are looking for.

I wish u the best for your awesome project!

Share this post


Link to post
Share on other sites

Would it be possible to parachute your units into the ocean and then go on into the diving seamlessly?

Share this post


Link to post
Share on other sites
hey Feint,

which kind of object are u attaching to the heads as particle source? it sounds like it has a geometry lod or a fire lod. atleast that's what i think would influence AI movement. this may be obvious and u may be totally aware of it already. just trying to help. an object without these lods shouldn't influence their behaviour. or maybe it's the fact that u put it inside of the head where it collides. maybe try putting it infront of the face. should be invisible though;)

just some thoughts i had reading your latest posts.

I think you were right. I ended up using hideObject to hide the object that was spitting out the particles (a baseball) and that seems to have made them a little smarter. The dive light still screws them up a little at night, but I'm guessing that they go blind slightly as their vision adjusts to the new light.

---------- Post added at 20:25 ---------- Previous post was at 20:21 ----------

Hi Feint.

1. Binkowski released this great sample soldier where u can have an overview: http://forums.bistudio.com/showthread.php?94538-US-Soldier-Template&highlight=Soldier+Template

2. This is c+p from the "weapons_e\ca\scar.pbo":

class SCAR_L_CQC_Holo: SCAR_L_CQC

{

scope = 2;

model = "\Ca\weapons_E\SCAR\mk16_short_holo_lamp";

modelOptics = "-";

displayName = "$STR_EP1_DN_staticSCAR_L_CQC_Holo";

picture = "\Ca\weapons_E\data\icons\mk16_short_holo_lamp_CA.paa";

UiPicture = "\CA\weapons\data\Ico\i_regular_CA.paa";

handAnim[] = {"OFP2_ManSkeleton","\Ca\weapons_E\SCAR\Data\Anim\SCAR.rtm"};

class FlashLight

{

color[] = {0.9,0.9,0.7,0.9};

ambient[] = {0.1,0.1,0.1,1};

position = "flash dir";

direction = "flash";

angle = 30;

scale[] = {1,1,0.5};

brightness = 0.1;

};

guess "flash dir" is the point you are looking for.

I wish u the best for your awesome project!

Cool! Thanks! I'll try this. And thanks for the link to the example model!

---------- Post added at 20:27 ---------- Previous post was at 20:25 ----------

Would it be possible to parachute your units into the ocean and then go on into the diving seamlessly?

Even in real life, soldiers who parachute into water spent a little time on the surface of the water ditching their chutes, last min check on dive gear, etc. During that time, if you run the sea level calibration (which only takes 10 seconds), you could dive after that. But yes, I've skydived to the water surface, calibrated and then swam on from there subsurface.

Alternatively, you could go into the ocean near your base of operations, run the seal level calibration, get out of the water, get into the cargo plane, reach your drop zone, HALO into your offshore LZ and dive immediately as soon as you hit the water. You only have to calibrate sea level once every 6 hours or so.

Share this post


Link to post
Share on other sites
I'm guessing that they go blind slightly as their vision adjusts to the new light.

I'm not intending to insult you Feint, you know I love your work. But are you serious about the AI having to adjust their sight at night? (No sarcasm meant). I assume you just meant it figuratively, but just in case I ever have to deal with it in scripting, I'd like to know how indepth the AI aspects get.

Thanks

Share this post


Link to post
Share on other sites

Yes, I'm serious. I don't know if the AI have blindness scripted in, but I know that at night when they don't have NVG's, they can't see you. So maybe there's something similar to that like a time delay for AI when they experience large changes in light level. I am just guessing though. They are effected by the change in light, and the only thing really happening to them is a hiddenObject is being attached above their heads about a meter above them. The effect is, when the light is strobing, if they are running in a straight line with me as the leader, every time the strobe blinks, they stop for a half second and then keep running. Sometimes they make a course correction as if they've lost their way for a short while.

Here's something I've been thinking about for a long time. Let me know what you guys think?

UDM_dive_watch-01_LR.jpg UDM_dive_watch-02_LR.jpg

UDM_dive_watch-03_LR.jpg

The UDM Dive Watch. I based it on this:

h3p6507d500a.jpg

It just replaces the regular watch for now (except not in Map view yet). I originally had the whole face orange, but the tick marks then had to be black which blocked their tritium glow at night. So I changed it to just an inner face being orange and the outer part of the face black. I still want to change the hands so that there are white markings on the tips. I also want to change the center and tip of the second hand to white instead of red and black. I don't know if I could just have this activate when using the Underwater Diving Module is activated in a mission, but that would be my intention.

Edited by Feint

Share this post


Link to post
Share on other sites

This mod looks great can't wait till its released to have a go at swimming in to shore underwater instead of puttin ai on the other side of the island to make it seem like a sneeky infil

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×