Voxelers/mcthings

Add MultiScene (World) support

Closed this issue · 18 comments

acs commented

The goal is to have several Scences to build the creations. And probably Scenes are going to be just a Thing that includes other Things (so the composition is getting richer and at several levels). With this approach we can for example create a fenced Scene. And this fence could be a railway so you can move around the Scene quickly.

So we have the concept of World, which is a list of Scenes.

In order to be compatible with the current approach, mono scene, an initial Scene will be created and all is used in McThings like now.

acs commented

Ok, the goal is to create a fenced scene. This use case generates a pretty interesting architectural requirement with scenes used as a thing.

Scenes and Things have a common API, but they are different concepts. Both ot them can be a composition of things, but ... what are the diffs between them? Food for thought! Right now we are saving scenes saviing all the things inside them. But probably we can also save a Thing (with its children).

acs commented

Ok, so the bet is to create the world class, which is linked to the minecraft/minetest world. So the connection is here. And there is only one world (the root of all the tree). And then scenes are the direct children of the world.

In all the design I am trying to avoid circular dependencies. But maybe the key is that we can just remove the Scene class ... but my intuition says me that it is a useful concept in the design and in the architecture.

acs commented

It is important in the Future to have the ability of integrating McThings inside Blender:

#74

Screenshot from 2020-05-30 09-08-35

and it has the Scene concept.

And when you are working in the creation/edition of the world, normally you are doing it in the context of a Scene.

And loading/saving a Thing probably is not that useful. So load/save could be something specific of a Scene. So a Scene could be right now a Thing with load/save function. So it can inherit from Thing adding this two new methods.

acs commented

In any case, the use case is to fence a scene. Let's implement that and during the process, let's redesign what a Scene is and its relation with Things, and introduce the World class.

acs commented

In any case, the use case is to fence a scene. Let's implement that and during the process, let's redesign what a Scene is and its relation with Things, and introduce the World class.

acs commented

Pretty close to have the railway idea working, but:

  • You need to fix to 1 the height: let's add a param with the height of the fence
  • The rail ways are not connected correctly in the way they are filled
    Screenshot from 2020-05-31 01-53-17
    Screenshot from 2020-05-31 01-53-06
    Screenshot from 2020-05-31 01-52-51
acs commented

Ok, next steps:

  • Add the World code and update McThigs Extra and Scenes so all works with the new design
  • Think about and idea to fix the railway issue
acs commented

A bit tricky, but we have it. It oly works correctly in <=1.12 because how the legacy material convert the railways. In >1.12 the corners must be fixed manually.

Screenshot from 2020-05-31 09-19-57

acs commented

After thinking about it, the railway is not a fence, it is just the new Border decorator :) i will change that later.

acs commented

To test scenes, let's create a Decorator that joins two scenes using railways.

acs commented

Ok mostly done! We have a new Border Decorator, used to do the railway, but we need to fix some issues. The test have some strange results to be checked:

Screenshot from 2020-05-31 18-32-39

acs commented

So pending:

  • Check the margins in the border test for the railway
  • Check the global tests to understand why there are so many railways created!
acs commented

mcthings, mcthings_extra and mcthings_scenes updated to use the new world API.

Just missing final debug of the railway around the Scence for 0.40.0.

acs commented

Really close ... but some final issues have appeared.

Screenshot from 2020-06-01 20-53-18

It is cool that the railways is scratched 1 position! The metro is coming ... :)

acs commented

The problem is not builiding the rails scratching. So probably it is related to how the box is built. Let's continue the research:
Screenshot from 2020-06-01 21-15-27

acs commented

Bug found. All works except one you add the sphere! So let's focus in the sphere case to understand the reason.

Executing it in debug mode with steps, it works nicely. So probably, we must way a bi until the sphere is built before decorating the scene.

Screenshot from 2020-06-02 00-09-11

acs commented

I can't not reproduce anymore the bug :( Ok, we have all working in McThings 0.34.2, including to add the railway on the surface.

Screenshot from 2020-06-02 00-30-02