Afficher un message
  #5  
Vieux 11/09/2007, 16h26
Avatar de Manu Militari
Manu Militari Manu Militari est déconnecté
Un Worms peut en cacher un autre.
 
Date d'inscription: août 2005
Localisation: Seine Saint Denis
Messages: 2 118
Attention le concept du "mean_time_to_happen"

Le concept le plus important des events

Very important concept: MTTH (=mean_time_to_happen)
Un concept très important : le MTTH (= "temps moyen de déclenchement" (pour se produire))

Events are tested based on their probability to happen, not on a specific set-in-stone date (although date may be a component of the event trigger). Loosely, this is based on a statistical concept used in materials testing and analysis called "mean time to failure". A web search will show you some of the complexities of this system for those who are mathematically inclined but may need to bone up on their statistics.
Les events sont testés via leur probabilité à se déclencher et non pas avec une date "en dur" (bien que la date puisse être un composant du déclenchement d'événement). Malheureusement, ceci est basé sur un concept statistique, bati pour la science de la resistance des matériaux et son analyse, appelé "temps mpyen de rupture" (du matériau). Une recherche sur le web vous montrera la complexité de ce système pour ceux qui ont une inclinaison pour les mathématiques (NDT : de haut niveau) mais vous aurez besoin de décortiquer ces statistiques.


Each event is assigned a MTTH value in either days, months or years. It is recommended that you avoid using very large or very small numbers since in testing we have observed some "clipping" due to processor rounding. This assigned value is plugged into a hard-coded formula that determines the odds of an event firing and then compared to the result of a RNG to see if it fires in any particular instance. This means that events are not tracked to see how many times it has been tested for someone (or some province) and frees up vast amounts of CPU and memory for other game functions.
A chaque évènement est assigné une valeur de MTTH que ce soit en jour, mois ou année. Il est recommandez que vous évitiez d'employer des nombres très grands ou très petits puisqu'en pratique nous avons observé un certain "tronquage" due à l'arrondie du processeur. Cette valeur assigné est affecté à une formule mathématique codé "en dur" qui détermine la probabilité d'un déclenchement d'un event et alors compare au résultat d'un RNG (? tableau ? vecteur ? ) pour voir s'il déclenche n'importe quel event particulier. Ceci signifie que les events ne sont pas "pisté" pour savoir combien de fois elle ont été testé pour un pays (ou pour une province), libérant grace à cela de vaste quantité de ressources système et de mémoire pour d'autres fonctions du jeu.


The net effect is that assigning a MTTH of 1 year does not mean that the event will fire in 1 year. It means that the mean time to happen is one year, but the formula being used has a rather long head and tail so it could fire in a matter of days, or it could fire years from now (or never) depending on what number the RNG produces. Think of it as predicting the results of a die roll. You can calculate the odds of a certain result, but you can't guarantee that any given test will produce it. You could, theoretically, have a test that *never* produces the result - although the odds of this happening are staggeringly small.

Further, there are currently (as of 1.00 and 1.01) some hard-coded "cheats" being used as part of the processor optimization process that are helping to keep the game performance as high as possible but are resulting in some slightly negative effects on "real" MTTH as opposed to statistically determined MTTH. This is being worked on, but for now I would recommend using a lower MTTH value than would be empirically calculated in order to have your events trigger when you want them to, and then test your event repeatedly in a controlled environment to determine if its frequency is roughly what you desire. My personal rule of thumb - and this is a personal reccomendation, not an official one - is to use an MTTH value that is about 25% lower than the one you would normally expect to use.

Example: if I want something to have a *real* MTTH of 10 years I would usually set the event MTTH to about 7.5 years. To repeat an earlier caveat, though, this doesn't guarantee that the event will fire in 10 years - it merely results in the effective event MTTH being about 10 years and repeated testing will probably produce a mean firing frequency of 10 years. It could fire in a day, or it could fire 100 years from now. I conducted several thousand controlled statistical tests on both the advances_discovery and advances_spread events when I scripted them to ensure that they were WAD with the MTTH values I'd assigned them, and I would recommend that anyone doing "critical" event scripting conduct similar testing.

Some more tips:

Don't forget to use MTTH modifiers since they tend to make events more interesting and more "fun" for the players - and decrease the average person's ability to guess roughly when an event will fire. In particular, use monarch or kingdom stats in tiers (i.e. apply different modifiers depending on how good or bad the martial skill is), or power settings in tiers. In character events, don't forget to throw in some traits modifiers to increase the importance/effect of having a certain trait. There is plenty of fun to be had with these!

Caveat: don't forget, when scripting, that all modifiers that are valid (i.e. the condition test results in "true") are multiplied together to produce a modified MTTH. This is a common error that can be made when scripting tiers.

In province_x_province events, don't forget that you *must* specify either "to" or "from" in almost every trigger, condition and effect. For the few that you don't have to specify, either the "to" province is used or the condition is a comparison between the two provinces.

There are probably more tips, but those are the ones that spring to mind right now.
__________________
Un Worms peut en cachez un autre

Dernière modification par Manu Militari ; 12/09/2007 à 14h48.
Réponse avec citation