diff --git a/assets/mods/basegame/items/itemid.csv b/assets/mods/basegame/items/itemid.csv index 56663956f..726946e80 100644 --- a/assets/mods/basegame/items/itemid.csv +++ b/assets/mods/basegame/items/itemid.csv @@ -52,7 +52,9 @@ id;classname;tags # gemstones -#144; gems +144;net.torvald.terrarum.modulebasegame.gameitems.GemQuartz;SMELTABLE,SIO2 +145;net.torvald.terrarum.modulebasegame.gameitems.GemAmethyst;SMELTABLE,SIO2 +146;net.torvald.terrarum.modulebasegame.gameitems.ItemRockSalt; # tree seeds by tree species 160;net.torvald.terrarum.modulebasegame.gameitems.ItemSeedOak;SEEDLING diff --git a/assets/mods/basegame/items/items.tga b/assets/mods/basegame/items/items.tga index c4e6764ff..90518ab83 100644 --- a/assets/mods/basegame/items/items.tga +++ b/assets/mods/basegame/items/items.tga @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f6acb450f5ce5db757f85c7fe66a27ecec5b35f633b0ee3aaeb9fd8c475cc2f7 +oid sha256:e62409fc2fb24b70f68d1192803f4f9a2da9ff72c966865ead05c26ee16594bb size 2408466 diff --git a/assets/mods/basegame/locales/en/items.json b/assets/mods/basegame/locales/en/items.json index 49673b61b..22b21c9cd 100644 --- a/assets/mods/basegame/locales/en/items.json +++ b/assets/mods/basegame/locales/en/items.json @@ -13,6 +13,7 @@ "ITEM_GEM_TOPAZ": "Raw Topaz", "ITEM_GEM_DIAMOND": "Raw Diamond", "ITEM_GEM_AMETHYST": "Raw Amethyst", + "ITEM_GEM_QUARTZ": "Raw Quartz", "ITEM_HATCHET_COPPER": "Copper Axe", "ITEM_HATCHET_IRON": "Iron Axe", "ITEM_HATCHET_STEEL": "Steel Axe", diff --git a/assets/mods/basegame/locales/koKR/items.json b/assets/mods/basegame/locales/koKR/items.json index 99fe6522c..efdf2ea6f 100644 --- a/assets/mods/basegame/locales/koKR/items.json +++ b/assets/mods/basegame/locales/koKR/items.json @@ -13,6 +13,7 @@ "ITEM_GEM_TOPAZ": "황옥석", "ITEM_GEM_DIAMOND": "금강석", "ITEM_GEM_AMETHYST": "자수정석", + "ITEM_GEM_AMETHYST": "석영석", "ITEM_HATCHET_COPPER": "구리 도끼", "ITEM_HATCHET_IRON": "철 도끼", "ITEM_HATCHET_STEEL": "강철 도끼", diff --git a/assets/mods/basegame/ores/256.tga b/assets/mods/basegame/ores/256.tga new file mode 100644 index 000000000..0f7b18f0c --- /dev/null +++ b/assets/mods/basegame/ores/256.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35c9fcf7627753c7f2659df232a8f77acaacde649bb740ec8c1cd696c5031103 +size 131090 diff --git a/assets/mods/basegame/ores/257.tga b/assets/mods/basegame/ores/257.tga new file mode 100644 index 000000000..40d18124e --- /dev/null +++ b/assets/mods/basegame/ores/257.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5a01528f361424764bbc3e0c6903fa2105ee002e00a5edbf28015c087711c67 +size 131090 diff --git a/assets/mods/basegame/ores/258.tga b/assets/mods/basegame/ores/258.tga new file mode 100644 index 000000000..0e926e53d --- /dev/null +++ b/assets/mods/basegame/ores/258.tga @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebf26fd8dc1f9d31cee8521d5c1107b39ea93a64403b0e6dea908a43140c1063 +size 131090 diff --git a/assets/mods/basegame/ores/ores.csv b/assets/mods/basegame/ores/ores.csv index 32d16c9cf..0f95de0db 100644 --- a/assets/mods/basegame/ores/ores.csv +++ b/assets/mods/basegame/ores/ores.csv @@ -7,14 +7,16 @@ "6";"item@basegame:133";"GOLD,NATURAL_GOLD" "7";"item@basegame:134";"SILVER,NATURAL_SILVER" "8";"item@basegame:135";"LEAD,GALENA" -# "8";"item@basegame:136";"GEM,RUBY" -# "9";"item@basegame:137";"GEM,EMERALD" -#"10";"item@basegame:138";"GEM,SAPPHIRE" -#"11";"item@basegame:139";"GEM,TOPAZ" -#"12";"item@basegame:140";"GEM,DIAMOND" -#"13";"item@basegame:141";"GEM,SIO2,AMETHYST" -#"14";"item@basegame:142";"GEM,SIO2,QUARTZ" -#"16";"item@basegame:143";"TITANIUM,RUTILE" +#"9";"item@basegame:143";"TITANIUM,RUTILE" -#"256";"macro@BASETILE";"GRASS" -#"257";"macro@BASETILE";"MOSS" \ No newline at end of file +"256";"item@basegame:146";"SALT" +"257";"item@basegame:145";"GEM,SIO2,AMETHYST" +"258";"item@basegame:144";"GEM,SIO2,QUARTZ" +#"259";"item@basegame:136";"GEM,RUBY" +#"260";"item@basegame:137";"GEM,EMERALD" +#"261";"item@basegame:138";"GEM,SAPPHIRE" +#"262";"item@basegame:139";"GEM,TOPAZ" +#"263";"item@basegame:140";"GEM,DIAMOND" + +#"512";"macro@BASETILE";"GRASS" +#"513";"macro@BASETILE";"MOSS" \ No newline at end of file diff --git a/assets/mods/basegame/ores/worldgen.csv b/assets/mods/basegame/ores/worldgen.csv index 4e091592b..96dbb490b 100644 --- a/assets/mods/basegame/ores/worldgen.csv +++ b/assets/mods/basegame/ores/worldgen.csv @@ -8,6 +8,10 @@ "7";"0.013";"0.300";"0.476";"1.0";"a16x16";"natural silver" "8";"0.017";"0.020";"0.511";"1.0";"a16x16";"lead (galena)" +"256";"0.010";"-0.366";"0.528";"2.4";"a16x8";"rocksalt" +"257";"0.007";"0.100";"0.494";"1.0";"a16x8";"amethyst" +"258";"0.019";"0.015";"0.509";"1.0";"a16x8";"quartz" + ################################################################################ # id: ore ID to spawn, the ID must exist on the ores.csv diff --git a/src/net/torvald/terrarum/modulebasegame/FancyWorldReadLoadScreen.kt b/src/net/torvald/terrarum/modulebasegame/FancyWorldReadLoadScreen.kt index 57ed8bbdd..96520f801 100644 --- a/src/net/torvald/terrarum/modulebasegame/FancyWorldReadLoadScreen.kt +++ b/src/net/torvald/terrarum/modulebasegame/FancyWorldReadLoadScreen.kt @@ -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 diff --git a/src/net/torvald/terrarum/modulebasegame/console/ExportMap.kt b/src/net/torvald/terrarum/modulebasegame/console/ExportMap.kt index f67763319..a82520854 100644 --- a/src/net/torvald/terrarum/modulebasegame/console/ExportMap.kt +++ b/src/net/torvald/terrarum/modulebasegame/console/ExportMap.kt @@ -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) diff --git a/src/net/torvald/terrarum/modulebasegame/gameitems/OreItemBase.kt b/src/net/torvald/terrarum/modulebasegame/gameitems/OreItemBase.kt index 00ad98435..96070d7af 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameitems/OreItemBase.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameitems/OreItemBase.kt @@ -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" diff --git a/src/net/torvald/terrarum/modulebasegame/worldgenerator/OregenAutotiling.kt b/src/net/torvald/terrarum/modulebasegame/worldgenerator/OregenAutotiling.kt index 70382ee51..253b5e66d 100644 --- a/src/net/torvald/terrarum/modulebasegame/worldgenerator/OregenAutotiling.kt +++ b/src/net/torvald/terrarum/modulebasegame/worldgenerator/OregenAutotiling.kt @@ -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) diff --git a/src/net/torvald/terrarum/modulebasegame/worldgenerator/Worldgen.kt b/src/net/torvald/terrarum/modulebasegame/worldgenerator/Worldgen.kt index cbdfefc6e..0286e05d2 100644 --- a/src/net/torvald/terrarum/modulebasegame/worldgenerator/Worldgen.kt +++ b/src/net/torvald/terrarum/modulebasegame/worldgenerator/Worldgen.kt @@ -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 diff --git a/src/net/torvald/terrarum/tests/WorldgenNoiseSandbox.kt b/src/net/torvald/terrarum/tests/WorldgenNoiseSandbox.kt index d92be58a2..409d36e11 100644 --- a/src/net/torvald/terrarum/tests/WorldgenNoiseSandbox.kt +++ b/src/net/torvald/terrarum/tests/WorldgenNoiseSandbox.kt @@ -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 diff --git a/src/net/torvald/terrarum/worlddrawer/CreateTileAtlas.kt b/src/net/torvald/terrarum/worlddrawer/CreateTileAtlas.kt index 1b43a8567..a10f76995 100644 --- a/src/net/torvald/terrarum/worlddrawer/CreateTileAtlas.kt +++ b/src/net/torvald/terrarum/worlddrawer/CreateTileAtlas.kt @@ -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") } diff --git a/work_files/graphics/items/basegame_items.kra b/work_files/graphics/items/basegame_items.kra index f7f6891c4..7d75d81cf 100644 --- a/work_files/graphics/items/basegame_items.kra +++ b/work_files/graphics/items/basegame_items.kra @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:17b944ce40375963784d92e48cf95712b128188e85500641fe40b11039f9a930 -size 1081066 +oid sha256:d54cc8a4bf962dfe61a6fe708e9a0cc0a043b890333a13749487286a47042313 +size 1157742 diff --git a/work_files/graphics/terrain/gems.kra b/work_files/graphics/terrain/gems.kra new file mode 100644 index 000000000..a8eb28455 --- /dev/null +++ b/work_files/graphics/terrain/gems.kra @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41e6d57f36c5c38c088cc137bfff991fe2835a72fef4f3d8f75cd77384c5bc9f +size 631562