;The MicroComputer. Programmed by Jude Hungerford. Work began on 17/10/2000. ;Don't copy anything from this without giving me some credit. I have taken ;ideas, but no direct code, from Zitgun. ;Last modified on 19/10/2000. Version 0.16 ;modlist- starting from version 0.08, updated when I can be bothered. ;0.07 - 0.08: ;in the routines that lock onto targets and reduce the scanarc, move the ;turret 0.8-1.8 instead of 0.5-1.5. ;0.08 - 0.09: ;make sure it starts moving again after an overheat, ;and move turret 1-2 instead of .8-1.8. The comments will be out of date. ;0.09 - 0.10 ;add more steps to the scanarc reduction routines: arc64 and arc16. ;add new scan64 and scan16 routines to handle it. ;and return ratios to 0.5-1.5 just for the new routines. ;fix up the comments. ; note- there has been some extensive rewriting for these changes, so it may ; be buggy. I'm not sure if I fixed the comments up right or not. ;0.10 - 0.11: ;0.10 Did not perform as well as 0.09, seemingly due to jumping the turret ;too far and losing the enemy. The changes should probably be kept, though. ;This version makes all the arc routines jump between 0.5 and 1.5, not 1 and ;2. Hopefully, this will fix the problem. ;Also removes the mov 12, @3, as this sight "correction" should be ;unnecessary, and in fact bad, now that the other bits are fixed. ;0.11 - 0.12: ;0.11 still seems to lose slightly to 0.09. Not quite sure what to do. ;Improving firing accuracy seems to be a good idea at this point, but I'm not ;sure that 0.11 is really better than 0.09. In principal, it is, but it's not ;performing as well as I'd like. I'll run a bigger test with 0.11 (/201 was ;close), and if it does better, work on firing accuracy. I'm not sure how, ;and if it does worse, I don't really know what to do. ;After test: They're pretty close. I'll go with 0.11, because it fixes some ;definite problems with 0.09. I imagine it's just the extra speed that makes ;0.09 work better. I'm sure this can be overcome, and it should perform ;better against other robots. ;So, I'm fiddling around with firing routines for this version, and making ;sure there are no bugs in the new code from 0.10 and 0.11. ;Also, I'm making the flip routine jump 126 degrees instead of 121, and ;adding !mshot to the beginning of the !arc8 routine- which is where I ;originally intended to put it. I don't know why I put it in arc4 at all. ;I'll leave it for the moment, and experiment with it later. ;0.12 - 0.13: ;After 0.12 modification: Well, that failed. It did worse than 0.01. I'll ;leave the firing modification in the potshot routine, but not the others. ;Clearly I'm overcompensating for them moving for close distances. ;Hm... better than 0.12. Still not beating 0.09. Most irritating. I think the ;next change I make will be to reduce the number of arc changes by one. From ;0.09 to 0.10, I added two. I think this may have been too many. It actually ;makes more sense to have 5 in total, I think. Hopefully doing that will ;make it beat 0.09. So. That's the planned change for 0.14... ;I also think I'll relocate this modlist to a separate file. That'll mean ;I'll update it less, but it's getting too big and ugly to put at the ;beginning like this. ;0.13 - 0.14: ;Okay, I'm changing the angle progression to: ;128 -> 52 -> 20 -> 8 -> 4. ;This means that I'm taking 2/5 of my previous arc each time. I started out ;taking 1/4, which was really too little, and then moved to taking 1/2, which ;was really too slow. As it happens, this progression makes more sense, b/c ;the arc is divided into 5 segments, not 4, which was what I was thinking of ;before. So, I'm taking the segment I found the enemy in, and half of the ;segment either side of that one each time I narrow the scan. This cuts it ;down to 5 possible scanarc values from 6. The 52 is a bit out, but it had to ;be an even number. Also, there was some remnant code from 0.09 here that I ;meant to get rid of, but forgot to. I'm removing it now. This change is also ;potentially very buggy, so it may need some fixing/tweaking. ;0.14 - 0.15 ;I'm reducing the weapon power and increasing the speed. I think this is good ;all-round, but particularly for big battles. Also, I've changed it so that ;it aims to be offset from its opponent by 16 degrees, instead of trying to ;head straight for it. ;0.15 - 0.16 ;That didn't seem to work too well. I'll try for an offset of 4, see if that ;works better. Ideally, I'd be moving perpendicular to my line of fire, but ;that'd probably have me running into walls the whole time. Moving according ;to my actual position is probably too time-comsuming, but I'll look into it. ;Didn't work. Remove the offset, but only turn 1/4 of the way each time ;instead of 1/2. ;Didn't work, try turning the whole way. ;I'll ditch this whole idea for the moment, b/c it's clearly not working. ;In fact, things have been going wrong ever since 0.09. Kind of. ;I'll just try another big contest to see how they're going in big battles. ;Version 0.16 will have the difference that it doesn't shoot quite so wildly, ;and it only ever fires 1 bullet at a time. Sometime, I'll try Cobra's bullet ;spray. !init #config scanner= 3 #config weapon= 2 #config armor= 2 #config engine= 4 #config heatsinks= 1 #config mines= 0 #config shield= 0 mov AX, 1 int 3 ;keepshift off. out 17, 64 ;wide scan out 18, 0 ;No overburn out 11, 100 ;Full throttle. out 22 ;lay mine nop nop nop nop nop nop out 22 ;lay mine jmp !flip ;turn radar !flip out 12, 126 ;turn radar 121 degrees. jmp !scan128 ;scan for enemies !arc128 out 17, 64 ;set radar arc to 128 degree scans (64 each way). jmp !scan128 ;and scan. !arc52 out 17, 26 ;set radar arc to 52 degree scans (26 each way). cmp @3, 0 ;is it left or right? jls !arc52l ;if left, jump to appropriate label. jgr !arc52r ;if right, jump to appropriate label. jmp !arc52e ;otherwise, end function. !arc52l cmp @3, -2 ;How far left? jgr !arc52l1 ;if 1, move radar 52 degrees left. out 12, -52 ;if 2, move radar 52+26 degrees left !arc52l1 out 12, -26 ;execute the 26 degree turn. ; out 12, @3 ;small modification to fix getting stuck. jmp !arc52e ;and end function. !arc52r cmp @3, 2 ;How far right? jls !arc52r1 ;if 1, move radar 52 degrees right. out 12, 52 ;if 2, move radar 52+26 degrees right !arc52r1 out 12, 26 ;execute the 26 degree turn. ; out 12, @3 ;small modification to fix getting stuck. jmp !arc52e ;and end function. !arc52e jmp !scan52 ;scan with new radar settings. !arc20 out 17, 10 ;set radar arc to 20 degree scans (10 each way). cmp @3, 0 ;is it left or right? jls !arc20l ;if left, jump to appropriate label. jgr !arc20r ;if right, jump to appropriate label. jmp !arc20e ;otherwise, end function. !arc20l cmp @3, -2 ;How far left? jgr !arc20l1 ;if 1, move radar 10 degrees left. out 12, -20 ;if 2, move radar 20+10 degrees left !arc20l1 out 12, -10 ;execute the 10 degree turn. ; out 12, @3 ;small modification to fix getting stuck. jmp !arc20e ;and end function. !arc20r cmp @3, 2 ;How far right? jls !arc20r1 ;if 1, move radar 10 degrees right. out 12, 20 ;if 2, move radar 20+10 degrees right !arc20r1 out 12, 10 ;execute the 10 degree turn. ; out 12, @3 ;small modification to fix getting stuck. jmp !arc20e ;and end function. !arc20e jmp !scan20 ;scan with new radar settings. !arc8 ; call !mshot ;take a shot at the object that triggered arc8. out 17, 4 ;set radar arc to 8 degree scans (4 each way). cmp @3, 0 ;is it left or right? jls !arc8l ;if left, jump to appropriate label. jgr !arc8r ;if right, jump to appropriate label. jmp !arc8e ;otherwise, end function. !arc8l cmp @3, -2 ;How far left? jgr !arc8l1 ;if 1, move radar 4 degrees left. out 12, -8 ;if 2, move radar 8+4 degrees left !arc8l1 out 12, -8 ;execute the 4 degree turn. ; out 12, @3 ;small modification to fix getting stuck. jmp !arc8e ;and end function. !arc8r cmp @3, 2 ;How far right? jls !arc8r1 ;if 1, move radar 4 degrees right. out 12, 8 ;if 2, move radar 8+4 degrees right !arc8r1 out 12, 4 ;execute the 4 degree turn ; out 12, @3 ;small modification to fix getting stuck. jmp !arc8e ;and end function. !arc8e jmp !scan8 ;and scan. !arc4 call !mshot ;take a shot at the object that triggered arc4. out 17, 2 ;set radar arc to 4 degree scans (2 each way). cmp @3, 0 ;is it left or right? jls !arc4l ;if left, jump to appropriate label. jgr !arc4r ;if right, jump to appropriate label. jmp !arc4e ;otherwise, end function. !arc4l cmp @3, -2 ;How far left? jgr !arc4l1 ;if 1, move radar 2 degrees left. out 12, -4 ;if 2, move radar 4+2 degrees left !arc4l1 out 12, -2 ;execute the 2 degree turn. jmp !arc4e ;and end function. !arc4r cmp @3, 2 ;How far right? jls !arc4r1 ;if 1, move radar 2 degrees right. out 12, 4 ;if 2, move radar 4+2 degrees right !arc4r1 out 12, 2 ;execute the 2 degree turn jmp !arc4e ;and end function. !arc4e jmp !scan4 ;and scan. !scan128 in 7, EX ;scan cmp EX, 1500 ;anyone there? jls !arc52 ;if yes, narrow the scan. call !steer ;else, check steering- jmp !flip ;and continue scanning. !scan52 in 7, EX ;scan cmp EX, 1500 ;anyone there? jls !arc20 ;if yes, narrow the scan. out 17, 64 ;else, increa