This commit is contained in:
minjaesong
2024-02-07 01:32:54 +09:00
parent a143887375
commit 866b8fed83
18 changed files with 91 additions and 27 deletions

View File

@@ -121,7 +121,7 @@ open class FancyWorldReadLoadScreen(screenToBeLoaded: IngameInstance, private va
class FancyWorldgenLoadScreen(screenToBeLoaded: IngameInstance, private val worldwidth: Int, private val worldheight: Int) : FancyWorldReadLoadScreen(screenToBeLoaded, worldwidth, worldheight, {}) {
private val chunks = (worldwidth / CHUNK_W) * 8
private val chunks = (worldwidth / CHUNK_W) * 9
override fun getProgress(): Double {
return progress.get().toDouble() / chunks * previewWidth

View File

@@ -34,6 +34,9 @@ internal object ExportMap : ConsoleCommand {
"ores@basegame:6" to Cvec(0xffcc00ff.toInt()),
"ores@basegame:7" to Cvec(0xd5d9f9ff.toInt()),
"ores@basegame:8" to Cvec(0xff9300ff.toInt()),
"ores@basegame:256" to Cvec(0xff00ffff.toInt()),
"ores@basegame:257" to Cvec(0xee77ffff.toInt()),
"ores@basegame:258" to Cvec(0xffffffff.toInt()),
)
private val WALL_OVERLAY = Cvec(0.35f, 0.35f, 0.35f, 1f)

View File

@@ -153,6 +153,23 @@ class OreLead(originalID: ItemID) : OreItemBase(originalID, true) {
get() = CommonResourcePool.getAsItemSheet("basegame.items").get(8,6)
}
class GemQuartz(originalID: ItemID) : OreItemBase(originalID, true) {
override var originalName = "ITEM_GEM_QUARTZ"
override var smeltingProduct: ItemID? = "item@basegame:149"
override val itemImage: TextureRegion
get() = CommonResourcePool.getAsItemSheet("basegame.items").get(13,6)
}
class GemAmethyst(originalID: ItemID) : OreItemBase(originalID, true) {
override var originalName = "ITEM_GEM_AMETHYST"
override val itemImage: TextureRegion
get() = CommonResourcePool.getAsItemSheet("basegame.items").get(14,6)
}
class ItemRockSalt(originalID: ItemID) : OreItemBase(originalID, true) {
override var originalName = "ITEM_ROCK_SALT"
override val itemImage: TextureRegion
get() = CommonResourcePool.getAsItemSheet("basegame.items").get(10,6)
}
class ItemCoalCoke(originalID: ItemID) : OreItemBase(originalID) {
override var originalName = "ITEM_COAL_COKE"

View File

@@ -62,6 +62,15 @@ class OregenAutotiling(world: GameWorld, isFinal: Boolean, seed: Long, val tilin
BlocksDrawer.connectLut16[autotiled] or mult.shl(4)
}
"a16x8" -> {
// get placement (tile connection) info
val mult = getHashCoord(x, y, 8)
val autotiled = getNearbyOres8(x, y).foldIndexed(0) { index, acc, placement ->
acc or (placement.item == ore).toInt(index)
}
BlocksDrawer.connectLut16[autotiled] or mult.shl(4)
}
"a16x16" -> {
// get placement (tile connection) info
val mult = getHashCoord(x, y, 16)

View File

@@ -146,7 +146,7 @@ object Worldgen {
val start = (0.00342f * world.height - 3.22f).floorToInt().coerceAtLeast(1)
// this value has to extend up, otherwise the player may spawn into the chopped-off mountaintop
// this value has to extend down into the rock layer, otherwise, if the bottom of the bottom chunk is dirt, they will turn into grasses
return start - 1 to start + 6
return start - 1 to start + 7
}
private val rockScoreMin = 40

View File

@@ -332,17 +332,20 @@ internal object TerragenTest : NoiseMaker {
Block.STONE_MARBLE to Color(0.8f, 0.8f, 0.8f, 1f)
)
private val COPPER_ORE = 0x00e9c8ff
private val IRON_ORE = 0xff7e74ff.toInt()
private val COAL_ORE = 0x383314ff.toInt()
private val ZINC_ORE = 0xefde76ff.toInt()
private val TIN_ORE = 0xcd8b62ff.toInt()
private val GOLD_ORE = 0xffcc00ff.toInt()
private val SILVER_ORE = 0xd5d9f9ff.toInt()
private val LEAD_ORE = 0xff9300ff.toInt()
private val COPPER_ORE = 0//x00e9c8ff.toInt()
private val IRON_ORE = 0//xff7e74ff.toInt()
private val COAL_ORE = 0//x383314ff.toInt()
private val ZINC_ORE = 0//xefde76ff.toInt()
private val TIN_ORE = 0//xcd8b62ff.toInt()
private val GOLD_ORE = 0//xffcc00ff.toInt()
private val SILVER_ORE = 0//xd5d9f9ff.toInt()
private val LEAD_ORE = 0//xff9300ff.toInt()
private val QUARTZ = 0//x55ff33ff.toInt()
private val AMETHYST = 0//xee77ffff.toInt()
private val ROCKSALT = 0xff00ffff.toInt()
private val oreCols = listOf(
COPPER_ORE, IRON_ORE, COAL_ORE, ZINC_ORE, TIN_ORE, GOLD_ORE, SILVER_ORE, LEAD_ORE
COPPER_ORE, IRON_ORE, COAL_ORE, ZINC_ORE, TIN_ORE, GOLD_ORE, SILVER_ORE, LEAD_ORE, ROCKSALT, QUARTZ, AMETHYST
)
private val terragenYscaling = (NOISEBOX_HEIGHT / 2400.0).pow(0.75)
@@ -353,7 +356,7 @@ internal object TerragenTest : NoiseMaker {
val cave = if (noiseValue[1] < 0.5) 0 else 1
val ore = (noiseValue.subList(2, noiseValue.size)).zip(oreCols).firstNotNullOfOrNull { (n, colour) -> if (n > 0.5) colour else null }
val isMarble = noiseValue[10] > 0.5
val isMarble = false // noiseValue[13] > 0.5
val wallBlock = if (isMarble) Block.STONE_MARBLE else groundDepthBlock[terr]
val terrBlock = if (cave == 0) Block.AIR else if (isMarble) Block.STONE_MARBLE else wallBlock
@@ -687,6 +690,9 @@ internal object TerragenTest : NoiseMaker {
Joise(generateOreVeinModule(caveAttenuateBiasScaledCache, seed shake "ores@basegame:6", 0.009, 0.300, 0.474, 1.0)),
Joise(generateOreVeinModule(caveAttenuateBiasScaledCache, seed shake "ores@basegame:7", 0.013, 0.300, 0.476, 1.0)),
Joise(generateOreVeinModule(caveAttenuateBiasScaledCache, seed shake "ores@basegame:8", 0.017, 0.020, 0.511, 1.0)),
Joise(generateOreVeinModule(caveAttenuateBiasScaledCache, seed shake "ores@basegame:256", 0.010, -0.366, 0.528, 2.4)),
Joise(generateOreVeinModule(caveAttenuateBiasScaledCache, seed shake "ores@basegame:257", 0.007, 0.100, 0.494, 1.0)),
Joise(generateOreVeinModule(caveAttenuateBiasScaledCache, seed shake "ores@basegame:258", 0.019, 0.015, 0.509, 1.0)),
Joise(generateRockLayer(groundScalingCached, seed, params, (0..7).map {
thicknesses[it] + marblerng.nextTriangularBal() * 0.006 to (2.6 * terragenYscaling) + it * 0.18 + marblerng.nextTriangularBal() * 0.09

View File

@@ -367,6 +367,11 @@ class CreateTileAtlas {
addTag(blockID, RenderTag.CONNECT_SELF, RenderTag.MASK_16X4)
drawToAtlantes(tilesPixmap, tilesGlowPixmap, tilesEmissivePixmap, RenderTag.MASK_16X4)
}
// predefined by the image dimension: 256x128
else if (tilesPixmap.width == TILE_SIZE * 16 && tilesPixmap.height == TILE_SIZE * 8) {
addTag(blockID, RenderTag.CONNECT_SELF, RenderTag.MASK_16X8)
drawToAtlantes(tilesPixmap, tilesGlowPixmap, tilesEmissivePixmap, RenderTag.MASK_16X8)
}
// predefined by the image dimension: 256x256
else if (tilesPixmap.width == TILE_SIZE * 16 && tilesPixmap.height == TILE_SIZE * 16) {
addTag(blockID, RenderTag.CONNECT_SELF, RenderTag.MASK_16X16)
@@ -511,7 +516,8 @@ class CreateTileAtlas {
const val MASK_TORCH = 3
const val MASK_PLATFORM = 4
const val MASK_16X4 = 5
const val MASK_16X16 = 6
const val MASK_16X8 = 6
const val MASK_16X16 = 7
fun maskTypeToTileCount(maskType: Int) = when (maskType) {
MASK_NA -> 1
@@ -520,6 +526,7 @@ class CreateTileAtlas {
MASK_TORCH -> 4
MASK_PLATFORM -> 8
MASK_16X4 -> 64
MASK_16X8 -> 128
MASK_16X16 -> 256
else -> throw IllegalArgumentException("Unknown maskType: $maskType")
}