Jump to content

AI in MP maps for TD


Recommended Posts

So, I am making a multiplayer map in which there is a WF, Airstrip, and 16 SAMs owned by neutral (the purpose is for players to cap and battle over the WF and Airstrip).


I have the neutral AI set to replace all 18 structures (just to keep the conflict over the middle going), and I gave them 99,999 credits, the production trigger, 9 advanced power plants off the map, one construction yard off the map, and the necessary building prerequisites. Unfortunately, after several tests, it seems that whenever the AI starts to build or place down a building, the game crashes. My initial thought is if the AI can even do such a thing on multiplayer maps? I tried changing the house of the AI to Multi6 and the game would immediately crash as soon as I attacked. I also changed the house to special and goodguy, and nothing would happen.


If that's not possible, is there anyway to rewrite the rules and possibly make the those structures indestructible?


Also, if the AI can indeed perform this function on multiplayer maps, then can I change how fast their build times are? I wouldn't think there is a file like Rules.ini for this game, but it's worth a shot I suppose.

Link to comment
Share on other sites

That stuff shouldn't crash the map. I think you must've made some other mistake. Using Neutral is a bad idea in general though, since all their buildings will spawn civilians when destroyed, and they will relentlessly keep building civilians if they have the means to produce infantry.


What do you mean with "off the map" though? C&C1 ignores objects off the map and never spawns them in the actual game, as far as I know. Also, are you sure a map with inaccessible enemies can actually be won?


The "99,999 credits" seems like it could be a problem, though. There's no such thing. The amount in the ini file is multiplied by 100, so you probably gave them 9,999,900 credits. I wouldn't advice anything over 2mil, since you start reaching the limits of a 32-bit integer at that point.


TL;DR: you probably gave them negative money and corrupted some other data around that place in the process.

Link to comment
Share on other sites

Yeah, AI can definitely RE-build structures so I don't see why they couldn't build them.  Learned this from GiftS' SW maps where you capture neutral structures and the AI keeps rebuilding them if destroyed. 


As far as scripting attacks, you probably can get them to produce infantry and units, but scripting them to do anything is pretty useless.  They always go to "attack the northern-most thing" mode.  The only successful things I've got to work in MP are the c-17 cash trick, reinforcements (which attack northernmost), and an empty chinook landing on the map.  Hmmm... maybe I should try that one with troops.  Computer airstrikes probably work, as well.

Link to comment
Share on other sites

(A little off-topic)


Regarding AI making structures in multiplayer matches in TD; is it possible to create a bot, that when activated, is able to control one of the players? I mean, say for example I open up a 2 player game online, can a bot then join my game and start doing things? It'll probably have to have a shit load of if-else/mov-cmp-jne blocks in the code (like IF human player attacks AI owned structure then repair that structure). I know in theory anything is possible, but I mean is it possible to do without having to dissect and practically reprogram the whole game?


Of course you can always play online against a real person, but just for a bit of fun and also practice.

Link to comment
Share on other sites

We looked into that, but the game only sends actual game changes over the network, and each client checks separately whether these changes are possible and correct, and gives out-of-sync errors when they aren't; it's more or less WW's cheat prevention system. This means such a bot would need to actually exactly emulate the game, which is impossible to program.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...