mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 01:54:04 +09:00
open/cave mix control via tile survey
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
"MENU_IO_WORLDGEN_GROWING_MINERALS": "광물을 키우는 중...",
|
"MENU_IO_WORLDGEN_GROWING_MINERALS": "광물을 키우는 중...",
|
||||||
"MENU_IO_WORLDGEN_POSITIONING_ROCKS": "바위들의 위치 조정 중...",
|
"MENU_IO_WORLDGEN_POSITIONING_ROCKS": "바위들의 위치 조정 중...",
|
||||||
"MENU_IO_WORLDGEN_RETICULATING_SPLINES": "망상 구조 결합 중...",
|
"MENU_IO_WORLDGEN_RETICULATING_SPLINES": "망상 구조 결합 중...",
|
||||||
"MENU_LABEL_AUDIO_BUFFER_INSTRUCTION": "오디오 끊김이 들리지 않는 선에서 가장 작은 값으로 설정해주십시오.\n오디오에 끊김이 있다면 더 큰 값으로 설정하고 게임을 재시작하십시오.\n더 큰 값은 오디오 처리의 안정성을 증가시키지만 딜레이도 더 늘어나게 합니다.",
|
"MENU_LABEL_AUDIO_BUFFER_INSTRUCTION": "오디오 끊김이 들리지 않는 선에서 가장 작은 값으로 설정해주십시오.\n오디오에 끊김이 있다면 더 큰 값으로 설정하고 게임을 재시작하십시오.\n더 큰 값은 오디오 처리의 안정성을 증가시키지만 처리 지연도 더 늘립니다.",
|
||||||
"MENU_LABEL_KEYCONFIG_HELP1": "키캡을 클릭해 컨트롤을 배정하십시오",
|
"MENU_LABEL_KEYCONFIG_HELP1": "키캡을 클릭해 컨트롤을 배정하십시오",
|
||||||
"MENU_LABEL_SAVE_WILL_BE_DELETED": "선택된 세이브가 삭제됩니다.",
|
"MENU_LABEL_SAVE_WILL_BE_DELETED": "선택된 세이브가 삭제됩니다.",
|
||||||
"MENU_LABEL_UNSAVED_PROGRESS_WILL_BE_LOST": "저장하지 않은 진행 상황을 잃게 됩니다.",
|
"MENU_LABEL_UNSAVED_PROGRESS_WILL_BE_LOST": "저장하지 않은 진행 상황을 잃게 됩니다.",
|
||||||
|
|||||||
@@ -1,28 +1,31 @@
|
|||||||
idst;tens;impf;dsty;fmod;endurance;tcond;reach;rcs;comments
|
idst;tens;impf;dsty;fmod;endurance;tcond;reach;rcs;sondrefl;comments
|
||||||
WOOD;10;10;800;1;0.173;0.17;5;18;just a generic wood
|
WOOD;10;10;800;1;0.173;0.17;5;18;0.5;just a generic wood
|
||||||
ROCK;15;210;3000;1;0.42;2.9;5;48;data is that of marble
|
ROCK;15;210;3000;1;0.42;2.9;5;48;1.0;data is that of marble
|
||||||
OORE;15;210;3000;1;0.42;2.9;5;100;data is that of marble
|
GLSS;15;210;3000;1;0.42;2.9;5;48;1.0;glass
|
||||||
OGEM;15;210;3000;1;0.42;2.9;5;80;data is that of marble
|
OORE;15;210;3000;1;0.42;2.9;5;100;0.2;data is that of marble
|
||||||
CUPR;210;770;8960;2;1.00;401.0;5;120;copper
|
OGEM;15;210;3000;1;0.42;2.9;5;80;0.2;data is that of marble
|
||||||
EGLS;33;1000;2325;4;0.82;1.0;6;10;elven glass/moldavite
|
CUPR;210;770;8960;2;1.00;401.0;5;120;1.0;copper
|
||||||
IRON;350;1085;7874;5;1.42;80.4;6;120;not wrought iron,just natural iron
|
EGLS;33;1000;2325;4;0.82;1.0;6;10;1.0;elven glass/moldavite
|
||||||
ARGN;170;595;10490;9;0.91;429.0;6;120;argentum/silver
|
IRON;350;1085;7874;5;1.42;80.4;6;120;1.0;not wrought iron,just natural iron
|
||||||
AURM;120;350;19300;9;0.88;318.0;6;120;aurum/gold
|
ARGN;170;595;10490;9;0.91;429.0;6;120;1.0;argentum/silver
|
||||||
STAL;531;2520;7874;14;1.73;26.0;7;120;steel
|
AURM;120;350;19300;9;0.88;318.0;6;120;1.0;aurum/gold
|
||||||
EAUR;768;0;8192;21;1.36;1.0;7;120;elven aurichalcum
|
STAL;531;2520;7874;14;1.73;26.0;7;120;1.0;steel
|
||||||
TIAL;900;0;4420;33;2.16;1.0;8;120;titanium alloy (Ti6Al4V)
|
EAUR;768;0;8192;21;1.36;1.0;7;120;1.0;elven aurichalcum
|
||||||
ADMT;2000;4090;2700;71;3.42;1.0;8;120;adamant
|
TIAL;900;0;4420;33;2.16;1.0;8;120;1.0;titanium alloy (Ti6Al4V)
|
||||||
OOZE;20;0;1000;1;0.08;0.5;0;10;genetic ooze,data is about human skin
|
ADMT;2000;4090;2700;71;3.42;1.0;8;120;1.0;adamant
|
||||||
BONE;130;0;2000;1;0.23;0.55;4;10;data is that of bovine bone
|
OOZE;20;0;1000;1;0.08;0.5;0;10;0.0;genetic ooze,data is about human skin
|
||||||
BRAS;315;1015;8530;3;1.00;120;5;120;brass
|
BONE;130;0;2000;1;0.23;0.55;4;10;0.1;data is that of bovine bone
|
||||||
BRNZ;310;843;8770;3;1.20;75;5;120;bronze
|
BRAS;315;1015;8530;3;1.00;120;5;120;1.0;brass
|
||||||
TINN;220;350;7310;2;1.00;69;5;120;tin
|
BRNZ;310;843;8770;3;1.20;75;5;120;1.0;bronze
|
||||||
ZINC;90;525;7140;2;1.00;116;5;120;zinc
|
TINN;220;350;7310;2;1.00;69;5;120;1.0;tin
|
||||||
DIRT;1;1;1400;0.0;0.0;36;0;10;dirt
|
ZINC;90;525;7140;2;1.00;116;5;120;1.0;zinc
|
||||||
PLST;1;1;1400;0.0;0.0;36;0;16;TODO plastic (polyethylene)
|
DIRT;1;1;1400;0.0;0.0;36;0;10;0.25;dirt
|
||||||
AIIR;1;1;1;0.0;0.0;36;0;1;air
|
SAND;1;1;2400;0.0;0.0;36;0;36;0.25;sand
|
||||||
SAND;1;1;2400;0.0;0.0;36;0;36;sand
|
GRVL;1;1;2400;0.0;0.0;36;0;36;0.25;gravel
|
||||||
GRVL;1;1;2400;0.0;0.0;36;0;36;gravel
|
PLST;1;1;1400;0.0;0.0;36;0;16;0.5;TODO plastic (polyethylene)
|
||||||
|
GRSS;1;1;1400;0.0;0.0;36;0;10;-0.03;dirt
|
||||||
|
AIIR;1;1;1;0.0;0.0;36;0;1;-0.03;air
|
||||||
|
NULL;1;1;1;0.0;0.0;36;0;1;-0.03;air
|
||||||
|
|
||||||
# idst: ID_STRING, ALL CAPS
|
# idst: ID_STRING, ALL CAPS
|
||||||
#
|
#
|
||||||
@@ -46,6 +49,8 @@ GRVL;1;1;2400;0.0;0.0;36;0;36;gravel
|
|||||||
#
|
#
|
||||||
# rcs: Radar Cross Section -- how well the material reflects the radio wave used by the Ground Penetrating Radar.
|
# rcs: Radar Cross Section -- how well the material reflects the radio wave used by the Ground Penetrating Radar.
|
||||||
#
|
#
|
||||||
|
# sondrefl: Sound Reflective Power. Hard surface (glass) is 1.0
|
||||||
|
#
|
||||||
# Comments: do nothing;do not parse
|
# Comments: do nothing;do not parse
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|||||||
|
@@ -230,14 +230,14 @@ object AudioMixer: Disposable {
|
|||||||
it.pan = (it.pan - 0.001f).coerceIn(-1f, 1f)
|
it.pan = (it.pan - 0.001f).coerceIn(-1f, 1f)
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
if (Gdx.input.isKeyPressed(Input.Keys.UP)) {
|
/*if (Gdx.input.isKeyPressed(Input.Keys.UP)) {
|
||||||
convolveBusOpen.volume = (convolveBusOpen.volume + 0.001).coerceIn(0.0, 1.0)
|
convolveBusOpen.volume = (convolveBusOpen.volume + 0.001).coerceIn(0.0, 1.0)
|
||||||
convolveBusCave.volume = 1.0 - convolveBusOpen.volume
|
convolveBusCave.volume = 1.0 - convolveBusOpen.volume
|
||||||
}
|
}
|
||||||
else if (Gdx.input.isKeyPressed(Input.Keys.DOWN)) {
|
else if (Gdx.input.isKeyPressed(Input.Keys.DOWN)) {
|
||||||
convolveBusOpen.volume = (convolveBusOpen.volume - 0.001).coerceIn(0.0, 1.0)
|
convolveBusOpen.volume = (convolveBusOpen.volume - 0.001).coerceIn(0.0, 1.0)
|
||||||
convolveBusCave.volume = 1.0 - convolveBusOpen.volume
|
convolveBusCave.volume = 1.0 - convolveBusOpen.volume
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ object TileSurvey {
|
|||||||
val height: Int,
|
val height: Int,
|
||||||
val spatialGranularity: Int, // 1: survey every (w*h) tile, 2: survey every other (w*h/4) tile ...
|
val spatialGranularity: Int, // 1: survey every (w*h) tile, 2: survey every other (w*h/4) tile ...
|
||||||
val temporalGranularity: Int, // 1: survey every frame, 2: every other frame ...
|
val temporalGranularity: Int, // 1: survey every frame, 2: every other frame ...
|
||||||
val predicate: (GameWorld, Int, Int) -> Boolean
|
val predicate: (GameWorld, Int, Int) -> Float
|
||||||
)
|
)
|
||||||
|
|
||||||
private val proposals = HashMap<String, SurveyProposal>()
|
private val proposals = HashMap<String, SurveyProposal>()
|
||||||
private val results = HashMap<String, Pair<Double, Int>>() // (matching tiles/actually surveyed tiles)
|
private val results = HashMap<String, Pair<Double, Float>>() // (ratio of accumulated data to total tile count / raw accumulated data)
|
||||||
|
|
||||||
fun submitProposal(proposal: SurveyProposal) {
|
fun submitProposal(proposal: SurveyProposal) {
|
||||||
proposals[proposal.surveyIdentifier] = proposal
|
proposals[proposal.surveyIdentifier] = proposal
|
||||||
@@ -54,11 +54,11 @@ object TileSurvey {
|
|||||||
val for_x_end = ceil(player.intTilewiseHitbox.centeredX + proposal.width / 2.0).toInt()
|
val for_x_end = ceil(player.intTilewiseHitbox.centeredX + proposal.width / 2.0).toInt()
|
||||||
val for_y_end = ceil(player.intTilewiseHitbox.centeredY + proposal.height / 2.0).toInt()
|
val for_y_end = ceil(player.intTilewiseHitbox.centeredY + proposal.height / 2.0).toInt()
|
||||||
|
|
||||||
var akku = 0
|
var akku = 0f
|
||||||
|
|
||||||
for (y in for_y_start until for_y_end step proposal.spatialGranularity) {
|
for (y in for_y_start until for_y_end step proposal.spatialGranularity) {
|
||||||
for (x in for_x_start until for_x_end step proposal.spatialGranularity) {
|
for (x in for_x_start until for_x_end step proposal.spatialGranularity) {
|
||||||
if (proposal.predicate(world, x, y)) akku += 1
|
akku += proposal.predicate(world, x, y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ class Material {
|
|||||||
|
|
||||||
var rcs: Int = 10
|
var rcs: Int = 10
|
||||||
|
|
||||||
|
var sondrefl: Float = 0f
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mainly intended to be used by third-party modules
|
* Mainly intended to be used by third-party modules
|
||||||
*/
|
*/
|
||||||
@@ -73,6 +75,7 @@ class MaterialCodex {
|
|||||||
prop.identifier = it.get("idst").toUpperCase()
|
prop.identifier = it.get("idst").toUpperCase()
|
||||||
prop.toolReach = it.intVal("reach")
|
prop.toolReach = it.intVal("reach")
|
||||||
prop.rcs = it.intVal("rcs")
|
prop.rcs = it.intVal("rcs")
|
||||||
|
prop.sondrefl = it.floatVal("sondrefl")
|
||||||
|
|
||||||
materialProps[prop.identifier] = prop
|
materialProps[prop.identifier] = prop
|
||||||
|
|
||||||
|
|||||||
@@ -278,6 +278,10 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
CREATE_NEW, LOAD_FROM
|
CREATE_NEW, LOAD_FROM
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val soundReflectiveMaterials = hashSetOf(
|
||||||
|
""
|
||||||
|
)
|
||||||
|
|
||||||
override fun show() {
|
override fun show() {
|
||||||
//initViewPort(AppLoader.terrarumAppConfig.screenW, AppLoader.terrarumAppConfig.screenH)
|
//initViewPort(AppLoader.terrarumAppConfig.screenW, AppLoader.terrarumAppConfig.screenH)
|
||||||
|
|
||||||
@@ -295,6 +299,17 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
|
|
||||||
|
|
||||||
super.show() // this function sets gameInitialised = true
|
super.show() // this function sets gameInitialised = true
|
||||||
|
|
||||||
|
TileSurvey.submitProposal(
|
||||||
|
TileSurvey.SurveyProposal(
|
||||||
|
"basegame.Ingame.audioReflection", 72, 48, 2, 4
|
||||||
|
) { world, x, y ->
|
||||||
|
val tileProp = BlockCodex[world.getTileFromTerrain(x, y)]
|
||||||
|
val wallProp = BlockCodex[world.getTileFromWall(x, y)]
|
||||||
|
val prop = if (tileProp.isSolid && !tileProp.isActorBlock) tileProp else wallProp
|
||||||
|
MaterialCodex[prop.material].sondrefl
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
data class NewGameParams(
|
data class NewGameParams(
|
||||||
@@ -869,9 +884,17 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
|||||||
oldCamX = WorldCamera.x
|
oldCamX = WorldCamera.x
|
||||||
oldPlayerX = actorNowPlaying?.hitbox?.canonicalX ?: 0.0
|
oldPlayerX = actorNowPlaying?.hitbox?.canonicalX ?: 0.0
|
||||||
|
|
||||||
|
// update audio mixer
|
||||||
|
val ratio = (TileSurvey.getRatio("basegame.Ingame.audioReflection") ?: 0.0).coerceIn(0.0, 1.0)
|
||||||
|
AudioMixer.convolveBusCave.volume = ratio
|
||||||
|
AudioMixer.convolveBusOpen.volume = 1.0 - ratio
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WORLD_UPDATE_TIMER += 1
|
WORLD_UPDATE_TIMER += 1
|
||||||
|
|
||||||
|
// run benchmark if F2 is on
|
||||||
if (KeyToggler.isOn(Input.Keys.F2)) {
|
if (KeyToggler.isOn(Input.Keys.F2)) {
|
||||||
deltaTeeBenchmarks.appendHead(1f / Gdx.graphics.deltaTime)
|
deltaTeeBenchmarks.appendHead(1f / Gdx.graphics.deltaTime)
|
||||||
|
|
||||||
|
|||||||
@@ -33,12 +33,12 @@ object FeaturesDrawer {
|
|||||||
TileSurvey.submitProposal(
|
TileSurvey.submitProposal(
|
||||||
TileSurvey.SurveyProposal(
|
TileSurvey.SurveyProposal(
|
||||||
"basegame.FeaturesDrawer.coldTiles", 72, 48, 2, 2
|
"basegame.FeaturesDrawer.coldTiles", 72, 48, 2, 2
|
||||||
) { world, x, y -> BlockCodex[world.getTileFromTerrain(x, y)].hasTag("COLD") }
|
) { world, x, y -> BlockCodex[world.getTileFromTerrain(x, y)].hasTag("COLD").toInt().toFloat() }
|
||||||
)
|
)
|
||||||
TileSurvey.submitProposal(
|
TileSurvey.submitProposal(
|
||||||
TileSurvey.SurveyProposal(
|
TileSurvey.SurveyProposal(
|
||||||
"basegame.FeaturesDrawer.warmTiles", 72, 48, 2, 2
|
"basegame.FeaturesDrawer.warmTiles", 72, 48, 2, 2
|
||||||
) { world, x, y -> BlockCodex[world.getTileFromTerrain(x, y)].hasTag("WARM") }
|
) { world, x, y -> BlockCodex[world.getTileFromTerrain(x, y)].hasTag("WARM").toInt().toFloat() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user