diff --git a/.gitattributes b/.gitattributes index dccc09d154..3e4661f797 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,6 @@ *.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text *.vox filter=lfs diff=lfs merge=lfs -text *.ttf filter=lfs diff=lfs merge=lfs -text *.wav filter=lfs diff=lfs merge=lfs -text diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4967ab327b..bbf42dd77f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ variables: # https://docs.gitlab.com/ee/ci/yaml/#shallow-cloning GIT_DEPTH: 3 GIT_CLEAN_FLAGS: -f - CACHE_IMAGE_TAG: 8490f4b9 + CACHE_IMAGE_TAG: c6476744 default: # https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-pending-pipelines diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ad28d3149..30cc28e9cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Entity-entity pushback is no longer applied in forced movement states like rolling and leaping. - Updated audio library (rodio 0.13 -> 0.14). +- Improve entity-terrain physics performance by reducing the number of voxel lookups. ### Removed diff --git a/Cargo.lock b/Cargo.lock index 4f9c525c5e..bfe59249e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -713,6 +713,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "comma" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96677551532ffe910f470bd767a9a7daf9ba53b1f5532e0891dba6c735f692e5" + [[package]] name = "concurrent-queue" version = "1.2.2" @@ -6112,6 +6118,7 @@ dependencies = [ "bincode", "bytemuck", "chrono", + "comma", "conrod_core", "conrod_winit", "copy_dir", diff --git a/Cargo.toml b/Cargo.toml index d66acc620e..45716c89b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -89,8 +89,27 @@ opt-level = 3 overflow-checks = false debug-assertions = false lto = true -debug = 1 # line tables so we can have useful backtraces +debug = false panic = "abort" # don't need unwinding so we can skip including the landing pads for that +# line tables so we can have useful backtraces for in-house crates +[profile.release.package."veloren-network"] +debug = 1 +[profile.release.package."veloren-network-protocol"] +debug = 1 +[profile.release.package."veloren-common"] +debug = 1 +[profile.release.package."veloren-common-systems"] +debug = 1 +[profile.release.package."veloren-client"] +debug = 1 +[profile.release.package."veloren-server"] +debug = 1 +[profile.release.package."veloren-server-cli"] +debug = 1 +[profile.release.package."veloren-voxygen"] +debug = 1 +[profile.release.package."veloren-world"] +debug = 1 # used for cargo bench [profile.bench] diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index cb25f11d92..eaac0f0241 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -831,6 +831,19 @@ ], threshold: 0.2, ), + Utterance(Angry, Alligator): ( + files: [ + "voxygen.audio.sfx.utterance.alligator_angry1", + "voxygen.audio.sfx.utterance.alligator_angry2", + ], + threshold: 1.0, + ), + Utterance(Angry, Antelope): ( + files: [ + "voxygen.audio.sfx.utterance.antelope_angry1", + ], + threshold: 1.0, + ), Utterance(Angry, BipedLarge): ( files: [ "voxygen.audio.sfx.utterance.ogre_angry1", @@ -844,12 +857,6 @@ ], threshold: 1.0, ), - Utterance(Calm, Pig): ( - files: [ - "voxygen.audio.sfx.utterance.pig_calm1", - ], - threshold: 1.0, - ), Utterance(Angry, Adlet): ( files: [ "voxygen.audio.sfx.utterance.adlet_angry1", @@ -857,16 +864,10 @@ ], threshold: 1.0, ), - Utterance(Angry, Alligator): ( + Utterance(Angry, Pig): ( files: [ - "voxygen.audio.sfx.utterance.alligator_angry1", - "voxygen.audio.sfx.utterance.alligator_angry2", - ], - threshold: 1.0, - ), - Utterance(Angry, Antelope): ( - files: [ - "voxygen.audio.sfx.utterance.antelope_angry1", + "voxygen.audio.sfx.utterance.pig_angry1", + "voxygen.audio.sfx.utterance.pig_angry2", ], threshold: 1.0, ), @@ -889,6 +890,13 @@ ], threshold: 1.0, ), + Utterance(Calm, Cat): ( + files: [ + "voxygen.audio.sfx.utterance.cat_calm1", + "voxygen.audio.sfx.utterance.cat_calm2", + ], + threshold: 1.0, + ), Utterance(Calm, Cow): ( files: [ "voxygen.audio.sfx.utterance.cow_calm1", @@ -897,6 +905,19 @@ ], threshold: 1.0, ), + Utterance(Calm, Goat): ( + files: [ + "voxygen.audio.sfx.utterance.goat_calm1", + ], + threshold: 1.0, + ), + Utterance(Calm, Pig): ( + files: [ + "voxygen.audio.sfx.utterance.pig_calm1", + "voxygen.audio.sfx.utterance.pig_calm2", + ], + threshold: 1.0, + ), Utterance(Calm, Sheep): ( files: [ "voxygen.audio.sfx.utterance.sheep_calm1", @@ -922,6 +943,12 @@ ], threshold: 1.0, ), + Utterance(Hurt, BipedLarge): ( + files: [ + "voxygen.audio.sfx.utterance.ogre_hurt1", + ], + threshold: 1.0, + ), Utterance(Hurt, HumanMale): ( files: [ "voxygen.audio.sfx.utterance.humanmale_hurt1", diff --git a/assets/voxygen/audio/sfx/utterance/cat_calm1.ogg b/assets/voxygen/audio/sfx/utterance/cat_calm1.ogg new file mode 100644 index 0000000000..d4b4d28b0d --- /dev/null +++ b/assets/voxygen/audio/sfx/utterance/cat_calm1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:322d4281684f9097034e8fc700afcb7c72da260cf391cc4a5a7f994337b01a00 +size 11019 diff --git a/assets/voxygen/audio/sfx/utterance/cat_calm2.ogg b/assets/voxygen/audio/sfx/utterance/cat_calm2.ogg new file mode 100644 index 0000000000..14c891302d --- /dev/null +++ b/assets/voxygen/audio/sfx/utterance/cat_calm2.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10bc4f2f26fe2c7926700f71e4da79d2dd888643464e3e3855f27226ee252842 +size 10417 diff --git a/assets/voxygen/audio/sfx/utterance/goat_calm1.ogg b/assets/voxygen/audio/sfx/utterance/goat_calm1.ogg new file mode 100644 index 0000000000..2aa9585d6f --- /dev/null +++ b/assets/voxygen/audio/sfx/utterance/goat_calm1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7534a1bfc7a12790cc788ef2f5fb4af687f3af301bbe4ef77f66b2de8d730fdc +size 10435 diff --git a/assets/voxygen/audio/sfx/utterance/humanmale_greeting1.ogg b/assets/voxygen/audio/sfx/utterance/humanmale_greeting1.ogg index 69dbe5a088..5e07e3f7d5 100644 --- a/assets/voxygen/audio/sfx/utterance/humanmale_greeting1.ogg +++ b/assets/voxygen/audio/sfx/utterance/humanmale_greeting1.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ac12e8915ff261097d5aa24debf5685c4da3bc439ba64e6fd0bc12070f2ebff7 -size 12604 +oid sha256:6eb2f32ec21cab716fc1cc25a7696aa9dc527471e10dd365532fc288e6b62329 +size 12077 diff --git a/assets/voxygen/audio/sfx/utterance/humanmale_hurt1.ogg b/assets/voxygen/audio/sfx/utterance/humanmale_hurt1.ogg index f9db0309e9..3a6c64d0d5 100644 --- a/assets/voxygen/audio/sfx/utterance/humanmale_hurt1.ogg +++ b/assets/voxygen/audio/sfx/utterance/humanmale_hurt1.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bca43c8a18501f7345b2e5314af80c33bca3e464a16a8d9caef5b6e1adb57d5e -size 10669 +oid sha256:7b2ae464ac53a6dee238984827220b3b109ebff89837e5414f20103f126bf202 +size 9646 diff --git a/assets/voxygen/audio/sfx/utterance/lion_hurt1.ogg b/assets/voxygen/audio/sfx/utterance/lion_hurt1.ogg new file mode 100644 index 0000000000..1198c37769 --- /dev/null +++ b/assets/voxygen/audio/sfx/utterance/lion_hurt1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2c7ebca12210b894823d68ce4da292aaca1b8f7aa1e19ec55b0b51ca2e0db38 +size 10713 diff --git a/assets/voxygen/audio/sfx/utterance/ogre_angry1.ogg b/assets/voxygen/audio/sfx/utterance/ogre_angry1.ogg index 819348a228..19bedebcd4 100644 --- a/assets/voxygen/audio/sfx/utterance/ogre_angry1.ogg +++ b/assets/voxygen/audio/sfx/utterance/ogre_angry1.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:78f705397c01f73fd2bfad14f0aa3949a5409556cd5f004c185dea358fbd9701 -size 34809 +oid sha256:1e5c47f8ce7a014d2b7e312d6dd613164ffab6bce85070c99f0505e6a47d1d3d +size 19633 diff --git a/assets/voxygen/audio/sfx/utterance/ogre_angry2.ogg b/assets/voxygen/audio/sfx/utterance/ogre_angry2.ogg index da49817cca..80ddb9f150 100644 --- a/assets/voxygen/audio/sfx/utterance/ogre_angry2.ogg +++ b/assets/voxygen/audio/sfx/utterance/ogre_angry2.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5c97dcb8f2ff2543a041d07147c04a74b59e43421dd7452eccb095a947bd7466 -size 52973 +oid sha256:7b08e44983ea97c4a538a30f89b3687b4bef7e6f1d12bb3af323b2d1d7c96c7f +size 23645 diff --git a/assets/voxygen/audio/sfx/utterance/ogre_hurt1.ogg b/assets/voxygen/audio/sfx/utterance/ogre_hurt1.ogg new file mode 100644 index 0000000000..d0efb951ba --- /dev/null +++ b/assets/voxygen/audio/sfx/utterance/ogre_hurt1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ccc56b985270b0c1dad59d8a8182e597113958e6ba53195d3f0d7141fa67f0a +size 9182 diff --git a/assets/voxygen/audio/sfx/utterance/pig_angry1.ogg b/assets/voxygen/audio/sfx/utterance/pig_angry1.ogg new file mode 100644 index 0000000000..291788ee47 --- /dev/null +++ b/assets/voxygen/audio/sfx/utterance/pig_angry1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c3e8ca94271ee87509000dc64cdaf2d6840b64e6e49cd547663a4d6939f1c92 +size 10431 diff --git a/assets/voxygen/audio/sfx/utterance/pig_angry2.ogg b/assets/voxygen/audio/sfx/utterance/pig_angry2.ogg new file mode 100644 index 0000000000..d272adfd7a --- /dev/null +++ b/assets/voxygen/audio/sfx/utterance/pig_angry2.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b8105d7d18a397ff8267d9f7972ff05f1df06f81d6aa4c11eccf00803bf6a37 +size 10818 diff --git a/assets/voxygen/audio/sfx/utterance/pig_calm2.ogg b/assets/voxygen/audio/sfx/utterance/pig_calm2.ogg new file mode 100644 index 0000000000..c8e6200aed --- /dev/null +++ b/assets/voxygen/audio/sfx/utterance/pig_calm2.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b1a31ada99bcefd8cbf4ce89a814b2b5f8cec64760ba6a3a480f043923c2bed +size 9641 diff --git a/assets/voxygen/audio/sfx/utterance/pig_calm3.ogg b/assets/voxygen/audio/sfx/utterance/pig_calm3.ogg new file mode 100644 index 0000000000..875677e38e --- /dev/null +++ b/assets/voxygen/audio/sfx/utterance/pig_calm3.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a357b2b1dbe69e2e3844b8cac20a6ceeb70d00ea18a8b7440577c18e47b25e88 +size 9440 diff --git a/assets/voxygen/audio/sfx/utterance/saurok_angry1.ogg b/assets/voxygen/audio/sfx/utterance/saurok_angry1.ogg index a550c1bbe2..7ea8a88872 100644 --- a/assets/voxygen/audio/sfx/utterance/saurok_angry1.ogg +++ b/assets/voxygen/audio/sfx/utterance/saurok_angry1.ogg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2f859d590ac38bac163f0821eec8e2157f4f021d34d59575ccca2aeedde919ce -size 56816 +oid sha256:15416996c72da986349d277b9fc581776593d765d888e9dbffd85f6fd98e9931 +size 27654 diff --git a/assets/voxygen/background/bg_1.jpg b/assets/voxygen/background/bg_1.jpg new file mode 100644 index 0000000000..1f3a36e64a --- /dev/null +++ b/assets/voxygen/background/bg_1.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a27164c57a5c6e6adce341252317dbc34a00375f10b3a250d8c14b221ae2ec27 +size 226101 diff --git a/assets/voxygen/background/bg_1.png b/assets/voxygen/background/bg_1.png deleted file mode 100644 index 48772268ba..0000000000 --- a/assets/voxygen/background/bg_1.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c2f501dcf2404832c9f713fc704c62bfa76b20b07b234755adb9198ff3d6893f -size 1042062 diff --git a/assets/voxygen/background/bg_10.jpg b/assets/voxygen/background/bg_10.jpg new file mode 100644 index 0000000000..447bf5fac4 --- /dev/null +++ b/assets/voxygen/background/bg_10.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aea5f2986b1ec58751309e20c9c0c61a1eab8930316196a91255b7d2d6d9b5aa +size 918935 diff --git a/assets/voxygen/background/bg_10.png b/assets/voxygen/background/bg_10.png deleted file mode 100644 index 466e35655c..0000000000 --- a/assets/voxygen/background/bg_10.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:62a1fb6b416664dc346015492f4ed010eed55a4d59da25ea14837165ea5a8020 -size 2878018 diff --git a/assets/voxygen/background/bg_11.jpg b/assets/voxygen/background/bg_11.jpg new file mode 100644 index 0000000000..abd63f9c7a --- /dev/null +++ b/assets/voxygen/background/bg_11.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2ea61625000f6404fd1e5ffd72785ede6409a5b688db25ac7734105ae57c775 +size 888841 diff --git a/assets/voxygen/background/bg_11.png b/assets/voxygen/background/bg_11.png deleted file mode 100644 index e4bee3831b..0000000000 --- a/assets/voxygen/background/bg_11.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9343b6be6caf0099edeac7260bf65103b7d1ec33211629988068b2f1412945d6 -size 3256584 diff --git a/assets/voxygen/background/bg_12.jpg b/assets/voxygen/background/bg_12.jpg new file mode 100644 index 0000000000..8fc111642a --- /dev/null +++ b/assets/voxygen/background/bg_12.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26dc6a512343266c3b486c30db6da8a92b8a3fa2be83159a4001d66d1e5e8009 +size 149508 diff --git a/assets/voxygen/background/bg_12.png b/assets/voxygen/background/bg_12.png deleted file mode 100644 index ef49a9452b..0000000000 --- a/assets/voxygen/background/bg_12.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ae98e12dbdb515556281313ac8d5e93be059aaafbd3f0578c3af58750841d682 -size 505241 diff --git a/assets/voxygen/background/bg_13.jpg b/assets/voxygen/background/bg_13.jpg new file mode 100644 index 0000000000..12af3eb536 --- /dev/null +++ b/assets/voxygen/background/bg_13.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6df7d1e82f20da3f46a7ab909ae8a0b6102f7945794d0a690218cdc6d34dceb +size 166695 diff --git a/assets/voxygen/background/bg_13.png b/assets/voxygen/background/bg_13.png deleted file mode 100644 index 7b7eccaf52..0000000000 --- a/assets/voxygen/background/bg_13.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:52edcbfe10dec67d5351d7940059591884f19bbc6acda7ffd3092aa7ed90ccf3 -size 1282505 diff --git a/assets/voxygen/background/bg_2.jpg b/assets/voxygen/background/bg_2.jpg new file mode 100644 index 0000000000..9661ef9dc5 --- /dev/null +++ b/assets/voxygen/background/bg_2.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a90c88c855a19e27580ea42f7d85248c0c15a48bdcda959a295f911dd9ab4221 +size 204292 diff --git a/assets/voxygen/background/bg_2.png b/assets/voxygen/background/bg_2.png deleted file mode 100644 index a33086f1e9..0000000000 --- a/assets/voxygen/background/bg_2.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f6149efbefa2c9acb45a5b20c36aa085e6e413ecd17c66929c2c3e20c62a3171 -size 961708 diff --git a/assets/voxygen/background/bg_3.jpg b/assets/voxygen/background/bg_3.jpg new file mode 100644 index 0000000000..e4bd6a7322 --- /dev/null +++ b/assets/voxygen/background/bg_3.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:348dace603b51dcf9aa56602fe24e1e34631142d96e12eadce14c228a2c7825f +size 838789 diff --git a/assets/voxygen/background/bg_3.png b/assets/voxygen/background/bg_3.png deleted file mode 100644 index 89a5200c38..0000000000 --- a/assets/voxygen/background/bg_3.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:27ab466038b11f3026452e0c3eb4480300a328e31a708c323dc3b0cae89c04e1 -size 2272839 diff --git a/assets/voxygen/background/bg_4.jpg b/assets/voxygen/background/bg_4.jpg new file mode 100644 index 0000000000..5e80d2b35d --- /dev/null +++ b/assets/voxygen/background/bg_4.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3774ae810427c148a8b8d48b434f85438ea3352414229ca51213115e1444dde5 +size 362772 diff --git a/assets/voxygen/background/bg_4.png b/assets/voxygen/background/bg_4.png deleted file mode 100644 index beed1bcbf8..0000000000 --- a/assets/voxygen/background/bg_4.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9ff1f9d09e04ca1343cb481403428d8a604e4090f2e1760caecb1a8aee149caa -size 897858 diff --git a/assets/voxygen/background/bg_5.jpg b/assets/voxygen/background/bg_5.jpg new file mode 100644 index 0000000000..6575f8fa53 --- /dev/null +++ b/assets/voxygen/background/bg_5.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bc1c2f6f9f1dfc904f46eb6540fdbb15e5367f44a14322a525111cc4d666e28 +size 619281 diff --git a/assets/voxygen/background/bg_5.png b/assets/voxygen/background/bg_5.png deleted file mode 100644 index 3c320bdacb..0000000000 --- a/assets/voxygen/background/bg_5.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0ccdede73a20ae6355782d9c10b18f868a515a27f8da79013109930b8c39bd8c -size 2044001 diff --git a/assets/voxygen/background/bg_6.jpg b/assets/voxygen/background/bg_6.jpg new file mode 100644 index 0000000000..1d72e29ef8 --- /dev/null +++ b/assets/voxygen/background/bg_6.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7385e6c32080459cf8a667cb1e302bed9416e7dcd5e39e2930726e797238d4be +size 522922 diff --git a/assets/voxygen/background/bg_6.png b/assets/voxygen/background/bg_6.png deleted file mode 100644 index 1bac40b2c7..0000000000 --- a/assets/voxygen/background/bg_6.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7ae41c4fac3190e13d1bfdafe6905ede9eeb2f8bdc6b5708d28b82a499aaa5ab -size 2079829 diff --git a/assets/voxygen/background/bg_7.jpg b/assets/voxygen/background/bg_7.jpg new file mode 100644 index 0000000000..280be23cb0 --- /dev/null +++ b/assets/voxygen/background/bg_7.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a712e86e1ab5a3a2db292e34d637e1d7936dd711401df4bfa18e136f4462dad0 +size 208441 diff --git a/assets/voxygen/background/bg_7.png b/assets/voxygen/background/bg_7.png deleted file mode 100644 index 23de419292..0000000000 --- a/assets/voxygen/background/bg_7.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f69f880541dbb2962060419c893b0ab061c8e429d2a836b5bdcf9733c10c7d8 -size 1100362 diff --git a/assets/voxygen/background/bg_8.jpg b/assets/voxygen/background/bg_8.jpg new file mode 100644 index 0000000000..e276755ec8 --- /dev/null +++ b/assets/voxygen/background/bg_8.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:882088822becbf3ff812c3c952606a353f6c448d5c2d923b6e34dab9c9fb0db4 +size 192300 diff --git a/assets/voxygen/background/bg_8.png b/assets/voxygen/background/bg_8.png deleted file mode 100644 index b7db0e1bbb..0000000000 --- a/assets/voxygen/background/bg_8.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b8945a91805b8c0a6fbb9f7eee972c70a47ca1ac24d25ae9b91a3aa8fff5a336 -size 659820 diff --git a/assets/voxygen/background/bg_9.jpg b/assets/voxygen/background/bg_9.jpg new file mode 100644 index 0000000000..bc3a7f6181 --- /dev/null +++ b/assets/voxygen/background/bg_9.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64f48dbd1541451d73c290df7c12620030f9ac6c146a776c736cb0e1d59343fd +size 429957 diff --git a/assets/voxygen/background/bg_9.png b/assets/voxygen/background/bg_9.png deleted file mode 100644 index 3067fcb80c..0000000000 --- a/assets/voxygen/background/bg_9.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e101b354202f8d2fc872808041930b7b683d358b35cfe95203486e175f8cf6eb -size 1585712 diff --git a/assets/voxygen/background/bg_main.jpg b/assets/voxygen/background/bg_main.jpg new file mode 100644 index 0000000000..b287b8064e --- /dev/null +++ b/assets/voxygen/background/bg_main.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5cdc80edb4c64b436d4fa119edb6c8e3a963c5765697101613d7581c1be0d15 +size 326620 diff --git a/assets/voxygen/background/bg_main.png b/assets/voxygen/background/bg_main.png deleted file mode 100755 index 7696d64216..0000000000 --- a/assets/voxygen/background/bg_main.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:31135eadd773c6846a749e661197c1e95f99808f75e34b74c357476d706a5a7e -size 936308 diff --git a/client/src/lib.rs b/client/src/lib.rs index e4f2dd66fa..628578c97b 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -808,9 +808,9 @@ impl Client { //Only in game, terrain ClientGeneral::TerrainChunkRequest { .. } => &mut self.terrain_stream, //Always possible - ClientGeneral::ChatMsg(_) | ClientGeneral::Terminate => { - &mut self.general_stream - }, + ClientGeneral::ChatMsg(_) + | ClientGeneral::Command(_, _) + | ClientGeneral::Terminate => &mut self.general_stream, }; stream.send(msg) }, @@ -1370,6 +1370,11 @@ impl Client { } } + /// Send a command to the server. + pub fn send_command(&mut self, name: String, args: Vec) { + self.send_msg(ClientGeneral::Command(name, args)); + } + /// Remove all cached terrain pub fn clear_terrain(&mut self) { self.state.clear_terrain(); diff --git a/common/assets/src/lib.rs b/common/assets/src/lib.rs index b3031053d6..e8807680e2 100644 --- a/common/assets/src/lib.rs +++ b/common/assets/src/lib.rs @@ -97,19 +97,20 @@ impl Image { pub fn to_image(&self) -> Arc { Arc::clone(&self.0) } } -pub struct PngLoader; -impl Loader for PngLoader { - fn load(content: Cow<[u8]>, _: &str) -> Result { - let format = image::ImageFormat::Png; +pub struct ImageLoader; +impl Loader for ImageLoader { + fn load(content: Cow<[u8]>, ext: &str) -> Result { + let format = image::ImageFormat::from_extension(ext) + .ok_or_else(|| format!("Invalid file extension {}", ext))?; let image = image::load_from_memory_with_format(&content, format)?; Ok(Image(Arc::new(image))) } } impl Asset for Image { - type Loader = PngLoader; + type Loader = ImageLoader; - const EXTENSION: &'static str = "png"; + const EXTENSIONS: &'static [&'static str] = &["png", "jpg"]; } pub struct DotVoxAsset(pub DotVoxData); diff --git a/common/build.rs b/common/build.rs index 60fd6fe813..3a1d6ed8e9 100644 --- a/common/build.rs +++ b/common/build.rs @@ -55,7 +55,7 @@ fn main() { // Check if git-lfs is working if std::env::var("DISABLE_GIT_LFS_CHECK").is_err() && cfg!(not(feature = "no-assets")) { - let asset_path: PathBuf = ["..", "assets", "voxygen", "background", "bg_main.png"] + let asset_path: PathBuf = ["..", "assets", "voxygen", "background", "bg_main.jpg"] .iter() .collect(); let asset_file = match File::open(&asset_path) { diff --git a/common/net/src/msg/client.rs b/common/net/src/msg/client.rs index 9252e5ec85..0cc811ceb9 100644 --- a/common/net/src/msg/client.rs +++ b/common/net/src/msg/client.rs @@ -80,6 +80,7 @@ pub enum ClientGeneral { }, //Always possible ChatMsg(String), + Command(String, Vec), Terminate, RequestPlayerPhysics { server_authoritative: bool, @@ -129,7 +130,9 @@ impl ClientMsg { c_type == ClientType::Game && presence.is_some() }, //Always possible - ClientGeneral::ChatMsg(_) | ClientGeneral::Terminate => true, + ClientGeneral::ChatMsg(_) + | ClientGeneral::Command(_, _) + | ClientGeneral::Terminate => true, } }, ClientMsg::Ping(_) => true, diff --git a/common/src/cmd.rs b/common/src/cmd.rs index 892da21885..54c00c9af4 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -295,7 +295,11 @@ impl ChatCommand { "Spawns an airship", Some(Admin), ), - ChatCommand::Alias => cmd(vec![Any("name", Required)], "Change your alias", None), + ChatCommand::Alias => cmd( + vec![Any("name", Required)], + "Change your alias", + Some(Moderator), + ), ChatCommand::ApplyBuff => cmd( vec![ Enum("buff", BUFFS.clone(), Required), diff --git a/common/src/comp/controller.rs b/common/src/comp/controller.rs index c27a4c1c50..63c3664f8d 100644 --- a/common/src/comp/controller.rs +++ b/common/src/comp/controller.rs @@ -103,6 +103,9 @@ pub enum UtteranceKind { Surprised, Hurt, Greeting, + /* Death, + * TODO: Wait for more post-death features (i.e. animiations) before implementing death + * sounds */ } #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/common/src/event.rs b/common/src/event.rs index ffa178fdd4..1056da4716 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -140,7 +140,7 @@ pub enum ServerEvent { ClientDisconnect(EcsEntity, DisconnectReason), ClientDisconnectWithoutPersistence(EcsEntity), ChunkRequest(EcsEntity, Vec2), - ChatCmd(EcsEntity, String), + Command(EcsEntity, String, Vec), /// Send a chat message to the player from an npc or other player Chat(comp::UnresolvedChatMsg), Aura { diff --git a/common/systems/src/phys.rs b/common/systems/src/phys.rs index 613431035c..5852454f5f 100644 --- a/common/systems/src/phys.rs +++ b/common/systems/src/phys.rs @@ -1283,11 +1283,22 @@ fn box_voxel_collision<'a, T: BaseVol + ReadVol>( near_iter.filter_map(move |(i, j, k)| { let block_pos = pos.map(|e| e.floor() as i32) + Vec3::new(i, j, k); + // `near_iter` could be a few blocks too large due to being integer aligned and + // rounding up, so skip points outside of the tighter bounds before looking them + // up in the terrain (which incurs a hashmap cost for volgrids) + let player_aabb = Aabb { + min: pos + Vec3::new(-radius, -radius, z_range.start), + max: pos + Vec3::new(radius, radius, z_range.end), + }; + let block_approx = Aabb { + min: block_pos.as_(), + max: block_pos.as_() + Vec3::new(1.0, 1.0, Block::MAX_HEIGHT), + }; + if !player_aabb.collides_with_aabb(block_approx) { + return None; + } + if let Some(block) = terrain.get(block_pos).ok().copied().filter(hit) { - let player_aabb = Aabb { - min: pos + Vec3::new(-radius, -radius, z_range.start), - max: pos + Vec3::new(radius, radius, z_range.end), - }; let block_aabb = Aabb { min: block_pos.map(|e| e as f32), max: block_pos.map(|e| e as f32) + Vec3::new(1.0, 1.0, height(&block)), diff --git a/server/src/cmd.rs b/server/src/cmd.rs index fcdd197e1a..a10e1276d1 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -52,11 +52,15 @@ use scan_fmt::{scan_fmt, scan_fmt_some}; use tracing::{error, info, warn}; pub trait ChatCommandExt { - fn execute(&self, server: &mut Server, entity: EcsEntity, args: String); + fn execute(&self, server: &mut Server, entity: EcsEntity, args: Vec); } impl ChatCommandExt for ChatCommand { #[allow(clippy::needless_return)] // TODO: Pending review in #587 - fn execute(&self, server: &mut Server, entity: EcsEntity, args: String) { + fn execute(&self, server: &mut Server, entity: EcsEntity, args: Vec) { + // TODO: Pass arguments to commands as Vec, not String, to support + // proper parsing. + let args = args.join(" "); + if let Err(err) = do_command(server, entity, entity, args, self) { server.notify_client( entity, @@ -101,6 +105,7 @@ fn do_command( cmd.keyword() )); } + let handler: CommandHandler = match cmd { ChatCommand::Adminify => handle_adminify, ChatCommand::Airship => handle_spawn_airship, diff --git a/server/src/events/mod.rs b/server/src/events/mod.rs index 7ab52e6b60..38c73e6c52 100644 --- a/server/src/events/mod.rs +++ b/server/src/events/mod.rs @@ -51,7 +51,7 @@ impl Server { let mut frontend_events = Vec::new(); let mut requested_chunks = Vec::new(); - let mut chat_commands = Vec::new(); + let mut commands = Vec::new(); let mut chat_messages = Vec::new(); let events = self @@ -188,8 +188,8 @@ impl Server { ServerEvent::ChunkRequest(entity, key) => { requested_chunks.push((entity, key)); }, - ServerEvent::ChatCmd(entity, cmd) => { - chat_commands.push((entity, cmd)); + ServerEvent::Command(entity, name, args) => { + commands.push((entity, name, args)); }, ServerEvent::Chat(msg) => { chat_messages.push(msg); @@ -229,8 +229,8 @@ impl Server { self.generate_chunk(entity, key); } - for (entity, cmd) in chat_commands { - self.process_chat_cmd(entity, cmd); + for (entity, name, args) in commands { + self.process_command(entity, name, args); } for msg in chat_messages { diff --git a/server/src/lib.rs b/server/src/lib.rs index b7ca95298c..f1620b6680 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -983,16 +983,9 @@ impl Server { ); } - fn process_chat_cmd(&mut self, entity: EcsEntity, cmd: String) { - // Separate string into keyword and arguments. - let sep = cmd.find(' '); - let (kwd, args) = match sep { - Some(i) => (cmd[..i].to_string(), cmd[(i + 1)..].to_string()), - None => (cmd, "".to_string()), - }; - + fn process_command(&mut self, entity: EcsEntity, name: String, args: Vec) { // Find the command object and run its handler. - if let Ok(command) = kwd.parse::() { + if let Ok(command) = name.parse::() { command.execute(self, entity, args); } else { #[cfg(feature = "plugins")] @@ -1020,8 +1013,8 @@ impl Server { let rs = plugin_manager.execute_event( &ecs_world, &plugin_api::event::ChatCommandEvent { - command: kwd.clone(), - command_args: args.split(' ').map(|x| x.to_owned()).collect(), + command: name.clone(), + command_args: args.clone(), player: plugin_api::event::Player { id: uid }, }, ); @@ -1035,7 +1028,7 @@ impl Server { format!( "Unknown command '/{}'.\nType '/help' for available \ commands", - kwd + name ), ), ); @@ -1059,7 +1052,7 @@ impl Server { comp::ChatType::CommandError, format!( "Error occurred while executing command '/{}'.\n{}", - kwd, e + name, e ), ), ); @@ -1068,7 +1061,7 @@ impl Server { } }, Err(e) => { - error!(?e, "Can't execute command {} {}", kwd, args); + error!(?e, "Can't execute command {} {:?}", name, args); self.notify_client( entity, ServerGeneral::server_msg( @@ -1076,7 +1069,7 @@ impl Server { format!( "Internal error while executing '/{}'.\nContact the server \ administrator", - kwd + name ), ), ); diff --git a/server/src/sys/msg/general.rs b/server/src/sys/msg/general.rs index 26eaebb489..e3787cc0ca 100644 --- a/server/src/sys/msg/general.rs +++ b/server/src/sys/msg/general.rs @@ -29,12 +29,7 @@ impl Sys { if player.is_some() { match validate_chat_msg(&message) { Ok(()) => { - if let Some(message) = message.strip_prefix('/') { - if !message.is_empty() { - let argv = String::from(message); - server_emitter.emit(ServerEvent::ChatCmd(entity, argv)); - } - } else if let Some(from) = uids.get(entity) { + if let Some(from) = uids.get(entity) { const CHAT_MODE_DEFAULT: &ChatMode = &ChatMode::default(); let mode = chat_modes.get(entity).unwrap_or(CHAT_MODE_DEFAULT); // Send chat message @@ -52,6 +47,11 @@ impl Sys { } } }, + ClientGeneral::Command(name, args) => { + if player.is_some() { + server_emitter.emit(ServerEvent::Command(entity, name, args)); + } + }, ClientGeneral::Terminate => { debug!(?entity, "Client send message to terminate session"); server_emitter.emit(ServerEvent::ClientDisconnect( diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index f8cc7abb6b..973c3ff677 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -89,6 +89,7 @@ backtrace = "0.3.40" bincode = "1.3.1" chrono = { version = "0.4.9", features = ["serde"] } cpal = "0.13" +comma = "0.1" copy_dir = "0.1.2" crossbeam-utils = "0.8.1" crossbeam-channel = "0.5" diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index 65623f5bd2..061cd592ca 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -207,6 +207,8 @@ pub enum VoiceKind { Antelope, Alligator, Saurok, + Cat, + Goat, } fn body_to_voice(body: &Body) -> Option { @@ -223,6 +225,8 @@ fn body_to_voice(body: &Body) -> Option { Body::QuadrupedSmall(body) => match body.species { quadruped_small::Species::Sheep => VoiceKind::Sheep, quadruped_small::Species::Pig | quadruped_small::Species::Boar => VoiceKind::Pig, + quadruped_small::Species::Cat => VoiceKind::Cat, + quadruped_small::Species::Goat => VoiceKind::Goat, _ => VoiceKind::Critter, }, Body::QuadrupedMedium(body) => match body.species { @@ -410,7 +414,7 @@ impl SfxMgr { }, Outcome::GroundSlam { pos, .. } => { let sfx_trigger_item = triggers.get_key_value(&SfxEvent::GroundSlam); - audio.emit_sfx(sfx_trigger_item, *pos, Some(1.0), false); + audio.emit_sfx(sfx_trigger_item, *pos, Some(2.0), false); }, Outcome::ProjectileShot { pos, body, .. } => { match body { diff --git a/voxygen/src/hud/chat.rs b/voxygen/src/hud/chat.rs index 9bcd04ce3a..43283d68a0 100644 --- a/voxygen/src/hud/chat.rs +++ b/voxygen/src/hud/chat.rs @@ -168,6 +168,7 @@ pub struct State { pub enum Event { TabCompletionStart(String), SendMessage(String), + SendCommand(String, Vec), Focus(Id), ChangeChatTab(Option), ShowChatTabSettings(usize), @@ -645,7 +646,17 @@ impl<'a> Widget for Chat<'a> { s.history.truncate(self.history_max); } }); - events.push(Event::SendMessage(msg)); + if let Some(msg) = msg.strip_prefix('/') { + match msg.parse::() { + Ok(cmd) => events.push(Event::SendCommand(cmd.name, cmd.arguments)), + Err(err) => self.new_messages.push_back(ChatMsg { + chat_type: ChatType::CommandError, + message: err.to_string(), + }), + } + } else { + events.push(Event::SendMessage(msg)); + } } events } diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 6066aea2a5..419919936c 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -359,6 +359,7 @@ pub struct HudInfo { #[derive(Clone)] pub enum Event { SendMessage(String), + SendCommand(String, Vec), CharacterSelection, UseSlot { @@ -2706,6 +2707,9 @@ impl Hud { chat::Event::SendMessage(message) => { events.push(Event::SendMessage(message)); }, + chat::Event::SendCommand(name, args) => { + events.push(Event::SendCommand(name, args)); + }, chat::Event::Focus(focus_id) => { self.to_focus = Some(Some(focus_id)); }, diff --git a/voxygen/src/menu/main/client_init.rs b/voxygen/src/menu/main/client_init.rs index 01d6188095..e68b48b774 100644 --- a/voxygen/src/menu/main/client_init.rs +++ b/voxygen/src/menu/main/client_init.rs @@ -22,6 +22,7 @@ pub enum Error { mismatched_server_info: Option, }, ClientCrashed, + ServerNotFound, } #[allow(clippy::large_enum_variant)] // TODO: Pending review in #587 @@ -125,11 +126,10 @@ impl ClientInit { tokio::time::sleep(Duration::from_secs(5)).await; } - // Only possibility for no last_err is aborting - let _ = tx.send(Msg::Done(Err(last_err.unwrap_or(Error::ClientError { - error: ClientError::Other("Connection attempt aborted by user".to_owned()), - mismatched_server_info: None, - })))); + // Parsing/host name resolution successful but no connection succeeded + // If last_err is None this typically means there was no server up at the input + // address and all the attempts timed out. + let _ = tx.send(Msg::Done(Err(last_err.unwrap_or(Error::ServerNotFound)))); // Safe drop runtime tokio::task::block_in_place(move || drop(runtime2)); diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 97754adff1..b28703a6b0 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -435,6 +435,7 @@ fn get_client_msg_error(e: client_init::Error, localized_strings: &LocalizationH }, }, InitError::ClientCrashed => localization.get("main.login.client_crashed").into(), + InitError::ServerNotFound => localization.get("main.login.server_not_found").into(), } } diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index 21317b91b1..3f8ba44d02 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -1041,6 +1041,9 @@ impl PlayState for SessionState { // TODO: Handle result self.client.borrow_mut().send_chat(msg); }, + HudEvent::SendCommand(name, args) => { + self.client.borrow_mut().send_command(name, args); + }, HudEvent::CharacterSelection => { self.client.borrow_mut().request_remove_character() },