• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Making a river empty itself...

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I have a boat map that involves sailing a boat around arcade-style, i.e. the boat has momentum and you steer it.

At one point, the boat kills a dam, and the river starts draining. The boat has to outrace the draining water. In other words, the water behind the boat starts to disappear (becoming land) and the boat has to race forward against it before it gets beached. You can see a demo of sorts here (watch the left side of the screen): https://www.youtube.com/watch?v=c-Mj_DtIiwE&feature=youtu.be

What I've done: basically I use about 20 environment terrain "waves" with negative height so that the ground underneath the water rises up and it gives the illusion that the water is draining.

There are many problems though. The computer lags and I imagine people with worse computers will be downright paralyzed. Also, the ground sometimes looks edgy when the water and land are almost the same height...it isn't very smooth sometimes. Finally, the land rises up around doodads so you can see trees shrinking on the land next to the water.

I'm a bit overwhelmed with this system at the moment. Has anyone done anything like this before? Is there any advice?
 
The way I would do it:

- Remove all "blizzard water" from the game; instead replace the water paths with ground trenches
- Use a water model to re-create the visual water plane (looks much better anyway)
- the water model should be attached to a walkable destructable (for example, use circle of power as a basis)
- change the pathing texture to a 4x4 (or bigger) walkable texture
- Give your boats hover pathing, instead of swimming pathing, to allow them to "walk" on your water
- Create a simple death animation for the water model, that makes the water plane sink slowly (that's just 3 clicks in magos)
- When the water is supposed to sink, simply kill all the destructables in the region
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
It's too bad you have lag because from the video it actually looks really good, pretty original idea I have to say.

Sorry, I know this doesn't help... I'm just talking...
 
Level 11
Joined
Jun 2, 2013
Messages
613
There is a rounded water model in the Ultimate Terraining map that you may be able to use for what you need. You could use the model for a destructible and then trigger their removal. I couldn't find the model in the model section so not sure where it comes from, though should be credited in the map trigger section.



The model itself looks really nice and since it is rounded, it goes under the ground that is raised higher making it perfect for doing rivers seas etc.


If you need to find it in the map itself, it's under the custom doodads section under the water tab.

I've used the raise/lower terrain trigger before, but not on the scale you are talking about, so I'm actually not sure what the best way of going about it would be.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Thanks everyone.

Zwiebelchen, that is an ambitious idea. I'm going to hold off on it for now though, as the map is quite complicated and has air, land and sea units that need pathing checks to determine if the boat has run around, for example. I also need the river to empty so it drains in the west first while you flee eastward. I would have to lower the doodads one at a time, and I'm worried that this would create a jarring gap (for example, imagine two water doodads next to each other but with different heights...it would look really weird). Anyway, if I can't get the lag under control I'll come back to this. Thanks again; you always have creative solutions.

Veritas, a compliment is always welcome, thank you.

PublishedShadow, thanks I've found the model now. It does look nice, though covering the whole area with those doodads would be prohibitive (like I said to Zwiebelchen). I could use it in a cinematic perhaps. One of the problems I have is that I'm raising land, not lowering water. But if I zoom in a camera on one of those circular doodads and lower it to show the water draining before I start the actual race it will make it clear to the player what is going on.

UPDATE: I've managed to cut down some of the lag by using much fewer but wider terrain deformations. For each stretch of water I had been using 20 separate deformations timed differently so that the edges of the water disappeared first (e.g. if you imagine a bath tub draining at the end it will drain from the edges first and from the middle last). To do that I made the terrain deformations faster on the edges. It looked really cool, but I can get a similar effect with 3 deformations rather than 20. That's helping. I'll try to post a video when it's done.

Thanks everyone.
 
I still recommend using destructable instead of terrain deformations. It looks better and will be A LOT less taxing on game performance. Terrain deformations are terribly implemented in WC3 and not only cause bugs, but will also probably cause desyncs in multiplayer.

What you brought up as cons is an understandable, yet not an unsolvable problem.

You can always edit the water plane model to go slightly down at the edges to fix the problem with planes at different height not connecting (post it in the request section if you don't know how).
You can also slightly tilt the models when the animation starts, so that they connect properly (requires some testing though, to get the right angle).

Making the water drain from left to right is not a problem. Just create a periodic trigger that kills row after row of the destructables.

Pathing is also not really a problem. Just put pathing blockers between the land and the river to prevent units from moving out of or in the water. If you need amphibious units, just make them flying.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Zwiebelchen, I do think you're right, but the truth is that sort of thing is beyond my programming ability at the moment. It would probably take me months to do it right, and I would have to graft a whole different system (with flying units, new pathing checks, an ocean of pathing blockers - which would disrupt some of my other triggers - and so forth) onto the system that I use for the rest of the map. The model editing is indeed beyond my capability, and I'm still not sure I could get it to look right. I could request help with the model, but I think it would take a lot of editing until I got it right; which would require multiple requests and so forth.

For example, having the model tilt down on one side as it died would work great for the first row of water doodads, but as soon as the second row started (i.e. played their death animations) they would lower and create a jagged edge between the first doodad and the second (because of the z-height would not line up). I'm not sure I'm explaining this very well. Imagine the water doodads like blinds on a window. When the blinds are closed they are all lined up and smooth, but if you start to open them, each blind will tilt but it'll create a gap between them. I think the same would happen for water doodads that tilt during their death animations.

Anyway, I do appreciate the advice, but I'm afraid I'll have to settle on a mediocre system for now. It's part of a campaign, so the de-syncing at least won't be a problem. I've dramatically cut back on the number of deformations I use.


Maddeem, how do you make a pathing blocker that enables or disables naval pathing? I was looking for one of those earlier and couldn't find it.
 
Maddeem, how do you make a pathing blocker that enables or disables naval pathing? I was looking for one of those earlier and couldn't find it.
You need to create a custom pathing texture for that. The different colors in the pathing texture represent the type of pathing (buildable, unbuildable, unwalkable, unflyable, etc.).

A circle of power, for example, has a walkable but unbuildable 4x4 pathing texture. The Dalaran towers are unflyable, etc. ... just export their pathing textures and edit them in GIMP or photoshop to make your own, then import them back in.

If the tilting is a problem, you can always create a "water cube" model. Basicly a plane that has 4 more vertical planes around it's edges. This will make your water sink in steps, though, but that will be hardly visible from birdseye perspective.

The scripting side for this is terribly simple: just create a rectangular region and move it by 1-2 cells every second; enumerate every water destructable inside the region and kill it. Repeat.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
It is not possible to make pathing blockers for water with the same format as they are for ground, because ground pathing blockers are defined by 3 colors and you'd need something additional to define water pathability.

How do I know that? I've made custom pathing textures myself.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
As far as I know, it is technically impossible, as naval pathing is not handled by the usual pathing maps.
It appears to be an additional layer from some other file.

Note: Press P in editor. It will show you the actual colors of different pathing types. The same colors that are used for pathing maps.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Does the naval pathing really matter? Again, you can just make the water walkable and add normal ground pathing blockers around it to prevent players from leaving the water.

I can live without naval pathing (I can use destructibles for example), but I can't have the water being walkable because there is shallow water that both land and sea units can navigate. So i can't block the boats off of that area with ground blockers, and I can't block the ground units off it either.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Do note that terrain deformations are famous for causing multiplayer desynchronizations. Only use them if your map is single player. Additionally the results will vary depending on the game's visual settings.

Thanks, doctor. It is a single player campaign. I think I'll release a test map at some point and have some friends try it on a few systems to be sure it's worth keeping.
 
I can live without naval pathing (I can use destructibles for example), but I can't have the water being walkable because there is shallow water that both land and sea units can navigate. So i can't block the boats off of that area with ground blockers, and I can't block the ground units off it either.
Just make those units that can walk on land and water flying units?

Or just code the boat's movement so that it can not leave the water and stops if you try. Don't you have momentum based controls anyway?
 
Level 14
Joined
Aug 30, 2004
Messages
909
Just make those units that can walk on land and water flying units?

Or just code the boat's movement so that it can not leave the water and stops if you try. Don't you have momentum based controls anyway?

I use a combination of momentum based controls for the player and some enemies, but regular units as well. I think it's all fine now. I'll have a test map eventually and make sure most people's computers can handle it. It's a small part of the full map anyway.
 
Status
Not open for further replies.
Top