SteveB Posted March 19 Share Posted March 19 (edited) 13 hours ago, Vorticon said: Second match: Retrodroid versus SteveB A faster paced match for sure! Retrodroid versus SteveB.mp4 395.89 MB · 1 download Tomorrow: the competition FINALE Tursi versus Retrodroid Congratulation Retrodroid! I did not anticipate that the enemy would "sit and fire" even if I am not in range ... that confused my control three out of five times .. Much of my code did not even run for this wrong assumption, let me drive directly in front of your cannon. And what happened at 3:2 ... my tank just cycling in the left upper corner .. I don't know. I had this twice in testing but could not figure out, what goes wrong there. I had the picture of an armed roach .. how would it get along with limited knowledge of the surrounding and just some basic instincts? My control has three states: Immediate: Enemy is in range and it is shoot, turn or evasion Intercept: Enemy has been seen and needs to be intercepted somehow. I project the current course for up to ten moves, not expect the enemy to stop and "wait", my biggest mistake. Cruise: Patrol the field by constructing a path in a string to follow, until the enemy comes into sight. I use the string as well to plan an interception for the time I turn and lose sight of the enemy for a maneuver. I am fine with @Vorticon publishing my code for other to see ... even though it turned a little ugly while I progressed and learned, because I didn't rewrite older code when introducing new subroutines. Starting anew would produce cleaner code without any doubt. Edited March 19 by SteveB 4 2 Quote Link to comment Share on other sites More sharing options...
retrodroid Posted March 19 Share Posted March 19 (edited) My approach consisted of 3 basic goals: 1. Find the battle - it's sad to watch two tanks twirl around in opposite corners until the turns run out, so I wanted to try and make sure that I made myself "available for action". To that end, my tank will initially drive to the closest corner and turn in to the middle of the PF from there, all the while in a lane that should be highly visible to another tank on the same side (top/bottom) of the PF as I. Once I hit the middle of pf I turn once again and drive straight into the middle section of the pf. From there, I do circle around the middle, the length of each sprint growing every other turn between 2-4 moves. This allows my tank to "explore" a larger area faster if no contact occurs with the opposition tank. If the other tank is detected, I continue to move directly toward them for as long as I can "see" them. If I lose sight of them again during this manoeuvre, I continue where I left off. 2. Get as close as you dare, then wait for them to make a mistake. Once I'm within a couple of moves of being potentially in range of the enemy, I'll "stop" in place for several turns by shooting my gun just to consume a turn, but it's also to intimidate the enemy! . If heading directly toward the enemy on the same axis, the idea is to close just out side of firing range and skip a few turns to see if they keep moving, thus giving me the ambush advantage. This looks really cool when it works, and looks really dumb when it doesn't. If off axis (but within 8 spaces) I'll stop and turn toward a couple of moves before we intersect, again waiting for them to cross across in front of me. If I have enough spaces in front of me, I'll alternate shooting in place and moving forward one square, so the enemy sees me getting closer (and to avoid the non-movement penalty). 3. Don't move in front of their gun. I try to not move forward if there's any chance I could put myself in harms way. This works pretty well if I can "see" the enemy, but there's nothing to be done if I can't. One surprising aspect of my tank's programming is that I do zero obstacle collision detection at all. I found I just didn't need it. By programming a fixed path at the start of battle, when I do run into an obstacle, my tank turns soon enough and it usually works out okay. This has been a fun exercise, thanks to @Vorticon for hosting and @SteveB, @Switch1995 and @Tursi for competing! Edited March 19 by retrodroid Spelling 6 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted March 19 Share Posted March 19 27 minutes ago, retrodroid said: One surprising aspect of my tank's programming is that I do zero obstacle collision detection at all. I found I just didn't need it. By programming a fixed path at the start of battle, when I do run into an obstacle, my tank turns soon enough and it usually works out okay. This deserves a "Thinking Inside the Box" award. Very innovative IMHO. 2 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted March 19 Author Share Posted March 19 And the grand finale! Tursi versus Retrodroid.mp4 Congratulations to Retrodroid!!! It was a decisive victory! You are now the proud owner of a C64 Mini I will PM you for details. Thank you for all the participants! This was a lot of fun and maybe we'll do this again. I'm sure we have all learned a lot about potential new approaches to the tank AI by watching these battles unfold... Attached is the source code for all 4 competing tanks. Retrodroid.sxb SteveB.sxb SWITCH1995.sxb Tursi.sxb 8 2 Quote Link to comment Share on other sites More sharing options...
Switch1995 Posted March 19 Share Posted March 19 Thank you for hosting, Vorticon. Much appreciated! 2 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted March 19 Share Posted March 19 2 hours ago, Switch1995 said: Thank you for hosting, Vorticon. Much appreciated! Here here! 1 Quote Link to comment Share on other sites More sharing options...
retrodroid Posted March 19 Share Posted March 19 Woot! Ultimate victory is mine! 😃 That last match was really interesting, esp. round 2 and the final one. I had decided that if I didn't have a safe move in close quarters that I'd just blast away or turn toward the enemy, thinking I'd rather risk running out of turns due to non-movement than almost certain death. That reckless approach paid off overall, though it cost me on round 2. Well played everyone! 2 Quote Link to comment Share on other sites More sharing options...
+RXB Posted March 19 Share Posted March 19 SXB is that Super Extended Basic was my first thought but guess that is wrong. No line numbers in source so some special XB assembler for XB code without line numbers? So not really 110 version of XB, but a specialized version. I am sure those that entered had fun with it. But also totally explains such a small number of people involved. Quote Link to comment Share on other sites More sharing options...
retrodroid Posted March 19 Share Posted March 19 (edited) 9 minutes ago, RXB said: SXB is that Super Extended Basic was my first thought but guess that is wrong. No line numbers in source so some special XB assembler for XB code without line numbers? So not really 110 version of XB, but a specialized version. I am sure those that entered had fun with it. But also totally explains such a small number of people involved. Structured Extended Basic (attached the PDF for you), comes with TiCodeEd editor. It allows you code XB or XB256 using more modern / efficient programming syntax and then translates it into pure XB for you that you can just paste into Classic99, or it will do it automatically for you. The ability to use SXB was a big factor in my deciding to enter, honestly. TICodEd.pdf Edited March 19 by retrodroid 5 1 Quote Link to comment Share on other sites More sharing options...
+RXB Posted March 19 Share Posted March 19 Cool looking at the PDF documents do you have to update it when I release a new version of RXB? Down the road I am looking at adding Integer math to be used instead of Floating Point math in RXB, maybe a modified version of XB 110 also calling it XB 111. Adding a token to XB so like you can currently do A$= a string. But a new token A%= a word value (2 bytes) instead of like currently A= a floating point value (8 bytes). Thus instead of 9 x 8 bytes for say A(9) being 72 bytes for those numbers, A#(9) would be 9 x 2 bytes would be only 18 bytes and faster too. You see Floating Point really slows down XB especially when dealing with Graphics as row and column values never need to be Floating Points. Currently if you say ROW=7 (>40 >07, >00, >00 >00 >00 >00 >00) it is stored in 8 bytes floating point stored variable ROW. But in RXB or XB 111 it would be ROW$=7 (>00 >07) it is stored in 2 bytes variable ROW#. So over all savings of memory is 3 bytes vs 8 bytes. Ah but speed difference will really add up very fast as no Floating-Point conversion is needed. This will also be done in Assembly of the ROMs. (I am rewriting the XB ROMs for this new feature.) So this will benefit everyone using XB or RXB. And TIcodEd can also benefit. 2 Quote Link to comment Share on other sites More sharing options...
Tursi Posted March 20 Share Posted March 20 7 hours ago, retrodroid said: Woot! Ultimate victory is mine! 😃 That last match was really interesting, esp. round 2 and the final one. I had decided that if I didn't have a safe move in close quarters that I'd just blast away or turn toward the enemy, thinking I'd rather risk running out of turns due to non-movement than almost certain death. That reckless approach paid off overall, though it cost me on round 2. Well played everyone! Congrats!! As I expected, that stop and wait strategy was killer! I worked on the assumption that by the time both tanks were that close, we knew what we were in for so I might as well charge in fearlessly! I was paranoid of the stationary penalty so I coded to never stop. Also my tank got stuck on the bottom again... I suspect my seek code was turning down instead of up - copy and paste error from the top half, perhaps. I captured the videos at 16x speed with VLC and posted them here: Round 1 - Tursi vs Switch1995 - Round 2 - Retrodroid vs SteveB - Round 3 - Retrodroid vs Tursi - FINAL - 5 1 Quote Link to comment Share on other sites More sharing options...
Switch1995 Posted March 20 Share Posted March 20 This is the v2.0 code I wanted to submit but couldn't debug in time. I was trying to get to an advantageous defensive position and execute a preprogrammed pattern. I'm sharing because the commented out screen data at the bottom could help someone down the road. TANK2 v2.0.txt 2 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted March 20 Author Share Posted March 20 Since you have all the competing program listings, you can actually test out your code against them. Just replace the TANK1 SUB with yours and replace TANK2 with your opponent 2 Quote Link to comment Share on other sites More sharing options...
Switch1995 Posted March 20 Share Posted March 20 11 minutes ago, Vorticon said: Since you have all the competing program listings, you can actually test out your code against them. Just replace the TANK1 SUB with yours and replace TANK2 with your opponent Haha, I have to get it working first!! First time I ever tried to DIM an array in a Subprogram. Quote Link to comment Share on other sites More sharing options...
retrodroid Posted March 20 Share Posted March 20 8 hours ago, Tursi said: Congrats!! As I expected, that stop and wait strategy was killer! I worked on the assumption that by the time both tanks were that close, we knew what we were in for so I might as well charge in fearlessly! I was paranoid of the stationary penalty so I coded to never stop. Also my tank got stuck on the bottom again... I suspect my seek code was turning down instead of up - copy and paste error from the top half, perhaps. I captured the videos at 16x speed with VLC and posted them here: Round 1 - Tursi vs Switch1995 - Round 2 - Retrodroid vs SteveB - Round 3 - Retrodroid vs Tursi - FINAL - Thanks for posting these. 3 hours ago, Vorticon said: Since you have all the competing program listings, you can actually test out your code against them. Just replace the TANK1 SUB with yours and replace TANK2 with your opponent I found that not having a variety of opponents to test against made it difficult to anticipate my tank's weak points, having these examples available will surely make it possible for future contest contestants to implement more sophisticated tanks. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.