• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

Is 3D pathing possible ?

Status
Not open for further replies.
Level 14
Joined
Apr 20, 2009
Messages
1,543
Hello everyone,

I have a quite hard question. I'm making a FPS map. I would like to create a 3D perspective. Indeed, that would create a more intensive gameplay. For exemple, I would like to make a unit going under and on a bridge. Is this possible ?

Thanks.

For the bridge, I'm working on that at this moment.
Watch this thread:

http://www.hiveworkshop.com/forums/...98/question-about-invisible-platforms-212271/

I'm working on such a system, it'll take some time to figure out how to create parallelogramic regions.

But when this is done I'll create a system that would be capable of defining a "fake" region to be the same size as the bridge which gives you the ability to change units who enter from the cliff side to look as if they are flying. According to the z-height of the terrain, making it look as if the unit is walking on top of the bridge, while they can not go outside the "fake" region so that they won't be abled to walk off the sides of the bridge.

Which then makes it possible for other units to simultaniously walk underneath the bridge since they did not enter the "fake" region from the cliffside but from the cliff path underneath it.

Once this system is done I'll give a fully detailed explenation on how it should be used. I'll try to explain it as simplified as possible so that both GUI and Jass users are abled to use it inside their maps.

Caution: this system WILL take a long time before it is realised. And respectively I might fail due to impossible calculations.
Please be patient and if you are, it might never be released :S. I'll try my best though since I need it too.

Either ways, if your bridges are not diagonal, thus vertical or horizontal it won't be such a big deal to accomplish this.
But in my particular case (diagonal) I would have to re-invent regions through a co-ordinate system.

For the 3D perspective, I assume you want to use trackables in order to trace mouse movement so that it's possible to "look" with your weapon?
And of course a first person camera needs to be created, including a movement system which is operable through the usage of arrow keys I suppose?
Not only that, but you would also need to create fade filters in order to draw the weapon on the screen, and then to animate it replace those fade filters respectively in a periodic timer.

It would be impossible to create this game for online gameplay due to the usage of mouse trackables for each player.
And I strongly suggest to take it down a notch and try to figure out a game which might be easier to create.
Unless of course you want to dive into heavy scripting and really understand what you are trying to accomplish here.

In this case, try using Reinventing the Craft...

After all, I haven't seen any successfull first person shooters in warcraft 3 ;)
Just saying...
 
Actually, I have already made my FPS system. It works. 12 players can fight each other with various kind of weapons. I also add a story mode. There is no big problem about my map, excepted some lags.

You can see some screenshots of my map on my profile (Manhattan Project 2). I already have 5 different terrains (snow, town, jungle, underground). I also prepare an add-on for this map.

But I would like to make my map as realistic and detailled as possible. That's why I want to use this bridge system. That could be very useful.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Actually, I have already made my FPS system. It works. 12 players can fight each other with various kind of weapons. I also add a story mode. There is no big problem about my map, excepted some lags.

You can see some screenshots of my map on my profile (Manhattan Project 2). I already have 5 different terrains (snow, town, jungle, underground). I also prepare an add-on for this map.

But I would like to make my map as realistic and detailled as possible. That's why I want to use this bridge system. That could be very useful.

Wow, your map looks great man ;)!

For the bridge system: I am trying to create such a system by creating non-existing regions through a co-ordinate system. However, if your bridges are placed horizontally or vertically, then it would be possible to create normal regions.

Then this is what you'll need to do:

Create a region on top of the cliff before entering the bridge, create a region of the entire bridge and create a region on top of the cliff on the other side of the bridge.

Now whenever a unit enters the region that is infront of the bridge, you set a boolean array variable to true for the unit that entered the region.

Then you can use a periodic timer which checks if the boolean condition is true. While it is true you'll have to get the z-height of the terrain on the current location of your unit. Then you add the Crowform ability to your unit, set it's flying height accordingly to the difference between the z-height of the terrain on the position of the unit and the z-height of the terrain on the position of a dummy unit placed on top of the cliff (the standard cliff height).
After that, remove the ability and set the unit's animation to walk.

Since the boolean is still true when walking on top of the bridge for the specific unit, you can then check wether the unit is still inside the bridge region. If it's going out of the bridge region you can teleport the unit back to the edge of the region (which is the bridge).

Now what you want to do is set the boolean to false whenever the unit reaches the region on the other side of the cliff or the region which it entered before going on the bridge. When the boolean is false for the unit, you set it's flying height back to 0 so that the unit walks on the ground again.

This way units on top of the cliff can walk over the bridge since the boolean is true for that specific unit when it enters the bridge, while simultaniously a unit can walk underneath the bridge since the boolean for that unit would be false.

I hope this helped :goblin_good_job:
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
That can be useful for one player. Are you sure that could work in multi ? If an unit goes on the bridge and another one under it, that can fail. Actually the pathing won't work for those units.

It's not using pathing, it's using flying height by setting it for the units who enter from the cliff side of the bridge.
And then respectively setting it to the distance difference between the z-height of the location of the entering unit and the z-height of the location of the dummy unit.
Or do you mean the collision of the units? Units not being abled to walk "through" each other, is that it?
I see, this might give some problems. I'll try to find a workaround. I remember that there was an ability which removes collision of all allied units within a specified range of the caster.
It was an item ability I think. That should give the units the ability to walk through each other. If the collision of a unit is 0, then other units can walk through that unit...
Setting the collision of the unit on top of the bridge to 0 should do it.

Why wouldn't it work for multiple players if it works for multiple units b.t.w.?
Whoever controlls them doesn't really matter now, does it?
 
Last edited:
For advanced 3D pathing, you're going to need one bigass array.

Here:

JASS:
struct 3DArray extends array
    
    private static TableArray array data

    static method operator [] takes integer i returns TableArray
        if data[i] == 0 then
            set data[i] = TableArray[0x50000]
        endif
        return data[i]
    endmethod

endstruct

This requires Table.

What you need it for is when you're storing pathing data in 3D.

The indexing space:
3DArray[8192][327680][2147483648]

Thus, I'd recommend storing data like this:
3DArray[Z][X][Y]
 
Status
Not open for further replies.
Top