MineColonies

MineColonies

57M Downloads

[Discussion] Custom In-Game Huts

Elrol opened this issue · 25 comments

commented

The idea that I had, was to have either a custom style, or some way to make a custom built hut.

The way this could work is that there is a new config (or section of the config) that stores block requirements for each of the huts and levels of huts,

In order for the build to be complete the player would need to satisfy the requirements for the hut/level that they are trying to make.

I figured I would leave this here to see what everyone thinks, and maybe pool some ideas if this seems like a function that could be added while still being balanced.

commented

Not like that, that is to make a new style, I am talking more like a custom hut that you make how ever you want without scanning it and then haivng them build it.

So you would just be able to place the hut down, hit "Custom Hut" or something, it shows what you need to make the level one 'building' which is defined in the config, and when all of the blocks are placed in a certain radius then the hut will be 'built'

This would allow people to say, make a free form town without having to make each level of the hut in a different world just to make something that they will only use in a single world.

commented

Let me see if i can point out they keypoints here.

  1. Place down blank hut block.

  2. Gui has ability to determine type of hut and radius+height of scan.
    2a. Radius + height in blocks not chunks.
    2b. Type of hut + level of hut?
    3c. Optionally name the hut?

Is this what your goin for here?

commented

The problem is that some buildings require x of some item (not gonna talk about various/multi requirements) to work. Secondly, you need to calculate an approx cost of building level so a player will not be allowed to build level five from one wooden plank. This means to give a cost value to every block and balance it properly.
Otherwise nice idea

commented

Can't this be achieved with the decoration controller already?

commented

The way i imagined it would be a scantool as a block? Would be convenient for making schematics.

commented

Ok, so my thought was the type of hut and the level would not be configurable. when you place a hut, you can have it say that you want it to make a custom hut.

The type of hut would be determined on what hut you placed down, and the level would be 1.
You would have a button to allow the player to upgrade the hut to the next level, until its max.

I dont think the range should be configurable in game, unless we have a max range.

As for what blocks would be needed, we could have 2 different sets of blocks. one for the hut levels, that would be the same for each hut, and one that has the blocks needed per hut. so if you wanted to make a tier 3 builder, it takes the list of tier 3 blocks and the builder blocks and says that you need those blocks.

The reason I was thinking about this is I wasa trying to make a colony in a lost city, and wanted to have the entire colony in a few of the buildings. But to make this work currently I have to build each level, for each hut, and copy them over, then restart the game, then test to make sure they work then go back into the single player world and have the builder make them.

I was thinking that it would be easier for people who did not want to make a custom style to have a custom colony be able to do it all at once. Just place down the block, satisfy a list of blocks needed (just like the builder) and then its done.

commented
commented

If that is what the drcoration controller does then I have no idea how it works.

I thought the drcoration controller only controlled decorations. Not making custom functional huts without using the scanning tool

commented

Ok, so the list of points:

  • Placing the hut manually (not using the builder) will show a new button in the GUI to make a custom hut.

  • The custom hut would be level one to start with and you will be able to level it up using the GUI when level one is built.

  • Each hut type and level will have its own set of required blocks that will be needed to be placed in a radius that is predefined in the config.

  • When all of the blocks needed are present in the area that has been defined, the hut will be built and be able to function like a normal hut would.

This would allow you to build anything for the hut, without requiring it to be built twice, and would be best for players who want a custom hut without building the houses to make a new style.

commented

This... Makes sense, but the third point... Its like giving them free huts and might, no, will break progression majorly.

So to add to those points.

  1. Hut must have a system to ensure the hut at least has the appearance of one.

  2. Config option to enable/disable this feature.

That being said there is alot of things about this that probably disquallify this as a feature. But the simplest reason is it breaks progression due to only requiring minimum of blocks.

commented

we could offset the minimum amount of blocks to require a set amount of other blocks, that are not the specific required blocks for the hut.

commented

That would help somewhat... But in the end it doesnt help much if all they do is make a wall of blocks. Kinda want to see a village of wall huts though...

Perhaps taking "Galacticraft" mod as reference? The airlocks require an enclosed spaceb so if we use that as a basis the structure must be enclosed by walls/roof/floor and at least one door? But that prevents some builds like the lumberjacks and miners.

This kind of feature would be well suited to making underground colonies. Well the main issue remains that the structure can be cheated.

commented

I just wrote this up in notpad to show a possible idea of what I was thinking for some of the requirements, its not a full list but it will show possibly what I am talking about with needing a certain amount of a set of blocks.

`public static Class HutLogic {

public static final Block[] end_blocks = new Block[]{Blocks.endstone, Blocks.purpur, Blocks.purpur_stairs, ...};
public static final int end_qty = 16;
public static final int radius = 16;
public static final int height = 3;

public static boolean chechHut(World world, BlockPos origin){
        BlockPos min = origin.add(-radius, -height, -radius);
        BlockPos max = origin.add(radius, height, radius);
        int count = 0;
        
        for(int x = min.getX(); x < max.getX(); x++){
            
            for(int z = min.getZ(); z < max.getZ(); z++){
                
                for(int y = min.getY(); y < max.getY(); y++){
                    
                    Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock();
                    
                    if(end_blocks.contains(block){
                        count++;
                    }
                }
                
            }
            
        }
        if(count >= end_qty){
            return true;
        }
        return false;
    
    
}

}`

Also, you can still "cheat" the hut making, just go into single player, place a single hut, make 5 scans of the same hut so each one would require nothing to build and you would have a tier 5 hut with nothing around it.

commented

Ok then more points to clarify.

  1. Would these hut schematics be temporary?

  2. How would they be classified? That is how will they be classified in the build tool?

commented

That wpuld be thw beauty of it, there would not need to be a schematic or any use of the build tool. When you build it its done. The trade off is that you would need to build it yourself instead of the builder

commented

Sad to say that this kinda defeats thepurpose of the mod i think...

commented

the only thing that would change is that you would have the option to build the hut yourself, you would still need the same blocks, the hut would function the same, the only difference would be that you only have to build the hut once and not two times.

But that is why I made a discussion about it before dedicating all my time into trying to make it happen.

commented

The point of the scan tool is to make custom huts and builds. To do it without the tool the way you said... I get a headache just thinking how complex that would be.

So basically.

  1. Place down hut.
  2. Hut scans and detects structure. [Lets say a villager house.
  3. Structure becomes that hut after a few mods such as a furnace or crafting table?
  4. Upgrading hut as usual or such?
  5. Profit?

Basically you want to steal existing structures to act as huts?

commented

What I am suggesting is a way to make huts without having to buils them twice and withput saving. I could possibly start working on it to show how I was thinking it would be.

But it would only need the blocks listed for thw hut type and level, and once it has those blocks it would be built, which would allow people to make any kind of build for any rype of hut just like they were building any other building.

commented

Could you list the keypoints about this? Its hard to understand cause the whole thing is really vague. I understand you want to make huts in game without having to go through the regular process. But without a set of coordinates to determine the structures size and what blocks are in that box it's hard to tell what your aiming for.

commented

The problem I see with doing something like this is:

  1. each hut type has different requirements, such as smelters need furnaces, composters need barrels, workers should have crafting tables, citizen huts need beds, etc.
  2. each level has different requirements, mostly 1 wooden, 2 stone/iron, 3 nether, 4 ocean, 5 end
  3. workers also need more racks than housing, miners need mineshafts (coded into the miner, based on cobblestone/ladder.
  4. We could have "empty" hut schematics, that have just the hut block in it, and light placeholder blocks (which leave whatever is there alone, but I don't know if that means if there is a rack/furnace/or other item that is need if the worker will see that and use it.
  5. There isn't a required size on hut schematics, each schematic is different, the important part of hut schematics and levels is that the length and width are in the same place in relation to where the hut block is. The hut block determines where the edges are setup. If you use the build tool to place a hut and scroll through the different styles you will see the edge lines move, but the hut block doesn't. (After working on a new "Taiga/Nordic" style that uses someone elses footprint (length and width) and the same hut block placement, this isn't easy.

I hope this makes sense.

We do have a schematic database "thing" in the works, where you can upload your own version of huts that others can download (allowing users to download only the huts they want to use, and not all of them in order to save mod size)

commented

The plan that I had to tackle the first issue was to have an array of blocks that would list how many would be needed for each hut type, and at what tier, and how many. For example:
`
public class test{

private String[] smelterTier1 = new String[]{"minecraft:furnace * 1", "minecraft:chest * 1"};
private String[] smelterTier2 = new String[]{"minecraft:furnace * 2", "minecraft:chest * 1"};
private String[] smelterTier3 = new String[]{"minecraft:furnace * 2", "minecraft:chest * 2"};
private String[] smelterTier4 = new String[]{"minecraft:furnace * 3", "minecraft:chest * 2"};
private String[] smelterTier5 = new String[]{"minecraft:furnace * 3", "minecraft:chest * 3"};
public List<List<String>> smelterRequirements = new ArrayList();

public test(){
    smelterRequirements.add(Arrays.toList(smelterTier1));
    smelterRequirements.add(Arrays.toList(smelterTier2));
    smelterRequirements.add(Arrays.toList(smelterTier3));
    smelterRequirements.add(Arrays.toList(smelterTier4));
    smelterRequirements.add(Arrays.toList(smelterTier5));
}

public List<ItemStack> getListForTier(String hutName, int tier){
    List<String> list;
    List<ItemStack> requiredBlocks = new ArrayList<>();
    
    switch(hutName){
        case("smelter"): list = smelterRequirements.get(tier-1);
            break;
        default: list = new ArrayList();
            break;
    }
    
    for(String req : list)(
        String[] temp = req.split(" * ");
        try{
            int qty = Integer.parseInt(temp[1]);
            Item item = Item.REGISTRY.getObjectById(temp[0]);
            requiredBlocks.add(new ItemStack(item, qty);
        } catch(Exception e){
            e.printStackTrace;
            continue;
        }
    }
    return requiredBlocksl;
}

}
`

For the second part, we could have 5 lists of blocks for each of the tiers, and then have config options to say what the min amount of blocks in each of the lists the player would need for that tier. For example, to make a tier 4, it would need all the other tiers, plus a set number of blocks in the tier 4 to be present before making the hut.

The third point, I am not too sure about, I have not looked too much at the miner recently and dont know how it exactly works, But I am a pretty good problem solver from time to time.

For part four, That is possible, but the other option that players have is to just go into single player, and make a set of schematics that have just the hut in them and make them tier1-5 so upgrading from one to the next would be free, other then a few blocks that the huts would need to function, but I think that instead of that they would rather do a custom hut like I have explained here. The current way to make custom huts would still be used by people making hut styles for players who are not the best, or dont enjoy, building.

With this idea, the size would be preset in the config so on one can change it in game, and only in the files, but it would stay the same for each upgrade, it would only require more blocks for the player to place.

And I love the plans for the schematic database, I have no issues with the schematics and use them often myself, and it would be great to be able to share custom styles to other players like that.

Either way, I am glad that I started the discussion, I would not want to have coded the whole thing just to have no one want it integrated. But either way at the end of the day, its just a thought.

commented

I've been out of programming too long, so I don't quite understand what you are trying to do with the above code.

As the schematics admin, and main builder/updater (only built 1 full style myself) I love the idea of this, but don't see a way to make this practical. Even out of the 13 current styles we have, only a few are used on a regular basis.

commented