From 00c3ff09f1e2a8a36075214ce17471809a0dfe53 Mon Sep 17 00:00:00 2001 From: Cameron Murphy Reikes Date: Mon, 10 Jul 2023 18:37:18 -0700 Subject: [PATCH] Massive art import of forest scene, pallete shifted farmer --- art/BezierCurve.013_color.png.png | 3 +++ art/Cube.164_color.png.png | 3 +++ art/Cube.164_color2.png.png | 3 +++ art/Cube.167_color.png.png | 3 +++ art/Cube.295_color.png.001.png | 3 +++ art/Cube.296_color.png.001.png | 3 +++ art/Cube.297_color.png.001.png | 3 +++ art/Cube.297_color.png.002.png | 3 +++ art/Cube.314_color.png.001.png | 3 +++ art/Cube.314_color.png.002.png | 3 +++ art/Cylinder.126_color.png.001.png | 3 +++ art/Cylinder.126_color.png.png | 3 +++ art/Cylinder.130_color.png.001.png | 3 +++ art/Cylinder.130_color.png.002.png | 3 +++ art/Cylinder.131_color.png.001.png | 3 +++ art/Cylinder.131_color.png.002.png | 3 +++ art/EGround.001.png | 4 ++-- art/EGround3.png | 3 +++ art/Exporter.py | 11 +++++++---- art/FencePost.001.png | 4 ++-- art/Plane.029_color.png.png | 3 +++ art/Plane.033_color.png.png | 3 +++ art/TreeLayer2.png.png | 3 +++ art/art.blend | 4 ++-- assets.mdesk | 4 ++++ assets/shifted_farmer.png | 3 +++ character_info.h | 6 ++++++ main.c | 10 ++++++++-- makeprompt.h | 1 + threedee.glsl | 2 +- tuning.h | 2 +- 31 files changed, 97 insertions(+), 14 deletions(-) create mode 100644 art/BezierCurve.013_color.png.png create mode 100644 art/Cube.164_color.png.png create mode 100644 art/Cube.164_color2.png.png create mode 100644 art/Cube.167_color.png.png create mode 100644 art/Cube.295_color.png.001.png create mode 100644 art/Cube.296_color.png.001.png create mode 100644 art/Cube.297_color.png.001.png create mode 100644 art/Cube.297_color.png.002.png create mode 100644 art/Cube.314_color.png.001.png create mode 100644 art/Cube.314_color.png.002.png create mode 100644 art/Cylinder.126_color.png.001.png create mode 100644 art/Cylinder.126_color.png.png create mode 100644 art/Cylinder.130_color.png.001.png create mode 100644 art/Cylinder.130_color.png.002.png create mode 100644 art/Cylinder.131_color.png.001.png create mode 100644 art/Cylinder.131_color.png.002.png create mode 100644 art/EGround3.png create mode 100644 art/Plane.029_color.png.png create mode 100644 art/Plane.033_color.png.png create mode 100644 art/TreeLayer2.png.png create mode 100644 assets/shifted_farmer.png diff --git a/art/BezierCurve.013_color.png.png b/art/BezierCurve.013_color.png.png new file mode 100644 index 0000000..610f0ad --- /dev/null +++ b/art/BezierCurve.013_color.png.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbf9d4f1cb1fe9f5152f2a4b2d429f3c14768f629de6fc05349bc4e619788304 +size 61352 diff --git a/art/Cube.164_color.png.png b/art/Cube.164_color.png.png new file mode 100644 index 0000000..e769b65 --- /dev/null +++ b/art/Cube.164_color.png.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1e0255aa710b59accdeb393d849d1d3d9519f542e31ab0d7216535904bd955f +size 52522 diff --git a/art/Cube.164_color2.png.png b/art/Cube.164_color2.png.png new file mode 100644 index 0000000..706caee --- /dev/null +++ b/art/Cube.164_color2.png.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d2d2471e95169a946e60a5bdcd43837d794ed2b57a8ff1118b835a80a36929c +size 72239 diff --git a/art/Cube.167_color.png.png b/art/Cube.167_color.png.png new file mode 100644 index 0000000..6170d7a --- /dev/null +++ b/art/Cube.167_color.png.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b9f9d49ac8b4ca94c45e8fcb3226593f1ec886fd3cc5f7394640536904f74c1 +size 25630 diff --git a/art/Cube.295_color.png.001.png b/art/Cube.295_color.png.001.png new file mode 100644 index 0000000..f872b95 --- /dev/null +++ b/art/Cube.295_color.png.001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9319bb41d4e8f04c60ab5bb26542ca59b3e4d3ee9ee60b5106a8f4f7c8f28aa +size 523739 diff --git a/art/Cube.296_color.png.001.png b/art/Cube.296_color.png.001.png new file mode 100644 index 0000000..d94a218 --- /dev/null +++ b/art/Cube.296_color.png.001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d0207663989db553d96c1701352f2d65c9b21617e6d9ebafbe7243696df0910 +size 170182 diff --git a/art/Cube.297_color.png.001.png b/art/Cube.297_color.png.001.png new file mode 100644 index 0000000..3bb9b32 --- /dev/null +++ b/art/Cube.297_color.png.001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2652b1b17e7b36480c845828c4cc25fbc9afcd3efa58b3d9780453dd617809ed +size 34344 diff --git a/art/Cube.297_color.png.002.png b/art/Cube.297_color.png.002.png new file mode 100644 index 0000000..3bb9b32 --- /dev/null +++ b/art/Cube.297_color.png.002.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2652b1b17e7b36480c845828c4cc25fbc9afcd3efa58b3d9780453dd617809ed +size 34344 diff --git a/art/Cube.314_color.png.001.png b/art/Cube.314_color.png.001.png new file mode 100644 index 0000000..5a0825a --- /dev/null +++ b/art/Cube.314_color.png.001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07aaf77036b9304c59c68c9db237e3ad92fede440254776f36bdc3e51f3436e3 +size 41012 diff --git a/art/Cube.314_color.png.002.png b/art/Cube.314_color.png.002.png new file mode 100644 index 0000000..5a0825a --- /dev/null +++ b/art/Cube.314_color.png.002.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07aaf77036b9304c59c68c9db237e3ad92fede440254776f36bdc3e51f3436e3 +size 41012 diff --git a/art/Cylinder.126_color.png.001.png b/art/Cylinder.126_color.png.001.png new file mode 100644 index 0000000..ba33c5c --- /dev/null +++ b/art/Cylinder.126_color.png.001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e44d3285860569813bd1ef89ecc6fa8c7081105179f8fab2322f9c2d3ab4998 +size 25419 diff --git a/art/Cylinder.126_color.png.png b/art/Cylinder.126_color.png.png new file mode 100644 index 0000000..ba33c5c --- /dev/null +++ b/art/Cylinder.126_color.png.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e44d3285860569813bd1ef89ecc6fa8c7081105179f8fab2322f9c2d3ab4998 +size 25419 diff --git a/art/Cylinder.130_color.png.001.png b/art/Cylinder.130_color.png.001.png new file mode 100644 index 0000000..4c64e7e --- /dev/null +++ b/art/Cylinder.130_color.png.001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73b1983a8f0132e04756c39a4589428eef4cb032d631835eeecf5a799494a5f8 +size 136122 diff --git a/art/Cylinder.130_color.png.002.png b/art/Cylinder.130_color.png.002.png new file mode 100644 index 0000000..4c64e7e --- /dev/null +++ b/art/Cylinder.130_color.png.002.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73b1983a8f0132e04756c39a4589428eef4cb032d631835eeecf5a799494a5f8 +size 136122 diff --git a/art/Cylinder.131_color.png.001.png b/art/Cylinder.131_color.png.001.png new file mode 100644 index 0000000..86177b5 --- /dev/null +++ b/art/Cylinder.131_color.png.001.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2a77ce33d6c6927481e8d65383bf97c0a70d0c8952c2dca3fc884d78a790939 +size 30001 diff --git a/art/Cylinder.131_color.png.002.png b/art/Cylinder.131_color.png.002.png new file mode 100644 index 0000000..86177b5 --- /dev/null +++ b/art/Cylinder.131_color.png.002.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2a77ce33d6c6927481e8d65383bf97c0a70d0c8952c2dca3fc884d78a790939 +size 30001 diff --git a/art/EGround.001.png b/art/EGround.001.png index c6971de..2caf996 100644 --- a/art/EGround.001.png +++ b/art/EGround.001.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2d77ccfd742ef34528b7466363858c2ca26b0e8acd5ec3b504d75e9edff3d2f4 -size 3034306 +oid sha256:962eea7b186279f151c420ff8316a31657179bcdc98625c8fc4c87558836a8ff +size 3034307 diff --git a/art/EGround3.png b/art/EGround3.png new file mode 100644 index 0000000..508d8de --- /dev/null +++ b/art/EGround3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c40c217ec3c4b35f63c2d63cc219c7a3ce6e3ab0c3f36afe7b0d904037563c8b +size 389125 diff --git a/art/Exporter.py b/art/Exporter.py index bcc5ac4..7d44809 100644 --- a/art/Exporter.py +++ b/art/Exporter.py @@ -122,6 +122,9 @@ def ensure_tex_saved_and_get_name(o) -> str: return image_filename +def object_in_level(o): + return o.users_collection[0].name == "Level" or (o.users_collection[0] in D.collections["Level"].children_recursive) + # meshes can either be Meshes, or Armatures. Armatures contain all mesh data to draw it, and any anims it has for o in D.objects: @@ -131,7 +134,7 @@ for o in D.objects: mesh_object = o o = o.parent object_transform_info = (mesh_name, mapping @ o.location, o.rotation_euler, o.scale) - if o.users_collection[0].name == 'Level': + if object_in_level(o): assert False, "Cannot put armatures in the level. The level is for static placed meshes. For dynamic entities, you put them outside of the level collection, their entity kind is encoded, and the game code decides how to draw them" else: pass @@ -281,13 +284,12 @@ for o in D.objects: else: # if the parent type isn't an armature, i.e just a bog standard mesh mesh_name = o.to_mesh().name # use this over o.name so instanced objects which refer to the same mesh, both use the same serialized mesh. - object_transform_info = (mesh_name, mapping @ o.location, o.rotation_euler, o.scale) - if o.users_collection[0].name == 'Level' and mesh_name == "CollisionCube": + if object_in_level(o) and mesh_name == "CollisionCube": collision_cubes.append((o.location, o.dimensions)) else: - if o.users_collection[0].name == 'Level': + if object_in_level(o): print(f"Object {o.name} has mesh name {o.to_mesh().name}") assert(o.rotation_euler.order == 'XYZ') level_object_data.append(object_transform_info) @@ -297,6 +299,7 @@ for o in D.objects: if mesh_name in saved_meshes: continue saved_meshes.add(mesh_name) + print(f"Mesh name {mesh_name} in level {object_in_level(o)} collections {o.users_collection}") image_filename = ensure_tex_saved_and_get_name(o) assert(mesh_name != LEVEL_EXPORT_NAME) diff --git a/art/FencePost.001.png b/art/FencePost.001.png index a0f622d..4c3f70b 100644 --- a/art/FencePost.001.png +++ b/art/FencePost.001.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a40b44b480bc89055e29b0ba92414e89c31f462ff155b296a6da89155a58cb90 -size 30882 +oid sha256:a57c42b213c3184edbbcbd439f7db014c42b17f45fb58d4ac83cf946e967834f +size 30451 diff --git a/art/Plane.029_color.png.png b/art/Plane.029_color.png.png new file mode 100644 index 0000000..567f11e --- /dev/null +++ b/art/Plane.029_color.png.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:389d74d1d4b8f3c9dc3dada129ca908251d92493ac4a477335356edffa464e6d +size 227420 diff --git a/art/Plane.033_color.png.png b/art/Plane.033_color.png.png new file mode 100644 index 0000000..14d0c88 --- /dev/null +++ b/art/Plane.033_color.png.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:792cf56cfb7495091bf40414d48fd0458a27c4e066292e6819284b6c24fa61ae +size 26384 diff --git a/art/TreeLayer2.png.png b/art/TreeLayer2.png.png new file mode 100644 index 0000000..b002dc9 --- /dev/null +++ b/art/TreeLayer2.png.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb9cd396ef9883f922c0f3860625610c99d8e75aa975e0f69197b245e5c94056 +size 31258 diff --git a/art/art.blend b/art/art.blend index b109f67..674dee8 100644 --- a/art/art.blend +++ b/art/art.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf55748e756b3a00b771c5df4955fa3ae387efa6c2d8365688fc64b736d23cae -size 25493916 +oid sha256:44a79326726295efd4403137a0a8406ec349ce1e22374dea6e43a6401946e34e +size 30742332 diff --git a/assets.mdesk b/assets.mdesk index e43c49c..f3b39af 100644 --- a/assets.mdesk +++ b/assets.mdesk @@ -1,3 +1,7 @@ +@image shifted_farmer: +{ + filepath: "shifted_farmer.png", +} @image dialog_bubble: { filepath: "dialog_bubble.png", diff --git a/assets/shifted_farmer.png b/assets/shifted_farmer.png new file mode 100644 index 0000000..b9975ea --- /dev/null +++ b/assets/shifted_farmer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6be917da1780fe80824681c983a88c5e5c23930a3b34cf91e5af615c141f265 +size 1268645 diff --git a/character_info.h b/character_info.h index 1c2d345..f3b1195 100644 --- a/character_info.h +++ b/character_info.h @@ -129,6 +129,12 @@ CharacterGen characters[] = { .enum_name = "Farmer", .prompt = "The farmer wakes up, does his chores, and sleeps in the farmhouse all on his lonesome. He's tinkering with something fishy in the barn, but's mighty secretive about it. He used to have a wife, and suddenly she disappeared. The farmer gets MIGHTY angry if you question him about what's in his barn under the tarp, or what happened to his wife and family, but is otherwise a kind hearted soul.", }, + { + .name = "Shiftede Farmer", + .enum_name = "ShiftedFarmer", + .prompt = "The farmer wakes up, does his chores, and sleeps in the farmhouse all on his lonesome. He's tinkering with something fishy in the barn, but's mighty secretive about it. He used to have a wife, and suddenly she disappeared. The farmer gets MIGHTY angry if you question him about what's in his barn under the tarp, or what happened to his wife and family, but is otherwise a kind hearted soul.", + }, + }; typedef struct diff --git a/main.c b/main.c index bf3ca9b..3f26d24 100644 --- a/main.c +++ b/main.c @@ -646,7 +646,7 @@ Vec2 entity_aabb_size(Entity *e) } else if (e->is_npc) { - if(e->npc_kind == NPC_Farmer) + if(e->npc_kind == NPC_Farmer || e->npc_kind == NPC_ShiftedFarmer) { return V2(1,1); } @@ -3057,11 +3057,13 @@ void do_float_encoding_tests() Armature player_armature = {0}; Armature farmer_armature = {0}; +Armature shifted_farmer_armature = {0}; // armatureanimations are processed once every visual frame from this list Armature *armatures[] = { &player_armature, &farmer_armature, + &shifted_farmer_armature, }; Mesh mesh_player = {0}; @@ -3100,6 +3102,7 @@ void init(void) Log("Size of %d gs.entities: %zu kb\n", (int)ARRLEN(gs.entities), sizeof(gs.entities) / 1024); sg_setup(&(sg_desc) { .context = sapp_sgcontext(), + .buffer_pool_size = 512, }); stm_setup(); saudio_setup(&(saudio_desc) { @@ -3126,7 +3129,8 @@ void init(void) binary_file = MD_LoadEntireFile(frame_arena, MD_S8Lit("assets/exported_3d/Farmer.bin")); farmer_armature = load_armature(persistent_arena, binary_file, MD_S8Lit("Farmer.bin")); - + shifted_farmer_armature = load_armature(persistent_arena, binary_file, MD_S8Lit("Farmer.bin")); + shifted_farmer_armature.image = image_shifted_farmer; MD_ArenaClear(frame_arena); @@ -5570,6 +5574,8 @@ void frame(void) Armature *to_use = 0; if(it->npc_kind == NPC_Farmer) to_use = &farmer_armature; + else if(it->npc_kind == NPC_ShiftedFarmer) + to_use = &shifted_farmer_armature; else assert(false); diff --git a/makeprompt.h b/makeprompt.h index 892df63..afe6a9c 100644 --- a/makeprompt.h +++ b/makeprompt.h @@ -279,6 +279,7 @@ typedef struct Entity // npcs bool being_hovered; bool perceptions_dirty; + float dialog_fade; TextChunk *errorlist_first; TextChunk *errorlist_last; #ifdef DESKTOP diff --git a/threedee.glsl b/threedee.glsl index 500a0f8..1446fe8 100644 --- a/threedee.glsl +++ b/threedee.glsl @@ -103,7 +103,7 @@ uniform vs_params { }; void main() { - vec3 transformed_pos = vec3(pos_in.x, pos_in.y + sin(pos_in.x * 14.0 + pos_in.y * 20.0 + time*1.9)*0.009, pos_in.z); + vec3 transformed_pos = vec3(pos_in.x, pos_in.y + sin(pos_in.x * 14.0 + pos_in.y * 20.0 + time*1.9)*0.000, pos_in.z); pos = transformed_pos; uv = uv_in; diff --git a/tuning.h b/tuning.h index 3d619eb..8f2fc19 100644 --- a/tuning.h +++ b/tuning.h @@ -13,7 +13,7 @@ #define DIALOG_INTERACT_SIZE 5.0f // length of the centered AABB (not halfsize) around the player of who they're interacting with #define CAM_DISTANCE 15.0f -#define CAM_VERTICAL_TO_HORIZONTAL_RATIO 0.8f +#define CAM_VERTICAL_TO_HORIZONTAL_RATIO 0.95f #define ARENA_SIZE (1024*1024*10) #define BIG_ARENA_SIZE (ARENA_SIZE * 8)