[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
IceBlinkEngine.com • View topic - Implementing height levels

Implementing height levels

Any ideas or suggestions for improving the IB2 engine

Implementing height levels

Postby youngneil1 » Tue Aug 30, 2016 2:03 pm

User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Implementing height levels

Postby youngneil1 » Tue Aug 30, 2016 3:07 pm

User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Implementing height levels

Postby youngneil1 » Tue Aug 30, 2016 3:23 pm

User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Implementing height levels

Postby youngneil1 » Tue Aug 30, 2016 3:37 pm

User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Implementing height levels

Postby youngneil1 » Tue Aug 30, 2016 3:39 pm

User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Implementing height levels

Postby youngneil1 » Tue Aug 30, 2016 4:21 pm

User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Implementing height levels

Postby youngneil1 » Wed Aug 31, 2016 5:52 am

Besides above "prop with no path returns blank lowest coordinate" problem, I am contemplating about bridge squares right now:

Bridges pose additional pathfinding as well graphical representation challenges: They can be crossed above and under, yet unlike ramps (imagine those accessible from all sides, pyramid style) they allow passing only in vertical (NS) or horizontal (EW) direction for a mover in a specific situation, depending actually on the movers height level (precisely: the height level of the square the mover starts from).

So, a bridge square must contain additional info: the bool bridgeTopIsHorizontal refers to the alignment of the bridge. If true, the bridge connects an eastern and a westen high point (horizontal bridge), if set to false the bridge connects a northern and a southern high point (vertical bridge). The int bridgeTopHeight is the height level neeeded cross the bridge in its alignment direction. Teh tiel also ha sits normal heightLEvel property, which is teh botom of the bridge.

When a prop starts its move from a bridge square, the new prop's proprty bool isOnTopOfBridge will determine where the the prop can move. If true, the prop can only move in alignment direction, if false, the prop can only move against alignment direction.

props and party needed heightLevel (mayhaps sue Z coordinate for both in addtion to x and y) of their own; Triggers and props collsion with party require same height level; differnt triggers can this way also work on differnt height Levels only (heigt level attribute of Trigger as condition)...

A non-walkable square can never be entered.

Ramps and bridges have a heightLevel of the top of the structure and extend one level down.

Neighbouring squares, including diagonals, cannot have height level difference of more than 1.

Bridges
Props can always enter tiles with isBridge unless having a higher z value than the height level of a bridge. Exception are props on ramps.

Tiles with isBridge do not copy their heightLevel into Props z coordinate (unlike normal tiles.)
Props can only leave a tile with isBridge towards tiles whose heightLevel property matches the prop's z coordinate or isRamp or isBridge.

Ramps
Props can always enter tiles with isRamp.
Tiles with isRamp do not copy their heightLevel into Props z coordinate (unlike normal tiles.)
Props can always leave a tile with isRamp.

Normal tiles (neither ramp nor bridge)
Props can only enter normal tiles with height level matching prop's z.
Normal tiles copy their heightLevel into Props z coordinate prior prop pathfinding.
Props can only leave a normal tile towards tiles whose heightLevel property matches prop's z coordinate or isRamp or isBridge.


story short: Only difference of a bridge for path finding si that it does not change a prop's z coordinate.

For pathfinding methods above prop's z coordinate insetad of origin square's height level should be used.

Sqaures/tiles will copy their height level into a props z coordinate prior call of pathfinding for prop (remenber: bridges do not do this).
WIP
User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Implementing height levels

Postby youngneil1 » Thu Sep 01, 2016 5:37 am

I. Central rules for prop and party movement in a world with height levels:

Non-walkables
A non-walkable square can never be entered.

Highest point determines height level
Ramps and bridges have a heightLevel of the top of the structure and extend one level down.

Rule of 2
Neighbouring squares, including diagonals, cannot have height level difference of more than 2. Allowing too dramatic drop off/inclines will make look scale of props (and generally graphics) too much off in our orthographic, perspecitveless world. Also we would need too fine degrees of difference between the length levels of autoshadows otherwise. I guess I will go with 20% square size for shadow length if heightLevel difference is 1 and 40% if 2.

Z adjustment prior pathfinding
All moving props and party update their z coordinates with the height level of their current position tile prior pathfinding routines are called. Same goes for setting the isOnRamp/partyIsOnRamp property.
Exception: bridges never change the z value of prop or party.
Note: Keep double movers as well as multi squares moves due to target square occupied in mind.

Z must match heightLevel to enter
To enter a new tile (destination) the z coordinate of prop or party must be the same as the heightLevel of the Destination tile.
Exception 1: Destination is ramp. Ramps can also be entered if z coordinate of prop or party is 1 level lower than the heightLevel of the ramp.
Exception 2: Destination is bridge. Bridges can also be entered if z coordinate of prop or party is 1 level lower than the heightLevel of the bridge.
Exception 3: Origin is ramp (isOnRamp/partyIsOnRamp). Ramps can also be left if z coordinate of prop or party is 1 level higher than the heightLevel of the destination tile.

II. Additional properties needed:

Tiles:
int heightLevel
bool isRamp
bool isBridge

Props:
bool isOnRamp
int propLocation.Z (note: collsion with party will only be regsietred then if not only x and y match, but also z)

Module:
bool partyIsOnRamp
int partyLocation.Z (note: collsion with props will only be registered then if not only x and y match, but also z)

Triggers:
int triggerLocation.Z (this will allow trigers on top of bridges as well as under bridges)
User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Implementing height levels

Postby youngneil1 » Thu Sep 01, 2016 7:31 pm

Hmmm, not bad already.. minus: A* is not made to treat bridges the way they are described above (or I cant figure it out, more precisely :lol: ). BUT... directional bridges as I contemplated about from beginning should work (NorthSouth and EastWest bridges) :D .
User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Re: Implementing height levels

Postby youngneil1 » Fri Sep 02, 2016 6:00 am

I. Central rules for prop and party movement in a world with height levels:

Non-walkables
A non-walkable square can never be entered.

Highest point determines height level
Ramps and bridges have a heightLevel of the top of the structure and extend one level down.

Rule of 2
Neighbouring squares, including diagonals, cannot have height level difference of more than 2. Allowing too dramatic drop off/inclines will make look scale of props (and generally graphics) too much off in our orthographic, perspecitveless world. Also we would need too fine degrees of difference between the length levels of autoshadows otherwise. I guess I will go with 20% square size for shadow length if heightLevel difference is 1 and 40% if 2.

Z adjustment prior pathfinding
All moving props and party update their z coordinates with the height level of their current position tile prior pathfinding routines are called. Same goes for setting the isOnRamp/partyIsOnRamp property.

Z must match heightLevel to enter
To enter a new tile (destination) the z coordinate of prop or party must be the same as the heightLevel of the Destination tile.
Exception 1: Destination is ramp. Ramps can also be entered if z coordinate of prop or party is 1 level lower than the heightLevel of the ramp.
Exception 2: Destination is bridge. Bridges can also be entered if z coordinate of prop or party is 1 level lower than the heightLevel of the bridge.
Exception 3: Origin is ramp. Ramps can also be left if z coordinate of prop or party is 1 level higher than the heightLevel of the destination tile.
Exception 4: Destination is bridge. Bridges can also be entered if z coordinate of prop or party is 1 level lower than the heightLevel of the bridge.
II. Additional properties needed:

Tiles:
int heightLevel
bool isRamp
bool isBridge

Props:
bool isOnRamp
int propLocation.Z (note: collsion with party will only be regsietred then if not only x and y match, but also z)

Module:
bool partyIsOnRamp
int partyLocation.Z (note: collsion with props will only be registered then if not only x and y match, but also z)

Triggers:
int triggerLocation.Z (this will allow trigers on top of bridges as well as under bridges)
User avatar
youngneil1
Backer
Backer
 
Posts: 5078
Joined: Sat Dec 08, 2012 7:51 am

Next

Return to Engine Ideas and Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron