CZ45 AI Additions

Additional varied AI players for C&C and RA.

Information and discussion for custom maps and mods.
CannerZ45
Posts: 13
Joined: Thu Dec 04, 2014 1:15 pm

CZ45 AI Additions

Post by CannerZ45 » Thu Dec 04, 2014 4:07 pm

First off, hello, new member.
It's only two days ago that I got wind of this "OpenRA" thing, and today, still enjoying it. I really love the modern implementations(like the interface keyboard shortcuts), and the game rebalance, and also the comprehensible, and open-sourced environment. Plus, the fact that I can now run C&C95 on Windows 8 alone, for THAT i'm truly grateful.
But the two things that truly got my heart in is the availability of an offline Skirmish mode on CnC (with lots of cool game options to boot!), and the Quake 3-style modular AI.

I admit, I don't play games competitively(this coming from a guy who loves Quake 3 and Tiberium Dawn), and I grew up never appreciating the world of online play (I point my blame on our horrendous internet connection, but yeah, again, because I'm not a competitive opponent). I play RTS for simply enjoying the "pretend commander", so yeah, strictly skirmish/botmatch here since 1998.

Anyway, I'm digressing, sorry. Back on point, I really enjoy making my own band of crappy AI, and as my best show of gratitude to this wonderful(and hopefully, still lively) project and community. I would like to share these crappy AI's with you guys... : )




CANNERZ45's new batch of AI for C&C and RA(...also, maps for your troubles.REMOVED, they can now be downloaded in the 'OpenRA Resource Center')

--

'Installation':
Download and extract.
"ORAcncAI-0.04.zip" - for the C&C mod (Tiberium Dawn)
"ORAraAI-0.02.zip" - for the RA mod (Red Alert)

" CZ45OpenRAAIadd.zip" - zipped both into one file. Seems easier to update this way.
For guide, in the mods folder;
"cnc" - for the C&C mod (Tiberium Dawn)
"ra" - for the RA mod (Red Alert)

Simply extract the 'ai.yaml' file inside the "rules" folder of their respective mod. I recommend making a backup of the original AI files first as a precaution. It works fine for me so far, but I don't know how'll it fare out in others.

Main Info(these could also be found in the included readme files):
OpenRA AI additions adds alot of wildly varied artificial players for you to just dick around
with in the battlefield. They are as follows;

For C&C(Tiberium Dawn):
-
:N00B -Because OpenRA seems to lack a basic punching bag of a guy. Made to cater for potential newcomers and for those only getting used to the new C&C feel.
--
:PYLE -The guy that simply makes alot of foot soldiers and think that's a good enough offensive force.
--
:Couchpotat0 -'Turtle' taken to a whole, new, ludicrous level. Enjoys building and maintaining his base, rather than actually fighting in the frontlines.
--
:Kristi -Yes, a pretty weak duelist, but a very active teamplayer, cater to her on teamgames and she'll happily dish out some helping air support.
--
:RenegadeR -Light harrasser. Loves to wreak havoc early in the game with light forces. But cannot stand well on longer matches.
--
:Rockhead -Your run-o-the-mill tank guy. Loves to dish out in heavy vehicular combat, but takes time to gain serious momentum early in a match.
--
:J3NNI3 -A decent combatant, tends to do a slow-but-steady stream of attack.
--
:C3454R -A serious defensive combatant. Not as active as the typical AI, usually builds a confident defensive force before launching an attack.
--
:YsoldAAH -A rather...unconventional fighter. Enjoys creating the more specialized units.
--
:MilZ0N78 -A solid wall-breaker. Loves to use ranged strikes to pummel fortified bases. Not pretty good at defense himself though.

--

For Red Alert:
(Note that most of the additions here are simply based on C&C's, well, they're good enough as they are it seems...)
-
:Noob AI -For those looking for a simple punching bag. I just find it a bit odd that there's no default, "Introductory" level AI for OpenRA to welcome new arrivals.
--
:Infantry AI -An opponent that simply focuses on making crapton of infantries. Then utilizing them without any serious thought.
--
:AirSup AI -A more air focused player. Bad at duels, great supporting role at team game.
--
:Passive AI -An opponent that rather make a giant base and hang around, rather than actually fighting.
--
:Light AI -Harasser type, loves to pull a strike as early as possible, but tends to fall apart on later match.
--
:Weird AI -Simply builds random assortment of unconventional units. Then just throws it away and hope for the best.
--
:Tank AI -A typical combatant that highly prefers it's variety of onslaught has a thicker set of armor.
--
:Varied AI -A mix-up type of AI that's all about unit diversity.
--
:Defensive AI -While far more aggressive than, say, the 'passive ai', it tends to hunker down for a while until it's truly confident in it's fortification.
--
:Longbow AI -Likes to pummel fortified bases with a good dose of long-ranged units. Tends to be vulnerable to a counter-assault though.
--
:IvanDcraycraY -Loves explosives-equipped infantries. Soviet kind enjoys the demolition truck while the allied type spams the phase transport.

Notes/Issues:
I'll also plan on making one for Dune2000, but that's after further refinements of that particular mod from OpenRA, seems that d2k is not quite 'there' yet compare to 'cnc' and 'ra'.

For those wanting to integrate this in their own mod, go ahead. Even made a 'modding guide' for you guys out there!

I'd welcome anyone who'd like to further optimize this, or make a better one out of this,like I said, most I made here are just tweaks and additions, nothing big here. And I'd be glad to aid those who are interested in doing the same. Though note, most of my knowledge here are simply based on my hands-on experience with my tweaks. Just like some of you guys here, I'm currently just doing guesswork reliant on blind tests here.

Now, I like that, just like Quake 3, the format and structure of an AI character is quite comprehensive on its own. But still, there are some parts in the AI properties that I still don't quite get. I'd be grateful for anyone willing and able to shed light on some of those.

:UPDATES:
--6/12/2014-
deleted the old one from C&C to avoid confusion. the new one is "ORAcncAI-0.02.zip".

--6/12/2014-5:11pm-
Updated; zip file named "ORAcncAI-0.03.zip"
My final pass for C&C, added two more bots (added bots total for 10!) and made lots of re-tweaks for the others. Also, rearranged them by order of difficulty (which is solely based on MY experience in multiple tests/spars with them, and watching them duke it out themselves in a large-scale free-for-all. So yeah, "informed-ish decision". :roll: )

I'll be going dark for, probably two days, but don't fret, now I'm going to tackle my first pass at Red Alert's AI.

--6/12/2014-7:17pm-
Updated; zip file named "ORAcncAI-0.04.zip"
Finally! I think I got it now...i think. Really took me awhile how 'BuildingFractions' part work. Now AI's build as I intended them to be. Also, worked through how each AI utilize superweapons, now some use it accordingly, others use it to take down clumped vehicles and infantry(be wary of this while building/training units), other solely targets structures, etc...

--8/12/2014-11:16am-
Also wrapped up Red Alert's! As a minor bonus, also added a couple of MP/skirmish maps for both TD and RA.

--11/12/2014-2:50pm-
Removed the AI's ability to build surplus MCV's, kinda have this quirk where the AI seems to go bonkers, confused that its has alot of MCV, but already has reached the maximum amount of Construction Yard allowed to build. The whole game then lags alot. :\

Also, another pass on each, again. To further differentiate them to each other.
Oh, and yeah, "bonus maps" removed. As they could now be found at "OpenRA Resource Center".

--11/12/2014-9:33pm-
Checking out "HackyAI.cs" at github, I noticed alot of other AI character options that are left unused by default. Added/implemented them in some of my AI characters. Also, noticed that I hadn't removed the MCV unit option for the Defensive AI in C&C(TD), fixed!

--17/12/2014-6:17pm-
Further implemented other former unused properties for the AIs. Also, added a long, crude guide for budding AI modders out there!(included in the zip file)

--18/12/2014-6:46am-
How stupid of me. Only now that I'm giving the included "Documentation.html" a read, and saw that there I could also find lots answers... X/

Fixed a crash-inducing bug in the 'Passive AI' characters. Apparently, it is not allowed to have a large value in "MaxBaseRadius:". (can't pinpoint on what's the 'magic' value yet. The crash was caused by value '64'. Halved it to '32' and it seems to work okay now)

Also, some typographical errors fixed on the included modding guide.
--
[this was made on the 20141029-release version.]
Attachments
CZ45OpenRAAIadd.zip
OpenRA AI Additions (AI modding guide included!)
(11.79 KiB) Downloaded 318 times
Last edited by CannerZ45 on Wed Dec 17, 2014 10:56 pm, edited 13 times in total.

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Post by umairazfar » Thu Dec 04, 2014 5:56 pm

how about you update the wiki by explaining how the AI works?

You also did not explain what your AI does and why we should use it.

CannerZ45
Posts: 13
Joined: Thu Dec 04, 2014 1:15 pm

Post by CannerZ45 » Fri Dec 05, 2014 1:01 am

umairazfar wrote: how about you update the wiki by explaining how the AI works?

You also did not explain what your AI does and why we should use it.
The C&C one is updated, and added proper info, again, my bad. As for the wiki thing, I don't know. My current knowledge of the OpenRA AI is simply based on messing about with a single ".yaml" file...even I got questions of my own(anyone know how the 'BuildingFractions:' part actually work?). :P

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Post by umairazfar » Fri Dec 05, 2014 12:26 pm

If you really really want to help and want to learn as you go, I recommend making single player maps.

it is a lot of fun and it gives people a lot of things to do. If you open the single player missions, you can see that there are very few missions and Dune2K has none.

I have made enough tutorials about mapping and you can use my maps to learn as well (the latest one you can find in recent posts and it is very well documented)

plus I have also made tools to help you code and map as well.

Try that and it will be a lot of fun

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Post by umairazfar » Fri Dec 05, 2014 12:30 pm

for the wiki, just write what you know, others can add to it, that is why it is a wiki

I have fiddled with AI myself and many things are not clear to me.

My tutorials for single player missions are also limited as I do not know much but what I do know, I just put it out there and it helps a lot

Matt
Posts: 1020
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt » Fri Dec 05, 2014 8:47 pm

Build fraction is a value in percent that the AI checks against when deciding what to build based on what it already has. You can enable the bot debug messages in the Settings - Advanced menu to gain some insights.

CannerZ45
Posts: 13
Joined: Thu Dec 04, 2014 1:15 pm

Post by CannerZ45 » Fri Dec 05, 2014 10:19 pm

@umairazfar
I'll see what I can do regarding making proper singleplayer missions, right now, I'm just having fun getting the hang of the map editor included in OpenRA.
If ever I get a firm grasp of the multiplayer AI, then I'll try contributing to the wiki. :)

@Cmd. Matt
Yes! Thank you for clarifying that part. Also, the bot debug messages is a big help in understanding how the AI works in the building aspect. I'm now making some, rather, drastic changes on some of my bots given by how much I slipped up on the "BuildingFractions" part. Again, big thanks. :D

OH!, Cmd. Matt, one more thing, is the singleplayer/mission AI in C&C(Tiberium Dawn) also now uses the OpenRA bots, or is it still using the original-heavily scripted-AI from the original game?...just curious. :)

User avatar
BaronOfStuff
Posts: 438
Joined: Sun May 22, 2011 7:25 pm

Post by BaronOfStuff » Sat Dec 06, 2014 12:48 am

CannerZ45 wrote: OH!, Cmd. Matt, one more thing, is the singleplayer/mission AI in C&C(Tiberium Dawn) also now uses the OpenRA bots, or is it still using the original-heavily scripted-AI from the original game?...just curious. :)
Can answer that myself! It's using a completely new system! Nothing code-wise from the old games is in OpenRA; only art and sound assets are used. The renderer, bot AI, pathfinding, mission scripting, everything else? It's all from scratch.

CannerZ45
Posts: 13
Joined: Thu Dec 04, 2014 1:15 pm

Post by CannerZ45 » Mon Dec 08, 2014 1:51 pm

Updated, my final pass for TD for now. I'll start working on my first pass of RA's.

@BaronOfStuff
Awesome, it's really great how the OpenRA team-with all the new additions and enhancements-still managed to keep the '2D C&C' feel faithful to the original. Can't wait for the upcoming updates!

But yeah, for now. Got my own tiny modifications to do then.


UPDATED!
Done with Red Alert! Also, big rework on the whole original post, now with more clear info about the mod. :)

Also, got a new question for anyone in the know. Under the "SupportPowerDecision" part, how does these following things work?;
'Attractiveness'
'TargetMetric'
'CheckRadius'

most especially the "CheckRadius" part...
Last edited by CannerZ45 on Thu Dec 11, 2014 8:00 am, edited 2 times in total.

Matt
Posts: 1020
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt » Wed Dec 10, 2014 7:31 pm

The single-player missions are scripted with our https://github.com/OpenRA/OpenRA/wiki/Lua-API and don't use the skirmish bot routines at all for the moment.

CannerZ45
Posts: 13
Joined: Thu Dec 04, 2014 1:15 pm

Post by CannerZ45 » Thu Dec 11, 2014 7:18 am

Cmd. Matt wrote: The single-player missions are scripted with our https://github.com/OpenRA/OpenRA/wiki/Lua-API and don't use the skirmish bot routines at all for the moment.
Well, I guess that makes sense. While there is a positive draw/potential for the missions/main campaign to have that level of 'emergent gameplay'. It is a hassle(and also a bit pointless because, "Skirmish" mode) to try and wrangle such loose-AI in a supposedly more scripted, linear environment...

And, erhmm, another question, how many 'ticks' are there in a second?

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Post by umairazfar » Thu Dec 11, 2014 4:55 pm

it think it is 25

CannerZ45
Posts: 13
Joined: Thu Dec 04, 2014 1:15 pm

Post by CannerZ45 » Wed Dec 17, 2014 10:23 am

Changed the 'ticks'-based properties for the AI (thanks to umairazfar for that!), added a few more unused AI properties, and now, added a sort-of a guide in editing or making your own AI character/s.

umairazfar
Posts: 92
Joined: Mon Sep 08, 2014 1:01 pm

Post by umairazfar » Wed Dec 17, 2014 11:19 am

Great, I seriously recommend that you should write a Wiki entry about it.

noobmapmaker
Posts: 1086
Joined: Wed Dec 10, 2014 11:59 am

Post by noobmapmaker » Sat Dec 20, 2014 9:12 pm

Cool, I am going to try to get the new bots to work!

Thanks!

Post Reply