Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MultiScene (World) support #73

Closed
acs opened this issue May 24, 2020 · 18 comments
Closed

Add MultiScene (World) support #73

acs opened this issue May 24, 2020 · 18 comments
Labels
Framework Work in the framework

Comments

@acs
Copy link
Contributor

acs commented May 24, 2020

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 acs added the Framework Work in the framework label May 24, 2020
@acs
Copy link
Contributor Author

acs commented May 30, 2020

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
Copy link
Contributor Author

acs commented May 30, 2020

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
Copy link
Contributor Author

acs commented May 30, 2020

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
Copy link
Contributor Author

acs commented May 30, 2020

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.

1 similar comment
@acs
Copy link
Contributor Author

acs commented May 30, 2020

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
Copy link
Contributor Author

acs commented May 30, 2020

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
Copy link
Contributor Author

acs commented May 30, 2020

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
Copy link
Contributor Author

acs commented May 31, 2020

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
Copy link
Contributor Author

acs commented May 31, 2020

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

@acs
Copy link
Contributor Author

acs commented May 31, 2020

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

@acs
Copy link
Contributor Author

acs commented May 31, 2020

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
Copy link
Contributor Author

acs commented May 31, 2020

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
Copy link
Contributor Author

acs commented May 31, 2020

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
Copy link
Contributor Author

acs commented Jun 1, 2020

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
Copy link
Contributor Author

acs commented Jun 1, 2020

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
Copy link
Contributor Author

acs commented Jun 1, 2020

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
Copy link
Contributor Author

acs commented Jun 1, 2020

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

@acs
Copy link
Contributor Author

acs commented Jun 1, 2020

All done! Closing this ticket.

The scene is at:

https://github.com/juntosdesdecasa/mcthings_scenes/blob/develop/apps/scene_railway.py

Railways

@acs acs closed this as completed Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Work in the framework
Projects
None yet
Development

No branches or pull requests

1 participant