How to do a multi-layer system?

Zwiebelchen

You can change this now in User CP.
Reaction score
60
I was wondering if it is possible to somehow create a multi-layer system for Warcraft III.

Don't get me wrong: I do not intend to use it, I am just trying to get a new viewpoint on this. Maybe I missed a possibility somewhere.


What is meant by "multi layer system"?
Basicly, it should be a position engine, that allows two units to have the same X and Y coordinates, but walk on different "terrain layers".

Imagine a house with 2 floors. The unit is at floor 1. Now the unit steps up the stairs and when it reaches the end of the stairs, floor 2 is active and the unit is completely treated like invisible and unreachable for everyone still on floor 1.


I was thinking about (mainly for the upcoming Starcraft II ... I think it is almost impossible to do something like this in wc3) how to do that and came up with a solution:


- by using SetFlyHeight, units can be "placed" on the upper layer.
- the unit gets an integer attached, that identifies the layer number ... with all spells triggered (most maps do that anyways), it should be no problem to check wether the unit is on the same layer before applying AoE damage and stuff
- the flyHeight of second-layer units get determined by invisible destructables, as you can get the position of destructables by trigger

However, there are things I still couldn't figure out how to do with that approach:
- collision: As all units need to be flying units, the collision is naturally turned off
- the layer switching should be able to do without using trigger-interaction by just placing a destructable, to make it more user friendly ... though I think that is just a minor problem
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
I would just separate the terrain areas. A lot less of a headache, really.
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
I would just separate the terrain areas. A lot less of a headache, really.
I'm a perfectionist, and seriously: How cool would it be to actually have no "teleporting" between different floors?

I experimented with it a little and it definitely works. I'm using walkable destructables as indicators for the floor height, place a unit on it to find out the z height, store the z value to a coordinate-based hashtable and simply check the units x and y values and set up the flyHeight for those units according to the stored z for that position.

The only problem is, that the system requires periodic position checking for all participating units, which makes the system very slow. For RPGs, it should be no problem, though.


EDIT: Testmap attached.
 

Attachments

  • MultiFloorSystem.w3x
    17.3 KB · Views: 147
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top