7:17am - Things have flipped, instead of being up all night and going to bed in the morning, I'm getting up in the morning and missing my friends at night.
Oh well, life goes on I suppose. I'll flip it again eventually.
For now I'm going to try and isolate the command pattern in a way I can reuse in my own Godot projects.
7:30am - It looks like the GDQuest Command Pattern example is tightly bound to the class it runs the commands on. I wonder if that is neccesary for the pattern?
7:45am - I looked it up and there are two big examples in Game Programming Patterns, one which is abstract and one which is tightly bound. They're used for different things. In my case I'm going to want to use the abstract one.
So, I'm going to make something in Godot now.
I'll start with a 2D World node, and that will have a command stack. The UI or AI will operate the game by adding to the command stack, and the world will take commands off the stack and execute them in order to move things around.
I think there will have to be an Update or End_Of_Turn command that pauses until the next frame passes, to show the progress, otherwise everything will either stand still or be simultaneous and over instantly.
So to move a unit, you'd add something like a Move(unit, location) command, followed by an End_Of_Turn() command. To move a group, you'd do a bunch of Move commands instead.
8:09am - I finally remembered the other thing I was hoping to do soon. I might close this up and work on that instead, but I want to try a little more first.
8:37am - Well I at least got that Command base class written, tiny as it is. I'll have to work on this more another time. I'm too distracted now and I want to work on the other thing.
Oh well, life goes on I suppose. I'll flip it again eventually.
For now I'm going to try and isolate the command pattern in a way I can reuse in my own Godot projects.
7:30am - It looks like the GDQuest Command Pattern example is tightly bound to the class it runs the commands on. I wonder if that is neccesary for the pattern?
7:45am - I looked it up and there are two big examples in Game Programming Patterns, one which is abstract and one which is tightly bound. They're used for different things. In my case I'm going to want to use the abstract one.
So, I'm going to make something in Godot now.
I'll start with a 2D World node, and that will have a command stack. The UI or AI will operate the game by adding to the command stack, and the world will take commands off the stack and execute them in order to move things around.
I think there will have to be an Update or End_Of_Turn command that pauses until the next frame passes, to show the progress, otherwise everything will either stand still or be simultaneous and over instantly.
So to move a unit, you'd add something like a Move(unit, location) command, followed by an End_Of_Turn() command. To move a group, you'd do a bunch of Move commands instead.
8:09am - I finally remembered the other thing I was hoping to do soon. I might close this up and work on that instead, but I want to try a little more first.
8:37am - Well I at least got that Command base class written, tiny as it is. I'll have to work on this more another time. I'm too distracted now and I want to work on the other thing.