Getting Started with Rewriting My Bot
Why I Started to Rewrite
I began playing Screeps in August 2022, so it’s been about 2 years now. During this time, I’ve primarily focused on developing my own bot, which has been an immensely enjoyable experience. If you’re interested, you can see how my bot operates on my YouTube channel or check out its GitHub repository. However, recently, I’ve felt compelled to completely rewrite my bot.
The previous structures have grown overly complex, making it challenging to incorporate new features or tweak existing ones. Consequently, I’ve concluded that a complete overhaul of my bot is necessary.
My Goals
I dedicated several weeks to contemplating the objectives I wish to achieve through this rewrite. The knowledgeable players in the Screeps Discord channel provided invaluable guidance; it truly is an exceptional community. Here are the outcomes of my deliberations: the goals I aim to accomplish with this rewrite.
- Establish a structure that facilitates the addition of new features and the modification of existing ones.
- Adopt a top-down approach: create objects that oversee each mission, handling the requisition of necessary creeps and managing their behavior. I aim to avoid allowing creeps to operate autonomously.
- Preserve the economic functionality of my current bot with minimal alterations, as its current state boasts a robust economy.
- Revamp the room defense and remote conflict features, as they are outdated, inefficient, and excessively CPU-intensive.
- Refine the Quad and Duo code. Although functional, their complexity impedes scalability to larger combat scenarios. I aspire to simplify and enhance their usability.
- Implement effective CPU management by meticulously profiling each mission.
- Optimize spawn times by dynamically spawning creeps or repurposing idle ones.
So, let’s delve into it in the next post!