Space Fight AI Tournament Idea

User projects written in or related to FreeBASIC.
Thrawn89
Posts: 477
Joined: Oct 08, 2005 13:12

Postby Thrawn89 » May 16, 2006 4:09

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

Thrawn
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » May 16, 2006 4:15

http://fileanchor.com/26694-d

just so it doesn't get buried >.>


and, is the competition being run in a box with 0 lag? i have to fullscreen or it crawls for me.
Pritchard
Posts: 5492
Joined: Sep 12, 2005 20:06
Location: Ohio, USA

Postby Pritchard » May 16, 2006 4:40

mambazo wrote:ABS just means absolute, and causes a negative value to be positive, and a positive value to stay positive.
I was just going to look in the wiki but I figured ABS was purely trig stuff, so I didn't even bother.

Thanks Mambazo.
D.J.Peters
Posts: 7825
Joined: May 28, 2005 3:28

Postby D.J.Peters » May 16, 2006 4:42

Why do you not write a net (server/client or peer to peer) area for AI fights? :lol:

Joshy
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Postby arenth » May 16, 2006 5:25

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.
Shadowwolf
Posts: 341
Joined: May 27, 2005 7:01
Location: Canada
Contact:

Postby Shadowwolf » May 16, 2006 9:25

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.
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » May 16, 2006 9:36

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.
lillo
Site Admin
Posts: 447
Joined: May 27, 2005 8:00
Location: Rome, Italy
Contact:

Postby lillo » May 16, 2006 10:14

Hi guys (and gals)

I simply could't resist... I had to participate in this! :-)
Here's my AI, developed in ~7 hours taken off my sleep time...

http://www.ecplusplus.com/Lillo_AI.bi

Stress-tested against Pritchard's one ;-)
Shadowwolf
Posts: 341
Joined: May 27, 2005 7:01
Location: Canada
Contact:

Postby Shadowwolf » May 16, 2006 10:21

cha0s that what i did but it so hackish :)
cha0s
Site Admin
Posts: 5317
Joined: May 27, 2005 6:42
Location: Illinois
Contact:

Postby cha0s » May 16, 2006 10:26

lillo's in? oh god, we are All going to die ;/ lol
1000101
Posts: 2556
Joined: Jun 13, 2005 23:14
Location: SK, Canada

Postby 1000101 » May 16, 2006 10:55

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.

http://ecowles.dyndns.org/download.php? ... 0101_AI.bi

Code: Select all

#INCLUDE ONCE "AI\E1000101_AI.bi"
Ship( ? ).AI = @E1000101_AI
Ship( ? ).Callsign = "1000101"



cha0s wrote:lillo's in? oh god, we are All going to die ;/ lol


Code: Select all

---------------------------
--- 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.
1000101
Posts: 2556
Joined: Jun 13, 2005 23:14
Location: SK, Canada

Postby 1000101 » May 16, 2006 12:17

Ok, I updated my AI (mostly just tweaked values).

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.

Complete with all AI's up till now:
http://ecowles.dyndns.org/download.php? ... noHost.rar
mambazo
Posts: 652
Joined: Jul 17, 2005 13:02
Location: Ireland
Contact:

Postby mambazo » May 16, 2006 13:57

@1000101: Nice work, thanks for cleaning that up.

@Shadowwolf:

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.
mambazo
Posts: 652
Joined: Jul 17, 2005 13:02
Location: Ireland
Contact:

Postby mambazo » May 16, 2006 14:53

Wow, cha0s_AI3.bi is superb! :D

If someone feels like creating a NanoFrenzy.bas, please do. So we can have all AI's face eachother in a last-man-standing match!

The EnemyX and EnemyY could be passed as arrays EnemyX() and EnemyY()

Everyone's AI would only need a small change, to allow the AI to choose which ship to attack via that array index :)
Last edited by mambazo on May 16, 2006 15:00, edited 1 time in total.
1000101
Posts: 2556
Joined: Jun 13, 2005 23:14
Location: SK, Canada

Postby 1000101 » May 16, 2006 14:59

I updated the core code again (and mombazo2 AI).

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.

http://ecowles.dyndns.org/download.php? ... noHost.rar

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 4 guests