Looking for a bit of help regarding events

The sequel of the legendary wargame with a complete graphics and interface overhaul, major new gameplay and design features such as full naval combat modelling, improved supply handling, numerous increases to scenario parameters to better support large scenarios, and integrated PBEM++.
User avatar
cathar1244
Posts: 1321
Joined: Sat Sep 05, 2009 2:16 am

Looking for a bit of help regarding events

Post by cathar1244 »

Hi all,

I'm looking at a scenario that has crash to desktop problems.

One thing I've seen in a .gam dump of the scenario is this:

<EVENT ID="7" TRIGGER="Turn" CONTINGENCY="29" EFFECT="Rail transport 2" X="22" Y="111" VALUE="50000"/>

So I figured out CONTINGENCY means this event depends of Event 29 triggering.

Except event 29 is not defined.

Does TOAW ignore events like this or could it lead to unstable program behavior?

As a secondary question, I note events like this:

<EVENT ID="12" TRIGGER="1 occupies" CONTINGENCY="4" EFFECT="News only" X="36" Y="172" NEWS="WP captures the Kaiserslautern Reforger hex"/>

So, contingent on Event 4? Yet, viewing it in the event editor in the program makes no mention of the contingency. Is this a by product of the "news only" event type, or again, does it point to something buggy with the event definitions?

Thanks for any suggestions or help.

Cheers

User avatar
golden delicious
Posts: 4163
Joined: Tue Sep 05, 2000 8:00 am
Location: London, Surrey, United Kingdom

RE: Looking for a bit of help regarding events

Post by golden delicious »

ORIGINAL: cathar1244

Hi all,

I'm looking at a scenario that has crash to desktop problems.

One thing I've seen in a .gam dump of the scenario is this:

<EVENT ID="7" TRIGGER="Turn" CONTINGENCY="29" EFFECT="Rail transport 2" X="22" Y="111" VALUE="50000"/>

So I figured out CONTINGENCY means this event depends of Event 29 triggering.

Is that right? To me this reads that the event is triggered by Turn 29. If it was event 29 then it would read 'TRIGGER="Event Activated"' or similar.
Does TOAW ignore events like this or could it lead to unstable program behavior?

I doubt this would cause a crash bug, as it's a very easy mistake to make and so would be causing crashes all over the place if it was a problem. The only time I've seen a serious stability problem in a particular scenario, there was a certain unit which was causing the issue; there was something wrong with the connection between the unit and the parent formation (I forget what)- this was an old Spanish Civil War scenario which was doing the rounds nearly 20 years ago.

What's happening when the game crashes? Is it following a certain action by the player or during inter-turn calculations?
As a secondary question, I note events like this:

<EVENT ID="12" TRIGGER="1 occupies" CONTINGENCY="4" EFFECT="News only" X="36" Y="172" NEWS="WP captures the Kaiserslautern Reforger hex"/>

So, contingent on Event 4? Yet, viewing it in the event editor in the program makes no mention of the contingency. Is this a by product of the "news only" event type, or again, does it point to something buggy with the event definitions?

I'd suggest the "contingency" field is simply not used for this trigger type and this field is storing an old value from when the event ID was used for something else. Try changing the event trigger to "Turn" in the editor and see if you see the value of 4 coming through.
"What did you read at university?"
"War Studies"
"War? Huh. What is it good for?"
"Absolutely nothing."
User avatar
cathar1244
Posts: 1321
Joined: Sat Sep 05, 2009 2:16 am

RE: Looking for a bit of help regarding events

Post by cathar1244 »

Thanks GD. Yeah, I think you're right about that being the turn number.

Not sure about these crashes. About the time the crashing was noted, a problem was found with garbage collection in memory that was tied to the number of strings used for location names. But some scenarios, like Directive 21, have over 2,000 location names, and as far as I know, don't suffer the crashes to desktop.

In the case of this scenario, the crashes seemed random. Which log do you think might provide the best data (for when a crash occurs) -- the regular TOAW log or one of the others?

This scenario was an extension of one originally done by Bob Cross. I don't think Bob's original version had the crash issue, so it could be tied to new units/formations, events, or perhaps the expansion in location names.

Cheers
User avatar
Curtis Lemay
Posts: 15299
Joined: Fri Sep 17, 2004 3:12 pm
Location: Houston, TX

RE: Looking for a bit of help regarding events

Post by Curtis Lemay »

Windows 10?
My TOAW web site:

Bob Cross's TOAW Site
User avatar
76mm
Posts: 4768
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Looking for a bit of help regarding events

Post by 76mm »

ORIGINAL: golden delicious
Is that right? To me this reads that the event is triggered by Turn 29.
No, Contingency is ONLY used with an event trigger. If it is a turn trigger, it uses the TURN field.
ORIGINAL: golden delicious
I'd suggest the "contingency" field is simply not used for this trigger type and this field is storing an old value from when the event ID was used for something else.
Yes, the event engine leaves lots of "artifacts," or values apparently set when the event was used for something else, but not discarded (just ignored) once the event is changed. This usually doesn't cause an issue, but could cause an issue if it is then changed BACK to an event that does use that field, and the value in the field is not valid. I'm not so sure that such an issue wouldn't cause a crash.
User avatar
76mm
Posts: 4768
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Looking for a bit of help regarding events

Post by 76mm »

ORIGINAL: cathar1244
Thanks GD. Yeah, I think you're right about that being the turn number.

No, it's not. The turn number uses the TURN field, which is absent. The CONTINGENCY field is used for trigger events. That might be causing the crash. Insert a TURN field with an XML editor and see what happens. Note that the turn number in the XML file will be one less than the number displayed in the game...that's how it works for some reason.
User avatar
cathar1244
Posts: 1321
Joined: Sat Sep 05, 2009 2:16 am

RE: Looking for a bit of help regarding events

Post by cathar1244 »

Thanks 76mm!

@Curtis -- not sure. I think it was Win10, but will have to verify with those who experienced the crashes.

Cheers
User avatar
rhinobones
Posts: 2224
Joined: Sun Feb 17, 2002 10:00 am

RE: Looking for a bit of help regarding events

Post by rhinobones »

Other than the “Evil Editor” has anyone ever compiled examples of events in an easy-to-read format? I’ve tried to decipher event construction using the XML Editor, but that tends to get confusing very quickly.

Regards
Colin Wright:
Pre Combat Air Strikes # 64 . . . I need have no concern about keeping it civil

Post by broccolini » Sun Nov 06, 2022
. . . no-one needs apologize for douchebags acting like douchebags
User avatar
76mm
Posts: 4768
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Looking for a bit of help regarding events

Post by 76mm »

ORIGINAL: rhinobones
Other than the “Evil Editor” has anyone ever compiled examples of events in an easy-to-read format? I’ve tried to decipher event construction using the XML Editor, but that tends to get confusing very quickly.
While I was working on events in TOAWxml, I created an events spreadsheet which details which triggers use which fields, which effects, etc. The spreadsheet (actually, spreadsheets) shows which triggers/events are in which groups, which fields are involved, how they are labelled in the editor, etc. I have to say that I've found these spreadsheets really helpful when working with events.

Basically there are five groups of triggers which use the same fields, and six groups of events which use the same fields. The exact fields used, and their meaning, depends on the Trigger group plus the Effect group. To make things even less clear, the same fields can be used for different things depending on which Triggers/Events are involved (for instance, "TURN" can mean entry turn or delay, depending on the context), and values in the XML are often one less than values in the editor. Another thing that muddies the water is that the editor seems to leave unused fields in the XML ("event artifacts") rather than cleaning them up, so often your events XML includes entries which are totally irrelevant for the particular event.

IMHO to understand events you need to understand their structure, rather than just see lots of examples, because the examples will only confuse you. Once you understand their structure, however, all will be clear! [8D]

I'd be happy to upload this spreadsheet here, although you'll probably need to study it a bit to understand it.

Here is a screenshot of the master events summary, showing which fields are used for which trigger and effect groups:

Image
Attachments
eventsmaster.jpg
eventsmaster.jpg (168.56 KiB) Viewed 653 times
User avatar
76mm
Posts: 4768
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Looking for a bit of help regarding events

Post by 76mm »

While I'm at it, here are the event triggers broken down into trigger groups, and showing fields used for each group. Obviously, if a trigger says something about force 1, it also applies for force 2.

Image
Attachments
triggergroups.jpg
triggergroups.jpg (58.53 KiB) Viewed 651 times
User avatar
76mm
Posts: 4768
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Looking for a bit of help regarding events

Post by 76mm »

Here here are the effects groups. This is pretty much all there is too it...the spreadsheets include a couple more summary sheets, but they don't include anything not included in the master summary posted above.

Image
Attachments
effectsgroup.jpg
effectsgroup.jpg (147.2 KiB) Viewed 651 times
User avatar
76mm
Posts: 4768
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Looking for a bit of help regarding events

Post by 76mm »

ORIGINAL: 76mm
The turn number uses the TURN field, which is absent. The CONTINGENCY field is used for trigger events. That might be causing the crash. Insert a TURN field with an XML editor and see what happens.
Actually I'm quoting myself here to correct myself--I forgot that if an event is triggered by a Turn but there is no Turn field, it means that the event is triggered on Turn 1 (ie, Turn 1 - 1 = zero = a null field). Sorry for any confusion.
User avatar
rhinobones
Posts: 2224
Joined: Sun Feb 17, 2002 10:00 am

RE: Looking for a bit of help regarding events

Post by rhinobones »

Yes, please post your spreadsheet. Always something new to learn.

Not positive, but what I see seems to take the event information from the Evil Editor and put it into a more concise and readable format. Not quite what I’m looking for but appears to be a very good starting point.

Best Regards
Colin Wright:
Pre Combat Air Strikes # 64 . . . I need have no concern about keeping it civil

Post by broccolini » Sun Nov 06, 2022
. . . no-one needs apologize for douchebags acting like douchebags
User avatar
76mm
Posts: 4768
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Looking for a bit of help regarding events

Post by 76mm »

ORIGINAL: rhinobones
Not positive, but what I see seems to take the event information from the Evil Editor and put it into a more concise and readable format.
Zip file is attached. Actually I didn't start from the Evil Editor but went through every event trigger and event in the in-game editor. As you can imagine, this was a fairly tedious process, but I'm reasonably confident that it is correct.

The two tables included in the file which I've not posted are summaries of the event triggers and effects, but I don't think there's any info in them that is not included in the master summary (which includes both).

Note also that when messing with the XML files you need to pay very strict attention to capitalization--if you get it wrong it definitely won't work, might crash the game. So it's "Cool front" but also "Cease Fire".
Attachments
TOAWEVENTS.zip
(24.96 KiB) Downloaded 20 times
User avatar
76mm
Posts: 4768
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Looking for a bit of help regarding events

Post by 76mm »

One more clarification: the summary cells in the trigger and effect summaries are the events' "signature" in the editor, ie which parameters are exposed in the editor--each group uses the same "signature". To see which fields are used in the XML, you have to reference the top line in the master summary.

also, as you'll see, Trigger Groups 1 & 2 only use Effects Group 2.
User avatar
cathar1244
Posts: 1321
Joined: Sat Sep 05, 2009 2:16 am

RE: Looking for a bit of help regarding events

Post by cathar1244 »

76mm,

Having trouble reading the tables you've posted here.

Take T1-E2. The table with green cells indicates this should be a combination that uses radius as a value. But when I look at supply radius, it appears to be part of E1. What am I not seeing?

ETA: Okay, I see radius is a value used by both triggers and effects. Complex enough for errors to easily occur when read or manually edited.

Cheers
User avatar
76mm
Posts: 4768
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Looking for a bit of help regarding events

Post by 76mm »

ORIGINAL: cathar1244
Complex enough for errors to easily occur when read or manually edited.
Indeed. I've tried to bake all of this into the event editor in TOAWxml, as well as cleaning up "event artifacts", but haven't ever gotten much feedback on whether it is working for people.
User avatar
cathar1244
Posts: 1321
Joined: Sat Sep 05, 2009 2:16 am

RE: Looking for a bit of help regarding events

Post by cathar1244 »

I am looking at this .gam file description of an event:

<EVENT ID="127" TRIGGER="Event activated" CONTINGENCY="16" EFFECT="Theater Option 1" VALUE="10006" NEWS="Authorize nuclear weapons - 100 VP penalty" />

In the event editor, looking at this event, it states that it will in turn activate Event 10007.

Now, I understand TOAW IV has a limit of 10,000 events.

Is there a reason to set an event in this way, or should the VALUE field be set to "9999" ?

Cheers
User avatar
76mm
Posts: 4768
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Looking for a bit of help regarding events

Post by 76mm »

Note that the Effect is "Theater Option 1" rather than "Activate Event". I'm not sure--I either didn't fully explore Theater Options or don't remember if I did--but it is possible that the 10006 figure includes a "prefix" before the event number to indicate which side's Theater Option it is. To check, you might want to check the VALUE fields of other Theater Options (for both sides) to see if they correspond. Also, check event 7 (6?) to see if it makes sense if that is the one being called.

Also, I'm not sure, but IIRC once when I was playing around with events I tried entering an "Activate Event" which did not exist, and the game didn't seem to like that, although I can't remember the details at this point.

The event editor in TOAWxml allows you to filter by Effect (or trigger) if that helps at all...
User avatar
Curtis Lemay
Posts: 15299
Joined: Fri Sep 17, 2004 3:12 pm
Location: Houston, TX

RE: Looking for a bit of help regarding events

Post by Curtis Lemay »

ORIGINAL: cathar1244

I am looking at this .gam file description of an event:

<EVENT ID="127" TRIGGER="Event activated" CONTINGENCY="16" EFFECT="Theater Option 1" VALUE="10006" NEWS="Authorize nuclear weapons - 100 VP penalty" />

In the event editor, looking at this event, it states that it will in turn activate Event 10007.

Now, I understand TOAW IV has a limit of 10,000 events.

Is there a reason to set an event in this way, or should the VALUE field be set to "9999" ?

Cheers
This is how Theater Options are removed. If the event to activate is > 9999 (and the text is identical to another TO event) the TO is removed.

Inserting events prior to that event can cause the event number to advance past 10000.
My TOAW web site:

Bob Cross's TOAW Site
Post Reply

Return to “The Operational Art of War IV”