|
Hi dear people of TL forums,
A while ago, I started working on Brood War bot development. During this endeavor, I decided to write a book about it - and one of the chapters of this will be dissecting the code of StarCraft itself. This is quite an undertaking, but I'm making progress with it. Don't let the title "Brood War API" fool you, if you're a gamer, you might still find it interesting!
Here are the posts I have so far. I plan to post updates in this forum in the future, as I publish the episodes: (Last update: 2019-11-14)
Brood War API – The Comprehensive Guide (of time and space) Brood War API – The Comprehensive Guide – Distances, high ground, and unit behavior Brood War API – The Comprehensive Guide – Unit movement, and worker behavior Brood War API – The Comprehensive Guide: Creating buildings, and everything about the creep Brood War API – The Comprehensive Guide: Buildings, and placement Brood War API – The Comprehensive Guide: Movement modifiers, and Terran units Brood War API – The Comprehensive Guide: Terran units continued, and some Zerg ones
Feel free to ask questions, point out mistakes/typos! I have a pretty good plan how I want to proceed with the topics within the book, and I'd like to publish updates at least weekly.
Enjoy! Sonko
|
Nice work! I had a skim through it and even that taught me some things. A question though, what is the deal with detectors and moving? I wasn't aware that moving had any effect on a detector's ability to detect? Or is this just about its "detection region" only being updated every so often, ala sight?
|
Northern Ireland24272 Posts
Ah great, been looking for some light reading material!
Joking aside this is pretty cool, look forward to having a proper look later today.
|
Thanks for the feedback!
. A question though, what is the deal with detectors and moving? I wasn't aware that moving had any effect on a detector's ability to detect?
I don't really get your question here Can you maybe quote the part that implies that?
|
[quote=Sonko]Detector: If the unit is immobile, it can detect cloaked units within its sight range. If it’ mobile, it’s not constant. Blinded, incomplete, or disabled units cannot detect, and neither do hallucinations.[/quote] This was the text that I wasn't sure about. "If it's mobile, it's not constant".
I thought that meant moving units versus stopped units, but I'm guessing the distinction is between say, a missile turret and a science vessel? And you just mean that the region detected is not constant for a moving unit?
(which of course makes perfect sense)
|
Yes, you're correct Maybe I'll rephrase that to be more clear.
|
How did you get the SC source code?
|
The short answer is I didn't I use openBW, a decompiled source - see the first article
|
Wow this is really interesting stuff... thanks for sharing! The coding is crazy lol
|
|
Hero defiler (Unclean One) also has a different collision box than a regular Defiler.
For presenting tile/subtile grids you should better use screenshots from SCMDraft with walkability flag overlay.
People less versed in the OpenBW code, or coding in general, would probably like it if you would explain variable types and other definitions a bit.
The switching into additional terrain flags (cover, terrain level) also comes a bit sudden. You probably should write a more elaborate introduction to terrain flags first (you brush on all of it a bit, but I don't think it is very comprendable without prior knowledge).
The relationship between walkability and buildability is actually… a bit complicated… (Partially) unwalkable, but buildable tiles have some very interesting and useful effects.
|
Very interesting keep up the good work!
|
Does APM / speed of hand / latency / ping affect how units work / attack / move or is that all in my head?
|
"Does APM / speed of hand / latency / ping affect how units work / attack / move or is that all in my head?"
Latency is something you have to compensate for at some point, if you develop an AI. Other than that, they do, but not in the code
|
|
I know close to nothing about coding but this is super interesting! Thanks for sharing
|
You're welcome Also, if you want to get into programming, this is a great project. Many students have walked that path before
|
Thanks everyone for the feedback! I corrected a few minor things, and rephrased stuff. I plan to release the next article soon!
|
Really enjoyed your series on molesting crabs and such, looking forward to your newest deep dive!
|
And the next part is here. It's a little all over the place, I extended and revised some of the earlier parts, and added stuff here. Anyway, it's about movement modifiers, and code behind Terran units.
Read it here!
|
|
|
|