mambazo wrote:Well, yah, you got me there, it knows post-instantly ;)
EDIT: What I'm looking forward to seeing is, if someone manages to write code to accurately predict the enemy location (including its acceleration, arc of motion etc), and then fire at the exact perfect point to account for the time it takes for your laser to get there. I've been trying to code this for hours and, well, no, no its not easy at all, haven't a clue how to do it. Mambazo2_AI takes 2 estimates and then aims at the midpoint, so its far from perfect, but doesn't do too badly.
Yeah Im working on that...:p, let you know how I do
The problem with bullet to enemy collision prediction, is all the AI's so far dodge, so even if your collision course prediction was perfect, you'd never know. Watching the thrawn v mabazo2, there were alot of times where if thrawns AI kept moving forward, it would have hit.
What you'd have to do is figure out their forward velocity, figure out their deceleration rate, and then compensate for the ships back pedalling, so instead of shootign so that they run into the projectile, shoot so that it hits them while they attempt to dodge it.
this all looks kind of cool but one big problem with writing any real complex AI is that the current format is simple to limiting.
main problem being the interface function for the AI goes out of scope so its not really possible to write any type of AI that could take advantage of knowing the Enemy AI acceleration or work out likely places it would be after X amount of time.
since the function goes out of scope there no way of keeping track of information that would be need for example to calculate acceleration etc well there is the flag array but really that kind of sucks.
so at best you can only do a very reactionary AI
so i sugested adding an ANY pointer for the AI interface this way we can allocate a pool of memorey for custome use.
well, he condoned the use of hacking the flag() array to contain pointers. that would be relatively easy to do. you could also, through hacking, attain 8 256-state flags from each index of the flag array.
Ok, my submission. Note the overly complex code to say, "RUN AWAY!" Actually, it's only overly complex in determining where it should run from and the vector to do so.
---------------------------
--- 05-16-2006 05:10:47 ---
Lillo beat 1000101
Match Duration:313.80 seconds
Lillo stats:-
Health: 38
Power: 30.66%
Accuracy: 6.94%
Last words: Searching for target...
1000101 stats:-
Health:-17
Power: 85.51%
Accuracy: 6.38%
Last words: Reverse All Engines!
313.80 seconds. Not bad. The problem with fighting his AI is that he's got his set to move 200 units away from an enemy ship and mine is set to move to 150 units before firing.
It makes for an interesting dance and mine beats lillo about the same as his beats mine.
Also, I cleaned up the core code so it's more readable and the display isn't overwritten with stat information on top of the lasers and ships. Further, the results file is cleaned up a little too.
Finally, I made the damage of the lasers based on the ships power at the time of fire, *not* the time of laser impact. The lasers use 50% of the remaining power and have a 70% conversion ratio.
Shadowwolf wrote:this all looks kind of cool but one big problem with writing any real complex AI is that the current format is simple to limiting.
Actually, its quite the contrary. Acceleration is the rate of change of velocity. If you store the enemy velocity in a flag, you can check it the next cycle against it new velocity. The idea for this little tournament wasn't to make it easy, that would be pointless. Anyone could write a 100% accurate aiming algo if they had access to all the NanoHost data. The challenge isn't writing the AI, its using what you're given.
The screen is less cluttered and generally "prettier", heh.
The screen has a status bar on the bottom with health, power and charge bars. The game screen area is reduced by 16 scanlines to accomodate this.
Further, I made the lasers wrap at the screen edge and gave them a range (75% of the screen width). This provides for a bit more consistant laser action.
The only change to Mombazo2_AI was to use the screen dimension constants (which reflect the reduced area) instead of loading from ScreenInfo.