PDA

View Full Version : Computer Players



dayokay
July 22nd, 2013, 17:15
Is it OK to change the computer player setting mid-game? I have noticed that different computer player settings perform better earlier and later in a map I'm making, and I wonder if it'd be OK to switch between them at a later point in the game?

On a related note, could I set computer player to 0 (zero) to switch off the computer player for a set amount of time? I'm toying with add tunneller party for a computer keeper, and don't want the computer player to stop them from fulfilling their task. Or disable the player's hand?

Also, can I use the new KFX add gold to player command with a negative value? Or can I re-set a players gold to zero?

thanks

Dayo

mefistotelis
July 22nd, 2013, 21:15
Is it OK to change the computer player setting mid-game? I have noticed that different computer player settings perform better earlier and later in a map I'm making, and I wonder if it'd be OK to switch between them at a later point in the game?
No, you can't do that.
If the computer player performs poorly, we should just update its code.
You can't re-initialize computer player while it's working.


On a related note, could I set computer player to 0 (zero) to switch off the computer player for a set amount of time? I'm toying with add tunneller party for a computer keeper, and don't want the computer player to stop them from fulfilling their task. Or disable the player's hand?
It is possible to disable POWER_HAND, that should work. I'm not sure how computer player will react on it - he will probably try moving creatures but fail. Such scenario isn't considered in the code, so I'm not really sure. If a computer player without POWER_HAND can move creatures, then it's a bug and should be fixed.


Also, can I use the new KFX add gold to player command with a negative value? Or can I re-set a players gold to zero?
I'm not sure, you'll have to try.
I can tell for sure that the gold-related script commands won't affect the gold which exist on the level (is stored in gold piles).

DragonsLover
July 25th, 2013, 21:52
But POWER_HAND and POWER_SLAP are really reserved for the computer players and computer assistants, right? Disabling those spells for the human player don't seem to work at all.
Making sort that disabling POWER_HAND to prevent computers to move the creatures and POWER_SLAP to prevent slapping would be neat.

mefistotelis
July 26th, 2013, 08:02
But POWER_HAND and POWER_SLAP are really reserved for the computer players and computer assistants, right? Disabling those spells for the human player don't seem to work at all.
In original DK, they didn't influenced human player, and there was only one check in computer players code - if I remember correctly it was in moving to best room.

KeeperFX has more unified code for checking spells availability; information about where a spell can be casted is placed in a config file, and there's one function for checking whether spell is castable. I probably added call to this function in slapping and picking up code; if I didn't, let me know and I will fix that.

dayokay
July 26th, 2013, 15:06
No, you can't do that.
If the computer player performs poorly, we should just update its code.
You can't re-initialize computer player while it's working.

Fair enough. though I don't think they can be described as behaving poorly, as it depends a lot on the map. I see the file 'keepcompp.cfg' has a lot of computer player info in it, though I don't understand it. Is there a way (now or in future) of getting a computer player to be defensive for a time, and then get aggressive, attack an area, etc.? And are there 12 different computer players to choose from? (i.e. more than original DK1).

Dayo

mefistotelis
July 26th, 2013, 17:08
I see the file 'keepcompp.cfg' has a lot of computer player info in it, though I don't understand it. Is there a way (now or in future) of getting a computer player to be defensive for a time, and then get aggressive, attack an area, etc.?

That should be possible, in the future.
Actually, this can be done with a few SET_COMPUTER_PROCESS commands, but currently all the SET_COMPUTER_* commands can only be used outside a conditional block.
Also, all the parameters have different meaning for different computer processes - so we'd need a good documentation update for it.


And are there 12 different computer players to choose from? (i.e. more than original DK1).

Actually, there are 13 (0..12). All can be used, but some of these may perform poorly on they own.