Aller au contenu

Photo

Placeables with tileset walkmeshes (WOK)


  • Veuillez vous connecter pour répondre
33 réponses à ce sujet

#1
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages
Hello all,
I found an intresting thing, which riddles me a bit:

I'm playing with Borden's PLACEABLE treehouses to be found here:
http://nwvault.ign.c....detail&id=8152

Upon taking a closer look, I saw, that those placeables are exported as tile, thus creating a WOK file:
Posted Image
(Placeabe with visible WOK in the NWNexplorer)

Since Borden has based them on his according tile models, the walkmesh does have 2 levels to walk: the ground and the raised house floor  (or maybe it's just one raised area and the ground is managed by the tile).

And most intresting (for me): It works IG:
Posted Image
(Edited model: WOK added as a visible mesh, removed roof + missing textures)

Well, even though the trunk is unwalkable, the toon can walk through it, so probably only the raised walkmesh is handled this way.

Another issue is, that the toon can walk onto that raised part from the sides.

I thought, that placeable walkmesh (cuts) only work, if they are on the same level as the tile walkmesh.

If this WOK-combiantion allows raised walkmeshes, would open that up a whole new dimesion for placables, eg. ramps (haven't tested)? Or am I missing something?

Modifié par TheOneBlackRider, 10 décembre 2013 - 11:04 .

  • OldTimeRadio aime ceci

#2
Zwerkules

Zwerkules
  • Members
  • 1 318 messages
Don't get your hopes up. This may work in a way, but it causes dozens of other problems, like the toon being able to walk through the trunk, walk up the sides of houses, path finding problems and more.

#3
henesua

henesua
  • Members
  • 3 863 messages
I've been playing with this for a while now. I have a thread on "tile" magic with tile classification placeables. And OTR before me had also investigated the ins and outs of this. It works.

However some things you need to understand:
  • the aabb mesh of the "tile" placeable (this is what becomes the wok mesh of a tile) does not change the material (AFK) of the WOK. It merely replaces the Z position of the walkable surface.
  • the "tile" placeable must be placed in the x and y position to center on a tile. if there is any offset, things get messed up. (put these in to position by script, and to center in the tile) AND the "tile" placeable needs to be 10x10 in the x and y dimension so that it matches exactly the sie of a tile.
  • AFK you will not be able to change the material or walkability of the area with a new mesh. So.. if you need to add walls, then you need to put some placeables with a blocking mesh in place.
This is all something that I've wanted to take advantage of in a city dock tileset. All the water would be walkable. And then you'd have a bunch of 10x10 tile magic tiles with ships on them to spawn in when you needed them in the port. These ships would have a higher walkmesh for the ship's deck (and footstep types would be changed by script). To make a separation between the ship's deck and the water you'd need an invisible ship with a blocking mesh around the edge of the hull and surrounded the ecks of the tilemagic ships.

Its a bit sophisticated as you have all those interoperating parts, and would need scripting to spawn/despawn the different parts. Because of all that I have not had the time to implement it. I keep meaning to get to this, but never have the time. Unfortunately I have asked artists to help me on it, but wasted their time since I have not had the time to get to work with them.

Just as soon as we get Vives released I'll look at tackling this. I hope. :) Thats the plan anyway.

Modifié par henesua, 11 décembre 2013 - 09:22 .

  • OldTimeRadio aime ceci

#4
PLUSH HYENA of DOOM

PLUSH HYENA of DOOM
  • Members
  • 774 messages
Interesting.

#5
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages
Sorry for not replying earlier. RL...

Oh yes, Zwerkules. This "hybrid" probably was not ment to be! It may cause some trouble!

I made some more investigations and when finishing those, I found, that henesua had replied. -_-

And since I made some screens, I'll just add them to my reply.

I confirm the points of henesua:

The placeable WOK needs to be tile sized and in line with the tile grid:
Posted Image
(Toolset screen - This is a placeable! I just added a ground-mesh to line out the placement.)

Posted Image
(IG screen with rendered aabb)

Using a script for this! Good idea! Never thought of that. I lined them up via "Adjust Location". Maybe you could post the code? ;)


If it's not placed on the grid, the engine will choose a tile grid close by (light blue square) and the walkmesh will be messed up:
Posted Image
So, checking the walkmesh IG via the console/rendered aabb is a good way to identify issues.



What I found (in addition), that you can also add a PWK to the placeable (but still leave the model set to tile). And intresting enough: The PWK also prevents walking on raised WOK areas!
Posted Image
Here you can see in Gmax, that the (z=0) PWK is on the rim of the stage and also extends beyond the rim inwards. The toon won't be able to walk up the sides (as Zwerk mentioned) and won't drop off the top, even though the PWK is z=0!
:wizard:
(Also notice the possibility of a working ramp on a placeable)

So, Zwerk's pathfinding and uneven terrain may still be an issue!

So, this technique may be intresting, if you want a placeable with a walkmesh leading up, eg. stairs, and it is ok, if this placeable (WOK) is lined up with the tile grid.

And henesua: I really am ancious to see your tile magic one day.

Modifié par TheOneBlackRider, 12 décembre 2013 - 10:33 .


#6
Frith5

Frith5
  • Members
  • 380 messages
Does this work if the placeable is spawned at runtime?

#7
CaveGnome

CaveGnome
  • Members
  • 290 messages
Very interesting!

Is there any hope for an invisible walkable placeable ramp ? Was thinking of using it to fake SpellJammer spaceships taking off or landing, just moving the polymorphed models. This could also be used to make invisible bridges.

#8
henesua

henesua
  • Members
  • 3 863 messages

Frith5 wrote...

Does this work if the placeable is spawned at runtime?


Yes. I do this with tile magic. For this kind of tilemagic, I use placeables rather than VFX.

Modifié par henesua, 13 décembre 2013 - 03:46 .


#9
henesua

henesua
  • Members
  • 3 863 messages

TheOneBlackRider wrote...
Using a script for this! Good idea! Never thought of that. I lined them up via "Adjust Location". Maybe you could post the code? ;)


Its not complicated. You just create a placeable object.

TheOneBlackRider wrote...

So, checking the walkmesh IG via the console/rendered aabb is a good way to identify issues.


You can do this in the toolset if you use virusmans renderaabb plugin for nwntx.


TheOneBlackRider wrote...
What I found (in addition), that you can also add a PWK to the placeable (but still leave the model set to tile). And intresting enough: The PWK also prevents walking on raised WOK areas!
Posted Image
Here you can see in Gmax, that the (z=0) PWK is on the rim of the stage and also extends beyond the rim inwards. The toon won't be able to walk up the sides (as Zwerk mentioned) and won't drop off the top, even though the PWK is z=0!


Very interesting. I had assumed that if a model's classification was tile that you could not make a PWK. Good work!


TheOneBlackRider wrote...
And henesua: I really am ancious to see your tile magic one day.


There is nothing special with what I have done so far. My BSN thread on the subject is still around. You might be able to glean some more ideas from it. OTR chmes in with some valuable insights as well. Page three of that thread has a few of the things I have done with it.  And none of that is WOK manipulation. Creating a pit trap however.... that would be a brilliant idea!

Modifié par henesua, 13 décembre 2013 - 04:01 .


#10
PLUSH HYENA of DOOM

PLUSH HYENA of DOOM
  • Members
  • 774 messages
So, theoretically then, in theory, you could create a Placeable bridge and have it spawn via script to appear at a set point over unwalkable Tile terrain (chasm, water, etc), and then walk across it.

Exceedingly interesting.

#11
Frith5

Frith5
  • Members
  • 380 messages
Yes, PHOD, one of my ponderings too. Also, how about invisible 'flight paths' that spawn when someone begins flying (or swimming when underwater), simulating them moving upward at an angle?

#12
henesua

henesua
  • Members
  • 3 863 messages

PLUSH HYENA of DOOM wrote...

So, theoretically then, in theory, you could create a Placeable bridge and have it spawn via script to appear at a set point over unwalkable Tile terrain (chasm, water, etc), and then walk across it.

Exceedingly interesting.


No. This doesn't work as far as i know. You can't change the material from unwalkable to walkable. You are only changing the height of the existing WOK with the new tile placeable.

#13
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages

henesua wrote...
You are only changing the height of the existing WOK with the new tile placeable.


First, henesua, thanks for the tile magic link. Will roam through it. And I was going to ask, if there is a way to display the aabb within the toolset, but withdrew that question. And now you pointed me to a way using tx. Thanks!

I kept on testing:
Posted Image
2 ramps next to each other, one raised. And it confirms, what henesua wrote: The placeable WOK will override the tile WOK. If you lower this ramp into the ground, the toon will drop into the ground upon stepping "onto" the placeable (of course, the tile floor will still be visible).

I have not tested the material-change henesua mentioned.
Edit: I just placed the ramp so it crosses from (half way) cobble onto (uwalkable) water and the toon stops, where the water starts... So henesua seems to be right: The original tile WOK beneath the placable must be walkable.

Oh, henesua... you could speed up things (for me), if you could post an examplke script, which you use to adjust a spawned placeable to the tile grid, when spawned...
;)

Modifié par TheOneBlackRider, 13 décembre 2013 - 02:28 .


#14
Frith5

Frith5
  • Members
  • 380 messages
But this would still work for swimming/flying over walkable terrain. Imagine having an underwater area, and to swim up and exit it you'd have a chat command <swim up> that would spawn the invisible path up to the 'surface'. At the surface you'd have a trigger to jump the pc to the 'top' of the water (another area). Likewise an area where the 'flyer' wants to swoop up from the streets to the top of a tower battlement (both walkable areas). Could this work?

#15
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages
Well, regarding the swoop up to battlements, I'd say, that depends on the tilesets you are using. I made a test with the ramp using the rual set with raised terrain. Both tries - from bottom to top or over the top don't work, because the edge of the raised terrain does have a (slim) unwalkable part, which stops the toon. The same is for the city raised terrain. With these sets, you don't get up.
You probably would have to add a special tile variation - completely walkable, block it (with a placeable), when there is no ramp and remove the blocks, when the ramp is spawned.
With having such a special tile, I'd say, something like the earlier mentioned "appearing bridge over a gap" would work, too.

Modifié par TheOneBlackRider, 13 décembre 2013 - 04:21 .


#16
henesua

henesua
  • Members
  • 3 863 messages

Frith5 wrote...

But this would still work for swimming/flying over walkable terrain. Imagine having an underwater area, and to swim up and exit it you'd have a chat command <swim up> that would spawn the invisible path up to the 'surface'. At the surface you'd have a trigger to jump the pc to the 'top' of the water (another area). Likewise an area where the 'flyer' wants to swoop up from the streets to the top of a tower battlement (both walkable areas). Could this work?


Yes, all of that could work in a single player module. In multiplayer however it would be challenging at best to pull off. Not sure how to do it gracefully.

#17
henesua

henesua
  • Members
  • 3 863 messages

TheOneBlackRider wrote...

Well, regarding the swoop up to battlements, I'd say, that depends on the tilesets you are using. I made a test with the ramp using the rual set with raised terrain. Both tries - from bottom to top or over the top don't work, because the edge of the raised terrain does have a (slim) unwalkable part, which stops the toon. The same is for the city raised terrain. With these sets, you don't get up.
You probably would have to add a special tile variation - completely walkable, block it (with a placeable), when there is no ramp and remove the blocks, when the ramp is spawned.
With having such a special tile, I'd say, something like the earlier mentioned "appearing bridge over a gap" would work, too.


Yes. The way to do this would be to have the tile itself be walkable. Then use tilemagic placeables to create the variable situations.

Example city wall tiles:
  • change the WOK so that city wall tiles are all walkable.
  • Initialize the city areas with placeable tile magic "Wall State A" at those walls. Wall State A placeables include PWKs that disallow crossing the wall.
  • when you need a special aerial ramp, you destroy State A and spawn in "Wall State B". This has an invisible ramp, and no blocking PWK.
  • when the player is done flying up over the wall, destroy State B, respawn State A.
Obviously there are many problems with this. Most of the problems relate to the unpredicatbility of players. With that in mind the safest way to use these special effects would be with a cutscene.

----
About the script method of spawning, you use CreateObject. That function is supplied with a location. The location would be in the middle of a tile. Your X's and Y's need to end in 5.0. So x 45.0 and y 55.0 is dead center of a tile.

Alternatively you can look at spelljammer's tilemagic scripts which handle this for you. You'll need to adjust his functions to spawn placeables instead of VFX, but thats not hard. I've made the changes for myself. If he's cool with others sharing altered versions of his work, I'll be happy to paste my changes for other's use. But I'm not clear on his feelings about that, and I don't feel like completely rewritting a tilemagic system just so I have the rights to post it.

Modifié par henesua, 13 décembre 2013 - 05:46 .


#18
Zwerkules

Zwerkules
  • Members
  • 1 318 messages

TheOneBlackRider wrote...

You probably would have to add a special tile variation - completely walkable, block it (with a placeable), when there is no ramp and remove the blocks, when the ramp is spawned.
With having such a special tile, I'd say, something like the earlier mentioned "appearing bridge over a gap" would work, too.


Doing things like this with tilesets is the better way. If you want walkable parts in the water for ship placeables,
make a tile for it. Using placeables with tile sized walkmeshes only works on specific tiles or for specific
placeables anyway, so why not add a tile for them which already has a walkmesh that fits exactly and you
block off the parts that are only walkable when there's a ship/bridge/whatever with placeables?

#19
henesua

henesua
  • Members
  • 3 863 messages

Zwerkules wrote...

TheOneBlackRider wrote...

You probably would have to add a special tile variation - completely walkable, block it (with a placeable), when there is no ramp and remove the blocks, when the ramp is spawned.
With having such a special tile, I'd say, something like the earlier mentioned "appearing bridge over a gap" would work, too.


Doing things like this with tilesets is the better way. If you want walkable parts in the water for ship placeables,
make a tile for it. Using placeables with tile sized walkmeshes only works on specific tiles or for specific
placeables anyway, so why not add a tile for them which already has a walkmesh that fits exactly and you
block off the parts that are only walkable when there's a ship/bridge/whatever with placeables?


Perhaps I am misundersanding TheOneBlackRider or you, but that sounds like more or less what i suggest, Zwerkules.
  • Create walkable water tiles for the tileset.
  • Add the ships as "tile" placeables with aabb meshes.
  • when the ships are gone remove the ship placeables.


#20
Zwerkules

Zwerkules
  • Members
  • 1 318 messages

henesua wrote...
Perhaps I am misundersanding TheOneBlackRider or you, but that sounds like more or less what i suggest, Zwerkules.


Your answer wasn't there when I wrote mine, so yes, what I wrote is more or
less the same and I probably wrote it at more or less the same time, which is
wierd because your reply to Frith wasn't there either when I wrote my reply to
TheOneBlackRider even though you wrote both earlier.
So far I had seen that sometimes (rarely) my own posts only appeared after ten minutes or more.
Seems like I also sometimes get to see the replies of others minutes after they wrote them.

Modifié par Zwerkules, 13 décembre 2013 - 07:18 .


#21
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages
Thanks for all your insights and thoughts!
And thanks henesua for the script directions. That's all I need to know.

Regarding "flight ramps": I stumbled upon another problem. Those ramps would have to be invisible. So I tried to use the trick with the invisible NWN block, which shows a texture when set to "activated" in the toolset (for easier placement) and when deactivated, the texture is turned off, but the PWK still stops movement. For this, the placable must be set to "usable" or at least to NOT "static".
Well, this seems not to to be working with WOK-placeables: It seems, that they need to be set to "static", so the WOK is used. As soon as "static" is unchecked, the WOK is ignored.
I do have an invisible "swoop" ramp, but it's hard to place (since the facing is not shown) and probably also hard to set it with the correct facing via a spawn script.

Does anybody have an idea how to add/show a "hinting" of the facing, so that placing is more easy?

Modifié par TheOneBlackRider, 14 décembre 2013 - 05:17 .


#22
Rolo Kipp

Rolo Kipp
  • Members
  • 2 790 messages
<lighting up his pipe...>

Texture the object with a completely transparent texture named "noshow.tga"
While building drop a graph-paper texture (edit: with a bright red arrow on it ;-) named "noshow.tga" in the override ;-)
Smoke and mirrors, me lad =)

<...and preening in the mirror>

Modifié par Rolo Kipp, 14 décembre 2013 - 05:40 .


#23
Frith5

Frith5
  • Members
  • 380 messages
Since they're placeables, could you have two versions, one with a visible facing texture, the other 'invisible'? Place the visible, and at run time switch them out (copy the positioning from the placed one before destroying it, and apply it to the invisible one). Or, you could set the facing to the facing of the person 'flying' when spawning. Do an If check to make sure they can 'fly' in that direction. If so, get their facing and calculate where to place the invisible ramp. Maybe. heh

#24
henesua

henesua
  • Members
  • 3 863 messages
Frith and Rolo, the best way to handle a building condition versus a release version is to take the principle of Rolo's idea, but implement it with HAKs. A couple tilesets do this - Rosenkranz's Immersive Swamps, and Maxams Versatile Dungeon is another.

The method is to have two textures with the same name. The invisible one is in one of your module's main HAKs. The one that renders for the builder is in a special builder's only HAK at the top of the list.

While building your module. The builder's HAK is on top of the custom content list. Then before release you detach the builder's HAK, and save. (if you had blueprints inb your builder's HAK, you need to rebuild the module prior to saving).

#25
Frith5

Frith5
  • Members
  • 380 messages
Yeah, I've seen that done. Nice! Actually, though, if these are going to be spawned 'at will' you won't really place them in the Toolset anyway, right? I mean, isn't the point to modify the walkable area at run time? So, you need a way to specify coordinates and facing for spawning in the placeable. Or am I thinking of it wrong for what you're proposing?