In the hopes of promoting more "underwater" themed maps I wanted to show how you can simulate a key element of believable underwater gameplay - Camera Distortion.
This tutorial assumes you have basic familiarity with the editor (creating simple terrain and triggers; modifying unit and actor fields). By the time you're finished, your camera should have distortion "waves" going across it that look like this-
Terrain
For the purpose of this example, we're just going to use some generic terrain that will allow you to clearly see the effect as it moves across your screen.
Make a new map and add some height noise to it (I used 0.3 amplitude in the image above), and some nice tall doodads (those are Bel'shir Trees at 150% scale). Create a unit of some kind that the effect will "follow".
Once that's done, you'll want a good camera angle. Set Distance to 14, Pitch to 15, and Far Clip to 55 (for framerate reasons). The target X/Y and Yaw is pretty much up to you, but I recommend matching them to the unit the effect will be following for consistency. If you want you can just use "Set Camera to Current View" once you have a perspective you're happy with. Here's an example-
NOTE: These are settings that I know to be functional. There is, however, a range of settings that work and with experimentation it should be possible to make this effect function from a variety of camera perspectives.
Data
This effect is powered by a movable unit based on the Sentry's Guardian Shield model. We use a unit because the actor needs to be able to move with the camera. We'll want to create a Unit and Actor for this purpose, as well as a Behavior to control the speed of the animation.
Behavior
Create a new Behavior called Water Blur Speed and set its type to "Buff", then click ok. Open up the Modification+ field. Under the Unit tab find the "Time Scale" setting and set it to 0.25.
This value controls the speed of the distortion effect, but be careful as it also affects the movement speed of your "Water Blur" unit and therefore its ability to smoothly follow the camera. If you want to turn it down really low, you'll need to give your unit a correspondingly high speed and acceleration value. If you notice weird clipping behavior, it's probably because your unit is too slow.
Unit
The easiest way to do this is by duplicating a Probe (tip of the hat to OneTwoSC as this will function somewhat like his movable Skybox). Don't duplicate anything except the unit. We'll be making our Actor from scratch.
Rename the copy to Water Blur, and make sure its settings read as follows-
Abilities: Stop|Move
Acceleration: 100
Behaviors+: Water Blur Speed
Collide: Remove all values from this field
Deceleration: 100
Flags: In addition to the default Probe flags, you'll want to add- Invulnerable, Not on Radar, Uncommandable, Unselectable, Untargettable.
Inner Radius: 0
Lateral Acceleration: 100
Minimap Radius: 0
Radius: 0
Speed: 100
Actor
Create a new Actor called Water Blur with type Unit and based on GenericUnitBase.
Model: Guardian Shield
Scale: 2.4
Events:
UnitBirth.WaterBlur
Create
Triggers
Clear out the contents of the Melee Initialization trigger and create a new one called Water Blur. Create a global variable of type Unit also called Water Blur. Set their values as seen below-
If you run the map at this point, you should see "waves" of distortion crossing your camera (which is focused on your unit). When you move the unit, the bubble will follow. If you implement this in a playable map you'll also want to use triggers to make the camera follow the unit.
You can find a great tutorial from OneTwoSC on how to do that .
Other Thoughts
The outline above is just an example of one way to make this effect work. It should be possible to employ it from an overhead or first-person view as well with appropriate tweaks. Remember that the "scale" of the Water Blur actor controls how big the 'bubble' is, and your camera Distance will need to be adjusted accordingly.
Since the bubble is a sphere, you can use almost any value for Pitch and Yaw and it should still work normally. This is the case for airborne units as well (though you'd need to adjust the unit's height accordingly), if for example you wanted to do a cinematic with a submarine and have your shot from below the ship.
If you run into any problems, you're welcome to download the map I made this effect for from its project page and see exactly what I did. You can also PM me or post here as well.
I hope this helps some people to make some very cool stuff :)
Okay, so the only issue I've been having with this is that the blur effect seems to stop animating after around a minute. I noticed that this doesn't happen in the example map you posted, and I could probably work around it by having the unit replaced every 30 seconds or so... Am I missing something in the data editor, though, that would keep the animation refreshed?
Would it be possible to create this effect for a normal map? Not a melee map but a map that doesn't follow the units. A hero arena style map. Would I be able to place dummy units and have them create the effects or would that lag the player too much?
Would it be possible to create this effect for a normal map? Not a melee map but a map that doesn't follow the units. A hero arena style map. Would I be able to play dummy units and have the create the effects or would that lag the player too much?
I too am curious about this. I've been waiting for a while to see if anyone jumps in to let us know.
It should theoretically be possible if you-
1. Use triggers to make it follow the camera seamlessly (could prove difficult/buggy)
2. Use a method to make the actor show up individually for each player (there's a tutorial on mapster for this, but I haven't personally read through it yet).
Introduction
In the hopes of promoting more "underwater" themed maps I wanted to show how you can simulate a key element of believable underwater gameplay - Camera Distortion.
This tutorial assumes you have basic familiarity with the editor (creating simple terrain and triggers; modifying unit and actor fields). By the time you're finished, your camera should have distortion "waves" going across it that look like this-
Terrain
For the purpose of this example, we're just going to use some generic terrain that will allow you to clearly see the effect as it moves across your screen.
Make a new map and add some height noise to it (I used 0.3 amplitude in the image above), and some nice tall doodads (those are Bel'shir Trees at 150% scale). Create a unit of some kind that the effect will "follow".
Once that's done, you'll want a good camera angle. Set Distance to 14, Pitch to 15, and Far Clip to 55 (for framerate reasons). The target X/Y and Yaw is pretty much up to you, but I recommend matching them to the unit the effect will be following for consistency. If you want you can just use "Set Camera to Current View" once you have a perspective you're happy with. Here's an example-
NOTE: These are settings that I know to be functional. There is, however, a range of settings that work and with experimentation it should be possible to make this effect function from a variety of camera perspectives.
Data
This effect is powered by a movable unit based on the Sentry's Guardian Shield model. We use a unit because the actor needs to be able to move with the camera. We'll want to create a Unit and Actor for this purpose, as well as a Behavior to control the speed of the animation.
Behavior
Create a new Behavior called Water Blur Speed and set its type to "Buff", then click ok. Open up the Modification+ field. Under the Unit tab find the "Time Scale" setting and set it to 0.25.
Unit
The easiest way to do this is by duplicating a Probe (tip of the hat to OneTwoSC as this will function somewhat like his movable Skybox). Don't duplicate anything except the unit. We'll be making our Actor from scratch.
Rename the copy to Water Blur, and make sure its settings read as follows-
Actor
Create a new Actor called Water Blur with type Unit and based on GenericUnitBase.
Triggers
Clear out the contents of the Melee Initialization trigger and create a new one called Water Blur. Create a global variable of type Unit also called Water Blur. Set their values as seen below-
If you run the map at this point, you should see "waves" of distortion crossing your camera (which is focused on your unit). When you move the unit, the bubble will follow. If you implement this in a playable map you'll also want to use triggers to make the camera follow the unit.
You can find a great tutorial from OneTwoSC on how to do that .
Other Thoughts
The outline above is just an example of one way to make this effect work. It should be possible to employ it from an overhead or first-person view as well with appropriate tweaks. Remember that the "scale" of the Water Blur actor controls how big the 'bubble' is, and your camera Distance will need to be adjusted accordingly.
Since the bubble is a sphere, you can use almost any value for Pitch and Yaw and it should still work normally. This is the case for airborne units as well (though you'd need to adjust the unit's height accordingly), if for example you wanted to do a cinematic with a submarine and have your shot from below the ship.
If you run into any problems, you're welcome to download the map I made this effect for from its project page and see exactly what I did. You can also PM me or post here as well.
I hope this helps some people to make some very cool stuff :)
Great tutorial and the map itself was fun!
Great idea, easy to implement, and well explained. Thank you!
@Chiquihuite: Go
Okay, so the only issue I've been having with this is that the blur effect seems to stop animating after around a minute. I noticed that this doesn't happen in the example map you posted, and I could probably work around it by having the unit replaced every 30 seconds or so... Am I missing something in the data editor, though, that would keep the animation refreshed?
Thanks in advance!
Would it be possible to create this effect for a normal map? Not a melee map but a map that doesn't follow the units. A hero arena style map. Would I be able to place dummy units and have them create the effects or would that lag the player too much?
I too am curious about this. I've been waiting for a while to see if anyone jumps in to let us know.
@Keyeszx: Go
It should theoretically be possible if you- 1. Use triggers to make it follow the camera seamlessly (could prove difficult/buggy) 2. Use a method to make the actor show up individually for each player (there's a tutorial on mapster for this, but I haven't personally read through it yet).
@Hegemuffin: Go
Hmm...that's odd. If you post your map I can take a look.
Sorry for the slow response btw. Been busy XD