Miniaturization prototype

begla

Project Founder and Lead Developer
Contributor
Architecture
Logistics
I've been working on a small prototype this evening to finally move in direction of Cervator's beloved block miniatures (this feature is currently in a separate branch and not publicly available - but it will be soon).

The tool can be used to shrink an area defined by two blocks. A third click places the miniature (scaled by 1/16 blocks) on top of the selected block where it will stay and slowly rotate. The whole system is completely based on the current chunk rendering and tessellation engine so everything in there is fully functioning (like the waving grass or different types of blocks and block shapes).

I'm to sleepy to look into why the area is limited to 16 blocks in width and depth (x- and z-axis). I seems to be related to the new WorldView stuff in there which I couldn't look through completely yet.

Immortius could you take a look at my branch and maybe spot the error? The new MiniatureChunks should extend the default chunks to a size of 128x128x128 blocks (just for testing purposes).

Screen Shot 2012-06-27 at 01.46.21.pngScreen Shot 2012-06-27 at 01.46.24.pngScreen Shot 2012-06-27 at 01.46.30.pngScreen Shot 2012-06-27 at 01.46.49.pngScreen Shot 2012-06-27 at 01.46.53.png
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Oohhh, nice. And at full resolution too? Those are some mighty detailed mini-blocks :D
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
I think I hardset WorldView to assume 16x16 lateral chunks, by using a bit-filter to get the inner-chunk coords (was messing around with performance optimizations before I went and background threaded everything). I'll clean that up in develop.
 

begla

Project Founder and Lead Developer
Contributor
Architecture
Logistics
Works fine! Thank you Immortius. I had to make some minor adjustments to make it actually work with various chunk sizes but now...

I've tested different miniature sizes. Works flawlessly even with absurd dimensions like 2048x256x2048 and a 1/64 scaling factor. Generating the corresponding miniature chunks can take up to 10 seconds on my machine, but it works. Might need a small loading indicator later on here but...

See for yourself! Even things like torches are rendered correctly. Only the water and grass animations have to be updated according to the block scaling factor.

Screen Shot 2012-06-27 at 20.34.55.pngScreen Shot 2012-06-27 at 20.35.07.pngScreen Shot 2012-06-27 at 20.40.30.pngScreen Shot 2012-06-27 at 20.42.07.pngScreen Shot 2012-06-27 at 20.45.40.png
 

begla

Project Founder and Lead Developer
Contributor
Architecture
Logistics
Here are some more screenshots... Now with working billboard and water animations. :omg:

Screen Shot 2012-06-27 at 21.17.50.pngScreen Shot 2012-06-27 at 21.18.43.pngScreen Shot 2012-06-27 at 21.18.47.pngScreen Shot 2012-06-27 at 21.21.43.pngScreen Shot 2012-06-27 at 21.21.46.png
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Holy carp :rainbowhuh:

Those giant miniatures look amazing. And here I just wanted a chair :rofl:

There is a lot of stuff we can do with that, if it can be made fully usable. Picture a crystal ball (crystal cube?) scrying on distant landscape like that... :D
 

begla

Project Founder and Lead Developer
Contributor
Architecture
Logistics
Okay, the Miniaturizer tool is now publicly available in our develop branch. Just select the scissors in your toolbar, click on two blocks and finally select a third block to place the new miniature on. Fun thing is, that the miniature is actually bound to the tool. So if you like multiple miniatures... Just put multiple tools in your inventory. :geek:

If you want to get the Miniaturizer tool in an old world, just type

giveItem "core:miniaturizer"
in the console window.

The tool is still in its early alpha stages and might never make its way into the final game in the current form. Rendering isn't optimized too, so the miniatures are even being rendered while not being looked at.
 

overdhose

Active Member
Contributor
Design
World
GUI
looks mighty interesting, curious how many of those you can load :p
 

overdhose

Active Member
Contributor
Design
World
GUI
some toying around with the scale makes things interesting :
chairscaled.png


try to imagine there are no purple blocks :flutterrage:
 

overdhose

Active Member
Contributor
Design
World
GUI
the first "wall component" : 2X4 blocks at half scale, and a 4X4 windowed version, lego Terasology, to bad it isn't saved yet heh:

wall1.pngwall2.png
 

overdhose

Active Member
Contributor
Design
World
GUI
alternative selection rectangle after second grid position selection:
selection.png
 

overdhose

Active Member
Contributor
Design
World
GUI
and the fog see through bug :p
fogbug.png

Same bug when you select a glass panel and look through it... small detail but this way it's documented
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Nice examples, and nice bug find :D
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
I did a little digging this evening into these miniature chunk renderings that once were. I felt compelled to see what it would take to bring it back to some degree.

With an extra parameter in Tesselator.addMeshPart(...) I was able to get this produced inefficiently in to a single mesh. This does not do any optimization and renders all sides of each block.

Terasology-160306222835-1152x720.jpg Terasology-160306222844-1152x720.jpg Terasology-160306222910-1152x720.jpg

Obviously these do not feature lighting like begla's version. But they are a step in that general direction.

Here is the main code bits for posterity:
Code:
@ReceiveEvent
    public void onChunkDataAddedCreateMesh(OnAddedComponent event, EntityRef entityRef, ChunkDataComponent chunkDataComponent) {
        Tessellator tessellator = new Tessellator();
        for (ChunkDataComponent.BlockPosition item : chunkDataComponent.blockPositions) {
            Block block = blockManager.getBlock(item.blockId);
            for (BlockPart dir : BlockPart.values()) {
                BlockMeshPart part = block.getPrimaryAppearance().getPart(dir);
                    if (part != null) {
                        if (block.isDoubleSided()) {
                            tessellator.addMeshPartDoubleSided(part, item.position);
                        } else {
                            tessellator.addMeshPart(part, item.position);
                        }
                    }
            }
        }

        MeshComponent newMeshComponent = new MeshComponent();
        newMeshComponent.material = Assets.getMaterial("engine:terrain").get();
        newMeshComponent.mesh = tessellator.generateMesh();
        entityRef.addComponent(newMeshComponent);
    }
Code:
public class ChunkDataComponent implements Component {
    public List<BlockPosition> blockPositions = Lists.newArrayList();

    public void add(Vector3i position, short blockId) {
        blockPositions.add(new BlockPosition(position, blockId));
    }

    @MappedContainer
    final class BlockPosition {
        public Vector3i position;
        public short blockId;

        public BlockPosition() {
        }

        public BlockPosition(Vector3i position, short blockId) {
            this.position = position;
            this.blockId = blockId;
        }
    }
}
 
Last edited:
Top