Advanced AI? - Printable Version +- Renegade Projects Network Forums (https://forums.renegadeprojects.com) +-- Forum: Modding (https://forums.renegadeprojects.com/forumdisplay.php?fid=3) +--- Forum: Red Alert 2 & Yuri's Revenge Editing (https://forums.renegadeprojects.com/forumdisplay.php?fid=8) +--- Thread: Advanced AI? (/showthread.php?tid=118) |
- pd - 02.11.2005 I've just been playing alot of Generals and Starcraft recently, and there's something about the AI that owns YR: expanding territory. AI builds little sister bases at places where they find resources. This makes games longer and far more interesting. Besides it makes large maps very useful. The question is, how could something like that look like in YR? AI doesn't seem to care of base expansions by now. I.E. if it captures an oil derrick, it won't (unless an accident happens) place defenses there. I also don't think it would react if you wrote a script that tells a MCV to deploy somewhere. I need a few things clear here: what can the AI be forced to do regarding base building? With that knowledge I might be able to concept the easiest possible method to make things like that work. AI will be one of my targets anyway in the future. For instance, what are custom SWs for if you can't make the AI use them to support a specific team they built? (i.e. first EMP-strike a base, then attack it) Though that's another chapter... Oh well, a note: please don't bug me with like "can you also do...?" or "would you be able to ...?" concerning this, I need facts, no questions. Oh and don't look forward to these things, I didn't do any research and I don't think my current state of knowledge would be sufficient to code things like that - Beowulf - 03.11.2005 Scripted AI is fail. There's not much you can do unless you want to code the entire AI from scratch and in the process have thousands upon thousands of variables that the AI looks at so it 'learns' like the StarCraft AI. The verdict is in: give it some cheat measures and make it mass units. Best way to do it. Besides, you'd have a ton of [General]/[AI] section tags to make unused... too much work to be honest. - DCoder - 03.11.2005 If you tell the AI to deploy an MCV somewhere, it would, but I don't think it would build any stuff around it. Besides, multiple factories of the same type for the AI (especially conyards) are a bad idea - when the AI produces something, that "something" is produced in all factories of the proper type, like Cloning Vats for human players. So, two Conyards = two Battle Labs at once, two Nuke Silos at once, and a ton of wasted base space. Btw, the only scriptable destinations are: somewhere AISafeDistance= cells away from own base; -"- away from enemy base; waypoints, preplaced at map design time, you can only trust waypoints 0 and 1 to exist (WPs 0-7 are player locations, there are at least two players); right next to your own/enemy structure (structure defineable by its index in the BuildingTypes list). You can (kinda) force the AI to expand its base, with a shitload of cheats: 1. Sacrifice the Slave Miner logic - utilise this logic on a unit which deploys into something like the Base Expansion Node from CR. 2. Create a ton of dummy units that are invisible and can chrono, and deploy into standard base structures. 3. Script the AI to: build one such unit. move it to friendly structure (BENode structure index) deploy repeat until success 4. Repeat step 3 for all base structures you want it to build. But of course that is a LOT of work, and doesn't always work properly. Esp. in cases like Bay Of Pigs, where you have several ore piles near your base, the miner will usually pick one pile right next to your own base, and waste resources on fortifying that spot. See C-GEN forums > RedUtils forum > topics by jkraska , or DeeZire forum > topics by Courageous. However, the AI scripts leave a LOT to be desired: they are hardly reliable when there are multiple possible targets for the Move to ... command, like when it builds two nodes, you can't specify which of them to aim for, or whether to avoid sending the team to the same target the next time this script executes, etc. they can't target other xxxTypes by ID/index, only structures. So, you can't create a team of Snipers to specifically attack Spies, for instance. they can't load transports into transports, like IFVs/Flak Tracks into Amph Transports. a lot of stuff that I can't remember. - Bobingabout - 03.11.2005 DCoder;date=Nov 3 2005, 08:32 AM;post=1910 Wrote:If you tell the AI to deploy an MCV somewhere, it would, but I don't think it would build any stuff around it. Besides, multiple factories of the same type for the AI (especially conyards) are a bad idea - when the AI produces something, that "something" is produced in all factories of the proper type, like Cloning Vats for human players. So, two Conyards = two Battle Labs at once, two Nuke Silos at once, and a ton of wasted base space. actually, its not 100% true. building another contruction yard would be fine, however, if 1 was destroyed, it will build it back. the problem is not that it builds everything from all factories at the same time, this is a miss-observation of what i've observed to actually happen. the AI kinda fractures itself, so every yard runs the scripts. so, yes, it will build everything twice, more of less at the same time, not because its building things from both factories, but because its actully thinking its 2 seperate AIs, and they have the exact same decisions because the conditions are token over the overall, so the key factors are always the same. I've watched an AI with 5 construction yards before. well, 2 of its side, and 3, 1 from each of the other 3 sides. first thing i've got to do is destroy those 3 to break an endless loop, then it will build them back as its own sides, then the fun begins. 5 powerplants, 5 barracks, 5 refinaries, then, the magic 5 of different base defences(usually pillbox for allies, but gattling/tank bunkers for yuri and bunkers/guns for soviets.). 3 war factories and 2 airfields/radars!!! you get the idea. but yes, DCoders point is still kinda true, it'll build an entire base, including everything. then when you destroy a construction yard, it'll start building other stuff. you'd need to use something like the slave miner logic to build something else, like a mobile refinary/war factory. can something be both a refinary and a war factory? maybe PD should re-implement some of the TS:FS mobile war factory stuff, including the PrequisiteGDIFactory= and PrerequisiteNodFactory= and so on, or just PrerequisiteMisc##= so you can use them for whatever you want. getting it to build other things around it shouln't be too much of a problem imo, the reason it doesn't build next to a deployed slave miner is because of BaseNormal=no, AKA the TS line ;IsBase=no;PS IsBase isn't a rules tag. RE: Advanced AI? - VK - 12.06.2006 Test my script.... 1. Build MCV(AMCV, PCV) 2. Move out of base 3. Deploy It's interesting... RE: Advanced AI? - Bobingabout - 12.06.2006 you know what else is fun? try and make all sides into 1. make all buildable structures require the same construction yard, and all the same baseplanningside, and so on. they co completly nuts. RE: Advanced AI? - -Kiith-Sa- - 12.06.2006 Ok,so, the AI problems: 1:It cannot build base defense at the same time as normal building (like player, with sidebar tabs), so, if you try to give it lots of base defenses, it gets stuck building defenses, taking a lot of time to build BattleLab, and you have to do a lot of hard work to overcome that (get full control of what is AI building, make a separate clone of every defense you want AI to build, disable standard Base Defense logic, and make some BuildTimeMultiplier=0.0001 clones build right after structures more expensive than them- and you will still have bugs) The triggers can have only one condition- use of AND and OR would improve it a lot. Also, the logic that increases/decreases trigger value should save it to file. The chrono buildings- you also need to have a separate clone for every, say, oil derrick on the map and scripts for every one or the AI will send defenses only to one derrick. AI also cannot load more than one transport per team. will post more when I remember... RE: Advanced AI? - Nighthawk - 12.06.2006 Quote:It cannot build base defense at the same time as normal building (like player, with sidebar tabs), so, if you try to give it lots of base defenses, it gets stuck building defenses, taking a lot of time to build BattleLabBut you can build defenses and normal buildings at the same time. They're on two different sidebar tabs RE: Advanced AI? - Kiith-Sa - 13.06.2006 Did you read my post? RE: Advanced AI? - Bobingabout - 13.06.2006 the AI can't give a crap about tabs, they build ONE THING PER FACTORY, thats 1 building, not taking into account the second tab, so we can build buildings faster however, navel yard and war factory, we share the same build list, they build both at the same time. |