Jan. 12th, 2021

Work Post

Jan. 12th, 2021 07:17 am
relee: Picture of Relee Starbreeze, Wizard (Default)
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.

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

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 24th, 2025 10:06 pm
Powered by Dreamwidth Studios