2:39pm - Good Friday and I'm down at the McDonalds working on my projects. Well, I'm just no good at holidays I guess.
The first thing I'm going to try and do today is make the whole system where the PlayerBrain interfaces with the MobileController. Okay maybe that's a little too broad and vague...
I have a bit of trouble with the PlayerBrain in that since it's not a component it can't have an eventlistener from my event system catching events for it. So it can't interface with my nice new event system.
I still have the problem of routing input between the player in the scene and any menus the player opens up. I don't want the player moving when they try to select another menu item for example. I've been thinking of putting a GameState scriptable object in the game and the input only works for one or the other depending on the GameState.
At any rate that'll probably come in the future. First I want to make the PlayerBrain work.
Now, how do I get the player's input into the brain? Input Events aren't receieved by ScriptableObjects.
If I put input controls in the MobileController then every Mobile will have them and not need them unless the player takes them over, in which case they would need them... Huh... Maybe that will work?
The essential way that the brain works in this turn-based game is that the MobileController is told that it is it's turn by the TurnList, and then it runs the Think method of its brain, and the brain formulates that mobile's action that turn and runs the various methods on MobileController to enact that action, then it tells the TurnList to move onto the next turn.
The player brain has to work in a much different way, because it has to wait for player input, but it also has to work in the same way as the other brains, so that they're interchangeable.
Hmm... If I intercept the signal from the TurnList in the MobileController, I can react to it differently depending on the type of the brain. If it's a normal brain, then just run the think command normally... Hmm... But if it's a PlayerBrain, then it has to get input somehow.
One thing I could do is make the think run on the update event instead of just straight out. And keep a log of the last input the player put in, and if the player has put in an input since the last update, it accepts that command and runs it, and ends the players turn if the player is out of energy.
Hmm...
That works for basic movement input, I guess, but what about more advanced input? Like, open a menu, or shoot a ranged weapon, or look at a thing?
I'm starting to think this whole thing is falling apart.
Also frustratingly...
3:35pm - It's three thirty five and a ton of people just came into the McDonalds, and there's a couple families with small children in the area I usually like to work in, so I'm very distracted. So much for coming out to the McDonalds to work and focus... But it's a holiday so there isn't really anywhere else to go. That's probably why all these people are here too. The nice restaurants and such are closed.
3:52pm - Those families left but I'm feeling really lost and messed up now. I'm not sure how to solve the issues with my game right now. I'm also second guessing myself with regards to building it in Unity.
I keep telling myself, if I put it together in anything else I'd have to do a lot more work, not just the things I've already done, over again, but also the things Unity does for me.
But there's a lot of open source stuff out there for helping with RogueLikes.
It's not abnormal for a game to be rebuilt several times in the early stages. I've been working for months on and off but it's my first Roguelike and a lot of the things I did I didn't know how to do before.
Ahh well. I'm not sure what else I can do now. My mind's all confused.
4:32pm - Okay so I ended up deciding to put my Unity WoT on hold and try out the RogueSharp tutorial. We'll see how and where that goes as I work through it.
Unfortunately for me another, bigger, noisier family has moved into my nook. Alas.
5:38pm - Going along with that RogueSharp tutorial. It's been interesting so far. It's mostly just setting things up for the first few chapters.
7:01pm - Some guy sat down at my table so he could use the power outlet too. I said it was okay but it really wasn't, so I packed up and came home. Now I'm back at my apartment and I'm going to follow along with that tutorial some more.
10:38pm - I followed to the end of the tutorial I was on then laid down for a nap until now, and now is Pathfinder time. My Pathfinder buddies read these journals so I probably shouldn't work on my coding stuff while we play...
The first thing I'm going to try and do today is make the whole system where the PlayerBrain interfaces with the MobileController. Okay maybe that's a little too broad and vague...
I have a bit of trouble with the PlayerBrain in that since it's not a component it can't have an eventlistener from my event system catching events for it. So it can't interface with my nice new event system.
I still have the problem of routing input between the player in the scene and any menus the player opens up. I don't want the player moving when they try to select another menu item for example. I've been thinking of putting a GameState scriptable object in the game and the input only works for one or the other depending on the GameState.
At any rate that'll probably come in the future. First I want to make the PlayerBrain work.
Now, how do I get the player's input into the brain? Input Events aren't receieved by ScriptableObjects.
If I put input controls in the MobileController then every Mobile will have them and not need them unless the player takes them over, in which case they would need them... Huh... Maybe that will work?
The essential way that the brain works in this turn-based game is that the MobileController is told that it is it's turn by the TurnList, and then it runs the Think method of its brain, and the brain formulates that mobile's action that turn and runs the various methods on MobileController to enact that action, then it tells the TurnList to move onto the next turn.
The player brain has to work in a much different way, because it has to wait for player input, but it also has to work in the same way as the other brains, so that they're interchangeable.
Hmm... If I intercept the signal from the TurnList in the MobileController, I can react to it differently depending on the type of the brain. If it's a normal brain, then just run the think command normally... Hmm... But if it's a PlayerBrain, then it has to get input somehow.
One thing I could do is make the think run on the update event instead of just straight out. And keep a log of the last input the player put in, and if the player has put in an input since the last update, it accepts that command and runs it, and ends the players turn if the player is out of energy.
Hmm...
That works for basic movement input, I guess, but what about more advanced input? Like, open a menu, or shoot a ranged weapon, or look at a thing?
I'm starting to think this whole thing is falling apart.
Also frustratingly...
3:35pm - It's three thirty five and a ton of people just came into the McDonalds, and there's a couple families with small children in the area I usually like to work in, so I'm very distracted. So much for coming out to the McDonalds to work and focus... But it's a holiday so there isn't really anywhere else to go. That's probably why all these people are here too. The nice restaurants and such are closed.
3:52pm - Those families left but I'm feeling really lost and messed up now. I'm not sure how to solve the issues with my game right now. I'm also second guessing myself with regards to building it in Unity.
I keep telling myself, if I put it together in anything else I'd have to do a lot more work, not just the things I've already done, over again, but also the things Unity does for me.
But there's a lot of open source stuff out there for helping with RogueLikes.
It's not abnormal for a game to be rebuilt several times in the early stages. I've been working for months on and off but it's my first Roguelike and a lot of the things I did I didn't know how to do before.
Ahh well. I'm not sure what else I can do now. My mind's all confused.
4:32pm - Okay so I ended up deciding to put my Unity WoT on hold and try out the RogueSharp tutorial. We'll see how and where that goes as I work through it.
Unfortunately for me another, bigger, noisier family has moved into my nook. Alas.
5:38pm - Going along with that RogueSharp tutorial. It's been interesting so far. It's mostly just setting things up for the first few chapters.
7:01pm - Some guy sat down at my table so he could use the power outlet too. I said it was okay but it really wasn't, so I packed up and came home. Now I'm back at my apartment and I'm going to follow along with that tutorial some more.
10:38pm - I followed to the end of the tutorial I was on then laid down for a nap until now, and now is Pathfinder time. My Pathfinder buddies read these journals so I probably shouldn't work on my coding stuff while we play...