Jump to content

block shapes


Stroam
 Share

Recommended Posts

First some definitions. The picture on the left is 1/8th pieces and the picture on the right is 1/64th pieces. I am not saying we should use 1/64th pieces ever. I'll abbreviate pieces as pcs. Some use blocks/edge.

nkqiTFg.png 450aseW.png

Right now how blocks work is I have a different blocktype json for each block, stair, slab, inner stair, and outter stair. If I wanted to add vertical stairs and slabs I'd need a new blocktype json for each of those as well. What that means is when you add a block you need to add 7 or more blocktype jsons that are mostly the same thing to each other which is bad design. Furthermore, when you do stairs and slabs, for each you have to copy paste the `sidesolidByType`, `sideopaqueByType`, `shapebytype`. I feel like there could and should be a much better way. I propose a system where you define a block and it includes all of those shapes for free. Something like `blockshapable, tool: saw`. How this would work is you define the recipe for only the block. Once the block is placed in-game, the player taking to correct tool (in this example saw) sees a grid for 1/8th pieces. When the player right-clicks a corner it removes that corner and converts the block into the new shape with the correct solid sides and opaque sides.

This allows one json to cover 8 shapes and all possible rotations for each shape as well as removes the need for defining collision, shape, side solid, side opaque, saving the programmer much time in the long run. It also gives players freedom for making horizontal slabs, horizontal and vertical columns. They don't have to mess around with positioning themselves correctly. For burnable items you can keep track of how many 8th are missing and adjust the time accordingly. 

Edited by Stroam
  • Like 1
Link to comment
Share on other sites

This is a good idea. No, wait. This is a great idea.

The larger grid is perfect for the saw, and would make all kinds of clever shapes possible. (slabs with a missing corner? Sure, why not?)

What I don't agree with is leaving out the smaller grid. That grid would be perfect for a chisel. Carved stone statues? Grooved pillars? Decorative stone and woodwork of all kinds? Yes please!

 

"But won't that need too many models?" Not at all. Since each carved block would have 64 pieces it could be stored as a bitmap in a simple 64 bit integer, each bit indicating if the voxel at that position is removed or not. The client wold then take that bitmap and generate a model as needed. Textures would be similarly simple, just "project" the normal block texture onto the model. If viewed straight on with orthographic projection a carved block would then look identical to a normal block, but in practice this would not be a problem since the game is drawn with perspective.

With a proper client-side model caching and some other fun stuff there should not be any real performance problems unless there are tremendous numbers of differently shaped carved blocks in view.

Edited by Milo Christiansen
Link to comment
Share on other sites

I'll say one thing that I hated about chiseled blocks in TFC.  On the Happydiggers dynmaps, they did not show up at all.  They're just invisible once you chisel them at all.  This makes town maps look no so great in a lot of cases.  I'd just hope that if this becomes 'the system' for stairs and slabs and so on, that whatever maps are included recognize the blocks somehow, rather than making them invisible.

Link to comment
Share on other sites

If this was "the system" for all kinds of detail blocks it would be a high priority issue for any map software to deal with.

Anyway, Tyron was talking about chiseled blocks on Discord, and it seems like it would be easier than I had though to implement this, even as a mod. Sometime when I have less going I'll look into it assuming someone else doesn't get there first :)

Link to comment
Share on other sites

I like this, but if implemented I would also like to have a way to automate the manufacturing of partial blocks ( Slabs, Stairs, and corners). Is just that when you making a huge building it is easy to just have the slab in your hot bar than to have to place each block and then select another tool to change that block into what you actually want.

It would be OK for lets say the corner piece in a roof or stair, but not every single block that you are laying. 

Botton line, make it optional and not exclusively. Even if it needs a mechanical machine ( Waterwheel creates mechanical power feeds a Saw>).

Link to comment
Share on other sites

There was talk about the saw/chisel functioning like the hammer does with the forge. You are able to select how big of an area you want to remove, this would make stairs two clicks. Of course, this is all up to the mod creator which I think I'll let Milo have this one. He seems to already be able to visualize the code. Also if it's a mod, it's going to be a mod that a lot of other mods are dependant off of which comes with its own baggage. 

Link to comment
Share on other sites

2 hours ago, Stroam said:

I think I'll let Milo have this one. He seems to already be able to visualize the code.

Well... I'm glad you have confidence in me? I'm not sure if I'll manage to get to this in a timely manner, but I'll make an effort.

(I really need to stop procrastinating, and finish a few other things first...)

2 hours ago, Stroam said:

You are able to select how big of an area you want to remove

Yes, exactly this. Probably only two sizes, but that should be plenty.

Link to comment
Share on other sites

By the way @Stroam, the worldproperties thing was kinda my plan to fix the copy&paste pains. With another feature or 2 we could probably make that work without any kind of sub-block voxelization thing as you described.

Example: Let's say you want to add a new tree type "Willow" to the game. When you add a new wood variant to worldproperties/block/wood.json (and the ugly hack woodwithaged.json) then you automatically get the following blocks: 

  • Willow Log
  • Willow Planks
  • Willow Plank slabs
  • Willow Plank stairs

 

@Milo Christiansen I was actually thinking if I should make a 2 hour live stream that implements an ingame chisel feature as a mod sample. Whats a good time for streaming? Sunday night?
 

Link to comment
Share on other sites

@TyronIf the sub-block voxelization handles all the cases why would you bother with a second system? Stairs is an artistic variation of a block, with few exceptions, everything that is a stair should be able to be shaped into other designs. Furthermore not every wood needs a log counterpart. Look at bamboo. 
I missed your last stream. Don't want to miss this one as well.

Link to comment
Share on other sites

1 hour ago, Stroam said:

@TyronIf the sub-block voxelization handles all the cases why would you bother with a second system? Stairs is an artistic variation of a block, with few exceptions, everything that is a stair should be able to be shaped into other designs. Furthermore not every wood needs a log counterpart. Look at bamboo. 
I missed your last stream. Don't want to miss this one as well.

These are not quite interchangable. Sub block voxelization does not let me add a wood type with everything that comes with it by just adding one single line of json code. Plus the worldproperties thing was actually the very first feature i worked on for the game. Before there was even custom shapes.

Link to comment
Share on other sites

5 hours ago, Tyron said:
  • Willow Log
  • Willow Planks
  • Willow Plank slabs
  • Willow Plank stairs

A bit of an OT comment here, and one I know has been mentioned elsewhere, but it really would be nice for world-genned trees to have 'natural' log blocks with bark on all sides.  Even vanilla MC is going to have this from what I understand in the next update, and it'd be really nice not to be behind them on anything.

Link to comment
Share on other sites

1 minute ago, redram said:

A bit of an OT comment here, and one I know has been mentioned elsewhere, but it really would be nice for world-genned trees to have 'natural' log blocks with bark on all sides.  Even vanilla MC is going to have this from what I understand in the next update, and it'd be really nice not to be behind them on anything.

I'd love to, help me convince @Saraty :D
She's super against it. 

Link to comment
Share on other sites

1 hour ago, redram said:

A bit of an OT comment here, and one I know has been mentioned elsewhere, but it really would be nice for world-genned trees to have 'natural' log blocks with bark on all sides.  Even vanilla MC is going to have this from what I understand in the next update, and it'd be really nice not to be behind them on anything.

Are you talking about adding unbarked logs texture and bark items or bark as blocks surrounding the tree?

Link to comment
Share on other sites

I'm talking logs with bark on all 6 sides, so the trees don't look like franken-trees cobbled together from cut logs.   Only world-genned logs, or sapling-grown trees, would look have the 'all bark' blocks.  The second you cut them down they're logs with cut ends.

Edited by redram
Link to comment
Share on other sites

okay. Well, as soon as the game can distinguish natural from placed that wouldn't be a difficult mod if Saraty put her foot down. I'm already planning on making a mod so certain items change textures at night. Like lanterns that are only on at night.

Edited by Stroam
Link to comment
Share on other sites

9 hours ago, Tyron said:

I was actually thinking if I should make a 2 hour live stream that implements an ingame chisel feature as a mod sample. Whats a good time for streaming? Sunday night?

For me, any time if I know about it ahead of time. I can adjust when I get up for anything if needed. I would love to see a stream of this, it would be a good way to learn more about how drawing and all that fun stuff works in the game. The video would also be great for putting on the wiki.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.