• Projects
  • Project Regina - 3D 3rd person demo (Godot 4)

Wow! What kind of rig and where did the animation used for the model come from?

    Tomcat
    I did a simple rig and keyframe rough animations for testing purpose. Personally I have no idea what she's doing LOL

    11 days later

    Node based state machine.

    *There are some frozen states when jumping/running/with skirt. It probably has something to do with pressed and just_pressed jump/run button. I will try fix it along the way but overall the State Machine is working alright.

    *There is also this error with animation player. For some reason if I don't set animation to loop linear it will throw red error that "on_animation_finished not found" on that animation. Set to loop ping-pong also won't play either. So I set all my animations to loop linear.

    Next I will add my nemesis...Inventory 😆

    This is looking really cool. Reminds me of The Sims.

    a month later

    I have done the Inventory and Shop. It is based off this tutorial. I just added more functions / modified it to my likings.


    This is the Player Inventory. It has 4 tabs, 1 for each item category (Clothings, Accessories, Items, Food). Right now they are all empty. The right panel to show item Infomation and buttons.


    You walk to the shop and the Shop Inventory is activated. You then buy items and it will be placed in its category tab (in the Player Inventory). I also use ScrollContainer, there are empty spaces to put item descriptions and quantity.


    For Clothings Tab, there are 2 places where you can put item on the player, Body and Hip. They are just node3D positioned in player's scene. Then when press button it checks the name of item in that category then add_child it.

    I also got the Tick system when one of the Body/Hip item is being used.
    (by checking var is_used = true then make the sprite2D tick visible)


    I got a swimsuit item which is just swaps player's texture and play shapedkey to expand the hip back to normal proportion. (I originally shrank the hip so it won't see through clothes that much)


    You can unuse items and discard them


    For Accessories Tab is pretty much the same. I use boneattachment for head bone and wrist bone. I add jiggle to the Bunny ears.


    For Items Tab is just a pop up to show more details. Maybe use for clue or map or use key for doors..etc.


    For Food Tab, each Item can be stacked and used up. In this demo I use it to change variables, for example, Chocolate bar will decrease Health, Apple with increase it, and Cake will increase coins.

    This inventory code is kind of a mess, many duplicated codes, and totally unoptimized. I don't think it can/should be used in real game. There are also still room for improvement like sorting items. Overall though I'm pretty happy that I could make this Inventory work.

    Next I will try doing the scene switches and to carry those player's equipped items over. Then the save/load function.

    Well, it's almost an alternative to the The Sims. There's just a little bit of tweaking left to do. 😹

      Tomcat

      Far from it LOL. There are still so many things for me to learn in order to make any complete game.

      18 days later

      Not much new to show visually but I've managed to do the Scene Switching and Saving/Loading game.


      Methods:
      Scene Switching : using change_scene_to_file(). I have a player_load function that checks any inventory items being used == true then add_child() them.

      *I have red error regarding the body's materials. There is an github issue on it. I'm not sure it is fixed in the latest version. (I'm at version 4.0.1 rc2) https://github.com/godotengine/godot/issues/67144


      Saving/Loading game : using JSON (tutorial from document). Save all the inventories + player's info to JSON then load it all back, then player_load function.

      *There is a bug when saving player's health. I have to close and reopen the Menu then press save button in order the save the player's health correctly. The problem is that I put save function in Inventory Menu and while Menu is on, the mainscene process is disabled. I guess for a real game I'd need the put the save button somewhere else.

      Next I will try to add water with shader (pool, beach) and have character interact with it.

      As always — very interesting and extremely informative! There's a lot here that I've been thinking about how to implement. It was a great pleasure to look at it. I wanted to try to implement saving via JSON too.

      With your generous permission, I'll steal the ideas into my project. 😊

        Tomcat

        No need to ask for my permission 😃 . Those are already available on internet, youtube..etc (just search godot 4 scene switching/ saving/loading tutorials). But if you don't have access to youtube then don't worry, most of those tutorials are using official doc methods anyway.

        Change scene by change_scene_to_file() : https://docs.godotengine.org/en/stable/tutorials/scripting/scene_tree.html#changing-current-scene

        Change scene by add_child() : https://docs.godotengine.org/en/stable/tutorials/scripting/change_scenes_manually.html

        Saving game by JSON: https://docs.godotengine.org/en/stable/tutorials/io/saving_games.html

        Saving game using Resource : *Haven't tried yet but supposedly is easier than using JSON

        It's not hard but I guess the most "thinking" part of this procedure is decide which infos you want to send over (player's health, location, items..etc), where would you get those infos on your scripts, and how would you put those back to your player once you load it from JSON file (Might need to do some values conversion too). It will depend on how your setup your trees and scripts.

        You can check out my profile>discussions. I've been asking about it in recent weeks, there might be some useful stuffs for your project.

          Gowydot It's not hard but I guess the most "thinking" part of this procedure is decide which infos you want to send over

          It's a Sims-like game. So the amount of information saved will be quite large. But not right away. I will be making a small game to start with. I suppose there will be a lot of prototyping and investigating different approaches to implementing various features.

            5 days later

            Tomcat
            I'd say just go for it. You'd find that you need to make a lot of adjustments while you put it all together.

            In a mean time, this pops up on my youtube and I finally understand what they all means 😄.

              Gowydot In a mean time, this pops up on my youtube and I finally understand what they all means

              That's right… I've run into this before and I guess I understand it well… but I have two chits: I am not time-bound and there are no grants to account for.

              Just a footprint test, not really accurate but I'm ok with how it turns out. I have a raycast shooting down from body then place 2 foot sprite3Ds alternately. The sprites rotate according to the body's rotation.

              Wow! Well, such graphics would already be quite suitable for a Sims-like game. A small glitch when the camera is on the edge of the water, but I guess this is a common problem. By the way, what kind of shader?

              Very cool! 👍

                Thanks all.

                Tomcat
                For that gif I used -

                Although I'd probably end up just using animated textures instead 'cause my laptop gets too hot with shader LOL.

                Also, you couldn't see it on the gif but there are artifacts around the character when on top of the water shader, especially around the head area. I don't know if it's because the hair area has alpha texture or something else.
                *just tested and confirm it is the alpha material in front of shader issue, how to fix this?

                A small glitch when the camera is on the edge of the water

                Yea I've been researching on how to do half underwater camera effects. As I understand Godot would need a thing called stencil buffer which Godot doesn't have currently (correct me if I'm wrong), or it would requires a lot of shader/viewport/another camera trickery which kinda out of my league.

                  Gowydot *just tested and confirm it is the alpha material in front of shader issue, how to fix this?

                  I have observed a similar problem. As far as I understand, the solution is all sorts of masking and hiding it. The solution is, of course, palliative, but there doesn't seem to be any other solution yet. It could probably be a very good pull request. Along with a stencil buffer.