Compare commits

...

95 Commits

Author SHA1 Message Date
minjaesong
81ebf7a8ef world code placeholder to match the code struct 2023-09-08 19:32:41 +09:00
minjaesong
d5a8d098bb teleporter: list loading on separate thread 2023-09-08 18:51:53 +09:00
minjaesong
cc55e563f0 ModLoader: load IME unconditionally when found 2023-09-08 15:31:11 +09:00
minjaesong
64ef30e445 shorter share code if allowed; flickering teleporter beams 2023-09-08 02:14:36 +09:00
minjaesong
fbc700508f season variable moved to worldtime 2023-09-07 17:21:34 +09:00
minjaesong
37492dc8a0 six ecological seasons for terrain tiles 2023-09-07 13:19:32 +09:00
minjaesong
b0e4bd31eb temporary setup for picking next weather 2023-09-06 22:33:42 +09:00
minjaesong
0b5e3d7b77 skybox: old-current weather turbidity blend 2023-09-06 21:07:39 +09:00
minjaesong
b47cc17afd choosing next weather as its own function 2023-09-06 19:30:08 +09:00
minjaesong
6c97a9d5ab cloud stage has more depth 2023-09-06 18:01:33 +09:00
minjaesong
7259ca616c modloader: locale autoloader 2023-09-06 02:15:04 +09:00
minjaesong
70b9cebbd0 working sledgehammer item to take down walls 2023-09-05 22:47:40 +09:00
minjaesong
274be20e25 new texture for the teleporter 2023-09-05 20:40:55 +09:00
minjaesong
c576d087b4 newborn clouds will fade-in 2023-09-05 14:24:02 +09:00
minjaesong
699cc4dd74 another failed experiment 2023-09-05 13:45:02 +09:00
minjaesong
8fa9ddeec1 portalPoint to the world 2023-09-05 01:40:20 +09:00
minjaesong
c4deba14da cloud rendering: gamma change 2023-09-05 01:04:09 +09:00
minjaesong
cf98c13111 fix: 'q' would close the ui when you're typing in something 2023-09-05 00:41:43 +09:00
minjaesong
d0e1555ad0 sprite update 2023-09-04 22:40:48 +09:00
minjaesong
50eac69e3e working invitation code for new character 2023-09-04 22:16:51 +09:00
minjaesong
c45cab388e working invitation code via portal 2023-09-04 21:48:28 +09:00
minjaesong
7b3ac9cd06 weatherbox is now owned by the world 2023-09-04 14:59:12 +09:00
minjaesong
08b1d93d54 fix: double typing on world portal ui 2023-09-04 14:04:19 +09:00
minjaesong
da7ecaa75b share code ui wall of text 2023-09-03 20:30:23 +09:00
minjaesong
65b610ce01 world portal share code 2023-09-03 17:06:02 +09:00
minjaesong
6a78cf6a41 reverting akima intp: derivatives are not being preserved at the sample points 2023-09-02 23:43:50 +09:00
minjaesong
1e98353b50 akima interpolation to the WeatherBox 2023-09-02 22:37:07 +09:00
minjaesong
38c91bd8ec weatherbox: nonlinearity to the intp to remove overshoot-to-minus 2023-09-02 17:18:47 +09:00
minjaesong
78075d779b each cloud now carry its own gamma value 2023-09-02 02:40:27 +09:00
minjaesong
721a24d9dc commenting out some debug prints 2023-09-02 00:24:38 +09:00
minjaesong
66a103bd3a weather sched progression wip 2023-09-01 23:56:48 +09:00
minjaesong
abee176ef4 fix: graph rules not drawing if ymax < 1 2023-09-01 16:30:09 +09:00
minjaesong
ae078024cb angular modulo for wind dir 2023-09-01 15:51:46 +09:00
minjaesong
96af39ab4a changing the way weatherbox gets updated 2023-09-01 00:50:24 +09:00
minjaesong
c75fa73bac scrolling weatherbox; new skybox clut 2023-08-31 22:32:55 +09:00
minjaesong
5eed921288 debugwin: drawing ingame weatherboxes 2023-08-31 17:03:27 +09:00
minjaesong
7f3f94e01a gui-theme: cell colour change 2023-08-31 12:20:31 +09:00
minjaesong
1fe0ca9e2e debug window: weather box drawing 2023-08-31 12:19:56 +09:00
minjaesong
7cc985b627 debug info: timer toggle is now Ctrl+T 2023-08-31 10:56:32 +09:00
minjaesong
d17d576e15 sunlight and clouds changes 2023-08-30 19:57:11 +09:00
minjaesong
ced7cf99fc more cloud textures 2023-08-30 17:54:34 +09:00
minjaesong
c290d5dee7 minor phys fix 2023-08-30 14:39:20 +09:00
minjaesong
d32d6b8d1c torch should flicker less erratic now 2023-08-30 12:39:56 +09:00
minjaesong
9d118aebb0 todo weather example 2023-08-29 15:39:24 +09:00
minjaesong
0646425b76 build: removing unused files, instruction update 2023-08-29 14:29:25 +09:00
minjaesong
a348bac397 . 2023-08-29 14:04:17 +09:00
minjaesong
a9bd032c32 yet another cloud colour changes 2023-08-28 14:48:14 +09:00
minjaesong
349488376d sunrise/sunset transition is now longer 2023-08-28 14:30:24 +09:00
minjaesong
ce8c53f740 clut for cloud colours 2023-08-28 03:28:27 +09:00
minjaesong
7845146718 cloud spawn: fixing my bad maths 2023-08-28 00:04:00 +09:00
minjaesong
3cce1c0b65 faster import process 2023-08-27 21:13:52 +09:00
minjaesong
2bbf92d056 build script update 2023-08-27 21:01:13 +09:00
minjaesong
3d5713cd31 new test sprite/display screencaps for imported avatars if available 2023-08-27 17:38:43 +09:00
minjaesong
f8b6493cdc temporarily disabling evening-mustard :p 2023-08-25 21:28:20 +09:00
minjaesong
b69689a6be higher alpha-gamma makes it look better 2023-08-25 21:27:17 +09:00
minjaesong
cc2c841f76 app version string for .plist 2023-08-25 21:26:51 +09:00
minjaesong
89846db5d3 fix: using wrong method for retrieving mouse coord 2023-08-25 18:46:24 +09:00
minjaesong
bfd926d7fe avatar import error handling 2023-08-25 17:38:15 +09:00
minjaesong
602d5e046b fix: newly created world did not get clouds 2023-08-25 16:50:41 +09:00
minjaesong
72029ed458 new world screen for loading imported players 2023-08-25 16:47:00 +09:00
minjaesong
a4672a131d some gui stuff for imported players 2023-08-25 16:04:12 +09:00
minjaesong
75fcb5be5b new import screen 2023-08-25 15:49:35 +09:00
minjaesong
eeee1ebdbc F4 to hide GUI 2023-08-25 09:11:56 +09:00
minjaesong
32e750eb6a generating version number on build 2023-08-25 08:54:32 +09:00
minjaesong
a2ced31f8f removing os files on making assets_release 2023-08-25 08:40:06 +09:00
minjaesong
b1e45f1743 character import wip 2023-08-25 00:24:12 +09:00
minjaesong
8dda7ac79b linear filter for clouds 2023-08-24 20:27:10 +09:00
minjaesong
74b8cc20b7 fix: bad cloud spawn position on certain directions 2023-08-24 17:59:55 +09:00
minjaesong
f75a7dd812 control presets 2023-08-24 17:24:39 +09:00
minjaesong
b2454e4ca2 changing ui toggle keys in-world should work now 2023-08-24 16:08:18 +09:00
minjaesong
45af955488 wide cloud for overcast weather 2023-08-24 15:08:30 +09:00
minjaesong
1f39b9d448 cloud texture touchups 2023-08-23 22:38:01 +09:00
minjaesong
26a4cdbce1 clouds will despawn of old age 2023-08-23 21:22:46 +09:00
minjaesong
bf87dc04cb randomised weather but i'm just faking it rn 2023-08-23 18:12:32 +09:00
minjaesong
8535b0ce13 forgot to enable the initial clouds spawning 2023-08-23 13:01:20 +09:00
minjaesong
6e0004f165 clouds can spawn and drift in any direction 2023-08-23 12:49:33 +09:00
minjaesong
845333f33d timeflow on the titlescreen need not be that complex 2023-08-23 10:10:01 +09:00
minjaesong
6988feb731 day-night cycle on the titlescreen 2023-08-22 23:39:09 +09:00
minjaesong
ac2c7b1148 clouds on titlescreen 2023-08-22 23:17:49 +09:00
minjaesong
d6145fd0da even more clouds 2023-08-22 22:27:39 +09:00
minjaesong
194089827c more cloud texture 2023-08-22 21:27:33 +09:00
minjaesong
d69d032f74 more cloud texture 2023-08-22 20:27:25 +09:00
minjaesong
a9dbea3d16 more clouds 2023-08-22 20:06:22 +09:00
minjaesong
52938a4b60 improved cloud draw perf 2023-08-22 17:43:53 +09:00
minjaesong
a21f986f30 cloud spawn z-pos probability change 2023-08-22 16:33:39 +09:00
minjaesong
547158a313 more depth to the distant clouds 2023-08-22 16:20:35 +09:00
minjaesong
0a8b5f33f4 clouds parallax and can drift in 3D 2023-08-22 09:50:03 +09:00
minjaesong
da8d620766 clouds with just right depths 2023-08-22 02:55:31 +09:00
minjaesong
7dd520393c more clouds 2023-08-22 00:06:03 +09:00
minjaesong
dc83e12170 more clouds 2023-08-21 21:39:11 +09:00
minjaesong
d6b2940d8f more clouds 2023-08-21 01:26:16 +09:00
minjaesong
c5dfe46b76 cloud wip 2023-08-20 19:10:43 +09:00
minjaesong
3d3926c08b windows build 2023-08-18 20:30:57 +09:00
minjaesong
9a90bf69d4 trying to use the proper method of running exe on exe 2023-08-18 10:57:40 +09:00
minjaesong
0ed5472d8a adjusting pos for 'save will be deleted' msg 2023-08-18 00:05:03 +09:00
242 changed files with 4540 additions and 1134 deletions

View File

@@ -87,6 +87,7 @@
<element id="extracted-dir" path="$PROJECT_DIR$/lib/regex-22.3.1-edit.jar" path-in-jar="/" /> <element id="extracted-dir" path="$PROJECT_DIR$/lib/regex-22.3.1-edit.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/js-22.3.1-edit.jar" path-in-jar="/" /> <element id="extracted-dir" path="$PROJECT_DIR$/lib/js-22.3.1-edit.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/graal-sdk-22.3.1.jar" path-in-jar="/" /> <element id="extracted-dir" path="$PROJECT_DIR$/lib/graal-sdk-22.3.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/lib/commons-math3-3.6.1.jar" path-in-jar="/" />
</root> </root>
</artifact> </artifact>
</component> </component>

14
.idea/libraries/apache_commons_math3.xml generated Normal file
View File

@@ -0,0 +1,14 @@
<component name="libraryTable">
<library name="apache.commons.math3" type="repository">
<properties maven-id="org.apache.commons:commons-math3:3.6.1" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/commons-math3-3.6.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$PROJECT_DIR$/lib/commons-math3-3.6.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/commons-math3-3.6.1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build Version Number" type="Application" factoryName="Application">
<option name="ALTERNATIVE_JRE_PATH" value="17" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="MAIN_CLASS_NAME" value="net.torvald.terrarum.PrebuildKt" />
<module name="TerrarumBuild" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -7,6 +7,7 @@
<option name="ALTERNATIVE_JRE_PATH" value="17" /> <option name="ALTERNATIVE_JRE_PATH" value="17" />
<module name="TerrarumBuild" /> <module name="TerrarumBuild" />
<method v="2"> <method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Build Version Number" run_configuration_type="Application" />
<option name="BuildArtifacts" enabled="true"> <option name="BuildArtifacts" enabled="true">
<artifact name="ModuleComputers" /> <artifact name="ModuleComputers" />
<artifact name="TerrarumBuild" /> <artifact name="TerrarumBuild" />

View File

@@ -7,6 +7,7 @@
<option name="ALTERNATIVE_JRE_PATH" value="17" /> <option name="ALTERNATIVE_JRE_PATH" value="17" />
<module name="TerrarumBuild" /> <module name="TerrarumBuild" />
<method v="2"> <method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Build Version Number" run_configuration_type="Application" />
<option name="BuildArtifacts" enabled="true"> <option name="BuildArtifacts" enabled="true">
<artifact name="ModuleComputers" /> <artifact name="ModuleComputers" />
<artifact name="TerrarumBuild" /> <artifact name="TerrarumBuild" />

View File

@@ -2,6 +2,7 @@ package net.torvald.terrarum.modulecomputers.gameitems
import com.badlogic.gdx.graphics.Camera import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.g2d.TextureRegion import com.badlogic.gdx.graphics.g2d.TextureRegion
import com.badlogic.gdx.utils.Disposable import com.badlogic.gdx.utils.Disposable
@@ -118,7 +119,7 @@ class WearableWorldRadarUI(val device: VM) : UICanvas() {
device.update(delta) device.update(delta)
} }
override fun renderUI(batch: SpriteBatch, camera: Camera) { override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
batch.end() batch.end()
batch.color = Color.WHITE batch.color = Color.WHITE

View File

@@ -5,10 +5,7 @@ import com.badlogic.gdx.Input
import com.badlogic.gdx.graphics.* import com.badlogic.gdx.graphics.*
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer import com.badlogic.gdx.graphics.glutils.FrameBuffer
import net.torvald.terrarum.App import net.torvald.terrarum.*
import net.torvald.terrarum.FlippingSpriteBatch
import net.torvald.terrarum.blendNormalStraightAlpha
import net.torvald.terrarum.inAction
import net.torvald.terrarum.langpack.Lang import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.modulecomputers.gameactors.FixtureHomeComputer import net.torvald.terrarum.modulecomputers.gameactors.FixtureHomeComputer
import net.torvald.terrarum.ui.Toolkit import net.torvald.terrarum.ui.Toolkit
@@ -18,8 +15,8 @@ import net.torvald.tsvm.peripheral.GraphicsAdapter
import net.torvald.unicode.* import net.torvald.unicode.*
internal class UIHomeComputer : UICanvas( internal class UIHomeComputer : UICanvas(
toggleKeyLiteral = Input.Keys.ESCAPE, // FIXME why do I have specify ESC for it to function? ESC should be work as the default key toggleKeyLiteral = null,
toggleButtonLiteral = App.getConfigInt("control_gamepad_start"), toggleButtonLiteral = "control_gamepad_start",
) { ) {
override var width = 640 override var width = 640
override var height = 480 override var height = 480
@@ -45,7 +42,7 @@ internal class UIHomeComputer : UICanvas(
private val fbo = FrameBuffer(Pixmap.Format.RGBA8888, width, height, false) private val fbo = FrameBuffer(Pixmap.Format.RGBA8888, width, height, false)
private val controlHelp = private val controlHelp =
"${getKeycapPC(App.getConfigInt("control_key_inventory"))} ${Lang["GAME_ACTION_CLOSE"]}\u3000 " + "${getKeycapPC(ControlPresets.getKey("control_key_inventory"))} ${Lang["GAME_ACTION_CLOSE"]}\u3000 " +
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_T$KEYCAP_R Terminate\u3000" + "$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_T$KEYCAP_R Terminate\u3000" +
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_S Reset\u3000" + "$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_S Reset\u3000" +
"$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_Q SysRq" "$KEYCAP_CTRL$KEYCAP_SHIFT$KEYCAP_R$KEYCAP_Q SysRq"
@@ -53,7 +50,7 @@ internal class UIHomeComputer : UICanvas(
override fun updateUI(delta: Float) { override fun updateUI(delta: Float) {
} }
override fun renderUI(otherBatch: SpriteBatch, otherCamera: Camera) { override fun renderUI(otherBatch: SpriteBatch, otherCamera: OrthographicCamera) {
otherBatch.end() otherBatch.end()
fbo.inAction(camera, batch) { fbo.inAction(camera, batch) {

View File

@@ -25,5 +25,6 @@
<orderEntry type="library" name="jetbrains.kotlin.reflect" level="project" /> <orderEntry type="library" name="jetbrains.kotlin.reflect" level="project" />
<orderEntry type="library" name="jetbrains.kotlin.test" level="project" /> <orderEntry type="library" name="jetbrains.kotlin.test" level="project" />
<orderEntry type="library" name="io.github.classgraph" level="project" /> <orderEntry type="library" name="io.github.classgraph" level="project" />
<orderEntry type="library" name="apache.commons.math3" level="project" />
</component> </component>
</module> </module>

Binary file not shown.

BIN
assets/graphics/fonts/code.tga LFS Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -8,6 +8,7 @@
"GAME_ACTION_MOVE_VERB" : "Move", "GAME_ACTION_MOVE_VERB" : "Move",
"GAME_ACTION_ZOOM" : "Zoom", "GAME_ACTION_ZOOM" : "Zoom",
"MENU_IO_AUTOSAVE": "Autosave", "MENU_IO_AUTOSAVE": "Autosave",
"MENU_IO_CLEAR": "Clear",
"MENU_IO_IMPORT": "Import", "MENU_IO_IMPORT": "Import",
"MENU_IO_MANUAL_SAVE": "Manual Save", "MENU_IO_MANUAL_SAVE": "Manual Save",
"MENU_LABEL_COPYRIGHT": "Copyright", "MENU_LABEL_COPYRIGHT": "Copyright",
@@ -16,6 +17,7 @@
"MENU_LABEL_IME": "IME", "MENU_LABEL_IME": "IME",
"MENU_LABEL_IME_TOGGLE": "Toggle IME", "MENU_LABEL_IME_TOGGLE": "Toggle IME",
"MENU_LABEL_KEYBOARD_LAYOUT": "Keyboard Layout", "MENU_LABEL_KEYBOARD_LAYOUT": "Keyboard Layout",
"MENU_LABEL_PASTE": "Paste",
"MENU_LABEL_PASTE_FROM_CLIPBOARD": "Paste from Clipboard", "MENU_LABEL_PASTE_FROM_CLIPBOARD": "Paste from Clipboard",
"MENU_LABEL_PRESS_START_SYMBOL": "Press >", "MENU_LABEL_PRESS_START_SYMBOL": "Press >",
"MENU_LABEL_RESET" : "Reset", "MENU_LABEL_RESET" : "Reset",

View File

@@ -1,4 +1,5 @@
{ {
"ERROR_FILE_NOT_FOUND": "File not found.",
"GAME_32BIT_WARNING1": "It looks like youre running a 32-Bit version of Java.", "GAME_32BIT_WARNING1": "It looks like youre running a 32-Bit version of Java.",
"GAME_32BIT_WARNING2": "Please download and install the latest 64-Bit Java at:", "GAME_32BIT_WARNING2": "Please download and install the latest 64-Bit Java at:",
"GAME_32BIT_WARNING3": "https://www.java.com/en/download/", "GAME_32BIT_WARNING3": "https://www.java.com/en/download/",

View File

@@ -7,7 +7,9 @@
"COPYRIGHT_GNU_GPL_3": "GNU GPL 3에 따라 배포됨", "COPYRIGHT_GNU_GPL_3": "GNU GPL 3에 따라 배포됨",
"GAME_ACTION_MOVE_VERB" : "이동하기", "GAME_ACTION_MOVE_VERB" : "이동하기",
"GAME_ACTION_ZOOM" : "확대·축소", "GAME_ACTION_ZOOM" : "확대·축소",
"GAME_ACTION_ZOOM_OUT" : "화면 축소",
"MENU_IO_AUTOSAVE": "자동 저장", "MENU_IO_AUTOSAVE": "자동 저장",
"MENU_IO_CLEAR": "지우기",
"MENU_IO_IMPORT": "가져오기", "MENU_IO_IMPORT": "가져오기",
"MENU_IO_MANUAL_SAVE": "수동 저장", "MENU_IO_MANUAL_SAVE": "수동 저장",
"MENU_LABEL_COPYRIGHT": "저작권", "MENU_LABEL_COPYRIGHT": "저작권",
@@ -16,7 +18,8 @@
"MENU_LABEL_IME": "입력기", "MENU_LABEL_IME": "입력기",
"MENU_LABEL_IME_TOGGLE": "입력기 켜고 끄기", "MENU_LABEL_IME_TOGGLE": "입력기 켜고 끄기",
"MENU_LABEL_KEYBOARD_LAYOUT": "자판 배열", "MENU_LABEL_KEYBOARD_LAYOUT": "자판 배열",
"MENU_LABEL_PASTE_FROM_CLIPBOARD": "복사한 텍스트 붙여넣기", "MENU_LABEL_PASTE": "붙여넣기",
"MENU_LABEL_PASTE_FROM_CLIPBOARD": "복사한 문구 붙여넣기",
"MENU_LABEL_PRESS_START_SYMBOL": ">을 누르세요", "MENU_LABEL_PRESS_START_SYMBOL": ">을 누르세요",
"MENU_LABEL_RESET" : "재설정", "MENU_LABEL_RESET" : "재설정",
"MENU_LABEL_RESTART_REQUIRED": "재시작 필요", "MENU_LABEL_RESTART_REQUIRED": "재시작 필요",

View File

@@ -1,4 +1,5 @@
{ {
"ERROR_FILE_NOT_FOUND": "파일을 찾을 수 없습니다.",
"GAME_32BIT_WARNING1": "32비트 버전의 Java를 사용중인 것 같습니다.", "GAME_32BIT_WARNING1": "32비트 버전의 Java를 사용중인 것 같습니다.",
"GAME_32BIT_WARNING2": "아래 링크에서 최신 64비트 Java를 내려받아 설치해주세요.", "GAME_32BIT_WARNING2": "아래 링크에서 최신 64비트 Java를 내려받아 설치해주세요.",
"GAME_32BIT_WARNING3": "https://www.java.com/ko/download/", "GAME_32BIT_WARNING3": "https://www.java.com/ko/download/",

Binary file not shown.

Binary file not shown.

View File

@@ -32,4 +32,5 @@ Teleport
ToggleNoClip ToggleNoClip
Zoom Zoom
DynToStatic DynToStatic
DebugFillInventory DebugFillInventory
Uuid
1 CatStdout
32 ToggleNoClip
33 Zoom
34 DynToStatic
35 DebugFillInventory
36 Uuid

View File

@@ -0,0 +1,34 @@
{
"racename": "",
"racenameplural": "",
"baseheight": 90,
"basemass": 600.0,
"strength": 65535,
"strengthmult": [100,100,100,100,100,100,100],
"accel": 0.67,
"speed": 6.0,
"speedmult": [100,100,100,100,100,100,100],
"vertstride": 40,
"jumppower": 17.6,
"jumppowermult": [100,100,100,100,100,100,100],
"scale": 1.0,
"scalemult": [100,100,100,100,100,100,100],
"encumbrance": 2147483647,
"defence": 65535,
"reach": 226,
"toolsize": 40,
"intelligent": true,
"barehandactionminheight": 40,
"basebarehanddiggingsize": 16,
"__comments__": "This RAW is intended to test the theoretical maximum values for properties (strength, defence, etc.)"
}

Binary file not shown.

View File

@@ -2,6 +2,7 @@ id;classname
1;net.torvald.terrarum.modulebasegame.gameitems.PickaxeCopper 1;net.torvald.terrarum.modulebasegame.gameitems.PickaxeCopper
2;net.torvald.terrarum.modulebasegame.gameitems.PickaxeIron 2;net.torvald.terrarum.modulebasegame.gameitems.PickaxeIron
3;net.torvald.terrarum.modulebasegame.gameitems.PickaxeSteel 3;net.torvald.terrarum.modulebasegame.gameitems.PickaxeSteel
4;net.torvald.terrarum.modulebasegame.gameitems.SledgehammerIron
5;net.torvald.terrarum.modulebasegame.gameitems.ItemTikiTorch 5;net.torvald.terrarum.modulebasegame.gameitems.ItemTikiTorch
6;net.torvald.terrarum.modulebasegame.gameitems.ItemStorageChest 6;net.torvald.terrarum.modulebasegame.gameitems.ItemStorageChest
7;net.torvald.terrarum.modulebasegame.gameitems.WireGraphDebugger 7;net.torvald.terrarum.modulebasegame.gameitems.WireGraphDebugger
@@ -9,6 +10,9 @@ id;classname
9;net.torvald.terrarum.modulebasegame.gameitems.WireCutterAll 9;net.torvald.terrarum.modulebasegame.gameitems.WireCutterAll
10;net.torvald.terrarum.modulebasegame.gameitems.ItemTypewriter 10;net.torvald.terrarum.modulebasegame.gameitems.ItemTypewriter
11;net.torvald.terrarum.modulebasegame.gameitems.ItemWallCalendar 11;net.torvald.terrarum.modulebasegame.gameitems.ItemWallCalendar
12;net.torvald.terrarum.modulebasegame.gameitems.SledgehammerCopper
13;net.torvald.terrarum.modulebasegame.gameitems.SledgehammerSteel
256;net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorOak 256;net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorOak
257;net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorEbony 257;net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorEbony
1 id classname
2 1 net.torvald.terrarum.modulebasegame.gameitems.PickaxeCopper
3 2 net.torvald.terrarum.modulebasegame.gameitems.PickaxeIron
4 3 net.torvald.terrarum.modulebasegame.gameitems.PickaxeSteel
5 4 net.torvald.terrarum.modulebasegame.gameitems.SledgehammerIron
6 5 net.torvald.terrarum.modulebasegame.gameitems.ItemTikiTorch
7 6 net.torvald.terrarum.modulebasegame.gameitems.ItemStorageChest
8 7 net.torvald.terrarum.modulebasegame.gameitems.WireGraphDebugger
10 9 net.torvald.terrarum.modulebasegame.gameitems.WireCutterAll
11 10 net.torvald.terrarum.modulebasegame.gameitems.ItemTypewriter
12 11 net.torvald.terrarum.modulebasegame.gameitems.ItemWallCalendar
13 12 net.torvald.terrarum.modulebasegame.gameitems.SledgehammerCopper
14 13 net.torvald.terrarum.modulebasegame.gameitems.SledgehammerSteel
15 256 net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorOak
16 256 257 net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorOak net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorEbony
17 257 258 net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorEbony net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorBirch
18 258 259 net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorBirch net.torvald.terrarum.modulebasegame.gameitems.ItemSwingingDoorRosewood

Binary file not shown.

View File

@@ -9,6 +9,8 @@
"MENU_LABEL_MENU": "Menu", "MENU_LABEL_MENU": "Menu",
"MENU_LABEL_PREV_SAVES": "Previous Saves", "MENU_LABEL_PREV_SAVES": "Previous Saves",
"MENU_LABEL_RENAME": "Rename", "MENU_LABEL_RENAME": "Rename",
"MENU_LABEL_USE_CODE": "Use Code",
"MENU_MONITOR_CALI_TITLE": "Check Monitor",
"GAME_ACTION_CRAFT": "Craft", "GAME_ACTION_CRAFT": "Craft",
"GAME_ACTION_GRAPPLE": "Grapple", "GAME_ACTION_GRAPPLE": "Grapple",
"GAME_ACTION_QUICKSEL": "Quick Select", "GAME_ACTION_QUICKSEL": "Quick Select",

View File

@@ -5,6 +5,12 @@
"ITEM_CALENDAR": "Calendar", "ITEM_CALENDAR": "Calendar",
"ITEM_LOGIC_SIGNAL_EMITTER": "Logic Signal Emitter", "ITEM_LOGIC_SIGNAL_EMITTER": "Logic Signal Emitter",
"ITEM_PICK_COPPER": "Copper Pickaxe",
"ITEM_PICK_IRON": "Iron Pickaxe",
"ITEM_PICK_STEEL": "Steel Pickaxe",
"ITEM_SLEDGEHAMMER_COPPER": "Copper Sledgehammer",
"ITEM_SLEDGEHAMMER_IRON": "Iron Sledgehammer",
"ITEM_SLEDGEHAMMER_STEEL": "Steel Sledgehammer",
"ITEM_STORAGE_CHEST": "Storage Chest", "ITEM_STORAGE_CHEST": "Storage Chest",
"ITEM_TIKI_TORCH": "Tiki Torch", "ITEM_TIKI_TORCH": "Tiki Torch",
"ITEM_TYPEWRITER": "Typewriter", "ITEM_TYPEWRITER": "Typewriter",

View File

@@ -1,3 +1,12 @@
{ {
"CONTEXT_THIS_IS_A_WORLD_CURRENTLY_PLAYING": "This is a world currently playing." "CONTEXT_THIS_IS_A_WORLD_CURRENTLY_PLAYING": "This is a world currently playing.",
"CONTEXT_IMPORT_AVATAR_INSTRUCTION_1": "1. Place the Avatar file into the following directory:",
"CONTEXT_IMPORT_AVATAR_INSTRUCTION_2": "",
"CONTEXT_IMPORT_AVATAR_INSTRUCTION_3": "2. Enter the name of the file below, then press Import",
"CONTEXT_WORLD_CODE_SHARE_1": "Other people sharing the device can play on this",
"CONTEXT_WORLD_CODE_SHARE_2": "world when you are away.",
"CONTEXT_WORLD_CODE_SHARE_3": "",
"CONTEXT_WORLD_CODE_SHARE_4": "Share the code below so the other people can join!",
"ERROR_AVATAR_ALREADY_EXISTS": "The Avatar already exists.",
"ERROR_WORLD_NOT_FOUND": "World not found."
} }

View File

@@ -9,6 +9,7 @@
"MENU_LABEL_MENU": "메뉴", "MENU_LABEL_MENU": "메뉴",
"MENU_LABEL_PREV_SAVES": "이전 세이브", "MENU_LABEL_PREV_SAVES": "이전 세이브",
"MENU_LABEL_RENAME": "이름 바꾸기", "MENU_LABEL_RENAME": "이름 바꾸기",
"MENU_LABEL_USE_CODE": "코드 사용",
"MENU_MONITOR_CALI_TITLE": "모니터 확인", "MENU_MONITOR_CALI_TITLE": "모니터 확인",
"GAME_ACTION_CRAFT": "제작하기", "GAME_ACTION_CRAFT": "제작하기",
"GAME_ACTION_GRAPPLE": "매달리기", "GAME_ACTION_GRAPPLE": "매달리기",

View File

@@ -5,6 +5,12 @@
"ITEM_CALENDAR": "달력", "ITEM_CALENDAR": "달력",
"ITEM_LOGIC_SIGNAL_EMITTER": "신호발생기", "ITEM_LOGIC_SIGNAL_EMITTER": "신호발생기",
"ITEM_PICK_COPPER": "구리 곡괭이",
"ITEM_PICK_IRON": "철 곡괭이",
"ITEM_PICK_STEEL": "강철 곡괭이",
"ITEM_SLEDGEHAMMER_COPPER": "구리 해머",
"ITEM_SLEDGEHAMMER_IRON": "철 해머",
"ITEM_SLEDGEHAMMER_STEEL": "강철 해머",
"ITEM_STORAGE_CHEST": "보관상자", "ITEM_STORAGE_CHEST": "보관상자",
"ITEM_TIKI_TORCH": "티키 토치", "ITEM_TIKI_TORCH": "티키 토치",
"ITEM_TYPEWRITER": "타자기", "ITEM_TYPEWRITER": "타자기",

View File

@@ -1,3 +1,11 @@
{ {
"CONTEXT_THIS_IS_A_WORLD_CURRENTLY_PLAYING": "현재 플레이 중인 월드입니다." "CONTEXT_THIS_IS_A_WORLD_CURRENTLY_PLAYING": "현재 플레이 중인 세계입니다.",
"CONTEXT_IMPORT_AVATAR_INSTRUCTION_1": "1. 아바타 파일을 다음 폴더에 넣어주세요",
"CONTEXT_IMPORT_AVATAR_INSTRUCTION_3": "2. 아바타 파일 이름을 아래에 입력하고 가져오기를 눌러주세요",
"CONTEXT_WORLD_CODE_SHARE_1": "자리를 비운 동안 같은 기기를 공유하는 다른 사람이 이 세계를",
"CONTEXT_WORLD_CODE_SHARE_2": "플레이할 수 있도록 합니다.",
"CONTEXT_WORLD_CODE_SHARE_3": "",
"CONTEXT_WORLD_CODE_SHARE_4": "아래의 코드를 공유해 다른 사람을 초대하세요!",
"ERROR_AVATAR_ALREADY_EXISTS": "이미 존재하는 아바타입니다.",
"ERROR_WORLD_NOT_FOUND": "세계를 찾을 수 없습니다."
} }

View File

@@ -0,0 +1,48 @@
# complete file name is: SPRITESHEET + bodypart name + EXTENSION
SPRITESHEET=mods/basegame/sprites/test_werebeastf2/taimu_
EXTENSION=.tga
# defines frame size and origin point. Origin point is given as: (originx, 0)
CONFIG=SIZE 64,98;ORIGINX 40
! A skeleton also defines what body parts (images) be used.
! You can also write multiline text using reverse solidus; this is a feature of .properties
! skeleton joints are ordered: foremost-drawn object comes first, which means lowermost object IN THIS LIST
! are painted first, and any object that comes before it will paint over it. In other words, this list is
! first reversed then being iterated.
! Some keywords are considered special within the game, they are:
! HEADGEAR, HELD_ITEM, BOOT_L, BOOT_R, GAUNTLET_L, GAUNTLET_R and ARMOUR_* (star means any number starting from zero)
BODYPARTS=HEADGEAR 13,14;\
HEAD 13,14;\
ARM_REST_RIGHT 10,4;\
ARM_REST_LEFT 9,3;\
LEG_REST_RIGHT 15,6;\
LEG_REST_LEFT 8,6;\
TORSO_0 18,19;\
TORSO_1 18,19;\
TAIL_0 30,2;\
BUST_0 11,2;\
HELD_ITEM 0,0
SKELETON_STAND=HEADGEAR 0,78;\
ARM_REST_RIGHT -16,66;\
HELD_ITEM -11,33;\
HEAD 0,78;\
BUST_0 0,63;\
TORSO_0 0,54;\
TORSO_1 0,54;\
LEG_REST_RIGHT -5,41;\
LEG_REST_LEFT 3,41;\
ARM_REST_LEFT 8,66;\
TAIL_0 2,40
! When you move the arms/hands, make sure you move the HELD_ITEM as well
# RUNNING might need its own skeleton...
ANIM_RUN=DELAY 0.18;ROW 2;SKELETON SKELETON_STAND
ANIM_RUN_1=LEG_REST_RIGHT 2,2;LEG_REST_LEFT -2,0;TAIL_0 1,0;TORSO_1 0,-999
ANIM_RUN_2=ALL 0,2;LEG_REST_RIGHT 0,-2;LEG_REST_LEFT 0,2;TAIL_0 -1,0;TORSO_1 0,-999
ANIM_RUN_3=LEG_REST_RIGHT -2,0;LEG_REST_LEFT 2,2;TAIL_0 -1,0;TORSO_1 0,-999
ANIM_RUN_4=ALL 0,2;LEG_REST_RIGHT 0,2;LEG_REST_LEFT 0,-2;TAIL_0 1,0;TORSO_1 0,-999
ANIM_IDLE=DELAY 2;ROW 1;SKELETON SKELETON_STAND
ANIM_IDLE_1=TORSO_1 0,-999
ANIM_IDLE_2=TORSO_0 0,-999;ARM_REST_LEFT 0,1;ARM_REST_RIGHT 0,1;HELD_ITEM 0,1;BUST_0 0,1;HEAD 0,1

View File

@@ -0,0 +1,48 @@
# complete file name is: SPRITESHEET + bodypart name + EXTENSION
SPRITESHEET=mods/basegame/sprites/test_werebeastf2/taimuglow_
EXTENSION=.tga
# defines frame size and origin point. Origin point is given as: (originx, 0)
CONFIG=SIZE 64,98;ORIGINX 40
! A skeleton also defines what body parts (images) be used.
! You can also write multiline text using reverse solidus; this is a feature of .properties
! skeleton joints are ordered: foremost-drawn object comes first, which means lowermost object IN THIS LIST
! are painted first, and any object that comes before it will paint over it. In other words, this list is
! first reversed then being iterated.
! Some keywords are considered special within the game, they are:
! HEADGEAR, HELD_ITEM, BOOT_L, BOOT_R, GAUNTLET_L, GAUNTLET_R and ARMOUR_* (star means any number starting from zero)
BODYPARTS=HEADGEAR 13,14;\
HEAD 13,14;\
ARM_REST_RIGHT 10,4;\
ARM_REST_LEFT 9,3;\
LEG_REST_RIGHT 15,6;\
LEG_REST_LEFT 8,6;\
TORSO_0 18,19;\
TORSO_1 18,19;\
TAIL_0 30,2;\
BUST_0 11,2;\
HELD_ITEM 0,0
SKELETON_STAND=HEADGEAR 0,78;\
ARM_REST_RIGHT -16,66;\
HELD_ITEM -11,33;\
HEAD 0,78;\
BUST_0 0,63;\
TORSO_0 0,54;\
TORSO_1 0,54;\
LEG_REST_RIGHT -5,41;\
LEG_REST_LEFT 3,41;\
ARM_REST_LEFT 8,66;\
TAIL_0 2,40
! When you move the arms/hands, make sure you move the HELD_ITEM as well
# RUNNING might need its own skeleton...
ANIM_RUN=DELAY 0.18;ROW 2;SKELETON SKELETON_STAND
ANIM_RUN_1=LEG_REST_RIGHT 2,2;LEG_REST_LEFT -2,0;TAIL_0 1,0;TORSO_1 0,-999
ANIM_RUN_2=ALL 0,2;LEG_REST_RIGHT 0,-2;LEG_REST_LEFT 0,2;TAIL_0 -1,0;TORSO_1 0,-999
ANIM_RUN_3=LEG_REST_RIGHT -2,0;LEG_REST_LEFT 2,2;TAIL_0 -1,0;TORSO_1 0,-999
ANIM_RUN_4=ALL 0,2;LEG_REST_RIGHT 0,2;LEG_REST_LEFT 0,-2;TAIL_0 1,0;TORSO_1 0,-999
ANIM_IDLE=DELAY 2;ROW 1;SKELETON SKELETON_STAND
ANIM_IDLE_1=TORSO_1 0,-999
ANIM_IDLE_2=TORSO_0 0,-999;ARM_REST_LEFT 0,1;ARM_REST_RIGHT 0,1;HELD_ITEM 0,1;BUST_0 0,1;HEAD 0,1

Binary file not shown.

View File

@@ -1,8 +1,26 @@
{ {
"identifier": "generic01",
"skyboxGradColourMap": "generic_skybox.tga", "skyboxGradColourMap": "generic_skybox.tga",
"daylightClut": "clut_daylight.tga", "daylightClut": "clut_daylight.tga",
"classification": "generic", "classification": "generic",
"extraImages": [ "cloudChance": 125,
"cloudGamma": [0.7, 2.4],
] "cloudGammaVariance": [0.143, 0.0],
"windSpeed": 0.35,
"windSpeedVariance": 0.4,
"windSpeedDamping": 0.5,
"clouds": {
"cumulonimbus": {
"filename": "cloud_large.png", "tw": 2048, "th": 1024, "probability": 0.2,
"baseScale": 4.0, "scaleVariance": 0.3333333,
"altLow": 1080, "altHigh": 1120
},
"cumulus": {
"filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 1.0,
"baseScale": 2.0, "scaleVariance": 0.6,
"altLow": 1080, "altHigh": 1800
}
},
"atmoTurbidity": 3.5,
"shaderVibrancy": [1.0, 1.0]
} }

View File

@@ -0,0 +1,32 @@
{
"identifier": "generic02",
"skyboxGradColourMap": "generic_skybox.tga",
"daylightClut": "clut_daylight.tga",
"classification": "generic2",
"cloudChance": 800,
"cloudGamma": [0.8, 2.4],
"cloudGammaVariance": [0.125, 0.0],
"windSpeed": 0.35,
"windSpeedVariance": 0.4,
"windSpeedDamping": 0.5,
"clouds": {
"cumulonimbus": {
"filename": "cloud_large.png", "tw": 2048, "th": 1024, "probability": 0.02,
"baseScale": 4.0, "scaleVariance": 0.3333333,
"altLow": 1080, "altHigh": 1120
},
"cumulus": {
"filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 0.05,
"baseScale": 2.0, "scaleVariance": 0.6,
"altLow": 1080, "altHigh": 1800
},
"altocumulus": {
"filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 1.0,
"baseScale": 1.0, "scaleVariance": 0.1,
"altLow": 2600, "altHigh": 3400
}
},
"atmoTurbidity": 3.5,
"shaderVibrancy": [1.0, 1.0],
"__comment__": "Make a texture for altocumulus so that this weather can be realised with less than 1000 sprites"
}

View File

@@ -1,10 +0,0 @@
{
"globalLight": "generic_light.tga",
"skyboxGradColourMap": "generic_skybox.tga",
"classification": "genericrain",
"extraImages": [
"raindrop.tga"
],
"mixFrom": "__CURRENTWEATHER",
"mixPercentage": 80.0
}

View File

@@ -0,0 +1,31 @@
{
"identifier": "overcast01",
"skyboxGradColourMap": "generic_skybox.tga",
"daylightClut": "clut_daylight.tga",
"classification": "overcast",
"cloudChance": 300,
"cloudGamma": [2.0, 1.6],
"cloudGammaVariance": [0.0, 0.0],
"windSpeed": 10.45,
"windSpeedVariance": 0.5,
"windSpeedDamping": 0.5,
"clouds": {
"cumulus": {
"filename": "cloud_normal.png", "tw": 1024, "th": 512, "probability": 0.1,
"baseScale": 1.6, "scaleVariance": 0.6,
"altLow": 580, "altHigh": 1300
},
"cumulonimbus": {
"filename": "cloud_large.png", "tw": 2048, "th": 1024, "probability": 0.4,
"baseScale": 4.0, "scaleVariance": 0.3333333,
"altLow": 1080, "altHigh":1800
},
"nimbostratus": {
"filename": "cloud_wide.png", "tw": 4096, "th": 1024, "probability": 1.0,
"baseScale": 8.0, "scaleVariance": 0.1,
"altLow": 1100, "altHigh": 1500
}
},
"atmoTurbidity": 9.5,
"shaderVibrancy": [0.93, 0.9]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,26 @@
## actually blending
1. On Krita, load the cloudmap
2. Select and isolate suitable piece of the cloud
3. With liquefying brush, make the bottom flat
4. On new tab, load the solidmap
5. Resize the solidmap to 1024x1024
6. Rotate the solidmap by 30 deg or so
7. Overlay the processed solidmap to the cloudmap, opacity=30%
8. With airbrush tool, manually add the shade (see cloud_normal.kra to get the gist of it)
### cloudmap
1. On GIMP, prepare 4096x4096 canvas
2. Create Simplex Noise with following parameters:
- Scale: arbitrary (0.05 - 0.2)
- Iterations: MAX
- Seed: anything but 0
### solidmap
1. On GIMP, prepare 4096x4096 canvas
2. Create Solid Noise with following parameters:
- XY Size: 16.0
- Detail: MAX
- Tileable: check
- Turbulent: check
- Seed: anything but 0

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -6,6 +6,8 @@ APPIMAGETOOL="appimagetool-x86_64.AppImage"
SRCFILES="terrarumlinux_arm" SRCFILES="terrarumlinux_arm"
DESTDIR="TerrarumLinux.arm" DESTDIR="TerrarumLinux.arm"
RUNTIME="runtime-linux-arm" RUNTIME="runtime-linux-arm"
DESKTOPFILE="../out/build_autogen_linux.desktop"
JARNAME="TerrarumBuild.jar"
if [ ! -d "../assets_release" ]; then if [ ! -d "../assets_release" ]; then
echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2 echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2
@@ -18,7 +20,7 @@ mkdir $DESTDIR
# Prepare an application # Prepare an application
cp icns.png $DESTDIR/icns.png cp icns.png $DESTDIR/icns.png
cp $SRCFILES/Terrarum.desktop $DESTDIR/ cp $DESKTOPFILE $DESTDIR/
cp $SRCFILES/AppRun $DESTDIR/AppRun cp $SRCFILES/AppRun $DESTDIR/AppRun
chmod +x $DESTDIR/AppRun chmod +x $DESTDIR/AppRun
@@ -30,7 +32,7 @@ mv $DESTDIR/out/$RUNTIME/bin/java $DESTDIR/out/$RUNTIME/bin/Terrarum
# Copy over all the assets and a jarfile # Copy over all the assets and a jarfile
cp -r "../assets_release" $DESTDIR/ cp -r "../assets_release" $DESTDIR/
mv $DESTDIR/assets_release $DESTDIR/assets mv $DESTDIR/assets_release $DESTDIR/assets
cp "../out/TerrarumBuild.jar" $DESTDIR/out/ cp "../out/$JARNAME" $DESTDIR/out/
# Pack everything to AppImage # Pack everything to AppImage
ARCH=arm_aarch64 "./$APPIMAGETOOL" $DESTDIR "out/$DESTDIR.AppImage" || { echo 'Building AppImage failed' >&2; exit 1; } ARCH=arm_aarch64 "./$APPIMAGETOOL" $DESTDIR "out/$DESTDIR.AppImage" || { echo 'Building AppImage failed' >&2; exit 1; }

View File

@@ -6,6 +6,8 @@ APPIMAGETOOL="appimagetool-x86_64.AppImage"
SRCFILES="terrarumlinux_x86" SRCFILES="terrarumlinux_x86"
DESTDIR="TerrarumLinux.x86" DESTDIR="TerrarumLinux.x86"
RUNTIME="runtime-linux-x86" RUNTIME="runtime-linux-x86"
DESKTOPFILE="../out/build_autogen_linux.desktop"
JARNAME="TerrarumBuild.jar"
if [ ! -d "../assets_release" ]; then if [ ! -d "../assets_release" ]; then
echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2 echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2
@@ -18,7 +20,7 @@ mkdir $DESTDIR
# Prepare an application # Prepare an application
cp icns.png $DESTDIR/icns.png cp icns.png $DESTDIR/icns.png
cp $SRCFILES/Terrarum.desktop $DESTDIR/ cp $DESKTOPFILE $DESTDIR/
cp $SRCFILES/AppRun $DESTDIR/AppRun cp $SRCFILES/AppRun $DESTDIR/AppRun
chmod +x $DESTDIR/AppRun chmod +x $DESTDIR/AppRun
@@ -30,7 +32,7 @@ mv $DESTDIR/out/$RUNTIME/bin/java $DESTDIR/out/$RUNTIME/bin/Terrarum
# Copy over all the assets and a jarfile # Copy over all the assets and a jarfile
cp -r "../assets_release" $DESTDIR/ cp -r "../assets_release" $DESTDIR/
mv $DESTDIR/assets_release $DESTDIR/assets mv $DESTDIR/assets_release $DESTDIR/assets
cp "../out/TerrarumBuild.jar" $DESTDIR/out/ cp "../out/$JARNAME" $DESTDIR/out/
# Pack everything to AppImage # Pack everything to AppImage
"./$APPIMAGETOOL" $DESTDIR "out/$DESTDIR.AppImage" || { echo 'Building AppImage failed' >&2; exit 1; } "./$APPIMAGETOOL" $DESTDIR "out/$DESTDIR.AppImage" || { echo 'Building AppImage failed' >&2; exit 1; }

View File

@@ -6,6 +6,8 @@ SRCFILES="terrarummac_arm"
APPDIR="./TerrarumMac.arm.app" APPDIR="./TerrarumMac.arm.app"
DESTDIR="out/$APPDIR" DESTDIR="out/$APPDIR"
RUNTIME="runtime-osx-arm" RUNTIME="runtime-osx-arm"
PLISTFILE="../out/build_autogen_macos_Info.plist"
JARNAME="TerrarumBuild.jar"
if [ ! -d "../assets_release" ]; then if [ ! -d "../assets_release" ]; then
echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2 echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2
@@ -21,9 +23,9 @@ mkdir $DESTDIR/Contents/Resources
# Prepare an application # Prepare an application
cp AppIcon.icns $DESTDIR/Contents/Resources/AppIcon.icns cp AppIcon.icns $DESTDIR/Contents/Resources/AppIcon.icns
cp $SRCFILES/Info.plist $DESTDIR/Contents/
cp $SRCFILES/Terrarum.sh $DESTDIR/Contents/MacOS/ cp $SRCFILES/Terrarum.sh $DESTDIR/Contents/MacOS/
chmod +x $DESTDIR/Contents/MacOS/Terrarum.sh chmod +x $DESTDIR/Contents/MacOS/Terrarum.sh
cp $PLISTFILE $DESTDIR/Contents/Info.plist
# Copy over a Java runtime # Copy over a Java runtime
mkdir $DESTDIR/Contents/MacOS/out mkdir $DESTDIR/Contents/MacOS/out
@@ -33,8 +35,9 @@ mv $DESTDIR/Contents/MacOS/out/$RUNTIME/bin/java $DESTDIR/Contents/MacOS/out/$RU
# Copy over all the assets and a jarfile # Copy over all the assets and a jarfile
cp -r "../assets_release" $DESTDIR/Contents/MacOS/ cp -r "../assets_release" $DESTDIR/Contents/MacOS/
mv $DESTDIR/Contents/MacOS/assets_release $DESTDIR/Contents/MacOS/assets mv $DESTDIR/Contents/MacOS/assets_release $DESTDIR/Contents/MacOS/assets
cp "../out/TerrarumBuild.jar" $DESTDIR/Contents/MacOS/out/ cp "../out/$JARNAME" $DESTDIR/Contents/MacOS/out/
# zip everything
cd "out" cd "out"
rm $APPDIR.zip rm $APPDIR.zip
7z a -tzip $APPDIR.zip $APPDIR 7z a -tzip $APPDIR.zip $APPDIR

View File

@@ -6,6 +6,8 @@ SRCFILES="terrarummac_x86"
APPDIR="./TerrarumMac.x86.app" APPDIR="./TerrarumMac.x86.app"
DESTDIR="out/$APPDIR" DESTDIR="out/$APPDIR"
RUNTIME="runtime-osx-x86" RUNTIME="runtime-osx-x86"
PLISTFILE="../out/build_autogen_macos_Info.plist"
JARNAME="TerrarumBuild.jar"
if [ ! -d "../assets_release" ]; then if [ ! -d "../assets_release" ]; then
echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2 echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2
@@ -21,9 +23,9 @@ mkdir $DESTDIR/Contents/Resources
# Prepare an application # Prepare an application
cp AppIcon.icns $DESTDIR/Contents/Resources/AppIcon.icns cp AppIcon.icns $DESTDIR/Contents/Resources/AppIcon.icns
cp $SRCFILES/Info.plist $DESTDIR/Contents/
cp $SRCFILES/Terrarum.sh $DESTDIR/Contents/MacOS/ cp $SRCFILES/Terrarum.sh $DESTDIR/Contents/MacOS/
chmod +x $DESTDIR/Contents/MacOS/Terrarum.sh chmod +x $DESTDIR/Contents/MacOS/Terrarum.sh
cp $PLISTFILE $DESTDIR/Contents/Info.plist
# Copy over a Java runtime # Copy over a Java runtime
mkdir $DESTDIR/Contents/MacOS/out mkdir $DESTDIR/Contents/MacOS/out
@@ -33,8 +35,9 @@ mv $DESTDIR/Contents/MacOS/out/$RUNTIME/bin/java $DESTDIR/Contents/MacOS/out/$RU
# Copy over all the assets and a jarfile # Copy over all the assets and a jarfile
cp -r "../assets_release" $DESTDIR/Contents/MacOS/ cp -r "../assets_release" $DESTDIR/Contents/MacOS/
mv $DESTDIR/Contents/MacOS/assets_release $DESTDIR/Contents/MacOS/assets mv $DESTDIR/Contents/MacOS/assets_release $DESTDIR/Contents/MacOS/assets
cp "../out/TerrarumBuild.jar" $DESTDIR/Contents/MacOS/out/ cp "../out/$JARNAME" $DESTDIR/Contents/MacOS/out/
# zip everything
cd "out" cd "out"
rm $APPDIR.zip rm $APPDIR.zip
7z a -tzip $APPDIR.zip $APPDIR 7z a -tzip $APPDIR.zip $APPDIR

View File

@@ -5,6 +5,8 @@ cd "${0%/*}"
SRCFILES="terrarumwindows_x86" SRCFILES="terrarumwindows_x86"
DESTDIR="TerrarumWindows.x86" DESTDIR="TerrarumWindows.x86"
RUNTIME="runtime-windows-x86" RUNTIME="runtime-windows-x86"
RCFILE="../out/build_autogen_windows.rc"
JARNAME="TerrarumBuild.jar"
if [ ! -d "../assets_release" ]; then if [ ! -d "../assets_release" ]; then
echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2 echo "'assets_release' does not exist; prepare the assets for the release and put them into the assets_release directory, exiting now." >&2
@@ -21,8 +23,11 @@ then
echo 'Mingw32 not found; please install mingw64-cross-gcc (or similar) to your system' >&2; exit 1; echo 'Mingw32 not found; please install mingw64-cross-gcc (or similar) to your system' >&2; exit 1;
fi fi
x86_64-w64-mingw32-gcc -Os -s -o $DESTDIR/Terrarum.exe $SRCFILES/Terrarum.c || { echo 'Building EXE failed' >&2; exit 1; } # Compile .rc
# TODO add icon to the exe (use x86_64-w64-mingw32-windres?) x86_64-w64-mingw32-windres $RCFILE -O coff -o $RCFILE.res
# compile exe
x86_64-w64-mingw32-gcc -Os -s -o $DESTDIR/Terrarum.exe $SRCFILES/Terrarum.c $RCFILE.res || { echo 'Building EXE failed' >&2; exit 1; }
# Copy over a Java runtime # Copy over a Java runtime
mkdir $DESTDIR/out mkdir $DESTDIR/out
@@ -32,9 +37,10 @@ mv $DESTDIR/out/$RUNTIME/bin/java.exe $DESTDIR/out/$RUNTIME/bin/Terrarum.exe
# Copy over all the assets and a jarfile # Copy over all the assets and a jarfile
cp -r "../assets_release" $DESTDIR/ cp -r "../assets_release" $DESTDIR/
mv $DESTDIR/assets_release $DESTDIR/assets mv $DESTDIR/assets_release $DESTDIR/assets
cp "../out/TerrarumBuild.jar" $DESTDIR/out/ cp "../out/$JARNAME" $DESTDIR/out/
# Temporary solution: zip everything # zip everything
zip -r -9 -l "out/TerrarumWindows.x86.zip" $DESTDIR rm "out/$DESTDIR.zip"
zip -r -9 -l "out/$DESTDIR.zip" $DESTDIR
rm -rf $DESTDIR || true rm -rf $DESTDIR || true
echo "Build successful: $DESTDIR" echo "Build successful: $DESTDIR"

BIN
buildapp/icns.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -39,34 +39,20 @@ To build, **cd into the "(project root)/buildapp/", then execute the appropriate
The packaged application can be found on `(project root)/buildapp/out/` The packaged application can be found on `(project root)/buildapp/out/`
#### OSX .app Packaging
```
Terrarum.*.app
+.icns /* 512x512 PNG */
+Contents
`Info.plist
+MacOS
`start_game_mac_*.sh * permission: +x */
```
`assets/TerrarumBuild.jar` is the artifact built using the TerrarumBuild.
`start_game_*` files are on the root directory of the project; use them to build executable apps.
Hide the `.jar` within the subdirectory; users will think this file is the main executable and will try to execute it using whatever JVM they may (or may not) have.
### OSX .icns creation ### OSX .icns creation
Details: https://gist.github.com/jamieweavis/b4c394607641e1280d447deed5fc85fc
0. Do this on a real macOS 0. Do this on a real macOS
1. Create a folder `icon.iconset`, then cp the .png file as `icon_512x512.png` 1. Create a folder `icon.iconset`, then cp the .png file as `icon_512x512.png`
2. On Terminal, `iconutil -c icns icon.iconset` 2. On Terminal, `iconutil -c icns icon.iconset`
https://gist.github.com/jamieweavis/b4c394607641e1280d447deed5fc85fc It might be possible to create .icns on Linux, haven't tried though. https://dentrassi.de/2014/02/25/creating-mac-os-x-icons-icns-on-linux/
#### Some Notes ### Windows .ico creation
0. Open up the icon (png) file using GIMP
1. Export As... -> *.ico, make sure to select either of 24 bpp (1 bit alpha) or 32 bpp (8 bit alpha)
- Windows EXE creation is not there yet. Maybe use one of [these?](https://sourceforge.net/projects/batch-compiler/)
### Notes to Terrarum Programmers ### Notes to Terrarum Programmers

View File

@@ -18,8 +18,19 @@ rm $DESTDIR/graphics/*.bat
rm $DESTDIR/keylayout/*.not_ime rm $DESTDIR/keylayout/*.not_ime
rm $DESTDIR/mods/basegame/blocks/*.gz rm $DESTDIR/mods/basegame/blocks/*.gz
rm $DESTDIR/mods/basegame/blocks/*.txt rm $DESTDIR/mods/basegame/blocks/*.txt
rm $DESTDIR/mods/basegame/weathers/*.txt
rm $DESTDIR/mods/basegame/weathers/*.md
rm $DESTDIR/mods/basegame/weathers/*.kra
rm -r $DESTDIR/mods/basegame/sounds rm -r $DESTDIR/mods/basegame/sounds
rm -r $DESTDIR/mods/dwarventech rm -r $DESTDIR/mods/dwarventech
for s in .directory .DS_Store Thumbs.db thumbs.db; do
rm $DESTDIR/$s
rm $DESTDIR/*/$s
rm $DESTDIR/*/*/$s
rm $DESTDIR/*/*/*/$s
rm $DESTDIR/*/*/*/*/$s
rm $DESTDIR/*/*/*/*/*/$s
rm $DESTDIR/*/*/*/*/*/*/$s
rm $DESTDIR/*/*/*/*/*/*/*/$s
done

View File

@@ -1,6 +0,0 @@
[Desktop Entry]
Name=Terrarum
Exec=AppRun
Icon=icns
Type=Application
Categories=Game;

View File

@@ -1,6 +0,0 @@
[Desktop Entry]
Name=Terrarum
Exec=AppRun
Icon=icns
Type=Application
Categories=Game;

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundleExecutable</key><string>Terrarum.sh</string>
<key>CFBundleDisplayName</key><string>Terrarum</string>
<key>CFBundleName</key><string>Terrarum</string>
<key>CFBundleIconFile</key><string>AppIcon.icns</string>
</dict></plist>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundleExecutable</key><string>Terrarum.sh</string>
<key>CFBundleDisplayName</key><string>Terrarum</string>
<key>CFBundleName</key><string>Terrarum</string>
<key>CFBundleIconFile</key><string>AppIcon.icns</string>
</dict></plist>

View File

@@ -1,6 +1,11 @@
#include <windows.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <tchar.h>
int main() { int main() {
return system(".\\out\\runtime-windows-x86\\bin\\Terrarum.exe -jar .\\out\\TerrarumBuild.jar");
ShellExecute(NULL, "open", "\".\\out\\runtime-windows-x86\\bin\\Terrarum.exe\"", "-jar \".\\out\\TerrarumBuild.jar\"", NULL, SW_HIDE);
return 0;
//return system(".\\out\\runtime-windows-x86\\bin\\Terrarum.exe -jar .\\out\\TerrarumBuild.jar");
} }

Binary file not shown.

Binary file not shown.

BIN
lib/commons-math3-3.6.1.jar LFS Normal file

Binary file not shown.

View File

@@ -41,7 +41,7 @@ public class Float16FrameBuffer extends FrameBuffer {
} }
else { else {
FloatFrameBufferBuilder bufferBuilder = new FloatFrameBufferBuilder(width, height); FloatFrameBufferBuilder bufferBuilder = new FloatFrameBufferBuilder(width, height);
bufferBuilder.addFloatAttachment(GL30.GL_RGBA16F, GL30.GL_RGBA, GL30.GL_FLOAT, false); // FIXME sporadic black screen on GL_RGBA16F? or maybe it was Plasma bugging out? bufferBuilder.addFloatAttachment(GL30.GL_RGBA16F, GL30.GL_RGBA, GL30.GL_FLOAT, false);
if (hasDepth) bufferBuilder.addBasicDepthRenderBuffer(); if (hasDepth) bufferBuilder.addBasicDepthRenderBuffer();
this.bufferBuilder = bufferBuilder; this.bufferBuilder = bufferBuilder;
} }

View File

@@ -248,6 +248,10 @@ final public class FastMath {
return interpolateCatmullRom(u, 0.5f, p0, p1, p2, p3); return interpolateCatmullRom(u, 0.5f, p0, p1, p2, p3);
} }
public static float interpolateCatmullRom(float u, float[] ps) {
return interpolateCatmullRom(u, 0.5f, ps[0], ps[1], ps[2], ps[3]);
}
/**Interpolate a spline between at least 4 control points following the Catmull-Rom equation. /**Interpolate a spline between at least 4 control points following the Catmull-Rom equation.
* here is the interpolation matrix * here is the interpolation matrix
* m = [ 0.0 1.0 0.0 0.0 ] * m = [ 0.0 1.0 0.0 0.0 ]
@@ -331,8 +335,7 @@ final public class FastMath {
return l; return l;
} }
/*public static float interpolateHermite(float scale, float p0, float p1, float p2, float p3) {
public static float interpolateHermite(float scale, float p0, float p1, float p2, float p3) {
// return interpolateHermite(scale, p0, p1, p2, p3, 0f, 0f); // return interpolateHermite(scale, p0, p1, p2, p3, 0f, 0f);
float mu2 = scale * scale; float mu2 = scale * scale;
float mu3 = mu2 * scale; float mu3 = mu2 * scale;
@@ -350,7 +353,7 @@ final public class FastMath {
float a3 = -2*mu3 + 3*mu2 + 0; float a3 = -2*mu3 + 3*mu2 + 0;
return a0*p1 + a1*m0 + a2*m1 + a3*p2; return a0*p1 + a1*m0 + a2*m1 + a3*p2;
} }*/
//public static float interpolateHermite(float scale, float p0, float p1, float p2, float p3, float tension, float bias) {} //public static float interpolateHermite(float scale, float p0, float p1, float p2, float p3, float tension, float bias) {}

View File

@@ -34,6 +34,10 @@ abstract class SpriteAnimation(@Transient val parentActor: ActorWithBody) : Disp
/** /**
* This class should not be serialised; save its Animation Description Language instead. * This class should not be serialised; save its Animation Description Language instead.
*
* Maximum rows: 64
*
* Maximum frames: unlimited
*/ */
class SheetSpriteAnimation(parentActor: ActorWithBody) : SpriteAnimation(parentActor) { class SheetSpriteAnimation(parentActor: ActorWithBody) : SpriteAnimation(parentActor) {

View File

@@ -26,6 +26,7 @@ import net.torvald.terrarum.gamecontroller.KeyToggler;
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent; import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent;
import net.torvald.terrarum.gameitems.GameItem; import net.torvald.terrarum.gameitems.GameItem;
import net.torvald.terrarum.gameworld.GameWorld; import net.torvald.terrarum.gameworld.GameWorld;
import net.torvald.terrarum.imagefont.BigAlphNum;
import net.torvald.terrarum.imagefont.TinyAlphNum; import net.torvald.terrarum.imagefont.TinyAlphNum;
import net.torvald.terrarum.langpack.Lang; import net.torvald.terrarum.langpack.Lang;
import net.torvald.terrarum.modulebasegame.IngameRenderer; import net.torvald.terrarum.modulebasegame.IngameRenderer;
@@ -198,6 +199,7 @@ public class App implements ApplicationListener {
/** Big interchar */ /** Big interchar */
public static TerrarumSansBitmap fontUITitle; public static TerrarumSansBitmap fontUITitle;
public static TinyAlphNum fontSmallNumbers; public static TinyAlphNum fontSmallNumbers;
public static BigAlphNum fontBigNumbers;
/** A gamepad. Multiple gamepads may controll this single virtualised gamepad. */ /** A gamepad. Multiple gamepads may controll this single virtualised gamepad. */
public static TerrarumController gamepad = null; public static TerrarumController gamepad = null;
@@ -269,8 +271,8 @@ public class App implements ApplicationListener {
Gdx.gl20.glViewport(0, 0, width, height); Gdx.gl20.glViewport(0, 0, width, height);
} }
public static final int TICKS = 64; public static final int TICK_SPEED = 64;
public static final float UPDATE_RATE = 1f / TICKS; // apparent framerate will be limited by update rate public static final float UPDATE_RATE = 1f / TICK_SPEED; // apparent framerate will be limited by update rate
private static float loadTimer = 0f; private static float loadTimer = 0f;
private static final float showupTime = 100f / 1000f; private static final float showupTime = 100f / 1000f;
@@ -828,6 +830,7 @@ public class App implements ApplicationListener {
fontGame.dispose(); fontGame.dispose();
fontGameFBO.dispose(); fontGameFBO.dispose();
fontSmallNumbers.dispose(); fontSmallNumbers.dispose();
fontBigNumbers.dispose();
ItemSlotImageFactory.INSTANCE.dispose(); ItemSlotImageFactory.INSTANCE.dispose();
logo.getTexture().dispose(); logo.getTexture().dispose();
@@ -906,6 +909,7 @@ public class App implements ApplicationListener {
currentScreen.show(); currentScreen.show();
currentScreen.resize(scr.getWidth(), scr.getHeight()); currentScreen.resize(scr.getWidth(), scr.getHeight());
TerrarumGlobalState.INSTANCE.getHAS_KEYBOARD_INPUT_FOCUS().unset();
System.gc(); System.gc();
@@ -1007,6 +1011,7 @@ public class App implements ApplicationListener {
fontSmallNumbers = TinyAlphNum.INSTANCE; fontSmallNumbers = TinyAlphNum.INSTANCE;
fontBigNumbers = BigAlphNum.INSTANCE;
IME.invoke(); IME.invoke();
inputStrober = InputStrober.INSTANCE; inputStrober = InputStrober.INSTANCE;
@@ -1185,6 +1190,8 @@ public class App implements ApplicationListener {
public static String configDir; public static String configDir;
/** defaultDir + "/LoadOrder.txt" */ /** defaultDir + "/LoadOrder.txt" */
public static String loadOrderDir; public static String loadOrderDir;
/** defaultDir + "/Imported" */
public static String importDir;
public static RunningEnvironment environment; public static RunningEnvironment environment;
@@ -1224,6 +1231,7 @@ public class App implements ApplicationListener {
loadOrderDir = defaultDir + "/LoadOrder.txt"; loadOrderDir = defaultDir + "/LoadOrder.txt";
recycledPlayersDir = defaultDir + "/Recycled/Players"; recycledPlayersDir = defaultDir + "/Recycled/Players";
recycledWorldsDir = defaultDir + "/Recycled/Worlds"; recycledWorldsDir = defaultDir + "/Recycled/Worlds";
importDir = defaultDir + "/Imports";
System.out.println(String.format("os.name = %s (with identifier %s)", OSName, operationSystem)); System.out.println(String.format("os.name = %s (with identifier %s)", OSName, operationSystem));
System.out.println(String.format("os.version = %s", OSVersion)); System.out.println(String.format("os.version = %s", OSVersion));
@@ -1239,6 +1247,7 @@ public class App implements ApplicationListener {
new File(worldsDir), new File(worldsDir),
new File(recycledPlayersDir), new File(recycledPlayersDir),
new File(recycledWorldsDir), new File(recycledWorldsDir),
new File(importDir)
}; };
for (File it : dirs) { for (File it : dirs) {
@@ -1378,6 +1387,8 @@ public class App implements ApplicationListener {
* @throws NullPointerException if the specified config simply does not exist. * @throws NullPointerException if the specified config simply does not exist.
*/ */
public static int getConfigInt(String key) { public static int getConfigInt(String key) {
if (key == null) return -1;
Object cfg = getConfigMaster(key); Object cfg = getConfigMaster(key);
if (cfg instanceof Integer) return ((int) cfg); if (cfg instanceof Integer) return ((int) cfg);

View File

@@ -0,0 +1,90 @@
package net.torvald.terrarum
import com.badlogic.gdx.Input
/**
* Created by minjaesong on 2023-08-24.
*/
object ControlPresets {
val wasd = hashMapOf<String, Int>(
"control_key_up" to Input.Keys.W,
"control_key_left" to Input.Keys.A,
"control_key_down" to Input.Keys.S,
"control_key_right" to Input.Keys.D,
"control_key_jump" to Input.Keys.SPACE,
"control_key_movementaux" to Input.Keys.SHIFT_LEFT, // movement-auxiliary, or hookshot
"control_key_inventory" to Input.Keys.Q,
"control_key_interact" to Input.Keys.R,
"control_key_discard" to Input.Keys.F,
"control_key_close" to Input.Keys.X, // this or hard-coded ESC
"control_key_zoom" to Input.Keys.Z,
"control_key_gamemenu" to Input.Keys.TAB,
"control_key_crafting" to Input.Keys.E,
"control_key_quicksel" to Input.Keys.CONTROL_LEFT, // pie menu is now LShift because CapsLock is actually used by the my bespoke keyboard input
)
val esdf = hashMapOf<String, Int>(
"control_key_up" to Input.Keys.E,
"control_key_left" to Input.Keys.S,
"control_key_down" to Input.Keys.D,
"control_key_right" to Input.Keys.F, // ESDF Masterrace
"control_key_jump" to Input.Keys.SPACE,
"control_key_movementaux" to Input.Keys.A, // movement-auxiliary, or hookshot
"control_key_inventory" to Input.Keys.Q,
"control_key_interact" to Input.Keys.R,
"control_key_discard" to Input.Keys.T,
"control_key_close" to Input.Keys.C, // this or hard-coded ESC
"control_key_zoom" to Input.Keys.Z,
"control_key_gamemenu" to Input.Keys.TAB,
"control_key_crafting" to Input.Keys.W,
"control_key_quicksel" to Input.Keys.SHIFT_LEFT, // pie menu is now LShift because CapsLock is actually used by the my bespoke keyboard input
)
val ijkl = hashMapOf<String, Int>(
"control_key_up" to Input.Keys.I,
"control_key_left" to Input.Keys.J,
"control_key_down" to Input.Keys.K,
"control_key_right" to Input.Keys.L,
"control_key_jump" to Input.Keys.SPACE,
"control_key_movementaux" to Input.Keys.SEMICOLON, // movement-auxiliary, or hookshot
"control_key_inventory" to Input.Keys.P,
"control_key_interact" to Input.Keys.U,
"control_key_discard" to Input.Keys.Y,
"control_key_close" to Input.Keys.M, // this or hard-coded ESC
"control_key_zoom" to Input.Keys.SLASH,
"control_key_gamemenu" to Input.Keys.LEFT_BRACKET,
"control_key_crafting" to Input.Keys.O,
"control_key_quicksel" to Input.Keys.APOSTROPHE, // pie menu is now LShift because CapsLock is actually used by the my bespoke keyboard input
)
val empty = hashMapOf<String, Int>()
val presets = hashMapOf( // unordered
"WASD" to wasd,
"ESDF" to esdf,
"IJKL" to ijkl,
"Custom" to empty,
)
val presetLabels = listOf( // ordered
"WASD",
"ESDF",
"IJKL",
"Custom",
)
fun getKey(label: String?): Int {
if (label == null) return -1
val presetName = App.getConfigString("control_preset_keyboard") ?: "Custom"
return (presets[presetName] ?: throw IllegalStateException("No such keyboard preset: $presetName")).getOrDefault(label, App.getConfigInt(label))
}
}

View File

@@ -31,6 +31,8 @@ object DefaultConfig {
"usexinput" to true, // when FALSE, LT+RT input on xbox controller is impossible "usexinput" to true, // when FALSE, LT+RT input on xbox controller is impossible
"control_preset_keyboard" to "WASD",
"control_gamepad_keyn" to 3, "control_gamepad_keyn" to 3,
"control_gamepad_keyw" to 2, "control_gamepad_keyw" to 2,
"control_gamepad_keys" to 0, "control_gamepad_keys" to 0,

View File

@@ -1,5 +1,6 @@
package net.torvald.terrarum package net.torvald.terrarum
import com.badlogic.gdx.Input
import com.badlogic.gdx.utils.Disposable import com.badlogic.gdx.utils.Disposable
import com.badlogic.gdx.utils.GdxRuntimeException import com.badlogic.gdx.utils.GdxRuntimeException
import net.torvald.terrarum.App.printdbg import net.torvald.terrarum.App.printdbg
@@ -9,6 +10,7 @@ import net.torvald.terrarum.gameactors.ActorID
import net.torvald.terrarum.gameactors.ActorWithBody import net.torvald.terrarum.gameactors.ActorWithBody
import net.torvald.terrarum.gameactors.ActorWithBody.Companion.PHYS_EPSILON_DIST import net.torvald.terrarum.gameactors.ActorWithBody.Companion.PHYS_EPSILON_DIST
import net.torvald.terrarum.gameactors.BlockMarkerActor import net.torvald.terrarum.gameactors.BlockMarkerActor
import net.torvald.terrarum.gamecontroller.KeyToggler
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent
import net.torvald.terrarum.gameitems.ItemID import net.torvald.terrarum.gameitems.ItemID
import net.torvald.terrarum.gameworld.GameWorld import net.torvald.terrarum.gameworld.GameWorld
@@ -165,6 +167,9 @@ open class IngameInstance(val batch: FlippingSpriteBatch, val isMultiplayer: Boo
override fun show() { override fun show() {
// the very basic show() implementation // the very basic show() implementation
for (k in Input.Keys.F1..Input.Keys.F12) {
KeyToggler.forceSet(k, false)
}
// add blockmarking_actor into the actorlist // add blockmarking_actor into the actorlist
(CommonResourcePool.get("blockmarking_actor") as BlockMarkerActor).let { (CommonResourcePool.get("blockmarking_actor") as BlockMarkerActor).let {
@@ -531,6 +536,9 @@ open class IngameInstance(val batch: FlippingSpriteBatch, val isMultiplayer: Boo
else else
null null
} }
fun onConfigChange() {
}
} }
inline fun Lock.lock(body: () -> Unit) { inline fun Lock.lock(body: () -> Unit) {

View File

@@ -2,11 +2,13 @@ package net.torvald.terrarum
import com.badlogic.gdx.Gdx import com.badlogic.gdx.Gdx
import com.badlogic.gdx.files.FileHandle import com.badlogic.gdx.files.FileHandle
import com.badlogic.gdx.graphics.Pixmap
import com.badlogic.gdx.utils.JsonValue import com.badlogic.gdx.utils.JsonValue
import net.torvald.terrarum.App.* import net.torvald.terrarum.App.*
import net.torvald.terrarum.App.setToGameConfig import net.torvald.terrarum.App.setToGameConfig
import net.torvald.terrarum.blockproperties.BlockCodex import net.torvald.terrarum.blockproperties.BlockCodex
import net.torvald.terrarum.blockproperties.WireCodex import net.torvald.terrarum.blockproperties.WireCodex
import net.torvald.terrarum.gamecontroller.IME
import net.torvald.terrarum.gameitems.GameItem import net.torvald.terrarum.gameitems.GameItem
import net.torvald.terrarum.gameitems.ItemID import net.torvald.terrarum.gameitems.ItemID
import net.torvald.terrarum.itemproperties.ItemCodex import net.torvald.terrarum.itemproperties.ItemCodex
@@ -15,6 +17,7 @@ import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.utils.CSVFetcher import net.torvald.terrarum.utils.CSVFetcher
import net.torvald.terrarum.utils.JsonFetcher import net.torvald.terrarum.utils.JsonFetcher
import net.torvald.terrarum.utils.forEachSiblings import net.torvald.terrarum.utils.forEachSiblings
import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack
import org.apache.commons.codec.digest.DigestUtils import org.apache.commons.codec.digest.DigestUtils
import org.apache.commons.csv.CSVFormat import org.apache.commons.csv.CSVFormat
import org.apache.commons.csv.CSVParser import org.apache.commons.csv.CSVParser
@@ -211,6 +214,18 @@ object ModMgr {
GameRetextureLoader(moduleName) GameRetextureLoader(moduleName)
} }
// add locales if exists
if (hasFile(moduleName, "locales")) {
printdbg(this, "Trying to load Locales on ${moduleName}")
GameLanguageLoader(moduleName)
}
// add keylayouts if exists
if (hasFile(moduleName, "keylayout")) {
printdbg(this, "Trying to load Keyboard Layouts on ${moduleName}")
GameIMELoader(moduleName)
}
// run entry script in entry point // run entry script in entry point
if (entryPoint.isNotBlank()) { if (entryPoint.isNotBlank()) {
var newClass: Class<*>? = null var newClass: Class<*>? = null
@@ -513,6 +528,56 @@ object ModMgr {
} }
} }
object GameIMELoader {
const val keebPath = "keylayout/"
@JvmStatic operator fun invoke(module: String) {
val FILE = getFile(module, keebPath)
FILE.listFiles { file, s -> s.endsWith(".${IME.KEYLAYOUT_EXTENSION}") }.sortedBy { it.name }.forEach {
printdbg(this, "Registering Low layer ${it.nameWithoutExtension.lowercase()}")
IME.registerLowLayer(it.nameWithoutExtension.lowercase(), IME.parseKeylayoutFile(it))
}
FILE.listFiles { file, s -> s.endsWith(".${IME.IME_EXTENSION}") }.sortedBy { it.name }.forEach {
printdbg(this, "Registering High layer ${it.nameWithoutExtension.lowercase()}")
IME.registerHighLayer(it.nameWithoutExtension.lowercase(), IME.parseImeFile(it))
}
val iconFile = getFile(module, keebPath + "icons.tga").let {
if (it.exists()) it else getFile(module, keebPath + "icons.png")
}
if (iconFile.exists()) {
val iconSheet = TextureRegionPack(iconFile.path, 20, 20)
val iconPixmap = Pixmap(Gdx.files.absolute(iconFile.path))
for (k in 0 until iconPixmap.height step 20) {
val langCode = StringBuilder()
for (c in 0 until 20) {
val x = c
var charnum = 0
for (b in 0 until 7) {
val y = k + b
if (iconPixmap.getPixel(x, y) and 255 != 0) {
charnum = charnum or (1 shl b)
}
}
if (charnum != 0) langCode.append(charnum.toChar())
}
if (langCode.isNotEmpty()) {
printdbg(this, "Icon order #${(k+1) / 20} - icons[\"$langCode\"] = iconSheet.get(1, ${k/20})")
IME.icons["$langCode"] = iconSheet.get(1, k / 20).also { it.flip(false, false) }
}
}
App.disposables.add(iconSheet)
iconPixmap.dispose()
}
}
}
object GameMaterialLoader { object GameMaterialLoader {
const val matePath = "materials/" const val matePath = "materials/"

View File

@@ -1,6 +1,7 @@
package net.torvald.terrarum package net.torvald.terrarum
import com.badlogic.gdx.graphics.Camera import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.modulebasegame.ui.UIRemoCon import net.torvald.terrarum.modulebasegame.ui.UIRemoCon
import net.torvald.terrarum.ui.UICanvas import net.torvald.terrarum.ui.UICanvas
@@ -17,7 +18,7 @@ class ModOptionsHost(val remoCon: UIRemoCon) : UICanvas() {
override fun updateUI(delta: Float) { override fun updateUI(delta: Float) {
} }
override fun renderUI(batch: SpriteBatch, camera: Camera) { override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
} }
override fun dispose() { override fun dispose() {

View File

@@ -8,6 +8,7 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.glutils.FrameBuffer import com.badlogic.gdx.graphics.glutils.FrameBuffer
import net.torvald.terrarum.langpack.Lang import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.ui.Toolkit import net.torvald.terrarum.ui.Toolkit
import net.torvald.terrarum.utils.OpenFile
import java.awt.Desktop import java.awt.Desktop
import java.io.File import java.io.File
@@ -90,7 +91,7 @@ class NoModuleDefaultTitlescreen(batch: FlippingSpriteBatch) : IngameInstance(ba
App.scr.hf - Gdx.input.y in pathButtonY - 12..pathButtonY + pathButtonH + 12) App.scr.hf - Gdx.input.y in pathButtonY - 12..pathButtonY + pathButtonH + 12)
if (mouseOnLink && Gdx.input.isButtonJustPressed(Input.Buttons.LEFT)) { if (mouseOnLink && Gdx.input.isButtonJustPressed(Input.Buttons.LEFT)) {
Desktop.getDesktop().open(pathFile) OpenFile(pathFile)
} }
fbatch.inUse { fbatch.inUse {

View File

@@ -122,4 +122,6 @@ class Point2i() {
operator fun component1() = x operator fun component1() = x
operator fun component2() = y operator fun component2() = y
fun toVector() = Vector2(this.x.toDouble(), this.y.toDouble())
} }

View File

@@ -0,0 +1,72 @@
package net.torvald.terrarum
import java.io.File
/**
* Created by minjaesong on 2023-08-25.
*/
private fun writeWindowsRC(major: Int, minor: Int, patch: Int) {
val s = """1 ICON "icns.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION $major,$minor,$patch,0
PRODUCTVERSION $major,$minor,$patch,0
{
BLOCK "StringFileInfo"
{
BLOCK "040904b0"
{
VALUE "FileDescription", "${TerrarumAppConfiguration.GAME_NAME}\0"
VALUE "FileVersion", "${App.getVERSION_STRING()}\0"
VALUE "LegalCopyright", "${TerrarumAppConfiguration.COPYRIGHT_DATE_NAME}\0"
VALUE "OriginalFilename", "${TerrarumAppConfiguration.GAME_NAME}.exe\0"
VALUE "ProductName", "${TerrarumAppConfiguration.GAME_NAME}\0"
VALUE "ProductVersion", "${App.getVERSION_STRING()}\0"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x409, 1200
}
}"""
val f = File("./out/build_autogen_windows.rc")
f.delete()
f.writeText(s)
}
private fun writeOSXPlist(major: Int, minor: Int, patch: Int) {
val s = """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundleExecutable</key><string>${TerrarumAppConfiguration.GAME_NAME}.sh</string>
<key>CFBundleDisplayName</key><string>${TerrarumAppConfiguration.GAME_NAME}</string>
<key>CFBundleName</key><string>${TerrarumAppConfiguration.GAME_NAME}</string>
<key>CFBundleIconFile</key><string>AppIcon.icns</string>
<key>CFBundleVersion</key><string>${App.getVERSION_STRING()}</string>
</dict></plist>"""
val f = File("./out/build_autogen_macos_Info.plist")
f.delete()
f.writeText(s)
}
private fun writeLinuxDesktop(major: Int, minor: Int, patch: Int) {
val s = """[Desktop Entry]
Name=${TerrarumAppConfiguration.GAME_NAME}
Exec=AppRun
Icon=icns
Type=Application
Categories=Game;"""
val f = File("./out/build_autogen_linux.desktop")
f.delete()
f.writeText(s)
}
fun main() {
val major = (App.VERSION_RAW ushr 48).toInt()
val minor = ((App.VERSION_RAW and 0xffff000000L) ushr 24).toInt()
val patch = (App.VERSION_RAW and 0xffffffL).toInt()
writeLinuxDesktop(major, minor, patch)
writeOSXPlist(major, minor, patch)
writeWindowsRC(major, minor, patch)
}

View File

@@ -7,7 +7,7 @@ internal interface RNGConsumer {
val RNG: HQRNG val RNG: HQRNG
fun loadFromSave(s0: Long, s1: Long) { fun loadFromSave(ingame: IngameInstance, s0: Long, s1: Long) {
RNG.setSeed(s0, s1) RNG.setSeed(s0, s1)
} }

View File

@@ -167,8 +167,10 @@ class SavegameCollectionPair(private val player: SavegameCollection?, private va
// private var autoPlayer: DiskSkimmer? = null // private var autoPlayer: DiskSkimmer? = null
// private var autoWorld: DiskSkimmer? = null // private var autoWorld: DiskSkimmer? = null
var isImported: Boolean = false; private set
/* removing auto/manual discrimination: on Local Asynchronous Multiplayer, if newer autosave is available, there is /* removing auto/manual discrimination: on Local Asynchronous Multiplayer, if newer autosave is available, there is
* no choice but loading one to preserve the data; then why bother having two? */ * no choice but loading one to preserve the data; then why bother having two? */
private var playerDisk: DiskSkimmer? = null; private set private var playerDisk: DiskSkimmer? = null; private set
private var worldDisk: DiskSkimmer? = null; private set private var worldDisk: DiskSkimmer? = null; private set
@@ -221,6 +223,10 @@ class SavegameCollectionPair(private val player: SavegameCollection?, private va
2 2
else (player != null && world != null).toInt() else (player != null && world != null).toInt()
if (player != null) {
isImported = (player.loadable().getSaveOrigin() and VDSaveOrigin.IMPORTED != 0)
}
printdbg(this, "playerDisk = ${playerDisk?.diskFile?.path}") printdbg(this, "playerDisk = ${playerDisk?.diskFile?.path}")
printdbg(this, "worldDisk = ${worldDisk?.diskFile?.path}") printdbg(this, "worldDisk = ${worldDisk?.diskFile?.path}")
printdbg(this, "status = $status") printdbg(this, "status = $status")
@@ -341,6 +347,22 @@ class SavegameCollectionPair(private val player: SavegameCollection?, private va
return if (status == 0) null return if (status == 0) null
else DiskPair(playerDisk!!, worldDisk!!) else DiskPair(playerDisk!!, worldDisk!!)
} }
fun getImportedPlayer(): DiskSkimmer? {
return if (isImported) player!!.loadable() else null
}
fun getPlayerThumbnailPixmap(width: Int, height: Int, shrinkage: Double): Pixmap? {
return player?.loadable()?.getThumbnailPixmap(width, height, shrinkage)?.let {
if (it.isDisposed) null else it
}
}
fun getWorldThumbnailPixmap(width: Int, height: Int, shrinkage: Double): Pixmap? {
return world?.loadable()?.getThumbnailPixmap(width, height, shrinkage)?.let {
if (it.isDisposed) null else it
}
}
} }
data class DiskPair(val player: DiskSkimmer, val world: DiskSkimmer) { data class DiskPair(val player: DiskSkimmer, val world: DiskSkimmer) {

View File

@@ -813,8 +813,8 @@ fun AppUpdateListOfSavegames() {
// if multiple valid savegames with same UUID exist, only the most recent one is retained // if multiple valid savegames with same UUID exist, only the most recent one is retained
if (!App.savegameWorlds.contains(worldUUID)) { if (!App.savegameWorlds.contains(worldUUID)) {
App.savegameWorlds[worldUUID] = collection App.savegameWorlds[worldUUID] = collection
App.savegameWorldsName[worldUUID] = it.getDiskName(Common.CHARSET)
App.sortedSavegameWorlds.add(worldUUID) App.sortedSavegameWorlds.add(worldUUID)
App.savegameWorldsName[worldUUID] = it.getDiskName(Common.CHARSET)
} }
} }
@@ -848,8 +848,8 @@ fun AppUpdateListOfSavegames() {
// if multiple valid savegames with same UUID exist, only the most recent one is retained // if multiple valid savegames with same UUID exist, only the most recent one is retained
if (!App.savegamePlayers.contains(playerUUID)) { if (!App.savegamePlayers.contains(playerUUID)) {
App.savegamePlayers[playerUUID] = collection App.savegamePlayers[playerUUID] = collection
App.savegamePlayersName[playerUUID] = it.getDiskName(Common.CHARSET)
App.sortedPlayers.add(playerUUID) App.sortedPlayers.add(playerUUID)
App.savegamePlayersName[playerUUID] = it.getDiskName(Common.CHARSET)
} }
} }

View File

@@ -67,7 +67,7 @@ basegame
// Commit counts up to the Release 0.3.1: 2278 // Commit counts up to the Release 0.3.1: 2278
// Commit counts up to the Release 0.3.2: 2732 // Commit counts up to the Release 0.3.2: 2732
const val VERSION_TAG: String = "test001" const val VERSION_TAG: String = "test003"
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
// CONFIGURATION FOR TILE MAKER // // CONFIGURATION FOR TILE MAKER //

View File

@@ -0,0 +1,25 @@
package net.torvald.terrarum
/**
* Created by minjaesong on 2023-09-05.
*/
object TerrarumGlobalState {
val HAS_KEYBOARD_INPUT_FOCUS = CountedBool()
}
class CountedBool {
private var counter = 0L
fun set() {
counter += 1
}
fun unset() {
if (counter >= 1) counter -= 1
}
val value: Boolean
get() = counter > 0
fun isOn() = value
fun isOff() = !value
}

View File

@@ -13,6 +13,7 @@ import net.torvald.terrarum.App.IS_DEVELOPMENT_BUILD
import net.torvald.terrarum.gamecontroller.KeyToggler import net.torvald.terrarum.gamecontroller.KeyToggler
import net.torvald.terrarum.ui.BasicDebugInfoWindow import net.torvald.terrarum.ui.BasicDebugInfoWindow
import net.torvald.terrarum.ui.Toolkit import net.torvald.terrarum.ui.Toolkit
import net.torvald.terrarum.weather.WeatherMixer
/** /**
* Must be called by the App Loader * Must be called by the App Loader
@@ -236,6 +237,13 @@ object TerrarumPostProcessor : Disposable {
else else
shaderPostNoDither shaderPostNoDither
val (vo, vg) = INGAME.world.weatherbox.let {
if (it.currentWeather.identifier == "titlescreen")
1f to 1f
else
it.currentVibrancy.x to it.currentVibrancy.y
}
App.getCurrentDitherTex().bind(1) App.getCurrentDitherTex().bind(1)
fbo.colorBufferTexture.bind(0) fbo.colorBufferTexture.bind(0)
@@ -245,6 +253,7 @@ object TerrarumPostProcessor : Disposable {
shader.setUniformi("rnd", rng.nextInt(8192), rng.nextInt(8192)) shader.setUniformi("rnd", rng.nextInt(8192), rng.nextInt(8192))
shader.setUniformi("u_pattern", 1) shader.setUniformi("u_pattern", 1)
shader.setUniformf("quant", shaderQuant[App.getConfigInt("displaycolourdepth")] ?: 255f) shader.setUniformf("quant", shaderQuant[App.getConfigInt("displaycolourdepth")] ?: 255f)
shader.setUniformf("vibrancy", 1f, vo, vg, 1f)
shader.setUniformMatrix4fv("swizzler", swizzler, rng.nextInt(24), 16*4) shader.setUniformMatrix4fv("swizzler", swizzler, rng.nextInt(24), 16*4)
App.fullscreenQuad.render(shader, GL20.GL_TRIANGLES) App.fullscreenQuad.render(shader, GL20.GL_TRIANGLES)

View File

@@ -35,7 +35,7 @@ class UIFakeGradOverlay : UICanvas() {
} }
override fun updateUI(delta: Float) {} override fun updateUI(delta: Float) {}
override fun renderUI(batch: SpriteBatch, camera: Camera) { override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
batch.end() batch.end()
val dither = App.getConfigBoolean("fx_dither") val dither = App.getConfigBoolean("fx_dither")
@@ -84,7 +84,7 @@ class UIFakeBlurOverlay(val blurRadius: Float, val nodarken: Boolean) : UICanvas
private val batchDrawCol = Color(-1) private val batchDrawCol = Color(-1)
override fun updateUI(delta: Float) {} override fun updateUI(delta: Float) {}
override fun renderUI(batch: SpriteBatch, camera: Camera) { override fun renderUI(batch: SpriteBatch, camera: OrthographicCamera) {
batchDrawCol.a = openness batchDrawCol.a = openness
batch.color = batchDrawCol batch.color = batchDrawCol
if (App.getConfigBoolean("fx_backgroundblur")) { if (App.getConfigBoolean("fx_backgroundblur")) {

View File

@@ -1,9 +1,6 @@
package net.torvald.terrarum package net.torvald.terrarum
import com.badlogic.gdx.graphics.Camera import com.badlogic.gdx.graphics.*
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.Pixmap
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.gameitems.GameItem import net.torvald.terrarum.gameitems.GameItem
import net.torvald.terrarum.langpack.Lang import net.torvald.terrarum.langpack.Lang
@@ -271,7 +268,7 @@ class UIItemInventoryCatBar(
} }
} }
override fun render(batch: SpriteBatch, camera: Camera) { override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
super.render(batch, camera) super.render(batch, camera)
// button // button

View File

@@ -2,6 +2,7 @@ package net.torvald.terrarum
import com.badlogic.gdx.graphics.Camera import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.g2d.TextureRegion import com.badlogic.gdx.graphics.g2d.TextureRegion
import net.torvald.terrarum.gameitems.GameItem import net.torvald.terrarum.gameitems.GameItem
@@ -53,7 +54,7 @@ class UIItemInventoryElemSimple(
private var highlightToMainCol = false private var highlightToMainCol = false
private var highlightToSubCol = false private var highlightToSubCol = false
override fun render(batch: SpriteBatch, camera: Camera) { override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
blendNormalStraightAlpha(batch) blendNormalStraightAlpha(batch)
highlightToMainCol = customHighlightRuleMain?.invoke(this) ?: (equippedSlot != null && highlightEquippedItem) || forceHighlighted highlightToMainCol = customHighlightRuleMain?.invoke(this) ?: (equippedSlot != null && highlightEquippedItem) || forceHighlighted

View File

@@ -2,6 +2,7 @@ package net.torvald.terrarum
import com.badlogic.gdx.graphics.Camera import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.OrthographicCamera
import com.badlogic.gdx.graphics.g2d.SpriteBatch import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.graphics.g2d.TextureRegion import com.badlogic.gdx.graphics.g2d.TextureRegion
import net.torvald.terrarum.gameitems.GameItem import net.torvald.terrarum.gameitems.GameItem
@@ -78,7 +79,7 @@ class UIItemInventoryElemWide(
var textHighlightMouseUpCol = Toolkit.Theme.COL_MOUSE_UP var textHighlightMouseUpCol = Toolkit.Theme.COL_MOUSE_UP
var textHighlightNormalCol = Color.WHITE var textHighlightNormalCol = Color.WHITE
override fun render(batch: SpriteBatch, camera: Camera) { override fun render(batch: SpriteBatch, camera: OrthographicCamera) {
blendNormalStraightAlpha(batch) blendNormalStraightAlpha(batch)
highlightToMainCol = customHighlightRuleMain?.invoke(this) ?: (equippedSlot != null && highlightEquippedItem) || forceHighlighted highlightToMainCol = customHighlightRuleMain?.invoke(this) ?: (equippedSlot != null && highlightEquippedItem) || forceHighlighted

View File

@@ -146,7 +146,10 @@ class BlockCodex {
} }
try { try {
return blockProps[blockID]!! return if (blockID.startsWith("wall@"))
blockProps[blockID.substring(5)]!!
else
blockProps[blockID]!!
} }
catch (e: NullPointerException) { catch (e: NullPointerException) {
throw NullPointerException("Blockprop with id $blockID does not exist.") throw NullPointerException("Blockprop with id $blockID does not exist.")

View File

@@ -13,7 +13,7 @@ import net.torvald.terrarum.weather.WeatherMixer
*/ */
object BlockPropUtil { object BlockPropUtil {
//var flickerFuncX: Second = 0f // saves current status (time) of func //var flickerFuncX: Second = 0f // saves current status (time) of func
val flickerFuncDomain: Second = 0.06f // time between two noise sample val flickerFuncDomain: Second = 8f/64f // time between two noise sample
val flickerFuncRange = 0.036f // intensity [0, 1] val flickerFuncRange = 0.036f // intensity [0, 1]
//var breathFuncX = 0f //var breathFuncX = 0f
@@ -50,7 +50,7 @@ object BlockPropUtil {
/** /**
* Using our own timer so that they flickers for same duration regardless of game's FPS * Must be using ConsistentUpdateRate update governor
*/ */
internal fun dynamicLumFuncTickClock() { internal fun dynamicLumFuncTickClock() {
@@ -80,7 +80,7 @@ object BlockPropUtil {
// FPS-time compensation // FPS-time compensation
if (Gdx.graphics.framesPerSecond > 0) { if (Gdx.graphics.framesPerSecond > 0) {
prop.rngBase0 += Gdx.graphics.deltaTime prop.rngBase0 += App.UPDATE_RATE
} }
// reset timer // reset timer
@@ -108,7 +108,7 @@ object BlockPropUtil {
return when (prop.dynamicLuminosityFunction) { return when (prop.dynamicLuminosityFunction) {
1 -> getTorchFlicker(prop) 1 -> getTorchFlicker(prop)
2 -> (INGAME.world).globalLight.cpy() // current global light 2 -> (INGAME.world).globalLight.cpy() // current global light
3 -> WeatherMixer.getGlobalLightOfTimeOfNoon().cpy() // daylight at noon 3 -> WeatherMixer.getGlobalLightOfTimeOfNoon(WeatherMixer.weatherDict["generic01"]!!).cpy() // daylight at noon
4 -> getSlowBreath(prop) 4 -> getSlowBreath(prop)
5 -> getPulsate(prop) 5 -> getPulsate(prop)
else -> prop.baseLumCol else -> prop.baseLumCol

View File

@@ -74,9 +74,9 @@ fun main() {
// println("$yp\t$theta") // println("$yp\t$theta")
val xyz = CIEXYZ( val xyz = CIEXYZ(
ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, (gammaPair * 2f + 1f) * HALF_PI, 0).toFloat(), ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, HALF_PI, 0).toFloat(),
ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, (gammaPair * 2f + 1f) * HALF_PI, 1).toFloat(), ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, HALF_PI, 1).toFloat(),
ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, (gammaPair * 2f + 1f) * HALF_PI, 2).toFloat() ArHosekSkyModel.arhosek_tristim_skymodel_radiance(state, theta, HALF_PI, 2).toFloat()
) )
val xyz2 = xyz.scaleToFit(elevationDeg) val xyz2 = xyz.scaleToFit(elevationDeg)
val rgb = xyz2.toRGB().toColor() val rgb = xyz2.toRGB().toColor()

View File

@@ -60,17 +60,27 @@ object Skybox : Disposable {
data class SkyboxRenderInfo( data class SkyboxRenderInfo(
val texture: Texture, val texture: Texture,
val uvs: FloatArray, val uvs: FloatArray,
val turbidityPoint: Float, val turbidityThisBlend: Float,
val albedoPoint: Float, val albedoThisBlend: Float,
val turbidityOldBlend: Float,
val albedoOldBlend: Float,
) )
fun getUV(elevationDeg: Double, turbidity: Double, albedo: Double): SkyboxRenderInfo { fun getUV(elevationDeg: Double, oldTurbidity: Double, oldAlbedo: Double, thisTurbidity: Double, thisAlbedo: Double): SkyboxRenderInfo {
val turb = turbidity.coerceIn(turbiditiesD.first(), turbiditiesD.last()).minus(1.0).times(turbDivisor) val turb2 = thisTurbidity.coerceIn(turbiditiesD.first(), turbiditiesD.last()).minus(1.0).times(turbDivisor)
val turbLo = turb.floorToInt() val turb2Lo = turb2.floorToInt()
val turbHi = min(turbCnt - 1, turbLo + 1) val turb2Hi = min(turbCnt - 1, turb2Lo + 1)
val alb = albedo.coerceIn(albedos.first(), albedos.last()).times(5.0) val alb2 = thisAlbedo.coerceIn(albedos.first(), albedos.last()).times(5.0)
val albLo = alb.floorToInt() val alb2Lo = alb2.floorToInt()
val albHi = min(albedoCnt - 1, albLo + 1) val alb2Hi = min(albedoCnt - 1, alb2Lo + 1)
val turb1 = oldTurbidity.coerceIn(turbiditiesD.first(), turbiditiesD.last()).minus(1.0).times(turbDivisor)
val turb1Lo = turb1.floorToInt()
val turb1Hi = min(turbCnt - 1, turb1Lo + 1)
val alb1 = oldAlbedo.coerceIn(albedos.first(), albedos.last()).times(5.0)
val alb1Lo = alb1.floorToInt()
val alb1Hi = min(albedoCnt - 1, alb1Lo + 1)
val elev = elevationDeg.coerceIn(-elevMax, elevMax).plus(elevMax).div(elevations.last.toDouble()).div(albedoCnt * 2).times((elevCnt - 1.0) / elevCnt) val elev = elevationDeg.coerceIn(-elevMax, elevMax).plus(elevMax).div(elevations.last.toDouble()).div(albedoCnt * 2).times((elevCnt - 1.0) / elevCnt)
// A: morn, turbLow, albLow // A: morn, turbLow, albLow
@@ -82,14 +92,14 @@ object Skybox : Disposable {
// G: morn, turbHigh, albHigh // G: morn, turbHigh, albHigh
// H: noon, turbHigh, albHigh // H: noon, turbHigh, albHigh
val regionA = texStripRegions.get(albLo + albedoCnt * 0, turbLo) val regionA = texStripRegions.get(alb1Lo, turb1Lo)
val regionB = texStripRegions.get(albLo + albedoCnt * 1, turbLo) val regionB = texStripRegions.get(alb2Lo, turb2Lo)
val regionC = texStripRegions.get(albLo + albedoCnt * 0, turbHi) val regionC = texStripRegions.get(alb1Lo, turb1Hi)
val regionD = texStripRegions.get(albLo + albedoCnt * 1, turbHi) val regionD = texStripRegions.get(alb2Lo, turb2Hi)
val regionE = texStripRegions.get(albHi + albedoCnt * 0, turbLo) val regionE = texStripRegions.get(alb1Hi, turb1Lo)
val regionF = texStripRegions.get(albHi + albedoCnt * 1, turbLo) val regionF = texStripRegions.get(alb2Hi, turb2Lo)
val regionG = texStripRegions.get(albHi + albedoCnt * 0, turbHi) val regionG = texStripRegions.get(alb1Hi, turb1Hi)
val regionH = texStripRegions.get(albHi + albedoCnt * 1, turbHi) val regionH = texStripRegions.get(alb2Hi, turb2Hi)
// (0.5f / tex.width): because of the nature of bilinear interpolation, half pixels from the edges must be discarded // (0.5f / tex.width): because of the nature of bilinear interpolation, half pixels from the edges must be discarded
val uA = regionA.u + (0.5f / tex.width) + elev.toFloat() val uA = regionA.u + (0.5f / tex.width) + elev.toFloat()
val uB = regionB.u + (0.5f / tex.width) + elev.toFloat() val uB = regionB.u + (0.5f / tex.width) + elev.toFloat()
@@ -112,8 +122,10 @@ object Skybox : Disposable {
uG, regionG.v, uG, regionG.v2, uG, regionG.v, uG, regionG.v2,
uH, regionH.v, uH, regionH.v2, uH, regionH.v, uH, regionH.v2,
), ),
(turb - turbLo).toFloat(), (turb2 - turb2Lo).toFloat(),
(alb - albLo).toFloat(), (alb2 - alb2Lo).toFloat(),
(turb1 - turb1Lo).toFloat(),
(alb1 - alb1Lo).toFloat(),
) )
} }
@@ -152,7 +164,7 @@ object Skybox : Disposable {
val elevations = (0..150) val elevations = (0..150)
val elevMax = elevations.last / 2.0 val elevMax = elevations.last / 2.0
val elevationsD = elevations.map { -elevMax + it } // -75, -74, -73, ..., 74, 75 // (specifically using whole number of angles because angle units any finer than 1.0 would make "hack" sunsut happen too fast) val elevationsD = elevations.map { -elevMax + it } // -75, -74, -73, ..., 74, 75 // (specifically using whole number of angles because angle units any finer than 1.0 would make "hack" sunsut happen too fast)
val turbidities = (0..25) // 1, 1.2, 1.4, 1.6, ..., 6.0 val turbidities = (0..45) // 1, 1.2, 1.4, 1.6, ..., 10.0
val turbDivisor = 5.0 val turbDivisor = 5.0
val turbiditiesD = turbidities.map { 1.0 + it / turbDivisor } val turbiditiesD = turbidities.map { 1.0 + it / turbDivisor }
val albedos = arrayOf(0.0, 0.2, 0.4, 0.6, 0.8, 1.0) val albedos = arrayOf(0.0, 0.2, 0.4, 0.6, 0.8, 1.0)

View File

@@ -688,7 +688,7 @@ open class ActorWithBody : Actor {
} }
private fun displaceHitbox() { private fun displaceHitbox() {
val printdbg1 = true && App.IS_DEVELOPMENT_BUILD val printdbg1 = false && App.IS_DEVELOPMENT_BUILD
// // HOW IT SHOULD WORK // // // // HOW IT SHOULD WORK // //
// //////////////////////// // ////////////////////////
// combineVeloToMoveDelta now // combineVeloToMoveDelta now
@@ -891,15 +891,15 @@ open class ActorWithBody : Actor {
// points to the EDGE of the tile in world dimension (don't use this directly to get tilewise coord!!) // points to the EDGE of the tile in world dimension (don't use this directly to get tilewise coord!!)
val offendingTileWorldX = if (selfCollisionStatus in listOf(6, 12)) val offendingTileWorldX = if (selfCollisionStatus in listOf(6, 12))
newHitbox.endX.div(TILE_SIZE).floorToDouble() * TILE_SIZE - PHYS_EPSILON_DIST newHitbox.endX.div(TILE_SIZE).floorToDouble() * TILE_SIZE - PHYS_EPSILON_DIST // adding/subbing fixes a bug where player stops midair when L/R is held and moving down from the platform
else else
newHitbox.startX.div(TILE_SIZE).ceilToDouble() * TILE_SIZE newHitbox.startX.div(TILE_SIZE).ceilToDouble() * TILE_SIZE + PHYS_EPSILON_DIST // adding/subbing fixes a bug where player stops midair when L/R is held and moving down from the platform
// points to the EDGE of the tile in world dimension (don't use this directly to get tilewise coord!!) // points to the EDGE of the tile in world dimension (don't use this directly to get tilewise coord!!)
val offendingTileWorldY = if (selfCollisionStatus in listOf(3, 6)) val offendingTileWorldY = if (selfCollisionStatus in listOf(3, 6))
newHitbox.endY.div(TILE_SIZE).floorToDouble() * TILE_SIZE - PHYS_EPSILON_DIST newHitbox.endY.div(TILE_SIZE).floorToDouble() * TILE_SIZE - PHYS_EPSILON_DIST // adding/subbing fixes a bug where player stops midair when L/R is held and moving down from the platform
else else
newHitbox.startY.div(TILE_SIZE).ceilToDouble() * TILE_SIZE newHitbox.startY.div(TILE_SIZE).ceilToDouble() * TILE_SIZE + PHYS_EPSILON_DIST // adding/subbing fixes a bug where player stops midair when L/R is held and moving down from the platform
val offendingHitboxPointX = if (selfCollisionStatus in listOf(6, 12)) val offendingHitboxPointX = if (selfCollisionStatus in listOf(6, 12))
newHitbox.endX newHitbox.endX
@@ -1108,6 +1108,7 @@ open class ActorWithBody : Actor {
} }
private fun Hitbox.getWallDetection(option: Int): List<Double> { private fun Hitbox.getWallDetection(option: Int): List<Double> {
val SOME_PIXEL = 1.0 // it really does NOT work if the value is not 1.0
val x1: Double val x1: Double
val x2: Double val x2: Double
val y1: Double val y1: Double
@@ -1116,23 +1117,23 @@ open class ActorWithBody : Actor {
COLLIDING_TOP -> { COLLIDING_TOP -> {
x1 = this.startX x1 = this.startX
x2 = this.endX - PHYS_EPSILON_DIST x2 = this.endX - PHYS_EPSILON_DIST
y1 = this.startY - A_PIXEL y1 = this.startY - SOME_PIXEL
y2 = y1 y2 = y1
} }
COLLIDING_BOTTOM -> { COLLIDING_BOTTOM -> {
x1 = this.startX x1 = this.startX
x2 = this.endX - PHYS_EPSILON_DIST x2 = this.endX - PHYS_EPSILON_DIST
y1 = this.endY - PHYS_EPSILON_DIST + A_PIXEL y1 = this.endY - PHYS_EPSILON_DIST + SOME_PIXEL
y2 = y1 y2 = y1
} }
COLLIDING_LEFT -> { COLLIDING_LEFT -> {
x1 = this.startX - A_PIXEL x1 = this.startX - SOME_PIXEL
x2 = x1 x2 = x1
y1 = this.startY y1 = this.startY
y2 = this.endY - PHYS_EPSILON_DIST y2 = this.endY - PHYS_EPSILON_DIST
} }
COLLIDING_RIGHT -> { COLLIDING_RIGHT -> {
x1 = this.endX - PHYS_EPSILON_DIST + A_PIXEL x1 = this.endX - PHYS_EPSILON_DIST + SOME_PIXEL
x2 = x1 x2 = x1
y1 = this.startY y1 = this.startY
y2 = this.endY - PHYS_EPSILON_DIST y2 = this.endY - PHYS_EPSILON_DIST
@@ -1242,6 +1243,8 @@ open class ActorWithBody : Actor {
private fun isCollidingInternalStairs(pxStart: Int, pyStart: Int, pxEnd: Int, pyEnd: Int, feet: Boolean = false): Pair<Int, Int> { private fun isCollidingInternalStairs(pxStart: Int, pyStart: Int, pxEnd: Int, pyEnd: Int, feet: Boolean = false): Pair<Int, Int> {
if (world == null) return 0 to 0 if (world == null) return 0 to 0
val cornerSize = minOf((pyEnd - pyStart) / 3, (pxEnd - pyStart) / 3)
val ys = if (gravitation.y >= 0) pyEnd downTo pyStart else pyStart..pyEnd val ys = if (gravitation.y >= 0) pyEnd downTo pyStart else pyStart..pyEnd
val yheight = (ys.last - ys.first).absoluteValue val yheight = (ys.last - ys.first).absoluteValue
var stairHeight = 0 var stairHeight = 0
@@ -1260,7 +1263,19 @@ open class ActorWithBody : Actor {
val isFeetTileHeight = (ty == feetY) val isFeetTileHeight = (ty == feetY)
var hasFloor = false var hasFloor = false
for (x in pxStart..pxEnd) { // octagonal shape
val xs = /*if (y < cornerSize) {
val sub = cornerSize - y
(pxStart + sub)..(pxEnd - sub)
}
else if (y > pyEnd - cornerSize) {
val sub = y - (pyEnd - cornerSize)
(pxStart + sub)..(pxEnd - sub)
}
else*/
pxStart..pxEnd
for (x in xs) {
val tx = (x / TILE_SIZED).floorToInt() // round down toward negative infinity val tx = (x / TILE_SIZED).floorToInt() // round down toward negative infinity
val tile = world!!.getTileFromTerrain(tx, ty) val tile = world!!.getTileFromTerrain(tx, ty)

View File

@@ -1,5 +1,6 @@
package net.torvald.terrarum.gameactors package net.torvald.terrarum.gameactors
import com.jme3.math.FastMath
import net.torvald.terrarum.Point2d import net.torvald.terrarum.Point2d
import net.torvald.terrarum.printStackTrace import net.torvald.terrarum.printStackTrace
import org.dyn4j.geometry.Vector2 import org.dyn4j.geometry.Vector2
@@ -190,6 +191,15 @@ class Hitbox {
companion object { companion object {
fun fromTwoPoints(x1: Double, y1: Double, x2: Double, y2: Double, nowarn: Boolean = false) = fun fromTwoPoints(x1: Double, y1: Double, x2: Double, y2: Double, nowarn: Boolean = false) =
Hitbox(x1, y1, x2 - x1, y2 - y1, nowarn) Hitbox(x1, y1, x2 - x1, y2 - y1, nowarn)
fun lerp(fraction: Double, a: Hitbox, b: Hitbox): Hitbox {
return Hitbox(
FastMath.interpolateLinear(fraction, a.startX, b.startX),
FastMath.interpolateLinear(fraction, a.startY, b.startY),
FastMath.interpolateLinear(fraction, a.width, b.width),
FastMath.interpolateLinear(fraction, a.height, b.height)
)
}
} }
operator fun minus(other: Hitbox): Vector2 { operator fun minus(other: Hitbox): Vector2 {

Some files were not shown because too many files have changed in this diff Show More