From 0d6a82e0e1b6515499a2409d7adc6cc6695a4a8d Mon Sep 17 00:00:00 2001 From: Denis Ranneft Date: Sat, 4 Apr 2026 02:41:02 +0300 Subject: [PATCH] render optimize --- frontend/public/assets/game/manifest.json | 1086 ++++++++++++++++++++- frontend/src/game/renderer.ts | 50 +- 2 files changed, 1091 insertions(+), 45 deletions(-) diff --git a/frontend/public/assets/game/manifest.json b/frontend/public/assets/game/manifest.json index dcf6125..1fe5246 100644 --- a/frontend/public/assets/game/manifest.json +++ b/frontend/public/assets/game/manifest.json @@ -1,5 +1,5 @@ { - "version": 11, + "version": 13, "assetsRoot": "frontend/assets", "note": "file paths relative to frontend/assets. Rest camp: prop.camp_tent/fire/bag.v0 (wild rest). Other props + heroes + NPC.", "textures": { @@ -361,98 +361,98 @@ "enemy.wolf_l1_1_meadow.south": { "file": "enemies/enemy.wolf_l1_1_meadow.south.png", "kind": "map_object", - "pixellabObjectId": "4bf33db2-712c-424a-b4ad-7e425e2e7e9b", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "4bf33db2-712c-424a-b4ad-7e425e2e7e9b" }, "enemy.wolf_l1_1_forest.south": { "file": "enemies/enemy.wolf_l1_1_forest.south.png", "kind": "map_object", - "pixellabObjectId": "d1f2dc86-520e-4360-9b07-0b61faf87e6d", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "d1f2dc86-520e-4360-9b07-0b61faf87e6d" }, "enemy.wolf_l2_2_forest.south": { "file": "enemies/enemy.wolf_l2_2_forest.south.png", "kind": "map_object", - "pixellabObjectId": "7d140a0e-ff83-4e99-af73-5f20439b5f56", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "7d140a0e-ff83-4e99-af73-5f20439b5f56" }, "enemy.wolf_l2_2_ruins.south": { "file": "enemies/enemy.wolf_l2_2_ruins.south.png", "kind": "map_object", - "pixellabObjectId": "5ce86bef-f686-4a11-bd72-f49e18067a94", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "5ce86bef-f686-4a11-bd72-f49e18067a94" }, "enemy.wolf_l3_3_ruins.south": { "file": "enemies/enemy.wolf_l3_3_ruins.south.png", "kind": "map_object", - "pixellabObjectId": "13159934-d604-4de7-a2ba-a648f7aed9f2", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "13159934-d604-4de7-a2ba-a648f7aed9f2" }, "enemy.wolf_l3_3_canyon.south": { "file": "enemies/enemy.wolf_l3_3_canyon.south.png", "kind": "map_object", - "pixellabObjectId": "18a2b9e4-0321-4051-af42-a780179ead28", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "18a2b9e4-0321-4051-af42-a780179ead28" }, "enemy.wolf_l4_4_canyon.south": { "file": "enemies/enemy.wolf_l4_4_canyon.south.png", "kind": "map_object", - "pixellabObjectId": "540c7767-775a-41e6-80fc-24399c4c8037", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "540c7767-775a-41e6-80fc-24399c4c8037" }, "enemy.wolf_l4_4_swamp.south": { "file": "enemies/enemy.wolf_l4_4_swamp.south.png", "kind": "map_object", - "pixellabObjectId": "64022324-5ce7-435c-bd9b-13f1f37cac5f", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "64022324-5ce7-435c-bd9b-13f1f37cac5f" }, "enemy.wolf_l5_5_volcanic.south": { "file": "enemies/enemy.wolf_l5_5_volcanic.south.png", "kind": "map_object", - "pixellabObjectId": "2ffa9c9d-4459-4ec5-8ed0-8db90d1f91ff", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "2ffa9c9d-4459-4ec5-8ed0-8db90d1f91ff" }, "enemy.wolf_l5_5_astral.south": { "file": "enemies/enemy.wolf_l5_5_astral.south.png", "kind": "map_object", - "pixellabObjectId": "e96d9819-fc57-4568-abc6-f9722cd9f163", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "e96d9819-fc57-4568-abc6-f9722cd9f163" }, "enemy.boar_l2_2_meadow.south": { "file": "enemies/enemy.boar_l2_2_meadow.south.png", "kind": "map_object", - "pixellabObjectId": "99e1a473-34fe-4c58-bc1e-9192902e4709", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "99e1a473-34fe-4c58-bc1e-9192902e4709" }, "enemy.boar_l2_2_forest.south": { "file": "enemies/enemy.boar_l2_2_forest.south.png", "kind": "map_object", - "pixellabObjectId": "771d2d9c-5d35-4a77-869d-70c86abc9d0b", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "771d2d9c-5d35-4a77-869d-70c86abc9d0b" }, "enemy.boar_l3_3_forest.south": { "file": "enemies/enemy.boar_l3_3_forest.south.png", "kind": "map_object", - "pixellabObjectId": "11b8358c-d4ed-49df-8da4-603845cb23c8", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "11b8358c-d4ed-49df-8da4-603845cb23c8" }, "enemy.boar_l3_3_ruins.south": { "file": "enemies/enemy.boar_l3_3_ruins.south.png", "kind": "map_object", - "pixellabObjectId": "3767a671-8c08-4ae3-b18a-fdcfe4d7c4ea", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "3767a671-8c08-4ae3-b18a-fdcfe4d7c4ea" }, "enemy.boar_l4_4_ruins.south": { "file": "enemies/enemy.boar_l4_4_ruins.south.png", "kind": "map_object", - "pixellabObjectId": "b401afd4-f349-4827-ab59-57fa1c2d1fdb", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "b401afd4-f349-4827-ab59-57fa1c2d1fdb" }, "enemy.boar_l4_4_canyon.south": { "file": "enemies/enemy.boar_l4_4_canyon.south.png", "kind": "map_object", - "pixellabObjectId": "abfd83f3-1ede-4fe2-a70e-4bd5746dce78", - "rotation": "south" + "rotation": "south", + "pixellabObjectId": "abfd83f3-1ede-4fe2-a70e-4bd5746dce78" }, "hero.player": { "file": "characters/hero.player.png", @@ -655,6 +655,1026 @@ "kind": "character", "pixellabCharacterId": "091ce71e-d1e2-4aa6-91dd-e37a033bfd14", "rotation": "south-west" + }, + "enemy.boar_l5_5_canyon.south": { + "file": "enemies/enemy.boar_l5_5_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.boar_l5_5_swamp.south": { + "file": "enemies/enemy.boar_l5_5_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.boar_l6_6_volcanic.south": { + "file": "enemies/enemy.boar_l6_6_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.boar_l6_6_astral.south": { + "file": "enemies/enemy.boar_l6_6_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.zombie_l3_4_meadow.south": { + "file": "enemies/enemy.zombie_l3_4_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.zombie_l3_4_forest.south": { + "file": "enemies/enemy.zombie_l3_4_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.zombie_l5_5_forest.south": { + "file": "enemies/enemy.zombie_l5_5_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.zombie_l5_5_ruins.south": { + "file": "enemies/enemy.zombie_l5_5_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.zombie_l6_6_ruins.south": { + "file": "enemies/enemy.zombie_l6_6_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.zombie_l6_6_canyon.south": { + "file": "enemies/enemy.zombie_l6_6_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.zombie_l7_7_canyon.south": { + "file": "enemies/enemy.zombie_l7_7_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.zombie_l7_7_swamp.south": { + "file": "enemies/enemy.zombie_l7_7_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.zombie_l8_8_volcanic.south": { + "file": "enemies/enemy.zombie_l8_8_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.zombie_l8_8_astral.south": { + "file": "enemies/enemy.zombie_l8_8_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.spider_l4_5_meadow.south": { + "file": "enemies/enemy.spider_l4_5_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.spider_l4_5_forest.south": { + "file": "enemies/enemy.spider_l4_5_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.spider_l6_6_forest.south": { + "file": "enemies/enemy.spider_l6_6_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.spider_l6_6_ruins.south": { + "file": "enemies/enemy.spider_l6_6_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.spider_l7_7_ruins.south": { + "file": "enemies/enemy.spider_l7_7_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.spider_l7_7_canyon.south": { + "file": "enemies/enemy.spider_l7_7_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.spider_l8_8_canyon.south": { + "file": "enemies/enemy.spider_l8_8_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.spider_l8_8_swamp.south": { + "file": "enemies/enemy.spider_l8_8_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.spider_l9_9_volcanic.south": { + "file": "enemies/enemy.spider_l9_9_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.spider_l9_9_astral.south": { + "file": "enemies/enemy.spider_l9_9_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.orc_l5_6_meadow.south": { + "file": "enemies/enemy.orc_l5_6_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.orc_l5_6_forest.south": { + "file": "enemies/enemy.orc_l5_6_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.orc_l7_8_forest.south": { + "file": "enemies/enemy.orc_l7_8_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.orc_l7_8_ruins.south": { + "file": "enemies/enemy.orc_l7_8_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.orc_l9_10_ruins.south": { + "file": "enemies/enemy.orc_l9_10_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.orc_l9_10_canyon.south": { + "file": "enemies/enemy.orc_l9_10_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.orc_l11_11_canyon.south": { + "file": "enemies/enemy.orc_l11_11_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.orc_l11_11_swamp.south": { + "file": "enemies/enemy.orc_l11_11_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.orc_l12_12_volcanic.south": { + "file": "enemies/enemy.orc_l12_12_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.orc_l12_12_astral.south": { + "file": "enemies/enemy.orc_l12_12_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_l6_7_meadow.south": { + "file": "enemies/enemy.skeleton_l6_7_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_l6_7_forest.south": { + "file": "enemies/enemy.skeleton_l6_7_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_l8_9_forest.south": { + "file": "enemies/enemy.skeleton_l8_9_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_l8_9_ruins.south": { + "file": "enemies/enemy.skeleton_l8_9_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_l10_11_ruins.south": { + "file": "enemies/enemy.skeleton_l10_11_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_l10_11_canyon.south": { + "file": "enemies/enemy.skeleton_l10_11_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_l12_13_canyon.south": { + "file": "enemies/enemy.skeleton_l12_13_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_l12_13_swamp.south": { + "file": "enemies/enemy.skeleton_l12_13_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_l14_14_volcanic.south": { + "file": "enemies/enemy.skeleton_l14_14_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_l14_14_astral.south": { + "file": "enemies/enemy.skeleton_l14_14_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.battle_lizard_l7_8_meadow.south": { + "file": "enemies/enemy.battle_lizard_l7_8_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.battle_lizard_l7_8_forest.south": { + "file": "enemies/enemy.battle_lizard_l7_8_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.battle_lizard_l9_10_forest.south": { + "file": "enemies/enemy.battle_lizard_l9_10_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.battle_lizard_l9_10_ruins.south": { + "file": "enemies/enemy.battle_lizard_l9_10_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.battle_lizard_l11_12_ruins.south": { + "file": "enemies/enemy.battle_lizard_l11_12_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.battle_lizard_l11_12_canyon.south": { + "file": "enemies/enemy.battle_lizard_l11_12_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.battle_lizard_l13_14_canyon.south": { + "file": "enemies/enemy.battle_lizard_l13_14_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.battle_lizard_l13_14_swamp.south": { + "file": "enemies/enemy.battle_lizard_l13_14_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.battle_lizard_l15_15_volcanic.south": { + "file": "enemies/enemy.battle_lizard_l15_15_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.battle_lizard_l15_15_astral.south": { + "file": "enemies/enemy.battle_lizard_l15_15_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.element_l18_20_meadow.south": { + "file": "enemies/enemy.element_l18_20_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.element_l12_14_forest.south": { + "file": "enemies/enemy.element_l12_14_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.element_l21_22_forest.south": { + "file": "enemies/enemy.element_l21_22_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.element_l15_16_ruins.south": { + "file": "enemies/enemy.element_l15_16_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.element_l23_24_ruins.south": { + "file": "enemies/enemy.element_l23_24_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.element_l17_18_canyon.south": { + "file": "enemies/enemy.element_l17_18_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.element_l25_26_canyon.south": { + "file": "enemies/enemy.element_l25_26_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.element_l19_20_swamp.south": { + "file": "enemies/enemy.element_l19_20_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.element_l27_28_volcanic.south": { + "file": "enemies/enemy.element_l27_28_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.element_l21_22_astral.south": { + "file": "enemies/enemy.element_l21_22_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.demon_l10_12_meadow.south": { + "file": "enemies/enemy.demon_l10_12_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.demon_l10_12_forest.south": { + "file": "enemies/enemy.demon_l10_12_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.demon_l13_14_forest.south": { + "file": "enemies/enemy.demon_l13_14_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.demon_l13_14_ruins.south": { + "file": "enemies/enemy.demon_l13_14_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.demon_l15_16_ruins.south": { + "file": "enemies/enemy.demon_l15_16_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.demon_l15_16_canyon.south": { + "file": "enemies/enemy.demon_l15_16_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.demon_l17_18_canyon.south": { + "file": "enemies/enemy.demon_l17_18_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.demon_l17_18_swamp.south": { + "file": "enemies/enemy.demon_l17_18_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.demon_l19_20_volcanic.south": { + "file": "enemies/enemy.demon_l19_20_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.demon_l19_20_astral.south": { + "file": "enemies/enemy.demon_l19_20_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_king_l15_17_meadow.south": { + "file": "enemies/enemy.skeleton_king_l15_17_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_king_l15_17_forest.south": { + "file": "enemies/enemy.skeleton_king_l15_17_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_king_l18_19_forest.south": { + "file": "enemies/enemy.skeleton_king_l18_19_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_king_l18_19_ruins.south": { + "file": "enemies/enemy.skeleton_king_l18_19_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_king_l20_21_ruins.south": { + "file": "enemies/enemy.skeleton_king_l20_21_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_king_l20_21_canyon.south": { + "file": "enemies/enemy.skeleton_king_l20_21_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_king_l22_23_canyon.south": { + "file": "enemies/enemy.skeleton_king_l22_23_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_king_l22_23_swamp.south": { + "file": "enemies/enemy.skeleton_king_l22_23_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_king_l24_25_volcanic.south": { + "file": "enemies/enemy.skeleton_king_l24_25_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.skeleton_king_l24_25_astral.south": { + "file": "enemies/enemy.skeleton_king_l24_25_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.forest_warden_l20_22_meadow.south": { + "file": "enemies/enemy.forest_warden_l20_22_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.forest_warden_l20_22_forest.south": { + "file": "enemies/enemy.forest_warden_l20_22_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.forest_warden_l23_24_forest.south": { + "file": "enemies/enemy.forest_warden_l23_24_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.forest_warden_l23_24_ruins.south": { + "file": "enemies/enemy.forest_warden_l23_24_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.forest_warden_l25_26_ruins.south": { + "file": "enemies/enemy.forest_warden_l25_26_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.forest_warden_l25_26_canyon.south": { + "file": "enemies/enemy.forest_warden_l25_26_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.forest_warden_l27_28_canyon.south": { + "file": "enemies/enemy.forest_warden_l27_28_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.forest_warden_l27_28_swamp.south": { + "file": "enemies/enemy.forest_warden_l27_28_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.forest_warden_l29_30_volcanic.south": { + "file": "enemies/enemy.forest_warden_l29_30_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.forest_warden_l29_30_astral.south": { + "file": "enemies/enemy.forest_warden_l29_30_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.titan_l25_27_meadow.south": { + "file": "enemies/enemy.titan_l25_27_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.titan_l25_27_forest.south": { + "file": "enemies/enemy.titan_l25_27_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.titan_l28_29_forest.south": { + "file": "enemies/enemy.titan_l28_29_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.titan_l28_29_ruins.south": { + "file": "enemies/enemy.titan_l28_29_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.titan_l30_31_ruins.south": { + "file": "enemies/enemy.titan_l30_31_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.titan_l30_31_canyon.south": { + "file": "enemies/enemy.titan_l30_31_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.titan_l32_33_canyon.south": { + "file": "enemies/enemy.titan_l32_33_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.titan_l32_33_swamp.south": { + "file": "enemies/enemy.titan_l32_33_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.titan_l34_35_volcanic.south": { + "file": "enemies/enemy.titan_l34_35_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.titan_l34_35_astral.south": { + "file": "enemies/enemy.titan_l34_35_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.golem_l8_10_meadow.south": { + "file": "enemies/enemy.golem_l8_10_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.golem_l8_10_forest.south": { + "file": "enemies/enemy.golem_l8_10_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.golem_l11_12_forest.south": { + "file": "enemies/enemy.golem_l11_12_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.golem_l11_12_ruins.south": { + "file": "enemies/enemy.golem_l11_12_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.golem_l13_14_ruins.south": { + "file": "enemies/enemy.golem_l13_14_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.golem_l13_14_canyon.south": { + "file": "enemies/enemy.golem_l13_14_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.golem_l15_16_canyon.south": { + "file": "enemies/enemy.golem_l15_16_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.golem_l15_16_swamp.south": { + "file": "enemies/enemy.golem_l15_16_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.golem_l17_18_volcanic.south": { + "file": "enemies/enemy.golem_l17_18_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.golem_l17_18_astral.south": { + "file": "enemies/enemy.golem_l17_18_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wraith_l5_6_meadow.south": { + "file": "enemies/enemy.wraith_l5_6_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wraith_l5_6_forest.south": { + "file": "enemies/enemy.wraith_l5_6_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wraith_l7_8_forest.south": { + "file": "enemies/enemy.wraith_l7_8_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wraith_l7_8_ruins.south": { + "file": "enemies/enemy.wraith_l7_8_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wraith_l9_10_ruins.south": { + "file": "enemies/enemy.wraith_l9_10_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wraith_l9_10_canyon.south": { + "file": "enemies/enemy.wraith_l9_10_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wraith_l11_12_canyon.south": { + "file": "enemies/enemy.wraith_l11_12_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wraith_l11_12_swamp.south": { + "file": "enemies/enemy.wraith_l11_12_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wraith_l13_14_volcanic.south": { + "file": "enemies/enemy.wraith_l13_14_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wraith_l13_14_astral.south": { + "file": "enemies/enemy.wraith_l13_14_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.bandit_l4_5_meadow.south": { + "file": "enemies/enemy.bandit_l4_5_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.bandit_l4_5_forest.south": { + "file": "enemies/enemy.bandit_l4_5_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.bandit_l6_7_forest.south": { + "file": "enemies/enemy.bandit_l6_7_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.bandit_l6_7_ruins.south": { + "file": "enemies/enemy.bandit_l6_7_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.bandit_l8_9_ruins.south": { + "file": "enemies/enemy.bandit_l8_9_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.bandit_l8_9_canyon.south": { + "file": "enemies/enemy.bandit_l8_9_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.bandit_l10_11_canyon.south": { + "file": "enemies/enemy.bandit_l10_11_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.bandit_l10_11_swamp.south": { + "file": "enemies/enemy.bandit_l10_11_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.bandit_l12_12_volcanic.south": { + "file": "enemies/enemy.bandit_l12_12_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.bandit_l12_12_astral.south": { + "file": "enemies/enemy.bandit_l12_12_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.cultist_l6_8_meadow.south": { + "file": "enemies/enemy.cultist_l6_8_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.cultist_l6_8_forest.south": { + "file": "enemies/enemy.cultist_l6_8_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.cultist_l9_10_forest.south": { + "file": "enemies/enemy.cultist_l9_10_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.cultist_l9_10_ruins.south": { + "file": "enemies/enemy.cultist_l9_10_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.cultist_l11_12_ruins.south": { + "file": "enemies/enemy.cultist_l11_12_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.cultist_l11_12_canyon.south": { + "file": "enemies/enemy.cultist_l11_12_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.cultist_l13_14_canyon.south": { + "file": "enemies/enemy.cultist_l13_14_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.cultist_l13_14_swamp.south": { + "file": "enemies/enemy.cultist_l13_14_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.cultist_l15_16_volcanic.south": { + "file": "enemies/enemy.cultist_l15_16_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.cultist_l15_16_astral.south": { + "file": "enemies/enemy.cultist_l15_16_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.treant_l18_20_meadow.south": { + "file": "enemies/enemy.treant_l18_20_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.treant_l18_20_forest.south": { + "file": "enemies/enemy.treant_l18_20_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.treant_l21_23_forest.south": { + "file": "enemies/enemy.treant_l21_23_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.treant_l21_23_ruins.south": { + "file": "enemies/enemy.treant_l21_23_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.treant_l24_26_ruins.south": { + "file": "enemies/enemy.treant_l24_26_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.treant_l24_26_canyon.south": { + "file": "enemies/enemy.treant_l24_26_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.treant_l27_28_canyon.south": { + "file": "enemies/enemy.treant_l27_28_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.treant_l27_28_swamp.south": { + "file": "enemies/enemy.treant_l27_28_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.treant_l29_30_volcanic.south": { + "file": "enemies/enemy.treant_l29_30_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.treant_l29_30_astral.south": { + "file": "enemies/enemy.treant_l29_30_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.basilisk_l9_11_meadow.south": { + "file": "enemies/enemy.basilisk_l9_11_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.basilisk_l9_11_forest.south": { + "file": "enemies/enemy.basilisk_l9_11_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.basilisk_l12_13_forest.south": { + "file": "enemies/enemy.basilisk_l12_13_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.basilisk_l12_13_ruins.south": { + "file": "enemies/enemy.basilisk_l12_13_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.basilisk_l14_15_ruins.south": { + "file": "enemies/enemy.basilisk_l14_15_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.basilisk_l14_15_canyon.south": { + "file": "enemies/enemy.basilisk_l14_15_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.basilisk_l16_17_canyon.south": { + "file": "enemies/enemy.basilisk_l16_17_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.basilisk_l16_17_swamp.south": { + "file": "enemies/enemy.basilisk_l16_17_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.basilisk_l18_19_volcanic.south": { + "file": "enemies/enemy.basilisk_l18_19_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.basilisk_l18_19_astral.south": { + "file": "enemies/enemy.basilisk_l18_19_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wyvern_l12_14_meadow.south": { + "file": "enemies/enemy.wyvern_l12_14_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wyvern_l12_14_forest.south": { + "file": "enemies/enemy.wyvern_l12_14_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wyvern_l15_17_forest.south": { + "file": "enemies/enemy.wyvern_l15_17_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wyvern_l15_17_ruins.south": { + "file": "enemies/enemy.wyvern_l15_17_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wyvern_l18_20_ruins.south": { + "file": "enemies/enemy.wyvern_l18_20_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wyvern_l18_20_canyon.south": { + "file": "enemies/enemy.wyvern_l18_20_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wyvern_l21_22_canyon.south": { + "file": "enemies/enemy.wyvern_l21_22_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wyvern_l21_22_swamp.south": { + "file": "enemies/enemy.wyvern_l21_22_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wyvern_l23_24_volcanic.south": { + "file": "enemies/enemy.wyvern_l23_24_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.wyvern_l23_24_astral.south": { + "file": "enemies/enemy.wyvern_l23_24_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.harpy_l6_7_meadow.south": { + "file": "enemies/enemy.harpy_l6_7_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.harpy_l6_7_forest.south": { + "file": "enemies/enemy.harpy_l6_7_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.harpy_l8_9_forest.south": { + "file": "enemies/enemy.harpy_l8_9_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.harpy_l8_9_ruins.south": { + "file": "enemies/enemy.harpy_l8_9_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.harpy_l10_11_ruins.south": { + "file": "enemies/enemy.harpy_l10_11_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.harpy_l10_11_canyon.south": { + "file": "enemies/enemy.harpy_l10_11_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.harpy_l12_13_canyon.south": { + "file": "enemies/enemy.harpy_l12_13_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.harpy_l12_13_swamp.south": { + "file": "enemies/enemy.harpy_l12_13_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.harpy_l14_15_volcanic.south": { + "file": "enemies/enemy.harpy_l14_15_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.harpy_l14_15_astral.south": { + "file": "enemies/enemy.harpy_l14_15_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.manticore_l14_16_meadow.south": { + "file": "enemies/enemy.manticore_l14_16_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.manticore_l14_16_forest.south": { + "file": "enemies/enemy.manticore_l14_16_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.manticore_l17_19_forest.south": { + "file": "enemies/enemy.manticore_l17_19_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.manticore_l17_19_ruins.south": { + "file": "enemies/enemy.manticore_l17_19_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.manticore_l20_22_ruins.south": { + "file": "enemies/enemy.manticore_l20_22_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.manticore_l20_22_canyon.south": { + "file": "enemies/enemy.manticore_l20_22_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.manticore_l23_24_canyon.south": { + "file": "enemies/enemy.manticore_l23_24_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.manticore_l23_24_swamp.south": { + "file": "enemies/enemy.manticore_l23_24_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.manticore_l25_26_volcanic.south": { + "file": "enemies/enemy.manticore_l25_26_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.manticore_l25_26_astral.south": { + "file": "enemies/enemy.manticore_l25_26_astral.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.shade_l10_12_meadow.south": { + "file": "enemies/enemy.shade_l10_12_meadow.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.shade_l10_12_forest.south": { + "file": "enemies/enemy.shade_l10_12_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.shade_l13_15_forest.south": { + "file": "enemies/enemy.shade_l13_15_forest.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.shade_l13_15_ruins.south": { + "file": "enemies/enemy.shade_l13_15_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.shade_l16_18_ruins.south": { + "file": "enemies/enemy.shade_l16_18_ruins.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.shade_l16_18_canyon.south": { + "file": "enemies/enemy.shade_l16_18_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.shade_l19_20_canyon.south": { + "file": "enemies/enemy.shade_l19_20_canyon.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.shade_l19_20_swamp.south": { + "file": "enemies/enemy.shade_l19_20_swamp.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.shade_l21_22_volcanic.south": { + "file": "enemies/enemy.shade_l21_22_volcanic.south.png", + "kind": "map_object", + "rotation": "south" + }, + "enemy.shade_l21_22_astral.south": { + "file": "enemies/enemy.shade_l21_22_astral.south.png", + "kind": "map_object", + "rotation": "south" } } } diff --git a/frontend/src/game/renderer.ts b/frontend/src/game/renderer.ts index 6a35f22..6a025d2 100644 --- a/frontend/src/game/renderer.ts +++ b/frontend/src/game/renderer.ts @@ -37,6 +37,8 @@ export interface WorldPoint { type SpritePoolEntry = { sprite: Sprite; textureKey: string; + worldX?: number; + worldY?: number; }; const TERRAIN_SEAM_BLEED_SCALE = 1.002; @@ -101,6 +103,10 @@ export class GameRenderer { private _objectSpritePool = new Map(); private _tileSpriteFreeList: Sprite[] = []; private _objectSpriteFreeList: Sprite[] = []; + private _usedTileSprites = new Set(); + private _usedObjectSprites = new Set(); + private _emptySpriteSet = new Set(); + private _groundTerrainCache = new Map(); private _buildingSpritePool = new Map(); private _characterSpritePool = new Map(); private _npcSpritePool = new Map(); @@ -321,6 +327,8 @@ export class GameRenderer { textureKey: string, texture: SpritePoolEntry['sprite']['texture'], layer: Container, + worldX?: number, + worldY?: number, freeList?: Sprite[], ): SpritePoolEntry { let entry = pool.get(poolKey); @@ -332,7 +340,7 @@ export class GameRenderer { sprite.anchor.set(0.5, 1); sprite.roundPixels = true; if (!sprite.parent) layer.addChild(sprite); - entry = { sprite, textureKey }; + entry = { sprite, textureKey, worldX, worldY }; pool.set(poolKey, entry); return entry; } @@ -340,6 +348,10 @@ export class GameRenderer { entry.sprite.texture = texture; entry.textureKey = textureKey; } + if (typeof worldX === 'number' && typeof worldY === 'number') { + entry.worldX = worldX; + entry.worldY = worldY; + } return entry; } @@ -359,10 +371,8 @@ export class GameRenderer { maxFreeListSize: number, ): void { for (const [key, entry] of pool) { - const sep = key.indexOf(','); - if (sep < 0) continue; - const wx = Number(key.slice(0, sep)); - const wy = Number(key.slice(sep + 1)); + const wx = entry.worldX ?? Number.NaN; + const wy = entry.worldY ?? Number.NaN; if (!Number.isFinite(wx) || !Number.isFinite(wy)) continue; if (wx >= minX && wx <= maxX && wy >= minY && wy <= maxY) continue; pool.delete(key); @@ -627,8 +637,20 @@ export class GameRenderer { const hw = TILE_WIDTH / 2; const hh = TILE_HEIGHT / 2; const terrainCtx = this._worldTerrainContext; - const usedTileSprites = new Set(); - const usedObjectSprites = new Set(); + const usedTileSprites = this._usedTileSprites; + const usedObjectSprites = this._usedObjectSprites; + usedTileSprites.clear(); + usedObjectSprites.clear(); + const terrainCache = this._groundTerrainCache; + terrainCache.clear(); + const terrainAt = (wx: number, wy: number): string => { + const key = `${wx},${wy}`; + const cached = terrainCache.get(key); + if (cached) return cached; + const terrain = proceduralTerrain(wx, wy, terrainCtx); + terrainCache.set(key, terrain); + return terrain; + }; // Pass 1: tiles for (let wx = startX; wx <= endX; wx++) { @@ -640,7 +662,7 @@ export class GameRenderer { ) { continue; } - const terrain = proceduralTerrain(wx, wy, terrainCtx); + const terrain = terrainAt(wx, wy); const dark = (wx + wy) % 2 === 0; const textureKey = spritesReady ? terrainToTextureKey(terrain) : null; const texture = textureKey ? this._spriteRegistry.getTexture(textureKey) : null; @@ -654,6 +676,8 @@ export class GameRenderer { textureKey, texture, this._groundSpriteLayer, + wx, + wy, this._tileSpriteFreeList, ); entry.sprite.x = iso.x; @@ -705,7 +729,7 @@ export class GameRenderer { ) { continue; } - const terrainHere = proceduralTerrain(wx, wy, terrainCtx); + const terrainHere = terrainAt(wx, wy); const obj = proceduralObject(wx, wy, terrainHere, terrainCtx); if (!obj) continue; const variant = tileHash(wx, wy, 999); @@ -720,6 +744,8 @@ export class GameRenderer { objTextureKey, objTexture, this._objectSpriteLayer, + wx, + wy, this._objectSpriteFreeList, ); entry.sprite.x = iso.x; @@ -767,8 +793,8 @@ export class GameRenderer { 1800, ); } else { - this._hideUnusedSprites(this._tileSpritePool, new Set()); - this._hideUnusedSprites(this._objectSpritePool, new Set()); + this._hideUnusedSprites(this._tileSpritePool, this._emptySpriteSet); + this._hideUnusedSprites(this._objectSpritePool, this._emptySpriteSet); } } @@ -1926,7 +1952,7 @@ export class GameRenderer { for (const lbl of this._npcLabels) { lbl.visible = false; } - this._hideUnusedSprites(this._npcSpritePool, new Set()); + this._hideUnusedSprites(this._npcSpritePool, this._emptySpriteSet); } /**