Protobound: Day One
Right now I am updating Arch, installing the new Linux kernel and eating breakfast. Soon, it begins.
Had some hiccups in the updates, seems to be on track now. We'll see after the reboot. Could lose a day here if it goes wrong and I have to reinstall the OS. Reinstalling would be quicker than troubleshooting at this point and I have a lot to do so I would like to get started as soon as I can here.
Hold onto ya butts, here comes the REBOOT!
Now to make sure the FS is still intact. It is. We're good to carry on.
I've installed Clion and am currently debating upgrading my license to all products to get Goland, RubyMine (I still like Ruby. It's slow but I really just kinda like the way it looks syntactically.) and more importantly better Django support for PyCharm. I'll wait til all the bills are paid and think about it again then. A recurring payment of over 20 bucks a month might not be a lot to some people but that could have a really bad snowball effect on my current financial situation.
Anyway, I think I got everything sorted, just gonna make a cup of tea and get started.
Went to make tea, UPS showed up with some PETG filament so I had to quarantine the package and now I am all scrubbed up and ready to get to work. First step, Game State Singleton. A lot of stuff depends on this so I should have it done first. NPCs and Monsters as well as the player input handling depend on it.
# The Game State machine.
# Controls the overall game state.
#KISS
enum STATE {
MENU,
EXPLORING,
CONVERSATION,
CUTSCENE,
BATTLE
}
var current_state = STATE.MENU
var state_history = []
func change_state(new_state):
add_last_state_to_history(current_state)
match new_state:
STATE.EXPLORING:
# All states should be able to transfer into exploring.
current_state == STATE.EXPLORING
STATE.MENU:
#Should not be able to open menu from
#cutscene, conversation, or battle.
# Hitting the button to open the menu
# Again when in menu will go back to explore.
if current_state != STATE.CONVERSATION and \
current_state != STATE.CUTSCENE and \
current_state != STATE.BATTLE:
current_state = STATE.MENU
STATE.CONVERSATION:
# There should be no situation to start a conversation
# Outside of the Explore, but let's be explicit anyway.
if current_state == STATE.EXPLORING:
current_state = STATE.CONVERSATION
STATE.CUTSCENE:
#Should be accessible from Conversation or Exploring.
if current_state == STATE.EXPLORING or \
current_state == STATE.CONVERSATION:
current_state = STATE.CUTSCENE
STATE.BATTLE:
#Should be accessible from Conversation or Exploration.
if current_state == STATE.EXPLORING or \
current_state == STATE.CONVERSATION:
current_state = STATE.BATTLE
func add_last_state_to_history(state):
# Manage the state history.
if len(state_history) > 10:
state_history.pop_back()
state_history.push_front(state)
func roll_back_state():
# Roll back to last state in history.
change_state(state_history.pop_front())
Simplicity is important. There are only a handful of states the game would need. So in my humble opinion I shouldn't overcomplicate the state management.
I had planned for this to take 2 pomodoro blocks. I managed to do it in half of one. Godot, you spoil me.
Up next, I need to gather some resources off Itch.io for building the test environment, probably a house. I think the main character is going to be a reflection of myself as a kid, exploring the city I lived in, breaking into abandoned buildings to see what was in them(sometimes in search of monsters, as you do). So we'll start in a bed room, as most of my adventures did.
Going to do this on my lunch break, seeing as it's noon now. Just so happens a video kinda perfect for putting me in the right headspace was uploaded on youtube by a creator I like. So while I eat my can of mandarin oranges and watch this on monitor 1, I will be locating some assets I can use on monitor 2. My budget is like... 20 bucks for this so... yeah. This should be interesting.
Found me a few tilesets and characters from GuttyKreum as well as LimeZu and might use some stuff from FinalBossBlues who I support on Patreon. So the game might have some Japanese Flavor to it, which is fine by me. The reas question is how I will blend 16x16 with 32x32. I have some ideas and it might just come down to doing some recoloring with a unified palette but that will be more in the polish phase.
Now I will take my dog out and then come back and get started assembling a bedroom/house map and create a character.
Now that I have a state management pattern for Game state and Player state I can use it as a guide for all state management going forward, one issue closed. Now on to the next.
Player state management seems to be functional as well as game state. Now to set up the animations, which will read the player's current state and play whatever animation is required for state.
I think I would do well to remember to "Only complicate as you need to." and start out with the simplest implementation, then iterate as I need changes to add complexity. This will probably speed up my dev time.
Now working on the animation for the player and updating it based on state. Had to use an AnimatedSprite with an AnimationPlayer because of the way the sprites I chose are setup. I could have edited the sprite into a sprite-sheet but that would have taken longer.
Realized I could remove the AnimationPlayer and rely on the AnimatedSprite to handle it, there is no need for the advanced features of the AnimationPlayer. I'll need it for the combat system, but not here.
I decided to use the velocity to check for Idle state transition. If velocity == (0,0) then there is no movement input. This will work with how I hopefully intend to control the NPCs and Enemies moving around, so... yeah. Hit the long break block on my Pomodoro so I am gonna go stretch, make some more tea and pet my dog.
Now on to the next thing... a small map to test on. Right after my mouth stops burning what the hell was I thinking drinking something that fucking hot? Damn idiot.
Alright, I have a floor. That's a start. I need to create walls and various decor items and add collisions, though. Debating putting in a backyard but we'll see.
Really seem to be stuck on making my tilesets work. A bit frustrating, really. I can't say I am a fan of the tileset editor in Godot, or the map editor really. I would prefer to use Tiled if I could, though importing from Tiled seems to be out of reach. One tileset had scale all over the damn place, with beds being smaller than the PC but Skateboards being the same size. This doesn't have to be perfect but geez...
Well, enough bitchin' gotta make it work.
Well, sort of. I need to bang on it some more and yell at it a bit until it starts to make sense. I'm
Welp, doesn't have any collision yet, but it's a start.
It's 5pm now and I should probably push my changes and go make some dinner.
Cheers