Korman subworlds

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

Korman subworlds

Postby JulyForToday » Thu Aug 27, 2020 1:33 pm

I apologize for my endless bevy of questions, but I can't seem to figure this one out (either... :lol: )

Here is what I've been doing in an attempt to get a basic subworld working in Korman:
* [Subworld] make an empty, add the Subworld modifier to it.
* [Entry Region] make a cube, add Subworld Region modifier, set transition to On Enter (I give it a transparent material so I can visually see it in Uru)
* [Exit Region] make a cube, add Subworld Region modifier, set transition to On Exit (parent this to the empty, also give transparent material)
* [Floor] make a third cube with material and add collision, using the terrain checkbox (parent this to the empty) -- this is the only thing intended to be visible ingame

Problem 1: Cannot get collision working in a subworld
When the avatar enters the [Entry Region] the [Floor]'s collision doesn't work, so the avatar immediately falls through the [Floor]. It continues to fall through the rest of the world (which indicates it entered the [Subworld]).
I'm using the [Subworld] as the direct parent to [Floor} (in Blender). There doesn't seem to be another way to tell Korman "hey, this thing over here should be part of this subworld".
I suspect I'm missing something simple to get this working, but I have no idea what.


I've also noticed two issues that are problematic:

Problem 2: [Entry Region] cannot be parented to [Subworld]
If this is done then the [Entry Region] becomes unusable. I can still see the [Floor] but the avatar falls through it and collides with everything else normally (indicating that the avatar never enters the [Subworld])
(although that also means the [Floor] IS actually being associated with the [Subworld], despite the collision not working for whatever reason)

If parenting is the main way to specify what object belongs to what physics 'world', then this limitation makes some sense: the [Entry Region] part of the 'main' physics world so the player can activate it.
But if you have something like an elevator or vehicle, it's desirable that the entry region travels with that collection of objects. So you need another way to synchronize the movement of the [Entry Region] and [Subworld] (or maybe add several stationary entry points for every stop the [Subworld] makes).


Problem 3: Unexpected behavior when move / animating [Subworld]
In order to work around Problem 2, I thought why not just parent both [Entry Region] and [Subworld] to another object/empty and animated that instead. Then that object becomes a sort of container for the subworld.

So I end up with this hierarchy:
[Container]
-[Subworld]
-[EntryRegion]
--[Floor]
--[ExitRegion]

(FYI, the origin for all 5 objects is actually the same, and of course I applied the scale & rotation (before parenting).

That opened up a can of worms. I was getting a lot of unexpected behavior. The hierarchy was appearing in unexpected places.

Transform Issue 1
It took some troubleshooting, but I figured out that when using Blender's empty objects in a transformation hierarchy and exporting it to Uru (using Korman) that it doesn't give the results you expect. Something goes wrong. You expect objects to be in a particular place, but that is not where they end up in Uru. This does not happen with normal mesh objects, which work exactly as I expect them to. I have no idea why this happens, or whether it's a Plasma / Korman / or Blender-setting issue. It's not really a subworld issue, since this incorrect behavior happens without a subworld involved. But it was having a negative effect on my efforts here. I could make a blend file for reproducing this issue if wanted.

(Edit: see my next post after this for the reproduction -- and how oblivious I can be :lol: )

So I stopped using empties, switched them to mesh objects ([Container] is a suzanne mesh and [Subworld] is a cube now). Now I can move the hierarchy (by moving [Container]) around in Blender and when I export to Uru, it is transformed correctly, and appears in the right spot (translate, rotate, and scale all work, and the entry region works correctly too.

Image
[my hierarchy of objects for the subworld] [same hierarchy has been translated/rotated/scaled and looks correct in Uru ]

Transform Issue 2
The next step was to try to animate it. But something peculiar happens. No matter what animation I add, say I simply make it move sideways 10 units, and I export it to Uru, the children of the subworld end up at exactly -2000 units on the z (vertical) axis, far below the 'ground'. I'm guessing this is intended behavior to some degree, since this is similar to how things are set up in Gahreesen. What else is odd is that occasionally when I first link into the age I have seen it for a frame or two as it rapidly moves downward to that position. Not sure what to make of that. The [Container] and the [Subworld] stay in the position where they are supposed to be, and the children are separated and far down there. Both are animated as I specify. The entry region doesn't work. I thought maybe this was related to the Subworld Type setting in the modifier on [Subworld]. I changed it from Separate World to Dynamic Avatar. No luck, it did not seem to change anything (I was hopeful for a moment).

I haven't tried moving the the hierarchy using a python script (which is ultimately what I want to do). Not sure whether that will work.



Even if I could get the animation working properly, doesn't do much good if I just fall through the floor though :D
Last edited by JulyForToday on Mon Sep 14, 2020 10:29 pm, edited 3 times in total.
User avatar
JulyForToday
 
Posts: 118
Joined: Sat Sep 29, 2007 5:34 am

Re: Korman subworlds

Postby JulyForToday » Sat Aug 29, 2020 10:25 am

I made a simple scene to reproduce the error I was talking about regarding transformations using empties.

Image

The column on the left are just normal sphere meshes parented one to the other.
[blue]
-[green]
--[yellow]
---[red]

They work entirely as I expect. I can move them around in blender, and I can also animate them, and they appear in Uru as they do in blender. Nothing wrong here.

The column on the right, I have instead replaced the blue and yellow spheres with empties. Same hierarchy as before
[empty]
-[green]
--[empty2]
---[red]

And as the picture on the right shows, somehow that relationship breaks down when exported to Uru.
The sphere's in the 2nd column are floating above the world origin point.
It seems that first empty's position isn't taken into account so they stay above the origin instead of being on the edge of the square.
The green sphere is then transformed by being raised vertically, which is expected. But it's only at half the height I would expect.
The 2nd empty is likewise not taken into consideration.
Finally the top red sphere is also raised vertically, but only seemingly by half.

I tried adding an empty at the world origin, and using that as the parent for the whole hierarchy to see if that might give me a different result, but it creates the exact same thing.

Again, I have no idea which element (improper Blender setting, Korman, Plasma) is causing this behavior.


link to blend file

EDIT: Please disregard this post, after having revisited this matter, and the blend file I included, I realized I was clearly neglecting to make the empties Plasma objects. I don't know how the hell I missed something so stupendously obvious, other than to say:
I am an idiot.
:roll:

Where'd that dunce cap get to now?....
Last edited by JulyForToday on Mon Sep 14, 2020 10:26 pm, edited 1 time in total.
User avatar
JulyForToday
 
Posts: 118
Joined: Sat Sep 29, 2007 5:34 am

Re: Korman subworlds

Postby Tsar Hoikas » Sat Aug 29, 2020 11:48 pm

Sorry for the delayed reaction - I've been trying to focus on issues that are blocking the CWE update to PhysX 4.1.

I've long suspected that there is some kind of issues with how Korman exports coordinate interfaces (read: "empties"). I was starting to feel fairly confident after I had fixed the problems with colliders being wrong in PotS, but you've clearly demonstrated there is still a problem. Thanks for the sample blend - when I get back to work on Korman, I'll use that to help debug what's going on. For now, if you're wanting to do something "simple" with a linearly displaced platform, I know that the "dynamic avatar" option works correctly in CWE (but PotS does not support that at all).

Interestingly, if you look in Cyan's ages... Specifically, Gahreesen, you can see problem 2 in action in that several of the subworld entry/exit regions are affected by this. I think your solution to create a hierarchy is correct, we just need for Korman to export it correctly.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2139
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Korman subworlds

Postby boblishman » Sun Aug 30, 2020 1:11 am

Same problem for me. No collision, even using Dynamic Avatar. (Destiny MOULa)
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Korman subworlds

Postby boblishman » Sun Aug 30, 2020 9:44 am

OK...further testing... and YES, I can get collision working if I set the Subworld Empty to Dynamic and also set the subworld collision object to Dynamic. However, I had to set the friction on the collider to 10 in order for him to move around WITH collider, which in my case is a rotation cylinder.

In my case, the subworld empty has the rotation animation ... and the collision object is parented to the empty (so it also rotates).
However, whilst the avatar does move with the rotation collision object, he himself always faces in the same direction!... it's all very weird.. and he appears to be rotation himself !!

Anyway, I can confirm that setting both the empty and any child objects with the collision subworld modifier to Dynamic means that the avatar no longer falls through the floor when he enters the subworld. The exit region also works fine.
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Korman subworlds

Postby Tsar Hoikas » Sun Aug 30, 2020 11:28 am

The dynamic avatar strategy won't work properly with angular displacement on PhysX 2.6 based builds of CWE, AFAIK. I suspect it will work fine with PhysX 4.1 builds, but that has yet to be tested. Subworlds were made originally as a workaround for issues with Havok based avatars incorrectly handling angular impulses in that very case. Ideally, we'd be using subworlds too, but sigh. :(
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2139
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Korman subworlds

Postby Sirius » Mon Aug 31, 2020 12:32 pm

Tsar Hoikas wrote:Interestingly, if you look in Cyan's ages... Specifically, Gahreesen, you can see problem 2 in action in that several of the subworld entry/exit regions are affected by this. I think your solution to create a hierarchy is correct, we just need for Korman to export it correctly.

Oh, that's interesting. The enter region is indeed parented to an object named "non-subworldTrnCtrAnimmatch", and there are two bridge colliders, one for the subworld, one for the mainworld.
It's too bad technology at the time required such ugly hacks. Nowadays engines support walking on animated objects without all that subworld hassle (kinda like in Jalak, but without all the bugs... in theory :lol: ).

Plasma has always been weird when it comes to collision anyway. That issue with misplaced colliders has been annoying for both Korman and ZLZ. Eventually I've managed to get ZLZ to import collisions correctly (I think), except for that one collider for the Well's subworld in Gahreesen's exterior. It's 87 feet too high, and that has been the case even during the days of the PyPRP importer.
I've been too lazy to figure out the crazy placement rule behind it, since it's the only remaining misplaced collider I could find. :shrug:
User avatar
Sirius
 
Posts: 1372
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: Korman subworlds

Postby JulyForToday » Mon Aug 31, 2020 1:04 pm

boblishman wrote:...I can get collision working if I set the Subworld Empty to Dynamic and also set the subworld collision object to Dynamic.


So I gave that a try. The avatar enters the subworld collides with the platform and then both the avatar and platform start their endless fall.
So in a technical sense, that works exactly as it should. I never even thought to switch the collider to dynamic, because this is exactly the behavior I would expect to see from using it (effectively turned the platform into a kickable)
I'm actually surprised that it's working for you (in that your collidable floor object is staying in place). Maybe something different from Havok to PhysX? (I have no idea)
User avatar
JulyForToday
 
Posts: 118
Joined: Sat Sep 29, 2007 5:34 am

Re: Korman subworlds

Postby boblishman » Mon Aug 31, 2020 2:55 pm

My (rotating) subworld platform is parented to the subworld empty. Not sure if that makes a difference.
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Korman subworlds

Postby boblishman » Tue Sep 01, 2020 3:18 am

JulyForToday wrote:I never even thought to switch the collider to dynamic


OK...just to be clear ...you should not switch the collider's collision to Dynamic (Kickable). Doing so would result in the behaviour you describe.

You need to set the colliders Subworld Modifier to Dynamic Avatar ... that means that the avatar will interact with the collider within the subworld ... and your collider platform should remain in position ...

Sorry for being lazy and just saying "Dynamic" in my post ... (instead of Dynamic Avatar) ... which caused your confusion ...

Here's how your subworld collider object should be set up in Blender ...

Dynamic.jpg
Dynamic.jpg (296.16 KiB) Viewed 893 times
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Next

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron