Loader
logo

Follow-up: "Opponents Remaining" sometimes ends in minus (-1 or -2)

Started by tos1, April 26, 2024, 10:30:19 PM

Previous topic - Next topic
April 26, 2024, 10:30:19 PM Last Edit: April 27, 2024, 08:12:10 AM by tos1 Reason: To add a note just after the time-flow image.


Related topics:
- "Re: Unmotivated practice melee fighters in arenas" by me. (v8.* but inherited to v9.3)
- "Melee (crowd) fight at arena ends at about 20 fighters left" by me. (v9.*)
- "Follow-up: Bunch of warnings at arena melee fights" by me. (v9.*)

I disassembled all triggers of mst_arena_melee_fight (68 triggers for AWoIaF v9.3, 71 triggers for v7.11) and associated scripts, and temporarily modified the code in my .txt files to check execution path and to test various cases.

The minus number happens because the trigger that does "add_visitors_to_current_scene" operation and the trigger that increases "$g_arena_training_num_agents_spawned" are asynchronous. Both should have to be placed in the same block of the same trigger. (See image below)



(Edited to add a line below)
Note: Both of two other issues (the WARNING and the duplicate count) must be fixed before we invesgate this issue (miscount of remaining opponents). For that, as I wrote in the related topic above, we must remove the loop from (v9.3 mst_arena_melee_fight) trigger 33, add agent_set_slot ":L0" 7 0 before the last try_end in trigger 34, and remove val_add "$g_arena_training_num_agents_spawned" 1 before the last try_end in trigger 37. (Trigger number here is from 0. I don't know true name of the local variable ":L0" here.)

I haven't been able to fully investigate the biggest remaining issue: people who are unmotivated, such as "standing still and staring at each other" and "waiting in line".

I get the impression that "re-setting" team (in order to increase majority-team in the latter half?) by the trigger 34's code (of v9.3) that was not present in v7.11,  does not match the manner for the engine.

In addition,

- I checked troop ID and found that the arena master (as a scene prop?) appears in some try_for_agents loops. He is team 7. It looks like some of the code (e.g. array for the number of team member?) doesn't take into account the team 7, but I haven't looked into that further.

- This mission (of v9.3) has some exact same triggers and I don't see the necessity of doing so (though my understanding of mod system is insufficient): trg 3 = trg 7, trg 8 = trg 40 = trg 49, trg 9 = trg 41 = reg 50, trg 38 = trg 47, trg 39 = trg 48, trg 45 = trg 54, trg 46 = trg 55.

I found an old post (in 2011) on the TW Warband forum Modding Q&A that says something like "If the number of triggers in a mission template exceeds about 60, the engine becomes unstable and may cause condition blocks to be failed.". I don't know if the same can be said for the current mod system.

- Game version (and steam or downloaded):
AWoIaF v9.3 - v9.0, v8.2. Warband v1.174 downloaded
(This minus value doesn't happen in v7.11)

Quick Reply

Note: this post will not display until it has been approved by a moderator.

Name:
Email:
Shortcuts: ALT+S post or ALT+P preview