GUI State Machine, and OOO Tomorrow

Hey Folks! More GUI work today, getting the multi-GUI system working for interactable items on the ship. Yesterday, I got multiple GUIs to load, and almost switch based on user input. Today, I firmed-up that system and can now switch rapidly between them.

It was a long slog, though.

The trick turned out to be using Unity's animation state machine instead of trying to roll my own state handling code. That's what you see in today's image. The orange box is the default "centered" state for a GUI, and from there, it can flow to various off-screen states on the right or left. And the main features of either "wing" of states is whether to insta-jump off-screen or slide gradually. (Plus the reverse of each.)

There was a lot of false starting involved, and re-learning the animation system. And at one point, I almost gave up when I caught a glimpse of the mountain of work ahead. Not just with this state machine system, but GUI data retention when loaded/unloaded, making them play nice together with game data while running, and generally the complexity of the game I'm building.

Fortunately, keeping at it and taking it one step at a time eventually got it to where it is now: I can interact with a nav station, which raises the orbital nav UI. Then, I can right-arrow to swap to the docking UI, and left-arrow back again. And, in theory, I can add any number of other left/right/up/down UIs to each of those as I want, making a 2D array of UIs you can navigate with arrows.

I think the next step is to setup the docking UI with some live data, and see if I can get it to control actual ship info. That, and have it only apply when within docking range. Hopefully, back to gameplay next week!

Which brings us to the other part of the headline: I'll be out of the office tomorrow for Veteran's Day. As usual, still likely to be around in case anything catches fire. But not working. Hope everyone has a good weekend!


Marc13Bautista's picture

Ah hope you have a good Vet's day too! All this programming looks tedious and exhausting... You'll overcome it though as you did with NEOScav!

Free Elusive Skill = Athletic x4 in ATN Enclave encounter

matsy's picture

Do you plan to let your crew r CPU/AI to do the docking for you to bypass the mini game with some sort of RNG simulation? I like the odd mini game as the next person but I got bored of lock picking for the 10th time in Fallout!

That said what you've done looks great, and for the most part. It sounds like doing this is very few and between but if you had to dock with a lot of stations in quick succession or board ships I could see this becoming tedious very quickly!

dcfedor's picture

@Marc, it can be pretty overwhelming at times. There have been more than a few cases where I wasn't sure if I'd be able to finish this game. I'm still not certain. It's a beast! But it's worth trying :)

@matsy, that's something I'll have to look into once the game is running more smoothly.

Right now, I'm expecting travel times to limit the frequency of docking. Especially when compared to lockpicking in Fallout or Skyrim (which can be multiple times per minute in some places). Even for short shuttle runs between nearby asteroids, the travel times are going to be minutes-to-hours long, and interplanetary travel could be days or weeks.

But this all assumes that the travel is the fun part of the game. E.g. managing the crew morale, fixing and maintaining the ship, dealing with events, etc. If that part isn't fun, I think this game becomes a lot more like most other space trading sims out there: hurry through the travel parts to get to the "good stuff" (e.g. combat, trading, crafting)

I'm not sure I have a silver bullet to guarantee I'll nail that fun, so this is a bit nerve-wracking :)

Dan Fedor - Founder, Blue Bottle Games