英語版のCKwikiのページ、Reading and understanding CK eventsより転載・翻訳中


もし他のパラドックスのゲーム、EU2とかHoIとかVictoriaとかに親しんでいたのであれば、CKのイベントシステムがそれらといささか異なっているとすぐに気付くでしょう。相違点は多いですが、主要な物は以下の通りです。

それでは、基本的なイベントの構造から始めるとしましょうか...

イベントのタイプ

CKには3つのイベントタイプがあります:キャラクターイベント(Character events)、プロヴィンスイベント(province events)そしてプロヴィンス間イベント(province_x_province events)です。

キャラクターイベントは、人物に関するイベントです。普通は、プレイ中の領主(ruler)に関するイベントか、もしくはその領主の宮廷内の人物に関するものです。それから、AIによってトリガーされたイベントを受けることもあるでしょう。例えば封臣(vassals)に関するものなどです。

プロヴィンスイベントはプロヴィンスに関するイベントです。これはプロヴィンスの所有者(owner)に対してのみ起きます。プレイヤーの場合、直轄領(demesne)のプロヴィンスで起きることになります。イベントのトリガーと(発生頻度の)修正は、プロヴィンスとその直接の領主によって左右されます。

プロヴィンス間イベントは「拡散イベント(spread events)」とも呼ばれます。これらのイベントは、ある一つのプロヴィンス(from province)から、そこに隣接するすべてのプロヴィンス(to province)へと、トリガーが成立すれば広がります。もし成立すれば、何かが対象のプロヴィンス(to province)で起きます。例えば、疫病が広まったり、技術が伝播したり、あるいは文化とか宗教が転向したりします。

イベントの構造

CKのイベントの構造は単純で、大きく5つの部分からなります。

province_event = {
    id = 31993

    picture = "event_agriculture" 

    trigger = { condition = { type = province value = 290 } } # Uppland

    mean_time_to_happen = { months = 6 }

    action_a = {
        effect = { type = prosperity value = -1 }
    }
}

最初がIDで、二番目にイベントの画像、三番目にトリガー、四番目にMTTH、最後が影響(action)です。それでは、これらを順を追って見ていきましょう。

Event ID/イベントID

これはゲームでイベントを識別・同定するために使われている数字です。各イベントについて固有のものであり、それからParadoxの常で、10000より大きなIDは自由に使えるように空けられています。

Event picture/イベント画像

そのイベントで使われる画像を指定する部分です:

    picture = "event_agriculture" 

これはリンクの一種で、ゲームに対して、.\gfx\interface\events\フォルダに入ってるどの画像を使うかを伝えます。*.bmpファイルの名前を入れてやります。例えば上記の例では、event_agriculture.bmpファイルが参照されます。
このファイルは320*165ピクセルで、24ビットの標準的なウィンドウズBMPフォーマットです。

Triggers/イベントのトリガー

These are the Trigger Conditions|conditions? which must be met before the game will begin the MTTH calculation.

trigger = { condition = { type = province value = 290 } } # Uppland

For instance, this event will only begin to be processed for MTTH for the province of Uppland. Any code in a line after a <nowiki>'</nowiki>#<nowiki>'</nowiki> symbolis ignored by the game, and is only there to clarify the code for future modification.

MTTH and dynamic polling/MTTHと動的な変化

In CK, no event has a defined date or date range where it will happend if triggers are fulfilled. Date can be a part of a trigger, but there is no guarantee the event will fire on a given day. Instead, you have a set of triggers, an assigned mean time to happend - the MTTH - and MTTH modifiers.

So, what exactly is this MTTH? The concept of mean time to happend comes from the field of statistics, and is often used in reliability and maintainability analyses of materials and components in the form of MTTF (mean time to failure). In short, it gives a statistic probability for an event to happend over a period of time, providing you have a large sample of events. Related to CK events, it defines the probability of a certain event to happend. When an event is polled, the modified MTTH value is plugged into a formula that determines the odds of an event firing and then compared to the result of a RNG to see if it fires in the particular instance. This means that compared to the EU2/HoI/Victoria system, events are not tracked to see how many times it has been tested for someone (or some province) and thus puts far less strain on CPU and memory resources. Instead, as a rule of thumb (athough not strictly an accurate one), one can assume that during any given year of game play each character and each province will be tested about 3 or 4 times for every event.

Any event you make must have a MTTH value defined, in days, months or years. It is recommended that you avoid using very large or very small numbers since in testing it has been observed some "clipping" due to processor rounding. Also, due to some code optimising, the MTTH values are slightly skewed, and you should use values about 25% lower than intended.

MTTH modifiers/MTTHの修正値

In most cases, one would want the events to happend sooner in some situations than in others. It would e.g. make more sense for a child to die in infancy if it was sick compared to a healthy child. Consider the event:

character_event = {
    id = 999

    picture = "event_plague"

    trigger = {
        condition = {
            type = not
            value = { type = age value = 2 }
        }
    }

    mean_time_to_happen = {
        months = 120

        '''modifier = {'''
            '''condition = { type = trait value = illness }'''
            '''factor = 0.2'''
        '''}'''
    }

    immidiate = {
        effect = { type = death }
    }
}

In this event, the MTTH to a health infant (< 2 years) is 120 months, while any child with the illness trait has an MTTH of 120*0.2 = 24 months.

This way, we can define a set of modifiers that will decrease (if < 1) or increase (if > 1) the MTTH of an event.

Effects/イベントの効果

These are the various Event Effect Commands|effects? an event may cause. There are two different methods of implementing an event's effects:

Multiple Options

This method makes one or more option avaliable to the recipient of an event. In the event code these options are refferd to as actions, beginnig at action_a, and progressing down the alphabet, with each letter marking a new action.

    action_a = {
        effect = { type = prosperity value = -1 }
    }

This action will cause the prosperity of the province affected to fall by 1. Some events will have more than one action, however, such as this one from a character event by Cat Lord:

action_a = {
	effect = { type = loyalty value = -0.5 }
}

action_b = {
	effect = { 
		type = random 
		chance = 25
		effect = {
				type = add_trait
				value = forgiving
		}
	}
}

Here the recipient would have two choices:

*AI Modifiers/AIの修正

Events with multiple options can include modifiers within the options to influence the chance of an AI - that is computer-controlled - recipient choosing that particluar action, as can be seen in the complete version of the above example from event 1194 in Claims_Events.txt:

action_a = 
       ai_chance = 50
	effect = { type = add_title_claim value = random_neighbor }
	effect = { type = death value = spouse }
	effect = { type = add_trait value = vengeful }
}

An AI recipient would have a 50% chance of choosing this action. Multiple actions can have various probabilities, as seen in this action group by Cat Lord:

action_a = {
	ai_chance = 36
	effect = { type = prestige value = 10 }
}
action_b = {
	ai_chance = 50
	effect = { type = piety value = 10 }
}
action_c = {
	ai_chance = 32
	effect = { type = piety value = 5 }
	effect = { type = prestige value = 5 }
}

For this event the AI would have a 36% chance of choosing action a, a 50% chance of choosing action b, and a 32% chance of choosing action c. however, these likelihoods can be further modified, like so:

action_a = {
	ai_chance = 36
		#start AI modifier block
		modifier = {
			condition = { type = not value = { type = diplomacy value = 2 } }
			factor = 1.5
		}
		modifier = {
			condition = { type = not value = { type = diplomacy value = 4 } }
			factor = 1.5
		}
		#end AI modifier block
	effect = { type = prestige value = 10 }
}
action_b = {
	ai_chance = 50
		#start AI modifier block
		modifier = {
			condition = { type = not value = { type = diplomacy value = 4 } }
			factor = 0.75
		}
		modifier = { 
			condition = { type = diplomacy value = 7 }
			factor = 0.75
		}
		#end AI modifier block
	effect = { type = piety value = 10 }
}
action_c = {
	ai_chance = 32
		#start AI modifier block
		modifier = { 
			condition = { type = diplomacy value = 7 }
			factor = 1.5
		}
		modifier = { 
			condition = { type = diplomacy value = 9 }
			factor = 1.5
		}
		#end AI modifier block
	effect = { type = piety value = 5 }
	effect = { type = prestige value = 5 }
}

In this action group the likelihood of the AI to choose various actions is influenced by the AI character's diplomacy attribute. To take the modifiers on action as a case study, the likelihood of the AI to choose action a would be multiplied by 1.5 if the AI character had a diplomacy attribute of less than 2, and would be multiplied by a further 1.5 if the AI character had a diplomacy value of less than 4.
Thus, the new AI chances of choosing a particular option are shown on this table:
{| border="1" cellspacing="0" cellpadding="5" align="center"
!Diplo value
!Chance of choosing action_a
!Chance of choosing action_b
!Chance of choosing action_c
|-
|<2
|72%
|37.5%
|32
|-
|2-3
|48%
|37.5%
|32%
|-
|4-6
|32%
|50%
|32%
|-
|7-8
|32%
|37.5%
|48%
|-
|9+
|32%
|37.5%
|72%
|-
|}

Immediate Effects/直接の効果

Note: This information may be incorrect. Could someone who is sure either correct this, or delete this note?<br/>

br/>
Some events can have an effect without being seen in game. The syntax for this type of effect can be seen in this event by Cat Lord:

######################
# Insult your vassal #
######################

character_event = {
	id = 10000
	
	picture = "event_intrigue"
	
	trigger = {
		condition = { type = trait value = arbitrary }
		condition = { type = has_vassal }
	}

	mean_time_to_happen = {
		months = 900

		# Personal trait modifiers:

		modifier = {
			condition = { type = trait value = energetic }
			factor = 0.8
		}

		modifier = {
			condition = { type = trait value = lazy }
			factor = 1.2
		}
	}

	'''''immidiate = {#You're a scum !'''''
		'''''effect = { type = trigger for = random_vassal value = 10001 }'''''
		'''''}'''''
}

In this event the triggering of event 10001 is done automatically, without the event popping up in the game screen (assuming the event occurs to a human player).


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS