archive by month
Skip to content

bugs that do not go quietly

I recently fixed 2 bugs that then turned around and bit me.

I fixed a bug that caused Steamhammer to make double queen’s nests in around 1 game out of 150. It was a simple missing condition. But I made a typo in the fix: Parentheses in a function call swallowed up the next condition in the if. In any safe language it would have failed to typecheck, but in any case, the result was that Steamhammer made 3 or more queen’s nests in every game. I think C++ was laughing at me—”Nyah nyah! I’m too sharp a knife for you!”

I also tracked down and fixed the last known crashing bug, a subtle oversight in the strategy boss that causes crashes in around 1% of games. I brought up a game for a first test of the fix and... crash! Somehow I replaced a rare crash with a frequent crash, and even though I only touched a little code, I haven’t found it yet.

Well, it probably won’t take long—though who knows? After that I have 2 other critical bugs, and then 1.2.1 will be ready.

By the way, Steamhammer does suffer from one other crash besides the “last known” crashing bug. In rare cases, it crashes on startup. But the crash happens before any Steamhammer code executes, so there’s not much I can do about it without taking a long detour.

Trackbacks

No Trackbacks

Comments

MicroDK on :

When Microwave is under attack and its drones in natural gets killed, it decide to nominee the drones in main as kamikaze drones. They transfer from main to natural only to get killed. Does or did Steamhammer have the same bug?

Jay Scott on :

When mining gas, Steamhammer will transfer drones to replace gas drones which are lost. When a base is under attack, it may keep sending drones 3 at a time until it runs so short that it stops mining gas to get the cash to rebuild them. It doesn’t transfer mineral drones.

Jay Scott on :

Hmm. Older versions also had an “it’s an emergency, send all drones to fight!” behavior which was not helpful. In recent versions there’s a bug which causes drones at all bases to cower in fear, not as bad but also unhelpful.

MicroDK on :

I think I found out what happens. Its the "workers defend rush" option in config. I had set it to true and messed up the code in CombatCommander::findClosestDefender() so the workers would defend against all races. ;)

LetaBot on :

What IDE do you use? IIRC in Visual Studios you can set different warning levels

Jay Scott on :

As I predicted, the bug did not take long to fix. The other 2 are tougher.

Jay Scott on :

Oh, now I realize that you were talking about the type non-error. I probably should try out the different warning options, yes, good idea.

krasi0 on :

Any luck with those?

MicroDK on :

Not really a bug, but an enhancement... will SHs units retreat to the main instead of the natural, if your natural exists? When MW is in defense, its units will retreat to the main and enemy units get free access to the natural even if it has sunkens in natural. This often lead to loss of sunkens, which might have been avoided if the units were fighting with the sunkens in natural.

Jay Scott on :

The feature is on my list. Sometime soon-ish I’ll retreat to the natural if it exists. Later I’ll do a map topology analysis to find common chokes.

Jay Scott on :

Aaaaand it was so easy that I just threw it into Steamhammer 1.2.1, without much of a test. Just a couple lines of code, ahem, “what could go wrong?”

MicroDK on :

Where did you put those couple of lines? ;)

Jay Scott on :

In UAB-speak, retreating is called “regrouping”. The position is calculated in Squad::calcRegroupPosition()

MicroDK on :

Thanks! I was looking for it in CombatCommander where the squads are initialized.

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.