Posted October 11, 2023 by ferniss
#quests #saves #engines #logo
I’m aiming to make a casual, 2D game. I downloaded multiple engines like Unity, Godot and Unreal. I was overwhelmed by the IDEs. They had more bells and whistle’s than I needed. I’m still learning the basics of Game Dev.
I chose Defold because the IDE reminded me of VS Code. It uses Lua and I’m used to scripting languages. I find it easy to see the 1-1 effect each feature has on the code.
Here’s some of their press that says what I’m trying to say:
The design philosophy is to provide developers with low level building blocks that can be used to create just about anything. But they are just that, low level, which means you have to do a bit more work yourself. On the other hand you are in full control of what you create. Two examples to show what we mean:
- If you need a button you can create one using our GUI system, but there is no ready made button component. You create a button from a box node with a nested text node.
- If you need a spaceship that can shoot bullets you create one from a game object (the basic building block of Defold games) to which you attach components. A sprite component for visuals, a factory component to spawn bullets and a script component for the logic.
I made some rules for myself around the structuring of world state and saving it.
I took the menu and quick menu GUI elements and code from MatchaNovel and added them to the Beeline GUI folder. I took the save and settings scripts and added them to my states folder. Save data is created in app support and is read by my save menu. I tested loading the data, and it takes me to the correct level, with the correct NPCs and data.
I added a new Game button to the main menu. I bound the escape key to the menu for navigating back and forth from from the game. Added an argument when loading levels that will flag whether the level is loading a new game, returning to game from menu, or loading the next turn of the game.
I found a old comment form myself in the code that said “Start Here”. There’s some logic where one of the NPCs will confront you if you try to steal form a luggage prop. There are a few skill checks and failure consequences that contains some hard-coded parts.
Here’s an example of my pre-existing logs that helped refresh my memory.
DEBUG:SCRIPT: max,min 0.7637939453125 0.4588623046875
DEBUG:SCRIPT: game.states.player.skills.stealth < npc.skills.perception 9 9
DEBUG:SCRIPT: game.states.player.skills.stealth < npc.skills.stealth 9 9
DEBUG:SCRIPT: skill pass- max * 10 7.637939453125
DEBUG:SCRIPT: Seen skill pass
DEBUG:SCRIPT: !!!SEEN!!!
DEBUG:SCRIPT: max,min 0.6236572265625 0.17459106445313
DEBUG:SCRIPT: npc.binaries.passive_aggressive > .4 or npc.binaries.lawless_lawful 0.4 -0.4
DEBUG:SCRIPT: game.states.player.skills.speed < npc.skills.speed 5 1
DEBUG:SCRIPT: game.states.player.skills.speed < npc.skills.constitution 5 5
DEBUG:SCRIPT: (npc.skills.speed + npc.skills.constitution)/1.5 4
DEBUG:SCRIPT: skill pass- max * 10 6.236572265625
DEBUG:SCRIPT: tell authority
Basically, when the player tried to open their luggage they may be witnessed by an npc. If seen, the player has a chance to be confronted by the NPC which will open a novel sequence. If not confronted, a consolation that does nothing but return a string, will eventually trigger something like quests, positive / negative effects, etc…
I have a rough alert system similar to GTA. If the player fails specific checks with NPCs their alert level is raised. Needs to be integrated into the game with relation to security NPCs and rooms.