Map Database  •  FAQ  •  RSS  •  Login

AI Attacks

<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 18 Nov 2008, 05:14

AI Attacks

Hello Everyone,
I am starting up this topic because I am unsure of a few things about AI attacks. Kuba11100 reported that my editor didn't handle the attack type 2 properly, and so I have done some research. I am really just interested in what the attack type actually does, as I am fairly confident with other values.
I have made a little table of what commands you can use with each attack type:
Image

That seams to suggest that type 2 is the most versatile, and can do everything the other attacks can do.
I have made names for use in my editor:
0 - Repeating
1 - Once Off
2 - Combo

A lot of that is probably wrong, so please correct me! I have done very little research and so please let me know if there is a mistake. Once a few people have confirmed or corrected my information then I will be updating my editor to support all the features of attack type 2. (right now it only does take all)

If you have anything else to add please do so as well. I will be updating this table as you do so.
Lewin.
<<

kuba11100

Sword Fighter

Posts: 286

Joined: 16 Jul 2008, 22:00

Location: Poland

Post 18 Nov 2008, 09:26

As far as I know attacks type 0 and 1 support TAKEALL command (at least in TPR) - it makes AI choose troops randomly, not the set value of 4 types. But I'm not sure - check it
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 19 Nov 2008, 04:21

Hmmm... Your right about that.
I've done some more experimenting, and discovered some interesting things:
- All attack type can use TROUP_AMOUNT or TAKE_ALL
- Type 2 will always repeat, even if you use COUNTER. However, the first attack will not come until COUNTER, then subsequent attacks will be executed after that without delay.

I've updated the image. Any other mistakes?


Oh and I have one more question: Is the COUNTER time in seconds, 10ths of seconds or what? I think The Dark Lord answered this question before, but that was in relation to messages. Are all timing things in KaM the same? (I have a rough idea of how much the message timing is)

Nearly ready to properly implement attacks into my editor...
Lewin.
<<

kuba11100

Sword Fighter

Posts: 286

Joined: 16 Jul 2008, 22:00

Location: Poland

Post 19 Nov 2008, 15:26

Picture doesn't display.

The COUNTER time is strange. I tried using some possiblities some time ago and I don't know how to convert seconds -> KaM counter. But I noticed something what might be interesting - timer is checked not with the milisecond precision: when 10 messages with counter set to 1; 2; 3 and so on are in mission, they're all sent at the same time.
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 19 Nov 2008, 20:18

Indeed, if you want 10 messages to be sent, and you use counter 1, 2 and 3, the messages will all appear at the same moment... Well, not exactly, but a human being won't notice the difference.

Lewin is right: 10ths of seconds. If you set the counter at 30000, the message or attack (there is no difference) will come after 30000/10 = 3000 seconds, which is 3000/60 = 50 minutes.
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 21 Nov 2008, 06:05

Picture doesn't display.
Yeah, there was an issue with my name caching server yesterday. It has been fixed. :lol: (not joking, that actually was the problem!)
Lewin is right: 10ths of seconds. If you set the counter at 30000, the message or attack (there is no difference) will come after 30000/10 = 3000 seconds, which is 3000/60 = 50 minutes.
Thanks for confirming that! I've updated my editor accordingly, and it now exports the full potential of AI Attacks!
I've also noted the 10ths of second thing so people won't get confused.

Remember to tell me if you find out anything else about the way attacks work.
Lewin.
<<

kuba11100

Sword Fighter

Posts: 286

Joined: 16 Jul 2008, 22:00

Location: Poland

Post 21 Nov 2008, 13:12

Indeed, if you want 10 messages to be sent, and you use counter 1, 2 and 3, the messages will all appear at the same moment... Well, not exactly, but a human being won't notice the difference.
Okay, maybe that was a bad example, but all of that messaages came after 1 second.
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 21 Nov 2008, 23:08

Okay, maybe that was a bad example, but all of that messaages came after 1 second.
@TDL: kuba has a point. The game will not display messages to exact 10ths of seconds. If you set messages at 1, 5, 10, 15 and 20 then they all will be displayed at exactly the same time, a few seconds after starting. (whereas in fact there should be a 2 second gap between the first and last) Try it.

My guess is that the game checks for events every 2 seconds or so, and so by the time it does the first check all of the messages are ready to be displayed. If it checked every 10th of a second it would slow the game up too much.

Anyway, that's a bit off topic. :wink:
Lewin.
<<

Litude

User avatar

King Karolus

Posts: 1233

Joined: 01 May 2006, 22:00

Website: http://www.knightsandmerchants.net

Location: Finland

Post 05 Dec 2008, 11:49

The biggest (and most useful) difference I've noticed between attacks of TYPE 0 and TYPE 2 is that a TYPE 0 attack can occur even if it is in slot 4 and the conditions for the attack to take place are met (so if there's an attack TYPE 1 in slot 1 with a counter of 150000, the TYPE 0 attack in slot 4 will most likely occur before it).
TYPE 2 on the other hand "waits for its turn" until the attack takes place.
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 06 Dec 2008, 04:55

Uh... Just when I thought I had the attacks nailed down. That makes it more complex, explaining that to a beginner will be very tricky.
So you're saying that with TYPE 2 all attacks before it must have already happened (or expired) before it will itself happen? Does that include attack TYPE 0? If I have a TYPE 0 in slot 1 and a TYPE 2 in slot 2 then does the TYPE 0 need to occur (as in the right number of troops are met and they attack you) before the TYPE 2 can happen? Or does it only apply to TYPE 1?
Hey wait a minute! This relates to the "fake attack" bug! TYPE 2 must have at least one other attack before it, all of which have happened.

Ok: So now all I need to figure out is how to do that into my editor in a user friendly way.
Any suggestions for how to implement/explain this into my editor will be appreciated.
Lewin.
<<

Litude

User avatar

King Karolus

Posts: 1233

Joined: 01 May 2006, 22:00

Website: http://www.knightsandmerchants.net

Location: Finland

Post 06 Dec 2008, 09:43

Hmm... I'm not quite sure about that, only tried it for situations with TYPE 1 attacks...
By the way, if I make four TYPE 0 attacks, will they be carried out in order and the last attack will keep on repeating, or will they all repeat and be carried out once the conditions are met regardless of order?
EDIT: Seems like the latter case, which is good.
<<

Litude

User avatar

King Karolus

Posts: 1233

Joined: 01 May 2006, 22:00

Website: http://www.knightsandmerchants.net

Location: Finland

Post 09 Dec 2008, 19:35

It seems that even if you have a COUNTER set for a TYPE 2 attack, the attack still won't occur until all other attacks have taken place and this is when the counter starts.

Return to “Map Design”

Who is online

Users browsing this forum: No registered users and 20 guests