Monday, January 31, 2011

Sunday, Jan 30th. More of the same.

So now that we have a working AI I've been redesigning the game so that the AI works properly. Now this isn't as easy as it sounds. The redesigning part I am enjoying, that I can not lie about. But one of the things that I've been asked to "fix" I'm finding impossible to do for some reason. That's the Resource Dropoff point.

Now the way the game code works is this. The Resource building "spawns" a drone, which is the beacon. This beacon lives for 5 seconds then it dies. When it dies it summons in the Madea to the place where it died which has a unit inside it. This unit drops and then kills itself, replacing itself with a structure that looks the exact same. Finally this structure has a 3 second lifespan, but 2 seconds in it uses the tiberium spire code to give the player 2000$. Can you see where my problem is?

The problem is that every time one of these units dies to spawn the next bit the games "audio information delivery system" lets you know that you've lost a unit that you didn't even know you had. It's retarded! So at the moment I'm trying to figure out how to get this to stop, but I'm not having much sucsess.

Another thing that we've been thinking about is how do we want the special powers to go. A lot of people have complained that they don't like that EF's powers are all just "summon gundams". They want more. One person's suggestion has lead me to try something, but again I'm not sure if I can pull it off. Basically, what it is is an area-of-effect ability that boosts the attack speed and health of the select units that are "caught" in this boost affect area. It's basically a "free" promotion to becoming an elite unit. I was going to do this for UC, but now am looking to use this idea for AW and call it "Trigger Newtype Abilities". So that means I still don't have any good ideas for UC's special powers. I may just make them "off screen attacks" like artillery bombardments and stuff, if I do anything at all.

Which brings me to something else that I'm finding interesting while doing all this recoding. We've been updating the buildings while doing all of this and one of the big issues that is still creeping up is "size vrs. ingame size". All I can say to this is please, just give it some time. Trial and error is the only way I'm going to get that stuff right.

But something that is comming up is the quality of the models. Since I'm already working on the new redesign I'm also redesigning the models. As people following the MODDB sight might have guessed by now, I go threw quite a few different attempts at making models before settling on one that will work "for now". I say "for now" because it keeps comming up. I do something, I like it, I put it in, it's fine for a month or 2, then I see a better idea that fits better and we restart all over again. :p So when it comes to the quality of the models, I guess all I can say is "Sorry, but they do progressivly get better right?" A good example will be the pics of the new Powerplant that I'm going to be posting up on MODDB later tonight.

So thats it for now, not much of an update but after getting the AI working there's not much going on other than me plugging away adding things back in and checking to make sure the new stuff works. Time to get back to it. If you have any questions, feel free to ask.

Tuesday, January 25, 2011

I shouldn't have worried.

So you know that big artical I posted up on sunday going on about how to get the AI to work?  I shouldn't have worried, I managed to get a working AI for a new faction.  Lol.  We're all good people.

Sunday, January 23, 2011

CNC3 and it's AI.

Well now that I'm moved into my new apartment and have begun working again on the Xenoforce Reborn mod I thought I should tackle that one thing that everyone wants to see. God did I not know what I was getting myself into. You see, I have been messing with CNC3's AI for the better part of 2 years now. Not seriously mind you, and not in the way that I'm now working on it, but just looking at it and reading online what others say can and can't be done with it.

I have recently started doing serious moding on the AI within the last 2 releases of the mod, more spicificly I've been working on making the GDI/NOD/Scrin AI more of a challenge. In some cases I would say I was sucsessful, in others not so much. But it has been a good learning process and I have made good progress.

So the next logical step would be to add that infamous AI to the Earth Federation faction. As the Earth Federation will be the most complicated army out of the 4 we are adding in they are the ones we wanted to start with. Now for a bit of information that you guys may not know about editing the games AI. If you edit the AI and make even the tinyest mistake, the game will crash. However, it will not crash the compiling of the MOD, it only does it once you try and load up a map with the new AI active. Also, for the AI to work the map must be edited so that it will apply AI Scripts to the new faction! This isn't nessicary on maps for new AI's based on the original 3 armies as all the maps have already been set up for GDI/NOD/Scrin players but this leads to a unique issue for a new faction. Is it a problem with the map that's causing the crash or the AI scripting that's doing it?

And of course when the game crash's it doesn't tell you why, just that it's sorry and it needed to close. So I have been working on a seperate mod simply called XenoforceAI which is just a new faction (Clone of GDI) with only one AI choice (xenoforce) with a single opening move set. Why did I do this? A few reasons actually, the first being that as long as I'm using an existing force's models and playset I can take my own units out of the equation as to why the game is crashing. Also by trying to make it as simple as possible and with as few changes a possible I take a mod that takes 15+ minutes to compile and do it in less than 5 seconds. This means I spend more time trying different things than sitting around doing nothing.

So that's where we stand now. I've been doing slight modifications to the game trying to get the AI to work in some form (heck I would settle on it just not crashing when starting at this point). I will know within the next few days weither this will be a plausible choice of if I should start looking at other ways of getting the AI into the game.

Now I know what your thinking. "Wait, he knows of another way to get the AI into the game and isn't just doing that?" Correct, I do. On top of that if I choose this path I would be garunteed a working (if not fully functional) AI. However I do not want to do this as for all of its advantages the major drawback is a big one to me.

What I would have to do is add the EF force into GDI.

I'll let that sink in a bit. All done? Good. I already know how to manipulate the exsisting AI, it's really not all that difficult honestly. What I would have to do is modify the exsisting GDI AI's opening moves and change the starting building for GDI. The new start building would simply be a building with 2 upgrade choices, GDI or EF.

You would select which side you want and the starting building would transform into that factions starting building. On the AI side the Opening Moves would have to have what "side" the player wanted as the first option to do, then everything would move on from there. In theory this would work fine. Another advantage to this idea is that the AI would work on all maps with no modifications needed by us. That makes things all the better for people who have a favorite map that they want to play on.

My issue with this solution should be fairly obvious. It's a serious pain in the butt to go back through and make the changes for this to work, and on top of that it's a fairly "blunt force" way of getting a working AI for EF into the game. I mean honestly, making a player jump through that many hoops just to get to play as UC for example, it's a bit more complicated than it should be. First you have to pick GDI, then EF, then build the required buildings to pick UC. Not that it's that big of a deal, it's just thats one step too many for my tastes.


Another thing that's come up about the AI recently is getting a unit to use it's special powers. We were sucsessful in getting the AI to use the upgrades that are located on the Devistator Warship (Scrin) and Avatar (NOD) recently, but only slightly. The Devistator works all the time just fine, so no problems there. The issue comes up with the Avatar using it's ability to upgrade itself. If you play the game on medium the AI will only use the Avatars ability to upgrade just before it's about to be killed. On Hard it does it after it's taken half damage, which is fine to me, but on medium it upgrades and dies almost at the same time. I'm trying to find the bit of code that controls this but so far have had no luck.

But this brings me to my last point on this topic today. The different difficulty settings. The game currently has 4, Easy - Medium - Hard - Brutal. The honest to goodness truth is that there are not a lot of differences between these settings. Easy has all of it's timerates turned to high so it takes forever for the AI to go from one build list to the next. Medium has all of it's times turned to low, so it only takes 3 to 5 seconds inbetween the AI switching to another build list. I suppose this could be seen as a normal player taking a few moments to decide what to do next. Also the Medium difficulty has a 25% chance to deviate from it's build order. So it has a chance that while it's supposed to build say an Orca it will randomy pick a different air unit (Orca Stormshell or Firehawk) for that team. This gives the AI a bit of random personality that I like.

The Hard AI is the exact same as the medium except they took out the time delay inbetween build orders and removed the chance to deviate from it's plan. The way I see it the Hard AI has a plan and it simply sticks to this plan, the consiquences be damned. A good thing and a bad thing at the same time. Finally the Brutal AI is the same as the Hard AI except that the game cheats on Brutal with all units costing half of what they normally cost and building twice as fast as normal. Not a good thing.

To me you have 2 choices. You can either make an AI smarter or make it unpredictable. If you have to have the AI cheat to win then you fail as a programmer. So with saying that I plan on making the following changes to the AI.

Easy will stay the same. Medium will have the same time delays as normal, but with only 2 different starting build orders and with a 20% chance of a build deviance. Hard with have 4 different build orders but will have a 0% chance of a build deviance. Finally Brutal will have 5 different build orders with a 40% chance of a build order deviance.

Thats right, Brutal AI will be the most random AI I can make it so that you will never know what to expect from it.

It will NOT have a cheat bonus. I will also be modifiying the "Kill Teams" that the Ai will choose to build, a good example of this would be our current NOD AI. It has the ability to build Scarab teams to seige the enemy instead of Beam Tanks, and it will do this 66% of the time if NOD gets into the position that it needs to lay seige to an enemy base. A good idea here would be to add in something unexpected for a seige attack on Brutal. Say, a kill team made up of 1 Scarab, 3 Avatars, and 8 Stealth Tanks. The Avatars and Scarab would be a good distraction (because they are visible the enemy will see them first and attack them) while the stealth tanks can get way up close and do what they do best (be evil).

So those are my thoughts on CNC3's AI, what we're trying to do, and possible solutions to exsisting problems with the AI. If you have any thoughts yourself, feel free to post them. Have a good Sunday everyone.

Saturday, January 22, 2011

OMG, he doesn't post here anymore! He left us for MODDB!

Not hardly lol. While it's true that I don't post here as often now that our MODDB page is up and running I have not forgotten about this page. In fact, I'm looking to change the reasoning behind this blog now that we have the MOD DB page, but I won't simply forget about it.

So what's this page going to be for going forward? Well, I don't always want to post every little "small" test update onto MODDB (why would I?) so people who look at this page will be able to get access to the mod before it appears on MOD DB. Also I plan on posting development pics here unlike MOD DB which will get in game pics only. Finally I will be posting different thoughts on the modding process in general on here going forward, hopefully once a week every Sunday night. This way it can be saw as a kind of "Developers Diary" but it will always be on a spicific topic.

So keep your eyes open for this Sundays post, I will be discussing the games AI, what I can do with it, what I've learned, and what you would like to see from it.