Crystal wedges, no extra IDs needed

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Except you need to store 5 bits for each of the 8 sub-blocks. That's 40 bits. As opposed to 8 originally. The new armor+surplus system is designed to fudge the HP so that you can reduce the number of bits in HP, and then condense all of the blocks into one ID that uses all possible orientation values.
    Except that you need 1 bit per block. Set, not set.
    5 HP bit are stored per 2x2x2 (4-5 orientation & 8 hp -> 5 hp and 7-8 sub-blocks)


    I would like to hear more about other in-depth mechanics.
    I like the armour+surplus system too - it could reduce required hp bits even further (had done something alike once myself)

    Currently hard hull has 200 hp (requires 8 bits hp, 1/3 of the 3 bytes)

    With sub-blocks each "hard hull sub-block" has 200/8 = 25 hp (5 bit).
    while( block.hp < 0 ) block.hp += 25, sub-blocks -= random 1.
    @ltmauve HP NOT STORED IN SUB-BLOCKS!!!
    @AsherMaximum HP ARE FOR EACH SUB-BLOCK!!!

    You need to store a blueprint for the repair beam, but we need this feature anyway.


    Just look at how many new orientations this would give (non-existing (aka wedge/penta) will be replaced by visible sub-blocks with not visible edges for diagonals).
    And how much easier it would be to edit corners wedges (you add/delete sub-blocks like blocks rather than needing to orientate).

    And then tell me it is not worth it.
     
    Last edited:
    Joined
    Mar 28, 2014
    Messages
    76
    Reaction score
    9
    Except that you need 1 bit per block. Set, not set.
    5 bit are stored per 2x2x2.
    If 5 bits were used for HP per "2x2x2 sub-blocks", you would have 32 possible values for HP. You could not store a 0-200 value for a HH using only 5 bits, unless you changed the HP resolution to 7, which is similar to what OP is proposing.
     
    Last edited:
    Joined
    Aug 28, 2013
    Messages
    1,831
    Reaction score
    374
    • Legacy Citizen 2
    • Top Forum Contributor
    • Legacy Citizen
    I see what you mean by having sub-block- you only store whichever sub-block will take damage, and just keep track of it. The problem is you cannot keep track of what shape a block is supposed to be. If I pound off the corner of a cube and make it a wedge, then when I repair it the computer doesn't know if it's a wedge or penta or cube.
     
    Joined
    Mar 28, 2014
    Messages
    76
    Reaction score
    9
    Currently hard hull has 200 hp (requires 8 bits hp, 1/3 of the 3 bytes)

    With sub-blocks each "hard hull sub-block" has 200/8 = 25 hp (5 bit).
    while( block.hp < 0 ) block.hp += 25, sub-blocks -= random 1.
    @ltmauve HP NOT STORED IN SUB-BLOCKS!!!
    @AsherMaximum HP ARE FOR EACH SUB-BLOCK!!!

    You need to store a blueprint for the repair beam, but we need this feature anyway.
    I don't understand your system then. If HP is not stored in the sub-block, but the HP is for each sub-block, how can you store all the possible values?
    For examples, you have one block HH with 200 total HP
    Explain how you would store the HP after it is hit with:
    23 damage (total for whole block left = 177)
    then 63 damage (remaining 114)
    then 42 damage (remaining 72)
     

    Lecic

    Convicted Lancake Abuser
    Joined
    Apr 14, 2013
    Messages
    5,107
    Reaction score
    1,228
    • Thinking Positive Gold
    • Purchased!
    • Legacy Citizen 11
    Excellent idea, still. I don't know a lot about computer bits and bytes and whatnot but Itmauve seems to know what they're talking about.

    EDIT- is it just me or are @mentions broken?
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    I see what you mean by having sub-block- you only store whichever sub-block will take damage, and just keep track of it. The problem is you cannot keep track of what shape a block is supposed to be. If I pound off the corner of a cube and make it a wedge, then when I repair it the computer doesn't know if it's a wedge or penta or cube.
    Yes, that is what you need a blueprint for. but you need it anyway for missing blocks.
     
    Joined
    Jun 19, 2014
    Messages
    1,756
    Reaction score
    162
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen
    Does anyone actually know why there are so may hp bits? I'm guessing it's because some blocks have more than 128 hp.
    But how does armor work then?
    Could we free up a bit by taking one hp bit away without changing anything else?
    If we could, that would double the item ID bits to 4096. That is as much as minecraft had (I think it has more now), and that wasnmore than enough there.
    This would allow for future giant mods with lots of blocks. On the bright side: I don't think that the upcoming creatures will use the same type of IDs as the blocks, so we could always compensate by adding about 2048 types of creature segments (or more!).
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Armour is stored once for all blocks. It does NOT need bit PER block.

    Personally, I think storing current (not max or armour) HP for each block in a 2x2x2 group or having more than 4 different IDs in a 2x2x2 block group is waste of memory.


    Maybe it is possible to use 11 bit for 2x2x2 blocks instead of 8*8 bits for 1x1x1 blocks on big ships.
    Small ships could have an extra array with 1 byte per block for HP ((blocks would occupy same index in this array as in their block-array)) if we really need this extra realism.

    HP is byte-waste #2
    byte-waste #1 is the possibility to have 8 different block IDs in a 2x2x2 area which is almost never used.
     
    Last edited:
    Joined
    Mar 28, 2014
    Messages
    76
    Reaction score
    9
    Armour is stored once for all blocks. It does NOT need bit PER block.

    Personally, I think storing current (not max or armour) HP for each block in a 2x2x2 group or having more than 4 different IDs in a 2x2x2 block group is waste of memory.


    Maybe it is possible to use 11 bit for 2x2x2 blocks instead of 8*8 bits for 1x1x1 blocks on big ships.
    Small ships could have an extra array with 1 byte per block for HP ((blocks would occupy same index in this array as in their block-array)) if we really need this extra realism.

    HP is byte-waste #2
    byte-waste #1 is the possibility to have 8 different block IDs in a 2x2x2 area which is almost never used.
    If you don't store the HP in the actual block, how do you know when a block's HP is gone and the block is destroyed?
    What do you mean, byte waste #1 is having 8 different block IDs in a 22x2 area? Is that with your "sub-block" idea?
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    If you don't store the HP in the actual block, how do you know when a block's HP is gone and the block is destroyed?
    With these 11 bit alone, you don't. You destroy the whole 2x2x2 block if the sum of their HP is drained, but that should be sufficient in big ships.

    But you can avoid this restriction (max 200 hp per block or a 12th bit).
    If the first three bits are set (200 hp *8 = 1600 = 1024+512+256+x = 1792 = impossible), the hp value is a 8-bit pointer to a more accurate set of 8 damage values for the 1x1x1 blocks (max: 64 byte PER SHIP).

    Whenever a new block get damaged (most significant 3 hp bits not all set) it allocates a new or the oldest 8-bit value and the block-group which points to it receives the sum of 8 values as hp which replaces the pointer (you lose data, but who cares? who can remember the exact location of a damaged block after damaging 255 other groups?)​

    In the battles we fight killing or not killing a single block almost never makes a difference. The level of all-time details should not suffer solely because of a higher detail level during combat (my opinion).


    What do you mean, byte waste #1 is having 8 different block IDs in a 22x2 area? Is that with your "sub-block" idea?
    No. Sub blocks can only have 1 ID for all (and 8 bits form a shape out of all possible 8-bit sub-block combos).

    This uses the assumption that players will very rarely build 8 different blocks in a 2x2x2 area, more likely <=4 (intersection of 4 areas, 4 computers in a wall) and that it is not bad to just leave more space in-between blocks or arrange them over the area of 2-4 2x2x2 areas by a 1-block shift left/right or front/rear.

    8 different IDs = 10 bit per block, 80 per 2x2x2, 640 per 4x4x4.

    4 different IDs (1/2 of now) in a 2x2x2 + 2 bits PER 1x1x1 to reference the map index = 56 bit /8 = 7 bit per block (3 saved)
    or
    16 different IDs (1/4 of now) in a 4x4x4 area + 4 bits PER 1x1x1 to reference the map index = 352 bit /64 = 6.5 bit per block.​

    Disadvantage: 2 / 4 blocks have to share IDs if more than 50% / 25% of space is used.
    Advantage: 2/3 only memory usage. you almost never need more.​

    Waste = ability to store data where the ability almost never gets used.
     
    Joined
    Aug 28, 2013
    Messages
    1,831
    Reaction score
    374
    • Legacy Citizen 2
    • Top Forum Contributor
    • Legacy Citizen
    You know, maybe there is another way to do this while freeing up additional IDs (in effect) without reducing HP (though the new armor system is still good)
    Move two bits from ID to orientation. Then have all IDs for the ship defined from a huge list. You limit the number of block types usable on ships, but you gain the fact that you can have an arbitrary large number of block IDs, which would be particularly useful for having a flora or fauna system. Since orientation is the same for all blocks, the only information the physics engine needs aside from orientation is whether the block is solid.
     
    Joined
    Jun 19, 2014
    Messages
    1,756
    Reaction score
    162
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen
    Moving two bits from id to orientation would mean that the current ids would be divided by 4, resulting in only 512 block ids, and that is less than the amount of blocks we already have.
     
    Joined
    Aug 28, 2013
    Messages
    1,831
    Reaction score
    374
    • Legacy Citizen 2
    • Top Forum Contributor
    • Legacy Citizen
    Basically, you would have only 512 ids per structure, but you could select from a list of say 65,000 IDs. For adding in flora for every world and all that having all those blocks might be a good idea.
     
    Joined
    Aug 28, 2013
    Messages
    1,831
    Reaction score
    374
    • Legacy Citizen 2
    • Top Forum Contributor
    • Legacy Citizen
    Came up with another advantage of consolidating blockIDs: You make transparent blocks behind other types visible. Like if you have glass and then mesh you would be able to see the mesh. The reason I assume this isn't done right now is because the graphics engine would have to know to relate different blockIDs together.

    Also edited the OP with this and made it a bit clearer.
     
    Joined
    Aug 28, 2013
    Messages
    1,831
    Reaction score
    374
    • Legacy Citizen 2
    • Top Forum Contributor
    • Legacy Citizen
    Of course, we need an interface for this.
    Proposal:
    While in adv. build mode
    Scroll wheel changes block shapes.
    WASDQE rotates the block. W rotates the block up (from your perspective), Q turns is horizontally, D rotates the block clockwise, etc.
    Middle click copies a rotation.
     
    Joined
    Jun 19, 2014
    Messages
    1,756
    Reaction score
    162
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen
    And there goes the most common use of crystals and ores... Could there be a way to keep their use in crafting hull, glass and lights?
     
    Joined
    Aug 28, 2013
    Messages
    1,831
    Reaction score
    374
    • Legacy Citizen 2
    • Top Forum Contributor
    • Legacy Citizen
    And there goes the most common use of crystals and ores... Could there be a way to keep their use in crafting hull, glass and lights?
    Wait, what? Giving crystals wedges means they're more useful for decoration, not less. I don't understand what you mean by this.