Im doing a Masters in Computer Games Technology. My MAsters dissertation is to create a Support Vector Machine AI to control the enemy AI in a RTS.
Kernel Panic seems less complicated than others on the site, at least in terms of unit numbers. Its also built more on strategy and tactics which is very useful for me. If people would let me know of their experiences developing AI for the game thatd be great.
One more thing actually, could someone point me to some technical info about the AI in the game. If there is none then could you leave a few lines describing it - if its a FSM, theres loads of states, how the strategy is handled, something along those lines.
Kernel Panic AI Often shortened to "KPAI", often lengthned to "Kernel Panic Lua AI". This AI is built-in the mod, as a Lua gadget. Use 7-zip to open up /mods/Kernel_Panic_4.0.sd7 then extract \LuaRules\Gadgets\KPAI.lua for the source code. All the source is in a single file, about 1300 lines long. I like to think it's a good exemple of AI since it's short yet complete, and you don't need any compiler to edit it. Then I might think that because it's the only AI I know the inners of. It was orginally written by KDR_11k. Then I expanded it to handle more factions and special commands, so now I mostly known how it works, except that the formula KDR_11k uses to assign weight to position still eludes me. I tried replacing it with formula that were easier for me to understand, but KDR_11k magic recipe always gave best results. I don't know much about Finite State Machine, but I don't think KPAI use one. In fact I don't see how finite state machines would be of any use for a RTS AI: There's lots going on at once, yet only one strategy to apply during the whole game. KPAI works by detecting units belonging to it that are new or that run out of orders, and then trying to find occupations for them. For instance, it sees that is has a new construction unit, or that a construction unit is doing nothing, then it looks for a nearby datavent that is free and tells the construction unit to build a minifac there. Then it is informed that a new minifac has been created, so it tells the minifac to build an endless queue of spam units. Then it gets noticed of having new spam units, and it assign them to a "position". That's the other part of KPAI logic. Since the only important terrain feature of KP are datavents, the KPAI first make a list of every datavent. Then during the game it keep track of the state of each datavent: Owned by ally, free, owned by enemy. Every attack unit are assigned a datavent to station around. Attacking is done by telling attack units to go station at an enemy datavent. KDR_11k magic formula give a weight to each datavent, depending on stuff like who owns it, how many enemy units around, etc.., I think it makes the one on the border of the controlled territory more attractive. Periodically the AI recalculate the weight of all positions, pick the best one, then assess how many units it would need to occupy it, then go grab all the units it think it needs and tell them to go there. I think. Not really sure. Like I said, the core logic was done by KDR_11k, I debugged it and expanded it, but some of it eludes me. The part I updated was the one giving orders to builders, and managing special abilities. Which I've done with simple stimulus-response, without any strategic view. For instance any Bug flip into Exploit if there are enemy within exploit cannon range but no enemy very close. Any Exploit switch back to Bug when there are no enemy in range, or when enemy is getting close. Or, the AI check firewalls regularly, when it find one that is charged, it looks for an area with a cluster of allies near a cluster of enemies, and if one is found, cast firewall there. Oh, and Kernel Panic AI is a cheating AI, since, as a gadget, it knows the position of enemy units it should not be able to see. But extra info is not a too severe form of cheating, so I don't mind.
Fair KPAI It's a copypasta of KPAI, except I changed it to count how many units of each type the enemy has, and stop the production when the AI outproduce the enemy. Also handle playing in place of the player when the player is playing HOMF. But just forget about that, I only mention it in case you stumble upon the part of the code mentionning "homf" or "megas".
NTai It worked then broke then worked again then broke again. So currently broken. NTai was an external C++ AI developped by AF. It used a profile per mod, that profile could be filled to give it indication about how to play a mod, which made it possible to make it play KP fairly competently (would usually beat KPAI). You can probably find NTai source next to Spring source, unless it's been culled when it stopped compiling. You could read the NTAI thread, but iirc AF doesn't support NTai anymore.
BaczekKPAI imbaczek wanted to try making an AI, so made a simple one geared to playing KP. Plays pretty good, and still works. I think the source is available, not sure where. No idea how it works internally, ask imbaczek. See the thread [ANN] Baczek's KP AI 1.2.
Shard I'll trust AF who told me yesterday Shard plays as well as the two other AI. Source not yet but soon available. Shard is an AI relying on lua files for configuation and to handle mod specificities. See Shard Thread for details.
At first I intended for the spots in the KPAI to be FSEs but there wasn't enough to put into them for a simple behaviour so all they have is three states. A proper AI will of course need global states like the strategy it is going for, KPAI is pretty much just designed to give players something to shoot at.
Lua is getting an awful lot of love on here. But there is one in C++ so ill have a look through that.
If all it has it 3 states maybe i can add a bit more myself. Ill download the source prob tomorrow and ill have a look through it. Cheers for the help lads.
startpostype=3;// Hey, BaczekKPAI always get the worst spot, not fair! Use random pos next time. Also, last KP is 4.0 not 3.6 (though that wouldn't change much).
I'm happy, I got results I liked, hehehehe I could run another batch and change the folders round for KP 4 but Id rather type the write up instead right now!
I'm happy, I got results I liked, hehehehe I could run another batch and change the folders round for KP 4 but Id rather type the write up instead right now!
I could run another batch myself, randomising maps and start pos and AI through my skirmish generator widget. But I would need a fresh Shard AI. I can only find the old Shard 0.21 on your website. Did you find a way to issue DISPATCH commands btw?
1v1 results would be more interesting than 1v1v1, coolest find would be if they all ended up beating 1 AI but losing to another most of their games (like rps)
I know its been a while. Was wrapping up projects and reports. mental times, im sure i dont need to explain. Then took a week or two off. But im still interested in this. Im downloading the game and the AI now. This is just to let whoever may care know im still doing this.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum