Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computer Player casting Call to Arms broken #53

Open
Loobinex opened this issue Aug 22, 2018 · 0 comments
Open

Computer Player casting Call to Arms broken #53

Loobinex opened this issue Aug 22, 2018 · 0 comments
Labels

Comments

@Loobinex
Copy link
Owner

This issue already exist on the official branch: dkfans/keeperfx#483

A computer player has several ways to attack the player, one of them is the 'Quick Attack', where the Call to Arms spell is used to attack the player. At some point the CP using CtA broke - it is working in old versions of KeeperFX and the original game - and now cannot be used to launch an effective attack or defense, and sometimes it even harms the computer.

What should happen on a quick attack is this:

  1. The CP decides (through the 'CHECK FOR QUICK ATTACK') to attack the player
  2. It casts CTA on a group of units.
  3. When it has not enough units in the group, it recasts it until enough units follow the flag
  4. It casts it on the room it hates most, causing its units to attack there
  5. After a while or when the attack is over, it disables CTA

However, only the first two steps work, the other 3 are problematic. It does not seem to gather enough units, units don't make it to the room to attack, and the CTA flag keeps on for far too long. This is seriously hampering the CP's effectiveness. My guess is the problem on (4) is that whenever a unit is hungry the CP picks it up, releasing it from CTA, and it's a long walk so most units go hungry. No idea why (3) and (5) go wrong.
The CP also cast CTA defensively when it is attacked, that flag also stays on for far too long after the battle is finished.

On this map the issue became really apparent, and I reworked it into a good test map: LevelCTAtest.zip

To reproduce the issue:

  1. Load the testmap
  2. Frameskip several paydays, until you see yellow cast CTA
  3. Notice very few units make it to your dungeon
  4. Notice the CTA spell stays enabled practically forever so it is never recast.

The map contains this script command:
SET_COMPUTER_CHECKS(PLAYER3,"CHECK FOR QUICK ATTACK",1500,45,3000,8,20)
Which is explained by the Duke as:

The enemy Keeper should become belligerent after 30000 gameturns, or 3 paydays. From there it will check every 1500 turns with a 45% chance to attack, raising the CTA flag for 3000 turns. In the regular Dungeon Keeper the enemy Keeper does behave as it should. According to similar scripts like in level 16, the value with 8 is defined as MinForAttack, which I think is the minimum amount of Creatures needed?

I changed the 30000 to 20, so that the first attack comes sooner for testing reasons.

@Loobinex Loobinex added the bug label Aug 22, 2018
Loobinex added a commit that referenced this issue Nov 8, 2019
Partial fix to #53
The timeout to CTA now works.
A problem remains that many creatures are picked up while affected by CTA/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant