Work Post

Nov. 30th, 2017 08:09 am
relee: Picture of Relee Starbreeze, Wizard (Default)
[personal profile] relee
8:09am - Now I'm at the McDonalds. Got food incoming and lots of work to do.

8:21am - They appologized for the wait but my food actually got here pretty quick. It was good, too! I feel better prepared to take on the day.

So, on the way over here I thought about the player first problem, and I think the best way to handle it is to have the list get initialized on scene changes and on that point search for the player, and put them first if there is one.

8:45am - Okay I've got that set up now, at least the TurnOrder part.

On Initialization it checks for a player and if there is one it sticks it in the List first. Now I just need to make sure the list is Initialized after the player and other mobs have been put in the scene but before they add themselves to the list. So, in other words, the initialization has to happen in the Awake phase and the list adds in the Start phase.

So besides this TurnOrder class/object, I need some sort of game state manager. Something to say "Hey, we're starting the game now." and "Hey we're loading a new level now." and "Hey we're looking at the menu now."

Hmm... Are those the only states? There should be one for the main menu and the in-game menu and three for the game; initialize, play, and next level.

Alright then, where will this game state manager live? I don't want to make any singleton managers if I can avoid it. It seems like it has to persist between scenes also, so I guess I should put it in a ScriptableObject.

I guess that'll work. It's mostly a data class, and the game objects will be telling it to switch and checking its state rather than it telling them what to do...

Alright.

9:31am - After looking at the State pattern and considering my design and use I'm thinking the GameState object won't even be an implementation of the State pattern. It's just a data class to keep track of what state the game is in.

9:45am - Okay, that's in. Now, I'll need a script somewhere in the scene to start everything off with the loading. I don't want to depend on starting at the main menu to load things. So, when the scene changes it should change the state and initialize the turnlist. I think I'll put it on the Camera since there's always a Camera in the scene.

10:01am - Alright, I've got the SceneInitializer created and put on the Main Camera.

I've also been here for two hours, so I'm going to take a break.

10:34am - Okay I guess that's enough messing around. Back to work!

What else do I need? I know I still need my tile grid, and my mobiles, and my loot.

I suppose I need a level generator and some premade levels too. That's going to be an ordeal.

I guess I could make my tile grid next. I do need to have someplace for my little computer people to live.

How to make it though?

I'm thinking of making it a grid of gameobjects inside a gameobject. So, there'll be components on the tiles to test for blocking and locking, and I expect I'll put data in there for pathfinding too.

Each tile will be an empty GameObject with a pair of Sprite GameObjects inside of it. Background and Foreground sprites. The main GameObject will keep track of everything though.

On the main tile GameObject we'll have a TileSprites component that holds references to the two sprites inside of it, a TileBlocking component that has a state for if the tile is a blocking tile like a wall, a TileLocked component that has a state for if the tile is locked or not and a reference to the GameObject/Mobile that's occupying it, a TileContents component that's got a list of the items/treasures/objects in the tile, and a TileCost component that holds the pathfinding cost of the tile.

I'll have to make each of those components. ^.^;;

12:00pm - Well I've done the TileSprites, TileBlocking, and TileLocked components, but now it's lunch time so I'mma eat.

12:51pm - Eating went well. Had a couple of promotional items. The fancy fries weren't very good compared to their usual fries, but the maple cheddar chicken sandwich was quite good.

1:47pm - I got all of the tile classes coded, most of them were just public properties to begin with. But then I got super distracted by my Job Developer and she convinced me to apply for a couple of jobs. That was a surprise.

Now it's almost two, the rain is calming down, and I'm getting crazy tired and my butt is sore so I'm gonna head home.

Next time, on RELEE SQUIRREL XL! I make the frickin' Tile Grid!

Until then, so long!

Profile

relee: Picture of Relee Starbreeze, Wizard (Default)
Relee Squirrel

July 2023

S M T W T F S
      1
23456 78
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 28th, 2025 06:01 am
Powered by Dreamwidth Studios