WorldModel Is Now Available

you can use already viewportframes in surface guis

2 Likes

No you can’t. I just tried to earlier and it wouldn’t show the model, and when I moved the model to a regular GUI it showed up. Unless it’s broken.

5 Likes

how you tried to do that?

8 Likes

Left is a regular GUI with the same model as the viewport frame on the right.

As you can see, it’s not showing up.

1 Like

try put the surface gui inside starter gui and set the adornee to the part.

7 Likes

6 months is pretty good turnaround time, not gonna lie.

7 Likes

That worked, thanks. But I seriously think they should allow you to add it how I originally tried. It’s more intuitive.

7 Likes

Is physics calculated ‘locally’ in WorldModels? Eg if I have a spaceship and character inside a WorldModel, can I put the WorldModel millions of studs away from the origin and still have stable physics for the ship and character?

3 Likes

This is great. Thanks for the consistent updates to make our lives easier. Many of the new features have helped trim down our code.

I am curious though; How the raycasting works with WorldModels. Anyone got an example of what this would look like?

1 Like

I haven’t checked this yet, but can we have lighting, skyboxes, shadows, etc… in viewportframes? If this isn’t a feature yet, then when will it be a feature?

If lighting gets added to viewportframes, then I see people being attempting to make windows using viewportframes in surfaceguis.

5 Likes

This is really nice. I like this.

1 Like

There seems to be quite a hefty performance penalty simply for putting things into a WorldModel:

The rightmost 2/3 or so of this picture is from adding WorldModels into ViewportFrames that have character rigs in them. The rigs have joints in them, however, none of them are animated or moving. Will we see more optimizations for this?

EDIT

I made sure everything was CanCollide false and Massless true as well. Performance issues still remained. Something interesting to note is that performance is mostly taken up by some kind of spatial filtering. This performance cost also does not really seem to scale up or down, it seems completely fixed at about 0.01ms per WorldModel on my machine.

15 Likes

Workspace inherits functions from WorldModels right?

1 Like

What issues have you found? A lot of functionality is not supported in the WorldModel. Specifically only what was mentioned in the original post are what we are supporting right now.

3 Likes

Workspace and WorldModel both inherit from WorldRoot. This does not seem to appear properly on devhub right now but you can see it if you run print(Instance.new('WorldModel'):IsA('WorldRoot')). You can also see it here.

3 Likes

Looks really cool! Will for sure check it out. Will you be updating this in the future to include more features than just Humanoids and raycasting?

1 Like

we will add functionality as appropriate, but no timelines at the moment

6 Likes

For reference what’s your total physicsStepped there? Judging by the total Frame Time for 44 frameSteps being .593, looks like your entire physicsStepped is < 1ms? You had to zoom in pretty far!

We can still do better, but 0.01 ms for an entire mini-Workspace isn’t terrible. That part of the overhead shouldn’t get much worse if the character was animating at least. And yeah, ideally this should be free if they’re static… WorldModels do have overhead, but it should be less than emulating the same thing yourself in Lua.

There’s room for many different optimizations here, and we actually have people working on a lot of these already! We decided not to hold this feature back waiting for that work to be completed though. That work proceeds in parallel, and soon this processing time will too. A lot of these changes will benefit both Workspace and WorldModels, without developers having to change anything.

16 Likes

Currently, you need to create it with Instance.new(“WorldModel”), but hopefully we can insert it through studio sometime soon :slight_smile:.

2 Likes

Just for context, that was on a machine with a 9900KS @ 5.2GHz, on the average machine it is usually about twice as slow or more. Approaching 1ms and above to add WorldModels into the ViewportFrames for our in game shop menu is unfortunately too much for us to use the feature right now.

Glad to see there are improvements being made, though!
Is there any sort of timeframe for when we can expect them?

4 Likes