Party attack filter

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Party attack filter

Post by Zyx »

Is it possible?
The idea is to trigger events and manipulate some parameters like damage when the party is attacking.

Some parameters could be:
damage
disabled time
stamina loss
gain of experience
skill involved
index of character
type of attack (slash, swing, throw, etc.) or attack option (1, 2 or 3)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Don't know. I will study. When we did this for spells
I had to rewrite the whole thing which was made easier by
the fact that the code was relatively compact and independent.
I don't know what the attack code looks like.
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

is there some PartyAttackFilter demo anywhere?
I`m thinking for example of sending a message (or several messages) by the filter to the actuators each time when a party makes certain attack type. Or each time party makes certain attack type on certain level. Or each time certain character makes certain attack type on certain level.

For example: when a party casts DISPELL attack (by using Yew Staff attack) on level 7, the door at (X,Y) are closing. Or when a party casts light spell (as a staff attack), the DSA at (X,Y)Z is activated.

There are some attack types never used in game, so that we could access them to an items, for example access X attack to the Yew Staff. The attack infact wouldn`t do anything by the original code, but it will, for example, enable teleporter on level 6 or open the door on level 2 by the filter. Or kill all the gigglers on level 3... ("FIND YEW STAFF SO YOU COULD KILL ALL THE GIGGLERS USING YEW GENOCIDE"), etc.

There are many possibilities - we could activate dragon generator each time the party will use "KICK" attack on level 1 ("DO NOT KICK ON THAT LEVEL OR YOU WILL BE PUNISHED") ;)
Or send a message to a counter set for 500 counts, sending a message to Lord Chaos generator, each time the party will make "FIREBALL" attack... (using FIREBALL will cause DSA to send a CLEAR message to the counter set to 500 counts; when a counter counts 0 then it sends a message to the Lord Chaos generator.. ("FIREBALLING ON LEVEL 10 MAKES LORD CHAOS MAD") ;)

What i need is a DSA that each time where there was an attack made by a party, checks which attack type was done and executing priopriate DSA line.
As there are 44 attacks in a code, the DSA could have 44 states, each with a possibility to add a line with a destination info (X,Y)Z transformed to hex value. Of course, 99% of possibilities would be probably unused. It`s up to the designer to make use of them whatever he likes. That`s how I see it.

**************************************
EDIT: in case there were 10 playable levels, there is need to have 441 DSA states (44 attacks * 10 levels), which seems impossible (as far as I know, DSAs has 256 states, right)? There have to be another way to do that.

EDIT2: OK, what about using different messages, each assigned to the certain level? S0 for level 0, C0 for level 1, T0 for level 2, S1 for level 3, S2 for level 4 ... T3 for level 11. So 12 messages in total, wchich gives a possibility for manipulating with 12 levels (I think its enough, at least for me). So 12 kinds of messages (levels) on 44 states (attack types). Of course, 99% lines would be probably empty.. it`s up to the desiner to assing a message type + destination to all of them.. So when a party uses CHOP attack on level 10, the DSA would execute 4C3 (CHOP is 3rd attack in a code) line with a hex value referring to the priopriate destination. Like this:
4C3: send (SET|CLEAR|TOGGLE message) to (hexXXXXXXX destination)
When a party will BASH on level 3, the DSA would execute 31S1 (BASH is in 30th in place in list of attacks) line.. like this:
31S1: send (SET|CLEAR|TOGGLE message) to (hexXXXXXXX destination)
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Zyx
DSA Master
Posts: 2592
Joined: Mon Jun 05, 2000 1:53 pm
Location: in the mind
Contact:

Post by Zyx »

A quick, untested answer:

S0:
L30 L0 &PARAM@ V0@ L30 L20 &CHAR@ L50 L10 &PARTY@ V4@ L60 L8 &MONSTER@ V0@ L1 &CHPOSS &DUP &TYPE V99! V98!
C0: G L0 V1@ L100 &+ &G*
T0: G

The S0 line just fills the parameters:
0-29: PartyAttackFilter parameters
30-49: attacking character parameters
50-59: party parameters
60-67: attacked monster parameters
98: ID weapon
99: type weapon



"L0 V1@ L100 &+ &G*" take the attack type number, adds 100, and executes a DSA state between 100 and 143 (since you said there are 44 attack types).



You don't need to check on what level the party is for each attack type, only for the pertinent ones. I recommend doing the specific tests inside the DSA state corresponding to the attack type.
For example if you want to link a particular effect with the FREEZE action (attack type 11) on level 7, then on state 111:

S0: V51@ L7 &= ?GT0

"if parameter 51 (party level) is 7, execute line T0."
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

thank you Zyx! I`ll try to test it!

Party Attack Filter description:
http://www.dianneandpaul.net/CSBwin/doc ... ilter.html

Table of attack types:

Code: Select all

NR ATTACK TYPE EXP DEF STA LKR DAM FAT SKILL   SUBSKILL    CSB
00 N           0   0   0   0   0   0   fighter -
01 BLOCK       8   36  4   22  15  6   fighter (parry)
02 CHOP        10  0   8   48  48  8   fighter (club)      STA= 10
03 X1          0   0   0   0   0   0   fighter -
04 BLOW HORN   0  -4   1   0   0   6   priest  (influence)
05 FLIP        0  -10  0   0   0   3   priest  (identify)
06 PUNCH       8  -10  1   38  32  1   ninja   (fight)
07 KICK        13 -5   3   28  48  5   ninja   (fight)
08 WAR CRY     7   4   1   0   0   3   priest  (influence) fighter (parry)
09 STAB1       15 -20  3   30  48  5   ninja   (fight)
10 CLIMB DOWN  15 -15  40  0   0   35  ninja   (steal)
11 FREEZE LIFE 22 -10  3   0   0   20  priest  (influence)
12 HIT         10  16  3   20  20  4   ninja   (fight)
13 SWING       6   5   2   32  16  6   fighter (swing)
14 STAB2       12 -15  4   42  60  10  fighter (thrust)
15 THRUST      19 -17  13  57  66  16  fighter (thrust)    STA= 17
16 JAB         11 -5   3   70  8   2   fighter (thrust)
17 PARRY       17  29  1   18  8   18  fighter (parry)
18 HACK        9   10  6   27  25  8   fighter (swing)
19 BERZERK     40 -10  26  46  96  30  fighter (swing)     STA= 40
20 FIREBALL    35 -7   5   0   0   42  wizard  (fire)
21 DISPELL     25 -7   2   0   0   31  wizard  (air)
22 CONFUZE     0  -7   2   0   0   10  priest  (influence)
23 LIGHTING    30 -7   4   0   0   38  wizard  (air)
24 DISRUPT     10 -7   5   46  55  9   wizard  (air)
25 MELEE       24 -5   17  64  60  20  fighter (club)      STA= 25
26 X2          0  -15  1   0   0   10  ninja   (steal)
27 INVOKE      25 -9   2   0   0   16  wizard  -
28 SLASH       9   4   2   26  16  4   fighter (swing)
29 CLEAVE      12  0   10  40  48  12  fighter (swing)
30 BASH        11  0   9   32  50  20  fighter (club)
31 STUN        10  5   2   50  16  7   fighter (club)
32 SHOOT       9  -15  3   0   0   14  ninja   (shoot)     EXP= 20
33 SPELLSHIELD 20 -7   1   0   0   30  priest  (defend)
34 FIRESHIELD  20 -7   2   0   0   35  priest  (defend)
35 FLUXCAGE    12  8   6   0   0   2   wizard  -
36 HEAL        0  -20  1   0   0   19  priest  (heal)
37 CALM        0  -5   1   0   0   9   priest  (influence)
38 LIGHT       20  0   3   0   0   10  wizard  (air)
39 WINDOW      30 -15  2   0   0   15  wizard  (earth)
40 SPIT        25 -7   3   0   0   22  wizard  (fire)
41 BRANDISH    0  -4   2   0   0   10  priest  (influence)
42 THROW       5   0   0   0   0   0   ninja   (throw)
43 FUSE        1   8   2   0   0   2   wizard  -

EXP - experience
DEF - defence
STA - stamina
LKR - luck required
DAM - damage
FAT - fatigue
CSB - differences for CSB (this table is for DM actually)
SKILL wizard SUBSKILL water is not used here
Last edited by Adamo on Sat Jul 07, 2007 11:59 am, edited 4 times in total.
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Two questions:

1) Is the table the same for DM and CSB?
For all versions?

2) CSBwin dumps this table to a text file
using the ACSII DUMP option. It labels
the colums as follows:

Code: Select all

Attack  Attack      Time   Skill  Defense    Energy  Strength  Damage Prob-
Type    Name               Number                    Required         ability
 00     N             00     00     0x00      0x00      00       0x00  0x00
 01     BLOCK         08     07     0x24      0x04      22       0x0f  0x06
 02     CHOP          10     06     0x00      0x08      48       0x30  0x08
 03     X             00     00     0x00      0x00      00       0x00  0x00
 04     BLOW HORN     00     14     0xfc      0x01      00       0x00  0x06
Is there common agreement as to what the
labels on the columns should be?
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

I updated the table for CSB (there are small differences). I don`t know if there are other differences between versions. I took all the values from ADGE attack editor; I opened your files (original DM graphics.dat and original CSB graphics.dat). I didn`t check the combos and items used by all of these attacks. These values can be easily changed through ADGE.

These values might be descripted in a ADGE attack editor in a wrong way..
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

This is very strange. I compared your table with the descriptions in ADGE monster editor.

1) EXP (experience) - in your table is descripted as "time" value
2) HPP (hit probability) - in your table is descripted as "strenght required"
3) FAT (fatigue) - in your table is descripted as "probability"
4) STA (stamina) - in your table is descripted as "energy"
5) DAM (damage) - in your table is descripted as "damage"; seems the description is right
6) DEF (defence) - in your table is descripted as "defence"; seems the description is right, but.. the numbers are shown uncorrectly.. for BLOW HORN it is 0xfc=252 (in your table), while in ADGE table it is shown as "-4" (???)
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

Adamo wrote:BLOW HORN it is 0xfc=252 (in your table), while in ADGE table it is shown as "-4" (???)
Those hex values are signed bytes. 0xfc + 4 = 0 (mod 256).

Therefore 0xfc = -4.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Here's what I call things in DSB, using "BLOCK" as an example because it's easy to correlate with the table above:

Code: Select all

BLOCK = {
	xp_class = CLASS_FIGHTER,
	xp_sub = SKILL_DEFENSE,
	xp_get = 8,
	idleness = 6,
	stamina_used = 4,
	power = 15,
	req_luck = 22,
	ddefense = 36
}
The "experience" label from ADGE is correct, the "time" is better described by the value I call "idleness" below--

The "hit probability" or "strength required" are both somewhat off-- from my analysis of the code, it has to do with how much luck you have to have to score a lucky hit in case the normal hit roll fails.

"Idleness" is how long the attack icon is greyed, represented in ADGE by "fatigue."

The rest are the same and my findings are consistent with what they are already labeled.
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

I updated the table (changed HPP - hit probability to LKR - luck required). Is everything OK in the table now?

Attack editor description from ADGE readme:
Attack editor:
--------------
The attack editor allows a user to change some of the variables used when selecting and executing an attack. Some characteristics of attacks are, unfortunately, built into CSB/DM and are unchangable. The characteristics are listed below. There are no ways to get around these issues except to modify the source of the game.

Name: The name of the attack. Note, there are only 300 characters available to be used for all attacks, so the combined length of all the names of all the attacks cannot exceed 300!

Skill: The associated skill that is required to use the attack, the amount of skill required to use the attack is set in the COMBO of the item, not the attack! This skill also influences what type of experience you gain while executing the attack.

Experience: The base value of experience added to the character on each attack.

Defense: When using this attack, you're defense will be increased by this variable while the character's attack is greyed out (or fatigued).

Stamina: The base value of stamina used while using the attack.

Hitprob: The base value of calculating whether or not the attack is successful or misses.

Damage: The base value of how much damage the attack does (This is multiplied by the damage value of the weapon as well)

Fatigue: The amount of time, in 1/6ths of a second, that the character's attacks are greyed out, making him unable to attack again. Could also be called the attack speed.

+++ Static attack characteristics +++
-------------------------------------
Note: This list includes the name of the attack for association purposes. The name of the attack is not in relation to the skills, instead, it is dependant on the number of the attack.

LIGHTNING(23): Always shoots a lightning bolt of power 180
DISPELL(24): Always shoots a dispel missile of power 150
FIREBALL(20): Always shoots a fireball of power 150
SPIT(40): Always shoots a fireball of power 250

BASH(30)/HACK(18 )/BERZERK(19)/KICK(7)/SWING(13)/CHOP(2): Always attempts to break down a door
DISRUPT(24)/JAB(16)/PARRY(17)/STAB(14)/STAB(9)/STUN(31)/THRUST(15)/MELEE(25)/SLASH(28 )/CLEAVE(29)/PUNCH(6): Includes the list above, and are the only attacks that will attempt to damage a creature directly infront of them, all other attacks will not damage a creature directly.

CONFUSE(22): Always decrements charges
CONFUSE(22)/WARCRY(8 )/CALM(37)/BRANDISH(41)/BLOWHORN(4): Always attempts to fear the opponent

SHOOT(32): Always attempts to shoot an item in the left hand

FLIP(5): Always flips a coin, yielding heads or tails.

SPELLSHIELD(33)/FIRESHIELD(34): Always casts the shield spell on the party

INVOKE(27): Always casts a random spell. 3/6 times being fireball, 1/6 times being either poison bolt, poison cloud, or dispel. The power of the spell cast is random between 100 and 228.

FLUXCAGE(35): Always creates a fluxcage infront of the player

FUSE(43): Always executes "Fusion" on lord chaos or a high powered dispel attack.

HEAL(36): Always heals the character at the rate of SKILL #13 health per 2 mana OR 10 health per 2 mana, whichever is better.

WINDOW(39): Always casts see through walls.

CLIMBDOWN(10): Always attempts to climb down a single pit infront of the character without a monster.

FREEZELIFE(11): Always freezes life. If the item used is a blue magical box, then the power is 30. If the item used is a green magical box, then the power is 125. Otherwise, the power is 70 and charges are decrimented by 1. I assume power is the amount of time, in 1/6ths of a second (ticks), that time is stopped.

LIGHT(38 ): Always increases the brightness by a constant and decreases charges.

THROW(42): Always throws the object strait forward.

DISRUPT(24): Always hits nonmaterial beings.
**********************************************
I wonder what does X2 attack attempts to do.. is it some kind of invicibility of so??

Code: Select all

NR ATTACK TYPE EXP DEF STA LKR DAM FAT SKL
26 X2          0  -15  1   0   0   10  ninja2
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Adamo wrote:Is everything OK in the table now?
It looks that way to me.
Adamo wrote:I wonder what does X2 attack attempts to do.. is it some kind of invicibility of so??
According to the CSBwin source code it's called "PRAY." There's no other information other than that, and nowhere else in the code is it referenced.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

I don't think you should cite CSBwin as
a source of information. I must have heard it
from sombody else . . . I have no idea where
that word 'PRAY' came from.
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

X is connected with ninja2 skill (steal); the same, that is responsible for climbing down. It also gives 0 experience and has damage = 0. I guess it would be responsible for stealing the items from monsters and was withdrawn to balance the game properly, but I have no proof. This is my guess only.

I assigned it to one of the combos and tried many possibilities, but without effects. It doesn`t harm monsters, it`s not responsible for shooting items or projectiles, it doesn`t open the door, it doesn`t give you any kind of shield, etc.
Does that function do something (anything) in the code?
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Conflux used this as a quick priest level boost for the bone doll - so perhaps it was hijacked for this and got that label at the time?
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

table updated for subskills. Seems that water subskill for wizard is not used here.
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

The DM2 names for subskills are a bit weird. I don't know how they're used in the DM2 code, but, at least in DM/CSB, a couple don't make sense.

For wizards, the "Water" subskill is used for mostly poison-related things. It's not used here, but spells involving ven use it. (I called it "Poison" in DSB)

The "Earth" one is kind of a catch-all-- I called it "Des" in DSB, because I saw its effects as more ephemeral, but I can see how they'd be seen as -affecting- earth-- it's used for footprints, windows, and des ew, though, oddly enough, using a "DISPELL" from a staff will use "Air" instead.

Anyway, as for priests, "Identify" is only ever used for FLIP. That's the only thing it's for. Kind of useless! Maybe DM2 uses it for something.

The same goes for Ninjas and "Steal." It's only ever used for "CLIMB DOWN," so I don't know what the game intends for you to steal. Is there some stealing in DM2? (I haven't played the game much)
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”