Pages: [1] 2 3
|
|
|
Author
|
Topic: Thoughts on rewriting the AI (Read 6721 times)
|
Elvish Pillager
Enlightened
Offline
Posts: 625
|
The AI code is an awful, awful mess. It manages to describe a decent AI, as AIs go, but with this base, it would be far less worthwhile to build on the current code than to start over completely froms scratch.
Currently, much of the code is generalized in a way that only really works for about half the ships in the game. It also only works against about half the ships in the game, as it's terrible against Orz, Chmmr, Utwig, Thraddash, Mycon, Syreen, Spathi, and Androsynth. (Yeah, there's others, but those are the ones that can mainly destroy the AI with complete impunity.)
So, where to begin? Clearly there's _some_ things that generalize across more than one ship (how to maneuver for a gravity whip, for instance) so it'd make sense to have a lot of utility functions that all the AIs draw on - but unlike the current system, to have them only for specific uses, desigining the main intelligence completely on a per-ship basis.
There are also some things that there seems to be no sane way for the AI code to find out - like the size of the ship it's flying. Maybe it'd be better to rework much of the current non-AI code before even starting to try to write an AI.
(There's also the possibility of writing a learning AI and running it for a while for each individual ship, but that approach has all its own issues...)
The more I think about it, the more I realize how huge a project this is. I did write an AI for tw-light, but that was mainly a wimpy AI to try to replace the even wimpier AI that was already in place. And IIRC, tw-light has better code than UQM anyway.
Hypothetically, who here both has programming skills and would be willing to help a new AI project if it got off the ground?
|
|
|
Logged
|
My team of four Androsynth and three Chmmr is the most unfair team ever! My mod
|
|
|
|
Valaggar
Guest
|
I've got no experience in coding, but I do know that there are 25*25=625 different match-ups (A vs B and B vs A being taken into account separately) to code if you go this way. Assuming that you do one per day, you'll need two years to finish! Two per day, and still you have to work for an entire year. I presume you want to do scripts for more than one match-up, right? For example, no matter what ship you have, you MUST avoid crashing into a Thraddash afterburner flame! I repeat, I am not a programmer...
|
|
|
Logged
|
|
|
|
Death 999
Global Moderator
Enlightened
Offline
Gender:
Posts: 3874
We did. You did. Yes we can. No.
|
PART I: if we were to do a learning AI.
Assuming that you do one per day, you'll need two years to finish! We could set up a Boinc project...
More seriously, we could have it be of a form where it reports the results of battles, then makes learning decisions.
Start off with a quick seris of, say, 25 one-on-one matches for each pair, at first against the Awesome AI, then against itself. That wouldn't take too long if we let it go on turbo.
Then send out that AI to volunteers. I don't think we'd have trouble gathering those. Each plays the AI and sends in the AI reports. Those are gathered and the resulting modified AI sent out for future waves.
The problem, of course, is what sort of learning algorithm would we use? Genetic algorithms on logic flows? Neural net weighting of actions using Newton's method to maximize results?
I would favor the former, but it would probably take longer to converge. You'd need a virtual machine, and of course there's the overhead for running the genetic algorithm. But it's always fun to see two computer programs 'getting it on', as it were. Funky stuff happens.
PART II:
I get C-like languages, but my only AI experience is when I scoured the SC2 AI to root out bizarre behavior bugs that became most obvious in AI vs AI matches. Also, not too much time.
|
|
« Last Edit: April 21, 2007, 05:40:17 am by Death 999 »
|
Logged
|
|
|
|
alexo
Zebranky food
Offline
Posts: 6
|
Hey,
For a long time now I've been working on evolving AIs for games. I am looking for a way now to plug my stuff into UQM. I've got the source but its a little overwhelming since I don't have much C experience, all of my stuff is in Java. After reading a lot about JNI and NLink I'm pretty sure I know how to call C from Java and vice versa, however I can't seem to find where I'm supposed to plug it in. Are there any central APIs for selecting the next ship, and for controlling the ship and reading the environment? I am willing to dig into the C code to do this because watching supermelee evolution would be very interesting.
Cheers, Alex Ostrovsky.
|
|
|
Logged
|
|
|
|
|
guesst
Enlightened
Offline
Gender:
Posts: 692
Ancient Shofixti Warrior
|
I know I probably should not dignify this thread with a responce, but here we go.
I recomend against this for the following reasons: (1)your initial post is asking for help, (2) the scope of the problem is too big any way you slice it, and (3) this discussion may be appropiate for TimeWarp, I don't forsee the UQM community as a whole thanking you for making the sylandro more difficult to beat.
Academicly it's an interesting discussion, you know, "what would it take to make a good AI in this game?" but practacally I think anyones time would be better served on other activities like making waffles from scratch.
Mmmmm, waffles.
|
|
|
Logged
|
|
|
|
Shiver
Guest
|
I'm told that good AI is the hardest thing in gaming to code. That said, the best place to start would be to give the AI some sort of script that recognizes Thraddash afterburner jets as extremely dangerous.
You could apply similar logic against the Spathi, except I wouldn't want the story game Ur-Quan and Kohr-Ah to be able to mop the floor with Fwiffo. Newbies need to be able enjoy UQM too.
|
|
|
Logged
|
|
|
|
|
|
alexo
Zebranky food
Offline
Posts: 6
|
Regarding... I recomend against this for the following reasons: (1)your initial post is asking for help, (2) the scope of the problem is too big any way you slice it, and (3) this discussion may be appropiate for TimeWarp.
All very good points, but luckily summer is here and I have no more school, so i'll be trying some code hacking to get this working. I'll obviously open source all my stuff, i think UQM could be the ultimate AI testbed.
@Shiver Totally agreed, it would also be cool if it learned its own scripts to see what it comes up with. We'll have to see this coming summer if i get this working.
@countchocula86 Yes for sure it should be an external "mod". I was thinking maybe making it a netplay client that controlled a ship as if over TCP, this way the C code is not touched at all.
Cheers all! Thanks for the great replays, Alex Ostrovsky.
|
|
« Last Edit: April 23, 2007, 06:42:46 pm by alexo »
|
Logged
|
|
|
|
|
|
|
|
Pages: [1] 2 3
|
|
|
|
|