archive by month
Skip to content

Steamhammer’s new Micro class

Yesterday I changed Steamhammer’s Micro namespace into a class. Instead of Micro::Move(unit, position) or whatever, I write the.micro.Move(unit, position) (because I didn’t update the capitalization, at least not yet). The technical difference is that the class can remember state.

It is part of the process of rewiring Steamhammer with goals and goal monitoring throughout. Micro::Move(unit, position) is a command for the unit to move to a position. the.micro.Move(unit, position) will be, once I’ve finished the implementation, giving the unit a goal to move to a position. My immediate purpose is to make Micro unstick stuck units—this way hides the details from the rest of the code. Eventually, with its knowledge of what each unit is trying to do, Micro might take on many other jobs: Find paths, follow specified paths, evade enemies on the way, coordinate kiting units, and in general notice and work around all kinds of unit level goal failures, or notify the rest of the program if the failure cannot be worked around (“you can’t get there, a pylon wall is in the way”).

I’m not sure what jobs I’ll end up actually assigning to Micro. At a minimum, it will have the lowest-level unit control stuff. Path following seems likely; because implementing it this way looks clean and simple.

One step at a time!

Trackbacks

No Trackbacks

Comments

No comments

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Form options

Submitted comments will be subject to moderation before being displayed.