If you read this, and have a blog where you make posts about your work developing a roguelike, then consider submitting your blog for inclusion on Planet-RLDev.
Monday, 17 November 2014
Monday, 27 October 2014
In changes to Incursion back in August, I fixed compiler warnings related to casting. In theory, the changes should have been side-effect free. Testing of the specific lines of code, indicates this is the case. But people were reporting crashes related to the "room weights algorithm". In this case RM_Weights is an array of unsigned int, and c and tot are signed short.
tot=0; for(i=0;RM_Weights[i*2+1];i++) tot += max(0,RM_Weights[i*2+1]); c = random(tot); for(i=0;RM_Weights[i*2+1];i++) if (c < RM_Weights[i*2+1]) goto RM_Chosen; else c -= RM_Weights[i*2+1]; Fatal("Strange Error in room weights algorithm."); RM_Chosen: RType = RM_Weights[i*2]; RM_Weights[i*2+1] = -1;
I was unable to reproduce the crashes, although others reported doing so up to 15% of the time.
Were the crashes always there and were they merely hidden by all the other crashes, which have previously been fixed? Or are they caused by some unreproducible nuance of the casting? I'm guessing the former.
There's an obvious bug in the above logic. Points to whomever spots it without looking at my fixes on bitbucket.
Thursday, 9 October 2014
Opium poppies last summer. These were grown in dirt dug from the drainage ditch at the front of the house, and it was likely sprayed at some point. So I didn't bother to save any seed.
I'll scatter some more seed over the top and perhaps get a succession of poppies coming up. Maybe I'll get enough poppy seeds this year to save for cooking.