Kalevala : The Iron Age

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

User avatar
Casual User
Posts: 475
Joined: March 11th, 2005, 5:05 pm

Post by Casual User »

Jgrr wrote:For each scenario, each casualty reduces your morale by a certain number of percentage units dependent on the scenario.
Definitely WML-able. Allow me to propose a system.

($Moraleeffect/$Morale) would be the chance that morale affect the game. $Moraleeffect starts at 0 while $Morale starts at a certain value that can vary from scenario to scenario.

Code: Select all

[event]
name=die
first_time_only=no
[filter]
side=1
[/filter]
[set_variable]
name=morale
add=1
[/set_variable]
[set_variable]
name=moraleeffect
add=1
[/set_variable]
[/event]
That way, both $Morale and $Moraleeffect grow the same way, but the chance that you be affected by morale rises with each casualty.

Example:
Let us say $Morale starts at 2 (very morale-important scenario).

After 0 casualties, $Morale=2, $Moraleeffect=0, chance to be effected by morale = 0.

After 1 casualties, $Morale=3, $Moraleeffect=1, chance to be effected by morale = 1/3.

After 2 casualties, $Morale=4, $Moraleeffect=2, chance to be effected by morale = 1/2.

After 3 casualties, $Morale=5, $Moraleeffect=3, chance to be effected by morale = 3/5.

After 4 casualties, $Morale=6, $Moraleeffect=4, chance to be effected by morale = 2/3.

By setting a higher beginning $Moraleeffect, you would make morale less important in a scenario.
Jgrr wrote:This will directly affect the damage dealt by your units.
The simplest way I can think of is this:

Code: Select all

[event]
name=attack
first_time_only=no
[filter]
side=1
[/filter]
[set_variable]
name=random
random=0..$Morale
[/set_variable]
[if]
[variable]
name=random
less_than=$Moraleeffect
[/variable]
[then]
[store_unit]
x,y=$x1,$y1
variable=temp
[/store_unit]
[set_variable]
name=temp.status.slowed
value=on
[/set_variable]
[unstore_unit]
variable=temp
[/unstore_unit]
[/then]
[/if]
[/event]
This way, whenever you attack, there is a chance based upon morale that your units become slowed and deal only half the damage (so as to suggest that your unit is gripped by fear).

It wouldn't really make sense that this apply to defense as well (also, the unit would actually be slowed down then, while this only affects your battle prowess).

Against slowing units, you should think of a different system.
Jgrr wrote:After a certain number of casualties, each subsequent casualty will cause a certain percentage of units to desert (return to recall list). Deserted units can be "rallied" back in the battle as normal recalls. Loyal units are not affected by morale and won't desert.
This is more tricky because returning an unit to the recall list is not easy.

Simply losing an unit would be simple:

Code: Select all

[event]
name=die
first_time_only=no
[filter]
side=1
[/filter]
[if]
[variable]
name=random
less_than=$Moraleeffect
[/variable]
[then]
[set_variable]
name=random
random=0..$Morale
[/set_variable]
[if]
[variable]
name=random
less_than=$Moraleeffect
[/variable]
[then]
[role]
role=deserter
type=(your unit types, from least experienced to most experienced)
[/role]
[message]
role=deserter
message= _ "We'll all die, I'll take my chances alone..."
[/message]
[kill]
role=deserter
[/kill]
[/then]
[/if]
[/then]
[/if]
[/event]
This way, after each casualty, the chance that one of your units should desert is ($Moraleeffect/$Morale)^2. The unit that would desert is simply dead.

The unit that would desert would be the most experienced of your low-level units. You could make it so some unit types do not desert by taking them off the list (heroes and very high-level units).

What you want to do is a little more complex, as it requires storing the deserters till the scenario's end. It is feasible though.

Well, hope this helps. Let me know if you like the system.

P.S. My WML is a little rusty after three months, so the code will probably need cleaning up
fmunoz
Founding Artist
Posts: 1469
Joined: August 17th, 2003, 10:04 am
Location: Spain
Contact:

Post by fmunoz »

An Amber and bear claw necklace :-)
More later...
Attachments
ambernecklace.png
ambernecklace.png (4.57 KiB) Viewed 2292 times
fmunoz
Founding Artist
Posts: 1469
Joined: August 17th, 2003, 10:04 am
Location: Spain
Contact:

Post by fmunoz »

A kantele... very plain one, still room for some improvement
Attachments
kantele.png
kantele.png (4.25 KiB) Viewed 2285 times
Jgrr
Posts: 121
Joined: June 19th, 2006, 5:53 pm
Location: Espoo, Finland

Post by Jgrr »

Great pictures so far!

Me and my schedules... this starts to look like a typical software project. :) The completion of the script (in plaintext) is about 80% now. To still be able to publish something, I've now added some more units to be recruitable to the test scenario. Note the warning: they are not going to stay there, they are there just for the sake of testing.
Jgrr
Posts: 121
Joined: June 19th, 2006, 5:53 pm
Location: Espoo, Finland

Post by Jgrr »

I've unfortunately been struck by an attack of self-criticism and trying to focus attention on other things for a while... this project is not dead, it is just sleeping. Expect an update in a couple of weeks.
Post Reply