Comments (11)
heeellll... LO?
from minekhan.
This is a feature I don't see a point for. However I do think we could use blockstates, and then mods could use that to simulate the effect you're talking about. I see the issue with modeling, but again blockstates could help since you could make 1 boolean state for each of the connecting directions, then if it's true, render the connector in that direction.
from minekhan.
well i definitely see a use, because it would mean i don't have to model every single state of a block to make it!
from minekhan.
Blocks already have states. Right now I think there's only 5 bits being used for shape, rotation, and whether it's flipped (upside down slab), with 8 bits reserved for the block ID. So only 13 bits being used right now. We can use up to 32.
Having multiple blocks in the same space is a very bad idea for performance reasons though. The main issue being memory usage. With an 8 chunk render distance, there'd be about 5.9 million blocks loaded. By using a 4 byte number for each block, that comes out to about 23.6MB of memory (could be reduced significantly with bit packing).
In order to store multiple blocks per position, I'd need an array for every block space, so the same number of blocks would end up using around 300MB, just from the different storage scheme. Additionally, it becomes much much slower to lookup block positions, which happens tens of millions of times during world gen. Basically everything would become way less efficient. And the code would get more complex, since a single position would no longer resolve to a block, but instead resolve to an array of blocks.
So this definitely won't be implemented. As Oranamous mentioned, waterlogging can be achieved with block states. Meaning you flip a bit on the block's 32 bit number, and that bit means it's waterlogged. For blocks with more states than can be stored in a few bits, entities or tile entities are the solution.
If your only concern is block modeling, then just copy/paste the models from 2 blocks into the same array, and you're done. It's just 1 block with double the vertices.
from minekhan.
If your only concern is block modeling, then just copy/paste the models from 2 blocks into the same array, and you're done. It's just 1 block with double the vertices.
will that still cull correctly?
from minekhan.
No worse than 2 separate blocks in the same space lol
from minekhan.
ok... fine, just to give you an idea of what all i have to model: wall post, wall 1 extension, wall corner, wall 2 extension, wall T, wall 4 extension, wall 1 extension raised, wall corner raised, wall 2 extension raised, wall T raised, wall 4 extension raised, wall 2 extension no post, and finally: wall 2 extension no post raised.... so.... i have to make a seperate block shape for every one of those... right, that'll be fun, to help me along, chance you could tell me how those CONSTs work for the block shape? because... i've noticed they don't like just any number
from minekhan.
As the comments suggest, they're bit flags. Meaning powers of 2. Fences can't be slabs, stairs, or upside down, so you can just re-use those bits.
Here's 16 values that would be fine to use:
0x0000
0x0100
0x0200
0x0300
0x0400
0x0500
0x0600
0x0700
0x2000
0x2100
0x2200
0x2300
0x2400
0x2500
0x2600
0x2700
And you would use blockState & 0x2700
to extract them from the block state. So for example
const wallTRaised = 0x2000 // define shape bits
const fenceMask = 0x2700
...
const blockState = blockIds.oakFence | wallTRaised // store block state
...
if ((blockState & fenceMask) === wallTRaised) // read block state
from minekhan.
yes those are what i mean... it's just... i don't fully understand the code, i only know basic html and javascript, so i don't know how to implement what you just told me
from minekhan.
oh and... another reason for it is water logging... do you have a fix for that?
from minekhan.
So this definitely won't be implemented. As Oranamous mentioned, waterlogging can be achieved with block states. Meaning you flip a bit on the block's 32 bit number, and that bit means it's waterlogged.
from minekhan.
Related Issues (20)
- [Question] Web Hosting HOT 2
- Backspace bug HOT 6
- How to fix lighting bug HOT 2
- Generation issue HOT 3
- The Far Lands??? HOT 2
- Suggestion: Better UI HOT 7
- Texture encoding HOT 5
- Iframes No Work HOT 1
- Mods(maybe i can create them?) HOT 1
- Armor NOW HOT 3
- A MOD adding music feature to the game, and a few useful commands HOT 1
- Website not updated to most recent version HOT 1
- hii HOT 3
- Banned from multiplayer HOT 1
- "Real Willard" HOT 1
- MineKhan Wiki! HOT 7
- Suggestion: 3rd Person View (edit: oops this already exists sorry) HOT 2
- Lighting Bug HOT 1
- How to know if banned HOT 2
- Banning question HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minekhan.