Jump to content

[1.12.2] Biome and Dimension tutorials


ttocskcaj

Recommended Posts

46 minutes ago, Dragonisser said:

Sadly i cant check the code right now.

I bet if TGG, diesieben, jabelar or draco would take a look at it they would probably find it quite fast, but that is not their job.

Just paste your code in if you don't figure it out. Someone will help. Probably start a new thread though :P

Link to comment
Share on other sites

If you dont mind ill post it here: https://github.com/Dragonisser/CobaltMod-2

 

I disabled the dimension light, sky, decoration, spreading of my block, particle effects and its still the exact same issue.

 

 

Changed the CMBiomeProvider to the simplier version of ttocskcaj which drastically increased the fps, but still not good enough.

 

 

And now in normal minecraft

 

 

Edited by Dragonisser
Link to comment
Share on other sites

10 hours ago, Dragonisser said:

If you dont mind ill post it here: https://github.com/Dragonisser/CobaltMod-2

 

I disabled the dimension light, sky, decoration, spreading of my block, particle effects and its still the exact same issue.

 

In your CMWorldProvider class I think you're overriding too many methods. One of the tricks with Minecraft world gen is that the classes and methods are very convoluted and you can run into trouble where you register things but also override methods in ways that don't match.

 

For example, you shouldn't provide the chunk generator directly. It should come from the WorldType (in the terrainType field) automatically. So I don't think you should override the createChunkGenerator() method.

 

You also shouldn't have to provide the biomes. I don't think you should override the getBiomeProvider() method. That should also come from the WorldType automatically. So I don't think you should override the getBiomeProvider() or the getBiomeForCoords() methods.

 

I suggest properly creating a WordType and having those methods automatically give the results in the WorldProvider (using the parent class without overriding), cause I've found mixups that can occur can cause lag.

 

Another thing I notices is that you're using your own "corrupted stone" to fill in the chunk. In your mineable world gen you properly use a predicate that also checks for corrupted stone, but I wonder if there are other features that are struggling because they look for regular stone or something. For example, if a ravine or mineshaft was looking for stone and couldn't find it then I would expect the chunk generation to take longer. For example MapGenCaves looks for specific blocks which may not be present in your case. To isolate this, I recommend commenting out each of the feature generators and see if any of them are causing lag; if so you might need to do a custom version.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

19 minutes ago, jabelar said:

Another thing I notices is that you're using your own "corrupted stone" to fill in the chunk. In your mineable world gen you properly use a predicate that also checks for corrupted stone, but I wonder if there are other features that are struggling because they look for regular stone or something. For example, if a ravine or mineshaft was looking for stone and couldn't find it then I would expect the chunk generation to take longer. For example MapGenCaves looks for specific blocks which may not be present in your case. To isolate this, I recommend commenting out each of the feature generators and see if any of them are causing lag; if so you might need to do a custom version.

MapGenCaves uses this method to check if it can replace a block with a cave:

    protected boolean canReplaceBlock(IBlockState p_175793_1_, IBlockState p_175793_2_)
    {
        if (p_175793_1_.getBlock() == Blocks.STONE)
        {
            return true;
        }
        else if (p_175793_1_.getBlock() == Blocks.DIRT)
        {
            return true;
        }
        else if (p_175793_1_.getBlock() == Blocks.GRASS)
        {
            return true;
        }
        else if (p_175793_1_.getBlock() == Blocks.HARDENED_CLAY)
        {
            return true;
        }
        else if (p_175793_1_.getBlock() == Blocks.STAINED_HARDENED_CLAY)
        {
            return true;
        }
        else if (p_175793_1_.getBlock() == Blocks.SANDSTONE)
        {
            return true;
        }
        else if (p_175793_1_.getBlock() == Blocks.RED_SANDSTONE)
        {
            return true;
        }
        else if (p_175793_1_.getBlock() == Blocks.MYCELIUM)
        {
            return true;
        }
        else if (p_175793_1_.getBlock() == Blocks.SNOW_LAYER)
        {
            return true;
        }
        else
        {
            return (p_175793_1_.getBlock() == Blocks.SAND || p_175793_1_.getBlock() == Blocks.GRAVEL) && p_175793_2_.getMaterial() != Material.WATER;
        }
    }


@Dragonisser If it ends up to be your mapgen, you could try override that method?

Link to comment
Share on other sites

Jfyi even the less lag isnt normal, there shouldnt be any at all.

 

 

I completely disabled everything that tries to put something below surface.

Caves are still in there tho, gotta check that.

 

Added a WorldType, but now the chunkgenerator and the rest doesnt work. How can i bind it to my world, i cant find any relations in your code.

 

https://github.com/Dragonisser/CobaltMod-2/commit/03fc2b919b0c61c13bd7a089c0db1bb2db7b20f1

Edited by Dragonisser
Link to comment
Share on other sites

15 minutes ago, Dragonisser said:

Jfyi even the less lag isnt normal, there shouldnt be any at all.

 

 

I completely disabled everything that tries to put something below surface.

Caves are still in there tho, gotta check that.

 

Added a WorldType, but now the chunkgenerator and the rest doesnt work. How can i bind it to my world, i cant find any relations in your code.

 

https://github.com/Dragonisser/CobaltMod-2/commit/03fc2b919b0c61c13bd7a089c0db1bb2db7b20f1

Do you wanna try building mine and running it? See if the lag is any less for you.

Link to comment
Share on other sites

6 minutes ago, Dragonisser said:

Jfyi even the less lag isnt normal, there shouldnt be any at all.

 

 

I completely disabled everything that tries to put something below surface.

Caves are still in there tho, gotta check that.

 

Added a WorldType, but now the chunkgenerator and the rest doesnt work. How can i bind it to my world, i cant find any relations in your code.

 

https://github.com/Dragonisser/CobaltMod-2/commit/03fc2b919b0c61c13bd7a089c0db1bb2db7b20f1

 

You can see my example code here: https://github.com/jabelar/ExampleMod-1.12/tree/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/worldgen

 

The way the WorldType works, is you MUST use the super constructor that just takes a string for the name. That constructor will add your custom world type to the available options in the new world creation menu. See https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/worldgen/WorldTypeCloud.java. In that you'll see you need to override the key methods for providing the BiomeProvider and ChunkGenerator.

 

I give a list of the things that need to be hooked together in this tutorial: http://jabelarminecraft.blogspot.com/p/minecraft-modding-custom-dimension.html.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

3 hours ago, jabelar said:

 

You can see my example code here: https://github.com/jabelar/ExampleMod-1.12/tree/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/worldgen

 

The way the WorldType works, is you MUST use the super constructor that just takes a string for the name. That constructor will add your custom world type to the available options in the new world creation menu. See https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/worldgen/WorldTypeCloud.java. In that you'll see you need to override the key methods for providing the BiomeProvider and ChunkGenerator.

 

I give a list of the things that need to be hooked together in this tutorial: http://jabelarminecraft.blogspot.com/p/minecraft-modding-custom-dimension.html.

Well, i dont start my world via the new world option. I use a portal to it, thats why i overwrite chunkgenerator and biomeprovider.

 

Edit:

I can try and load it via the world type and see what happens.

 

Edit: Works fine, no lag at all, even with decoration also no decoration and not what i want.

 

Therefore it has nothing to do with the decoration or generation.

 

 

WorldProvider

Minimal Lag and decoration:

public BiomeProvider getBiomeProvider() {
        return new CMBiomeProvider(this.world);
 }

 

I FIXED IT!

Instead of overwriting getBiomeProvider, i simply set it in the init and the lag is completely gone, even on my sort of shitty laptop.
 

protected void init() {
        this.hasSkyLight = true;
        this.biomeProvider = new CMBiomeProvider(this.world);
        this.setAllowedSpawnTypes(false, false);

}

 

https://github.com/Dragonisser/CobaltMod-2/commit/c4663a443573e289b4f5c46af8afeee04f22192f

Edited by Dragonisser
Link to comment
Share on other sites

6 hours ago, Dragonisser said:

 

I FIXED IT!

Instead of overwriting getBiomeProvider, i simply set it in the init and the lag is completely gone, even on my sort of shitty laptop.
 


protected void init() {
        this.hasSkyLight = true;
        this.biomeProvider = new CMBiomeProvider(this.world);
        this.setAllowedSpawnTypes(false, false);

}

 

https://github.com/Dragonisser/CobaltMod-2/commit/c4663a443573e289b4f5c46af8afeee04f22192f

 

Yeah, I guess you were creating a new biomeprovider over and over or something, rather than a single instance that gets referenced again. Usually when I have these problems with world gen I try to simply the amount of overriding and it helps narrow it down. Glad it worked!

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

3 hours ago, ttocskcaj said:

Just been working on the cave generation. @jabelar it automatically picks the biome blocks to repace as well (topBlock and fillerBlock).

Yes, but I was worried not about the biome filler but about the chunk generator "filler" block. In the chunk generator, such as the vanilla overworld it fills the chunk with STONE. After that the biome might add dirt and grass as filler and top. But the vanilla cave gen uses the canReplaceBlock() method which checks for a bunch of standard stuff including STONE. If you think about it, caves go deeper than the biome filler. If you have your own custom block which is used as tje main block in the chunk generator but not in your biome top or filler, then the caves will have trouble. Of course the solution is to simply override the canReplaceBlock() in your own custom cave generator.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

3 hours ago, ttocskcaj said:

Looks ok. But why not just extend MapGenCaves and override the one method you need to?

because i already changed 3 methods and the other will be changed too. bigger caves to be exact.

 

i recommend you to change your WorldProvider like it did to get rid of the lag.

 

 

Edited by Dragonisser
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • This is a MacOs related issue: https://bugs.mojang.com/browse/MC-118506     Download this lib: https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0.jar and put it into ~/Library/Application Support/minecraft/libraries/ca/weblite/java-objc-bridge/1.0.0  
    • I use Bisect-Hosting, and I host a relatively modded server.  There is a mod I desperately want to have in a server. https://www.curseforge.com/minecraft/mc-mods/minehoplite This is MineHop. It's a mod that replicates the movement capabilities seen in Source Engine games, such as Half-Life, and such.  https://youtu.be/SbtLo7VbOvk - A video explaining the mod, if anyone is interested.  It is a clientside mod, meaning whoever is using it can change anything about the mod that they want, with no restrictions, even when they join a server with the same mod. They can change it to where they can go infinitely fast, or do some other overpowered thing. I don't want that to happen. So I just want to know if there is some way to force the SERVER'S configuration file, onto whoever is joining.  I'm not very savvy with all this modding stuff. There are two config files: minehop-common.txt, and minehop.txt I don't really know much about how each are different. I just know what the commands relating to acceleration and stuff mean.    
    • My journey into crypto trading began tentatively, with me dipping my toes into the waters by purchasing my first Bitcoin through a seasoned trader. With an initial investment of $5,000, I watched as my investment grew, proving to be both fruitful and lucrative. Encouraged by this success, I decided to increase my investment to $150,000, eager to capitalize on the growing popularity of cryptocurrency, However, as cryptocurrency gained mainstream attention, so too did the number of self-proclaimed "experts" in the field. Suddenly, everyone seemed to be a crypto guru, and more and more people were eager to jump on the bandwagon without fully understanding the intricacies of this complex world. With promises of quick and easy profits, these con artists preyed on the uninformed, luring them into schemes that often ended in disappointment and financial loss. Unfortunately, I fell victim to one such scheme. Seduced by the allure of easy money, I entrusted my hard-earned funds to a dubious trading platform, granting them access to my accounts in the hopes of seeing my investment grow. For a brief period, everything seemed to be going according to plan, with regular withdrawals and promising returns on my investment. However, my hopes were soon dashed when, without warning, communication from the platform ceased, and my Bitcoin holdings vanished into thin air. Feeling helpless and betrayed, I confided in a family member about my predicament. They listened sympathetically and offered a glimmer of hope in the form of a recommendation for Wizard Web Recovery. Intrigued by the possibility of reclaiming what I had lost, I decided to explore this option further. From the moment I reached out to Wizard Web Recovery, I was met with professionalism and empathy. They took the time to understand my situation and reassured me that I was not alone in my plight. With their guidance, I embarked on a journey to reclaim what was rightfully mine. Wizard Web Recovery's expertise and dedication were evident from the start. They meticulously analyzed the details of my case, uncovering crucial evidence that would prove invaluable in our quest for justice. With each step forward, they kept me informed and empowered, instilling in me a newfound sense of hope and determination. Through their tireless efforts and unwavering support, Wizard Web Recovery succeeded in recovering my lost Bitcoin holdings. It was a moment of triumph and relief, knowing that justice had been served and that I could finally put this chapter behind me. In conclusion, My experience with Wizard Web Recovery  was nothing short of transformative. Their professionalism, expertise, and unwavering commitment to their clients set them apart as true leaders in the field of cryptocurrency recovery. I am forever grateful for their assistance and would highly recommend their services to anyone in need of help navigating the treacherous waters of cryptocurrency scams. 
    • Ok so: Two things to note: It got stuck due to my dimension type. It was previously the same as the overworld dimension tpye but after changing it , it didn't freeze during spawn generation. ALSO, APPARENTLY, the way I'm doing things, the game can't have two extremely-rich dimensions or it will make the new chunk generation be veeery VEEERY slow. I'm doing the dimension file genreation all in the data generation step now, so it's all good. Mostly. If anybody has any tips regarding how can i more efficently generate a biome-rich dimension, im all ears.
    • https://mclo.gs/qTo3bUE  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.