PDA

View Full Version : 3 A.I. Allies?



Mistressmaster
May 2nd, 2010, 20:49
After a while of trying to get editors to work on Vista and finding free time I got round to making a few of my first maps:D But I was wondering if it's even possible to make 3 ai's team up with each other? I put a line of script in:
'ALLY_PLAYERS(PLAYER1,PLAYER2,PLAYER3),' but get an error message in the Adikted script verifier saying:

Script command ''ALLY_PLAYERS'' requires 2 arguments, it has 3 at line 12.
Maybe I can't seeing as no other level does it, but I'm just curious.

DragonsLover
May 2nd, 2010, 20:57
ALLY_PLAYERS command only accept two players. If you want to ally multiple players, just do multiple ALLY_PLAYERS commands:

ALLY_PLAYERS(PLAYER1,PLAYER2)
ALLY_PLAYERS(PLAYER1,PLAYER3)
ALLY_PLAYERS(PLAYER2,PLAYER3)

And boom, all three players are allied together. :)

Mistressmaster
May 2nd, 2010, 22:18
Thanks:D I'm finding that fighting 3 at once is the only way to really get a challenge from the computer, seeing as the ai seems to have a phobia of training creatures, or makes training rooms too small.

Duke Ragereaver
May 2nd, 2010, 22:29
It's possible to make the trainingsroom that the AI builds larger. Take this command for example, this will force the AI to build a 5x5 trainingsroom. The explanation for the 5 values are below from left to right.


SET_COMPUTER_PROCESS(PLAYER#,"BUILD A TRAINING ROOM",0,5,5,6,0)

# = AI Keeper, choices are 1 (Blue) 2 (Green) or 3 (Yellow)
0 = The priority, usually setting it to 0 for the basic five will do it good. It makes sure the AI doesn't skip this action first.
5 = width of the room, minimum is 2 but at the same time I advise you not to make it too big.
5 = height, same as the width.
6 = index of the room, every room has it's own index. Look here (http://keeper.lubie.org/dk1_docs/dk_scripting_ref.htm#scrpt_cmd_set_computer_proces s) for more info about this and the whole process.
0 = Something I do not understand to be honest, but setting it to 0 will let it function.

In short, this command makes player # (non-specified in my command) to make a 5x5 trainingsroom.

Metal Gear Rex
May 2nd, 2010, 22:32
Thanks:D I'm finding that fighting 3 at once is the only way to really get a challenge from the computer, seeing as the ai seems to have a phobia of training creatures, or makes training rooms too small.

What features do the computers have compared to you, the player?

Mistressmaster
May 2nd, 2010, 22:48
It's possible to make the trainingsroom that the AI builds larger. Take this command for example, this will force the AI to build a 5x5 trainingsroom. The explanation for the 5 values are below from left to right.


SET_COMPUTER_PROCESS(PLAYER#,"BUILD A TRAINING ROOM",0,5,5,6,0)

# = AI Keeper, choices are 1 (Blue) 2 (Green) or 3 (Yellow)
0 = The priority, usually setting it to 0 for the basic five will do it good. It makes sure the AI doesn't skip this action first.
5 = width of the room, minimum is 2 but at the same time I advise you not to make it too big.
5 = height, same as the width.
6 = index of the room, every room has it's own index. Look here (http://keeper.lubie.org/dk1_docs/dk_scripting_ref.htm#scrpt_cmd_set_computer_proces s) for more info about this and the whole process.
0 = Something I do not understand to be honest, but setting it to 0 will let it function.

In short, this command makes player # (non-specified in my command) to make a 5x5 trainingsroom.

Thanks, and does this command just slot into the level script?

Mistressmaster
May 2nd, 2010, 22:50
What features do the computers have compared to you, the player?

Do mean just general things, like, starting gold and creature limit? If so I usually make them better off than me.

Duke Ragereaver
May 2nd, 2010, 22:52
Thanks, and does this command just slot into the level script?

Yea, just don't forget it to which Keeper you want it assigned to. :) If you want them all 3 to do it you just have to copy the code below here.


SET_COMPUTER_PROCESS(PLAYER1,"BUILD A TRAINING ROOM",0,5,5,6,0)
SET_COMPUTER_PROCESS(PLAYER2,"BUILD A TRAINING ROOM",0,5,5,6,0)
SET_COMPUTER_PROCESS(PLAYER3,"BUILD A TRAINING ROOM",0,5,5,6,0)

Metal Gear Rex
May 2nd, 2010, 22:54
Do mean just general things, like, starting gold and creature limit? If so I usually make them better off than me.

Yeah. Maybe you could give me a copy of the level so I could make it a little more difficult without the need for allying the three computers?

Mistressmaster
May 3rd, 2010, 10:10
Yeah. Maybe you could give me a copy of the level so I could make it a little more difficult without the need for allying the three computers?

Here's a copy of the lvl script, it's pretty simple stuff but good practice.

DragonsLover
May 3rd, 2010, 22:48
Eeek! :eek:

Just by taking a quick glance at your script, you wrote the commands badly:


SET_COMPUTER_PROCESS(PLAYER1,BUILD_A_TRAINING,0,15 ,15,6,0)
SET_COMPUTER_PROCESS(PLAYER2,BUILD_A_TRAINING,0,15 ,15,6,0)
SET_COMPUTER_PROCESS(PLAYER3,BUILD_A_TRAINING,0,15 ,15,6,0)should be:


SET_COMPUTER_PROCESS(PLAYER1,"BUILD A TRAINING ROOM",0,15,15,6,0)
SET_COMPUTER_PROCESS(PLAYER2,"BUILD A TRAINING ROOM",0,15,15,6,0)
SET_COMPUTER_PROCESS(PLAYER3,"BUILD A TRAINING ROOM",0,15,15,6,0)

Your loop to create infinite parties is also wrong:

SET_TIMER(PLAYER1,TIMER0)

It should be PLAYER0 instead of PLAYER1

Everything else seems fine.

Mistressmaster
May 4th, 2010, 14:21
Yea I saw that player1 thing, so that's fixed. I changed the Training room script because the Adikted script verifier complained about the amount of arguments, but fixed that by putting BUILD_A_TRAINING_ROOM, including the underscores. Or does it need the inverted commas without the underscores?

Mothrayas
May 4th, 2010, 14:30
Or does it need the inverted commas without the underscores?

Probably.

Remember, scripts have to be very precise - i.e., how DragonsLover posted them - and you can't just toy around with the script format and assume it still works.

opjohnaexe
May 5th, 2010, 22:47
if they're playable in Keeper FX do share :D (if possible) I'm always game for something new :D (besides best strategy vs ai's is box'ing them early on xD just take most of map and build boxes around gold (preferably not to many turns and mostly straight tunnels as they take less time to ''wallify'' as i call it)).

dragonfist
October 22nd, 2010, 06:06
Thanks:D I'm finding that fighting 3 at once is the only way to really get a challenge from the computer, seeing as the AI seems to have a phobia of training creatures, or makes training rooms too small."seems to have" is put correctly, because it is not entirely truth. In fact, an AI player can train creatures faster than a human player, because it automatically hits creatures, and casts the speed spell on them. But I know what you mean, because I made lot's of levels using the AI, and I understand what you are conveying. In many if not most cases, you need lots of tricks to get the AI to do what is needed for a level, and I had many levels where the AI refused to dig Gold, amongst other problems. But this what you say, AI refuses to train creatures, I had the same problem with a level I made in 2009, where the AI refused to train Bile Demons. It trained only skeletons, that where also in that dungeon. After play testing it, I decided to take away the Workshop from the AI player, and now it went to train Bile Demons faster than any human player would achieve. This maybe is exaggerated, because I also gave enough Gold to the AI keeper, to use every spell whenever it wants.

In that level, I also gave the AI keeper the same max creatures, as the human player. But if they encountered and attacked head on, the AI keeper would destroy the human keeper quickly. Enough challenge there. But making such a strong efficient AI keeper is an art, as I showed now only one trick in a huge set of tricks, in order to get the AI keepers to do, what you want them to do. In general, if you want your AI keeper to train it's creatures, you must not give the room that the creatures prefer. In the example, I showed you, that Bile Demons refused to train with a workshop, but trained like hell, once no workshop was found. For training Vampires, you should prevent a Scavenger room and Library, for training warlocks, you should prevent a library, and so forth. And if you want them to train quickly, I would suggest you build a large training room from the beginning yourself, instead of waiting for the AI to build a training room.

Instead of 3 Dungeons, you can also create one Dungeon with 3 times as much creatures. If you think the Portal is not fast enough to get something like 60 creatures against the 20 from the Human player, you can build a lair for the AI keeper yourself, because than the AI Keeper will already have some 5 tot 10 more creatures, before the Human player has build a lair to attract creatures. Tricks tricks tricks. 3 Allied dungeons might be fun, but if it is for the reason you describe, I think it is not valid. Off course, you might be right, it's your level, and 3 dungeons also give 3 portals, making the creatures 3 time as fast to regenerate, when a Dungeon looses many fights. But in the example of 20 creatures against 60 creatures, It seems to me harder to kill 60 creatures from 1 dungeon, than 3*20 creatures, where a hostile dungeon only has 20 creatures to kill one by one, while giving a huge room bonus once destroyed and taken over, in order to go kill the other keepers. The most used reason for allying keepers, is to prevent a tilt, that occurs often when AI keepers are fighting amongst themselves. AI get separated or allied, in order to prevent a system that makes the level unstable.