Discussion Vertical Pathing System

TheLegend

New Member
Reaction score
10
I've come across an idea to make a vertical pathing system but i lack the proper ideas for it

WHAT I'M AIMING FOR

a system short but effective that will create a vertical pathing network that will enable units to walk under bridges as well as over them, walk on other objects and units. It may sound complicated but it would make wc3 maps a lot more realistic. Making player units being able to jump on crates and from crates onto houses, walking under a bridge, trough a cave in the mountain, moving around houses and climbing onto the next floor of the house and so on
DOWNLOAD LINK AT THE BOTTOM OF THE POST

HOW I THINK THIS CAN BE DONE

by storing units height, object height and terrain height and adjust the flight z of an unit to make it look like its on or under another object. I know this will be hard to make so please feel free to use this post to exchange ideas and progress and when we finish the project we could get enormous credit and rep for it. Ill update how far i get with this project and please feel free to experiment on your own.

UNIT HEIGHTS​

Footman - height 92
Peasant - height 91
Knight - height 130
Bridge - height 256, fly height 50 (for cliff lvl 2)

NOTE: If you can calculate the height yourself and post in this Discussion for various units and if I have made a mistake correct me, i calculated by
making a lvl 1 cliff (i know the height is 128) using CTRL + right click hold + drag to adjust the camera so that the angle is 0 and change the scaling
of the unit so that the height is the same as the cliffs

WHAT COULD BE USEFUL​
- a system to get a object's height (complete)
- a system that would index possible z's of locations (not needed, the OZSYS works better than expected)
- Bridge height adjust system (complete)
- a new jump system with the new object height (im making it right now)
- someone to calculate existing units heights (new request)
- better models of bridges, houses and stuff

SYSTEMS SO FAR

The Object Z System or OZSYS, used for detecting the occupied height of units (designed for a jump system), will be needed later. This requires
the users "help" to operate, the user has to create units for every object he wants to index and set the Point Value of that unit (Object Editor)
to the units height
JASS:
//////////////////////////////////////////////////////////////////////////////////////////
//TheLegend's Object height system                                                      //
//////////////////////////////////////////////////////////////////////////////////////////
//IMPORTANT INFO
//--------------------------------------------------------------------------------------//
//Before importing the system you have to replace every object with units that have that//
//objects model and add them into the init function at the bottom. This system is used  //
//to get the minimum z on which a unit can stand at the location. This will enable the  //
//user to create more advanced jump systems where the units will be able to jump onto   //
//other units, walk under as well as over bridges, jump onto and over crates, houses,   //
//rocks and so on. This library will provide the user with these functions:             //
/*      function GetMinimumZ(location,boolean,real,boolean)                             */
//      -gets the minimum height if a new unit enters that location, the boolean will   //
//       determine will the terrain be included. Range is how far from the unit to scan //
//       and the last bool is if the systen will include the fly height                 //
/*      function GetUnitsZ(unit)                                                        */
//      -gets the units vertical Z value (on which height it is)                        //
//--------------------------------------------------------------------------------------//
//IMPLEMENTATION
//--------------------------------------------------------------------------------------//
//You will need vJass or NewGen World editor to implement this. If you have it then just//
//create a trigger, convert it to custom text and replece everything there with this.   //
//Before you run the system make sure all dodads, objects are replaced with units, you  //
//will have to create units with their models since units are the only tracable things  //
//in the world editor.And the system uses Units Point values to operate. You have to    //
//define the unit heights ( Point value) but here is a hint how to orientate, the cliff //
//lvl 1 is 128 high                                                                     //
//////////////////////////////////////////////////////////////////////////////////////////
library OZSYS
    globals
        private constant boolean enablesystem = true
        private group tempunitgroup = CreateGroup()
        private real tempreal
    endglobals
    public function GetUnitsZ takes unit u returns real
        local location l
        set tempreal = 0
        set l = GetUnitLoc(u)
        set tempreal = GetUnitFlyHeight(u) + GetLocationZ(l)
        set l = null
        return tempreal
    endfunction
    public function GetMinimumZ takes location l, boolean terrain,real range,boolean fly returns real
        local integer flyon = 0
        set tempreal = 0
        set tempunitgroup = GetUnitsInRangeOfLocMatching(range, l,null)
        if fly then
            set flyon = 1
        endif
        loop
            exitwhen FirstOfGroup(tempunitgroup) == null
            if tempreal < GetUnitPointValue(FirstOfGroup(tempunitgroup)) + flyon*GetUnitFlyHeight(FirstOfGroup(tempunitgroup)) then
                set tempreal = GetUnitPointValue(FirstOfGroup(tempunitgroup)) + flyon*GetUnitFlyHeight(FirstOfGroup(tempunitgroup))
            endif
            call GroupRemoveUnit(tempunitgroup,FirstOfGroup(tempunitgroup))
        endloop
        if terrain then
            set tempreal = tempreal + GetLocationZ(l)
        endif
        return tempreal
    endfunction
endlibrary


The Bridge system or simply BRSYS will (if you did everything the OZSYS required of you, that is create a unit for the bridge) make the units walk on or under the bridges. IT WORKS STUNNING MATES, JUST STUNNING
JASS:
//////////////////////////////////////////////////////////////////////////////////
//Bridge by TheLegend                                                           //
//////////////////////////////////////////////////////////////////////////////////
//INFO
//------------------------------------------------------------------------------//
//This system needs OZSYS to operate, if it is not included within the map you  //
//found this then the map is a rip. The system will attempt to give units the   //
//ability to walk under as well as over bridges, restrict fighting of units on  //
//different "levels" of the bridge. NOTE that this is not a cinematic effect but//
//an addon to warcraft to make it better and more realistic, open new ways of   //
//map games and so on                                                           //
//////////////////////////////////////////////////////////////////////////////////
library BRSYS initializer init uses OZSYS
    globals
        public group bridges = CreateGroup()
        private integer indextotal = 1
    endglobals
    private struct unitindexer
        integer id
        unit u
        location savedloc
    endstruct
    globals
        private unitindexer array D
    endglobals
    private function destroyD takes unitindexer data returns nothing
        local integer dataid = data.id
        call data.destroy()
        set indextotal = indextotal - 1
        loop
            set dataid = dataid + 1
            set D[dataid - 1] = D[dataid]
            exitwhen D[dataid].u == null
        endloop
    endfunction
    private function boolexpr1 takes nothing returns boolean
        return IsUnitInGroup(GetFilterUnit(),bridges) == false
    endfunction
    private function modandsort takes nothing returns nothing
        local unitindexer temp = unitindexer.create()
        local unit u
        if GetTriggerUnit() == null then
            set u = GetEnumUnit()
        else
            set u = GetTriggerUnit()
        endif
        call UnitAddAbility(u, 'Amrf')
        call UnitRemoveAbility(u, 'Amrf')
        if GetUnitTypeId(u) == 'h001' then
            call GroupAddUnit(bridges,u)
        else
            set temp.id = indextotal
            set temp.u = u
            set D[indextotal] = temp
            set indextotal = indextotal + 1
        endif
    endfunction
    private function identify takes unit u returns integer
        local integer unitid = 1
            loop
                exitwhen D[unitid].u == u
                set unitid = unitid + 1
            endloop
        return unitid
    endfunction
    private function setunits takes nothing returns nothing
        local location l = GetUnitLoc(GetEnumUnit())
        local location l1
        local group g = GetUnitsInRangeOfLocMatching(350, l,Not(Filter(function boolexpr1)))
        local integer id = identify(GetEnumUnit())
        local real height
        local real x = GetUnitX(GetEnumUnit()) - 64 * Cos(GetUnitFacing(GetEnumUnit())*bj_DEGTORAD)
        local real y = GetUnitY(GetEnumUnit()) - 64 * Sin(GetUnitFacing(GetEnumUnit())*bj_DEGTORAD)
        set l = Location(x,y)
        if FirstOfGroup(g) != null then
            if D[id].savedloc == null then
                set D[id].savedloc = l
            endif
            set l = GetUnitLoc(GetEnumUnit())
            set l1 = GetUnitLoc(FirstOfGroup(g))
            call SetUnitPathing( GetEnumUnit(), false )
            set height = GetLocationZ(D[id].savedloc) - OZSYS_GetMinimumZ(l1,true,256,false)
            if height <= 64 and height >= - 64 and GetLocationZ(l) != GetLocationZ(D[id].savedloc)then
                set height = OZSYS_GetMinimumZ(l1,true,16,false) - GetLocationZ(l)
                call SetUnitFlyHeight(GetEnumUnit(),height,0)
            else
                call SetUnitFlyHeight(GetEnumUnit(),0,0)
            endif
        else
            call SetUnitFlyHeight(GetEnumUnit(),0,0)
            call SetUnitPathing( GetEnumUnit(), true )
            set D[id].savedloc = null
        endif
        call RemoveLocation(l)
        call RemoveLocation(l1)
        set height = 0
        set id = 0
        set x = 0
        set y = 0
    endfunction
    private function bridgecheck takes nothing returns nothing
        local group g = GetUnitsInRectMatching(GetWorldBounds(),Filter(function boolexpr1))
        call ForGroup(g, function setunits)
        call GroupClear(g)
    endfunction
    private function leftmap takes nothing returns nothing
        call destroyD(D[identify(GetTriggerUnit())])
        call GroupRemoveUnit(bridges,GetTriggerUnit())
    endfunction
    private function init takes nothing returns nothing
        local group allunits = GetUnitsInRectMatching(GetWorldBounds(),null)
        local trigger t = CreateTrigger()
        call ForGroup(allunits, function modandsort)
        call TriggerRegisterTimerEvent(t, 0.1, true)
        call TriggerAddAction(t,function bridgecheck)
        set t = CreateTrigger()
        call TriggerRegisterEnterRectSimple(t, GetWorldBounds())
        call TriggerAddAction(t,function bridgecheck)    
        call GroupClear(allunits)
        set t = CreateTrigger()
        call TriggerRegisterLeaveRectSimple(t, GetWorldBounds())
        call TriggerAddAction(t,function leftmap)
        set t = null
    endfunction
endlibrary


AND NOW THE TEST MAP​

made a test map with some units necessary for the system (a knight, bridge, crate (for later)), youll need NewGen to open
http://www.epicwar.com/maps/199037/
 
It's not really hard. And i must know, since i already did it ;) But go ahead and build it since it's a nice project. Just look at the bridges as rects or regions an check on entering if the unit is high enough. Also, try to allow bridges above other bridges.

But i guess that leaving bridge on the "side" must be handled different from map to map. The easiest way is probably to just prohibit it. Just keep in mind, that this may not be an option.
 
this isnt just about bridges you know :) it should be a system that will make a 3d pathing map for every thing in the game so when you use a jump system you could land on a crate, unit, rock, tree, house etc
 
Oh welp, that makes it way, way more complex.
And normal wc3 pathfinding wouldn't work, but i think that's also an issue for bridges.
 
I'm pretty sure it is impossible to walk under a bridge, as the bridge is considered ground and wc3 rejects any fly height below 0.
 
but if you remove its pathing or just take its model and replace a units with it then it will be possible... trust me ;)

EDIT

how about a object height detection system or way to detect that ??? i could make all dodads the same height and use that constant but i think itll be better to preserve the random scaling

EDIT

I HAVE IT :D i only have to replace all dodads , objects with units and add them to unit groups (example: units with height 100 go to group 1) and when another unit comes to a specific point it checks if there is another unit there and in which group it is to set the height (im a genius), now the only problem is that im too lazy to do this... :D, when im in the mood ill make a test map
 
so far so good, im able to index units and set their heights fast, but i need models of crates that are "normal" not the open ones or the angled ones
 
Would this be a cinematic effect?
Sounds like where the unit appears to be the location in which it could be attacked is probably diffearent. Such as if your going under a bridge you could get attacked by a unit on the top of the bridge.
 
after the system is finished it aint hard to make a unit stop attacking if the total height (terrain + flight) of the two units is different (about 50 offset would be allowed). It isnt planed as a mere cinematic eff but an addon to warcraft to make it more interesting, enabling more features
 
EDIT
i had some problems with posting there so ill post here, the comments are info and how to implement
JASS:
library OZSYS
    globals
        private constant boolean enablesystem = true
        private group tempunitgroup = CreateGroup()
        private real tempreal = 0
    endglobals
    private function groupheightcalc takes nothing returns nothing
        if tempreal < GetUnitPointValue(GetEnumUnit()) + GetUnitFlyHeight(GetEnumUnit()) then
            set tempreal = GetUnitPointValue(GetEnumUnit()) + GetUnitFlyHeight(GetEnumUnit())
        endif
    endfunction
    public function GetUnitsZ takes unit u returns real
        local location l
        set tempreal = 0
        set l = GetUnitLoc(u)
        set tempreal = GetUnitFlyHeight(u) + GetLocationZ(l)
        set l = null
        return tempreal
    endfunction
    public function GetMinimumZ takes location l, boolean terrain returns real
        local real height
        set tempreal = 0
        set tempunitgroup = GetUnitsInRangeOfLocAll(16, l)
        call ForGroup(tempunitgroup, function groupheightcalc)
        call GroupClear(tempunitgroup)
        if terrain then
            set tempreal = tempreal + GetLocationZ(l)
        endif
        return tempreal
    endfunction
endlibrary

please comment and tell me how to improve this one, ill be working on a bridge snippet and a new jump system
 
EDIT:
I solved that little problem, now there is another problem, well its not that bad at all...
I've created units with models of bridges, with their pathing map and things like that and the system sets the FlyHeight right, but when you approach from the side of the bridge (trying to go under it) the unit is blocked by the pathing map but if you try to jump down form the bridge, you can jump down normally. Anyone know what could cause this crazy abnormality
 
solved it and made some updates, tnx for nothing... ill update the main Thread in a moment with the Bridge system and the OZSYS improved system
THERE STILL is a small problem and that is that youll have to click really close to the bridges edge to get onto it cause the unit still sees the pathing map and will refuse to just go under it, you have to force it under/onto but once there you can normally move
 
bump... so no one wants to participate in this huh...
Systems like this already exist. Check out my multi floor / two floor system that is in the graveyard.
It's very intuitive and 'works' but it simply fucks up the graphics of your map so nobody with brains will use it.
http://www.thehelper.net/forums/showthread.php/145900-Multi-Floor-System?highlight=floor+system

I don't want to decourage you, but things like that will not work the way you want them. I can tell you by experience.
There are some things you can not overcome and those are wc3 graphic limitations:

fact: you need to use flying units in order to make it work
problem: flying units have turned off collision, so all your units on a different layer than the ground layer will have no collision

fact: flying units have its shadow on the ground, not on your different layer
problem: no solution to this known, except using a model for the shadow, which will look weird, though

fact: You can not rightclick spots on the upper layer if there is no walkable destructable there
problem: no solution to this. If you don't use walkable destructables, you can not fix this. If you do, then units can't walk below them. Even if you use walkable destructables, the shadow will still be on the ground.

fact: You can not block pathing on the upper layer without using air pathing blockers.
problem: Air pathing blockers are bugged up by the wc3 engine. Ground units are affected by them and will sometimes randomly change their move direction for some weird reason.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    Or even third party. Like if you don't have an original one in a functional condition, you cannot play this game properly. Like yeah the keyboard mods exist, but I think those are BARELY functional
  • Varine Varine:
    And since almost all of my programming experience is with defunct shit now, I figure my best place is helping preserve legacy stuff. Which I don't know how to do necessarily, but I need some kind of a hobby and figuring out how older things worked is the only shit that really interests me. Well soldering and restoration is fun too, but no one is bringing me new stuff to fix and restore, so it's mostly old shit, and I LOVE OG Xbox so much. I want to make sure it can function as long as possible, until someone can effectively emulate it at least. I have like 15 I was going to fix over the winter and didn't get to.
    +1
  • Varine Varine:
    I also have a couple OG gameboys, but idk if I can do that without like, manufacturing new parts that no one makes anymore and I can't do that right now
  • tom_mai78101 tom_mai78101:
    Currently in the middle of getting the probate process going. We're doing the informal probate process.
    +3
  • Varine Varine:
    A probate is usually done with a will, yes? If so I am sorry for your loss
    +1
  • The Helper The Helper:
    Yeah Tom, me too sorry for your loss buddy my mom told me she finds out her olds friend died from Google searching them. She had not talked to one of her old friends in a year and found out she died from Google. Also another one in the same session. RIP all of them my sincere condolences Tom
    +1
  • Varine Varine:
    We have some elderly guests that regularly come hang out at the bar at the end of the night, and every once in a while we don't see someone for a few weeks and then someone shows up with their obituary.
  • Varine Varine:
    We usually let them do their memorials there in the morning if they want to and I'll make them some snacks and drinks. There was one guy named Tom that came in like every night and would sit by himself and get a bunch of soup and a glass of wine. idk why but he LOVED our fucking soup, like he would order a fucking quart of it at a time and would always get so sad when we stop doing it for the summer.
    +1
  • Varine Varine:
    But he also loved our calamari, which is another thing I hate but it sells super well so I can't change it. There was one day he came in and was asking me how to make it, because he tried to at home once in the off season when we stop running it and he really wanted it lol
  • Varine Varine:
    I think he's one of the only people I've made recipes for for free because he really wanted a broccoli cheddar, and it was like dude I don't have a recipe, it's just whatever I have, but here, this is how you do it
  • Varine Varine:
    I don't think he ever figured out how to do the calamari in a pan though, like idk how to do that either. He was afraid of the at home deep fryers though and it's like yeah, that's fair, I am too
  • Varine Varine:
    He was just such a sweet old man, we had two servers pregnant and they held a baby shower together, he was soooooo fucking excited to get to see a baby. Unfortunately he died a month or so before they were born
  • The Helper The Helper:
    So I decided to Google some people that I had not seen or heard from in a while and sure enough one of my old best friends, we had a falling out years ago but whatever, find out he died of Pancreatic Cancer in January. I have also lost a few of my closer acquaintances from growing up the last year. Getting old - people die - I kinda thought it was going to be this way a few years ago....
    +2
  • The Helper The Helper:
    Forum running super slow again
  • Ghan Ghan:
    Not really clear from the stats as to what is causing the slowness.
  • Ghan Ghan:
    We get a lot of guest traffic so it may just be the load is getting too high and not from any particular source.
  • Ghan Ghan:
    Looks like the server is maxed out on CPU.
  • Ghan Ghan:
    Oh it looks like a lot of the traffic is Silkroad Forums. That domain isn't protected by Cloudflare.
  • Ghan Ghan:
    But the old Silkroad site is still on its own server. I just had a test site set up on this server for it.
  • Ghan Ghan:
    I just disabled that test site. Let's see if that helps the load.
  • Ghan Ghan:
    Looks much better already.
  • The Helper The Helper:
    I had actually forgot about the Silkroad site. I had asked
  • The Helper The Helper:
    SD Ryoko about it and he said the couple of people left on there really like it, that was a few years ago, maybe I should check back
  • jonas jonas:
    I guess when you're getting old, and the last day of soup season draws near, you start wondering
  • jonas jonas:
    will I make it to the start of the next season? or was this the last time I'll ever have my favorite dish?

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top