You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Custom scenario crash
posted 21 October 2017 11:31 AM EDT (US)   
I've created a lot of scenarios so far but never had this problem before:
While testing/playing my scenario in single- or multiplayer, the game just closes at a (how I think) random point, opening the error window: "Age of Mythology: Extended Edition has stopped working" (even other players' games crash in multiplayer).

Here's my scenario Data:

scenario name: open_fight
number of players: 8 (everyone has greek gods)
map size: 500x500 meters
average height: 0.00 meters \
minimum height: 0.00 meters \ it's just flat
maximum height: 0.00 meters \
mainly used floors:
BlackRock
CoralA
CoralC2
CityTileAtlantisCoral
CoralC
map type: blank
seed: 0

The thing that's different from other maps I created is that there are a lot of triggers (66 in total).
Most of them are executed instantly at the start, providing the players with age 4 (3 triggers), a lot of upgrades for walls and towers (20 triggers), allowing and forbidding to build, research and train specific buildings, techs and units (24 Triggers), and one that removes all godpowers. And one trigger that quadruple invokes plenty in the middle of the map, creating four vaults close to eachother.
Further there's one trigger that provides the players with 10 of all resources per second as there are no sources on the map. This is the only trigger with max priority, all others are normal. And finally some triggers that set a maximum of 10 villagers for all players (16 triggers).
So these are a lot of triggers, but note that 49 triggers get activated only once at the start and that always worked perfect so far. For the other triggers: I actually have some other scenarios that use the same triggers and work just fine, so idk if the error has something to do with triggers at all.
Which brings us to other possibilities: As mentioned above everyone starts in age 4. The map is basically a round arena with eight circles of trojan walls (one for each player). Inside those walls, everyone has four villages, eight towers and one titan gate (because the ai doesn't research them). The gates work, they get built randomly by the ai villagers that finish another building nearby. Since I have the titan gates, the game NEVER crahed before any titans were freed. But BEFORE I added the gates, the scenario crahed aswell.

So that's my problem right now. If anyone has a clue, I'd be very happy

Thany you!

[This message has been edited by Niley (edited 10-21-2017 @ 11:35 AM).]

Replies:
posted 21 October 2017 01:21 PM EDT (US)     1 / 20  
I 'm not expert enough to say what is the problem here (but i don't see a problem in the triggers)
However the best way is to playtest.
You delete all triggers and if it isn' t working you remove titans gates etc (with a backup of course)

Be careful: the biggest problems you can have are linked problems.
Let's say it's the triggers with the titan gate that cause problems,if you don't see a problem WITTHOUT triggers you can think that they are the problem but not necessarely.
posted 21 October 2017 05:35 PM EDT (US)     2 / 20  
Is it a Trigger to set everyone to greek gods?

Also I am confused on what of the things you told is a trigger, and what an effect. Basically I have two Initiation-Triggers. One is high priority and "Run immediatly" so that it gets loaded with the start of the game to set the right diplomacy and player kill all god powers. "RUn immediatly" should be used carefully though, maybe you got that active anywhere? Also I learned that you can put high priority on all your triggers.

Initiation2 is just active/high priority to set all the technologies, modify tech, forbid and allow and stuff. With naming a lot of units I'd guess they are over 50 effects in there.

The next trigger you'd need would be one loop for the resources. So it sounds like 3-4 triggers in total.


I'd take a look at your file, but I cant with EEdition x.x

Azarath Metrion Zinthos

Steam: Order of Azarath
Twitch: twitch.tv/orderofazarath
Discord: Azarath @ https://discord.gg/3ENKJeb
posted 22 October 2017 03:40 AM EDT (US)     3 / 20  
So I tried adding a 'send chat' effect to every trigger to look if any of them get spammed excessively and it turns out setting a trigger to active AND loop leads to that effect. My trigers that check for the number of villagers a player possesses have that setting, so there are constantly 8 triggers that get spam-activated. That could be the problem tho I have other scenarios that use the same triggers and don't crash.
Thing is I need the trigges to check if a player reches a number of villagers and then disable them. Is there a way to create a triger that checks like one time per second instead of 50 times? Low priority doesn't seem to have an effect on this.
posted 22 October 2017 04:54 AM EDT (US)     4 / 20  
I have very rarely encountered a crash from spamming triggers - that usually just causes a slowdown but I could be wrong in your case. Generally I would take note of what was happening or about to happen the moment the crash occured.

If no good following your idea try putting all looping triggers have a time of 1 second and seeing if you still have the issue.

Just yesterday I been plagued with a crash that happens 10 seconds in which I have not found a proper solution to but if I set the non human players to No AI it works fine so it seems to be AI related. Might be worth trying in your case on multiplayer.
posted 22 October 2017 11:53 AM EDT (US)     5 / 20  
@nottud: when the game crashes the window just disappears and another window opens, giving the standard windows error message: Age of Mythology has stopped working. That's all. Multiplayer games also crash, showing all other players the same message.
So setting a timer of 1 second in addition to the unit counter causes the trigger to test once per second? That's so logic I can't believe I haven't thought of that yet. I'm dumb XD
Yes, it should work in multiplayer without an extra ai from the editor. Will try that if the other way doesn't work.

[This message has been edited by Niley (edited 10-22-2017 @ 11:53 AM).]

posted 22 October 2017 01:02 PM EDT (US)     6 / 20  
I have more often encountered sync errors rather than crashes when I'm 'spamming' triggers.

I would try to redesign your looped triggers in such a way so that they don't have to be looped where possible. I don't know how your triggers that check for the number of villagers work exactly, but those might already be good candidates to be redesigned. If those triggers just count the amount of villagers, then they could also be implemented like this:

Trigger name: P1SetVillagerCount
Active [X] Loop [] Run Immediately []
@HIGH Priority

NOT [X] OR []

Condition: QV Player Unit Count
Player = 1
Unit = Villager Greek
Operator = ==
QV = p1_villager_count


Effect: Fire Event
Trigger = P1SetVillagerCount_


Trigger name: P1SetVillagerCount_
Active [] Loop [] Run Immediately []
@HIGH Priority

Condition: Always

Effect: QV Set Unit Count
QV = p1_villager_count
Player = 1
Unit = Villager Greek


Effect: Fire Event
Trigger = P1SetVillagerCount

So what these triggers basically do is they only update the villager count when the quest var-stored villager count does not match the actual villager count. The elimination of the loop may or may not help decrease the chance of a crash to occur because I doubt these triggers are even related to the occurrence of the crash. But it will definitely increase the efficiency of your triggers which directly impacts the game's performance. Although in this case a villager counter is so light-weight, the performance increase would be negligible. But if there're more of such looped triggers, a decrease in performance could definitely be noticed then (and possibly higher chances of sync errors to occur). Just something to consider.

<Effect name="QV Set Unit count">
<Param name="QVName" dispName="$$23952$$Var Name" VarType="string">QV1</Param>
<Param name="ProtoUnit" dispName="$$19160$$Unit" VarType="protounit">default</Param>
<Param name="PlayerID" dispName="$$22534$$Fake Player" VarType="player">0</Param>
<Command>trQuestVarSet("%QVName%", trPlayerUnitCountSpecific(%PlayerID%, "%ProtoUnit%"));</Command>
</Effect>

<Condition name="QV Player Unit Count">
<Param name="PlayerID" dispName="$$22301$$Player" VarType="player">0</Param>
<Param name="ProtoUnit" dispName="$$19160$$Unit" VarType="protounit">default</Param>
<Param name="Op" dispName="$$22297$$Operator" VarType="operator">==</Param>
<Param name="QV" dispName="Quest Var" VarType="string">QV1</Param>
<Expression>trPlayerUnitCountSpecific(%PlayerID%, "%ProtoUnit%") %Op% trQuestVarGet("%QV%")</Expression>
</Condition>

What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]

[This message has been edited by Lewonas (edited 10-22-2017 @ 01:04 PM).]

posted 22 October 2017 04:06 PM EDT (US)     7 / 20  
@Lewonas:
Thanks for the inpunt, but I don't think that my computer's gonna lack any performance by triggers checking once per second (I mean i have up to 16 triggers that check 50 times per second, causing a total test of 800 times per second and I'm going well most of the time at 120+ fps and several other programs in use on my PC. Yes it's high-end btw )

Right now my triggers look like:

Active [X] Loop [X] Immediately [ ] (have to set both active to make loop work when no timer is set as condition)

Condition: PlayerUnitCount
Player = 1
Unit = VillagerGreek
Operator = >= 10
Effect: ForbidAndDisableUnit
Player = 1
Unit = VillagerGreek

And the enabling:

Condition: PlayerUnitCount
Player = 1
Unit = VillagerGreek
Operator = =< 9
Effect: UnforbidAndEnableUnit
Player = 1
Unit = VillagerGreek

These are definitely not lightweight, but it works fin if I change them to the following:

Active [ ] Loop [X] Immediately [ ]
Condition1: as seen above
Condition2: timer = 1s

That should cause the system to test only once per second. Especially with once per second the operators >= and =< are needed instead of == , just imageine two villagers dying within one second and they're not gatting enabled again.
I KNOW THIS TRIGGER ALLOWS A BYPASS BY PUTTING VILLAGERS INTO THE QUEUE BEFORE YOU REACH 10 but I'm a trigger noob, I didn't even know about the Fire Event function before and I'm only playing with friends who know the rules.
Thanks anyway, I'm still not sure what Fire Event does (I need the villagers to be enabled again as soon as you have less that 10 villagers and disables whan you have enouggh again and so on), but I'll try that out next time ;)

Oh and I can't / don't want to modify the scenario file directly, I want basic triggers only. I'm also not intending to use any mods.

[This message has been edited by Niley (edited 10-22-2017 @ 04:11 PM).]

posted 22 October 2017 04:27 PM EDT (US)     8 / 20  
66 isn't a lot of triggers

Unusual to have such a random crashing situation though. I'd recommend checking the triggers for syntax like there isn't a sneaky decimal point in there somewhere.
Also remove the _ from the scenario filename.

______________________________________ Yeebaagooon ______________________________________
____________________ AoMH Seraph ____________________
"You can't trust yeebaagooon to lead a rebelion, He would send everyone to steal mirrors so he could bask in his own brilliance." - Out Reach
"Yeebaagooon had never seen a more handsome man in all his life. He couldn't control himself, He needed to act. Gripping the mirror in his strong arms he kissed the figure before him..." - Out Reach
AoMH: Unfinished Scenarios|Singleplayer: Codename Ripto|Multiplayer: Minigames Z|CSC 7
Ex Seraphs Dictator, Spore Heaven Seraph

[This message has been edited by Yeebaagooon (edited 10-22-2017 @ 04:28 PM).]

posted 23 October 2017 06:41 AM EDT (US)     9 / 20  
I'm also using a lot of this sort of trigger.
The problem with forbid and unforbid is that it is complicated for the user (he can think that he will not be able to train this unit anymore).
That's why it's much better in your case to put simply a build limit.
If you have the titan expansion or the extended édition then you have the effect "modify protounit"
Then you just have to make this at the brgining:
Trigger name: vil_buildlimit
Active, high priority
Condition always
Effect modify protounit
Unit : villager greek
Player : what you need
Field: build limit
Delta:-70 (because this is 80 at the begining)

@lewonas why do you use two effect with fire event while here the looping trigger seems exactly the same (and maybe a bit faster) and takes less place in the editor (so this is easier to organise)
And for your exemple i use the same to make a bl for unit that are transformed after their garhering point
posted 23 October 2017 08:25 AM EDT (US)     10 / 20  
Oh, if you just want to limit the amount of villagers the player can have, just modify the build limit like gurkensalad suggested.

Yes, like I mentioned you won't notice a decrease in performance with your light-weight looped triggers. But it's still a pretty bad trigger design to use. You really don't want to keep activating the forbid and disable commands every frame (or 1 second if you use a timer) over and over again for the entire duration of the game. It's so much better to enable/disable the units just once when it's necessary.

The Fire Event effect just activates a trigger. So in my trigger example, it activates the inactive P1SetVillagerCount_ trigger (and this trigger also has a Fire Event effect that will reactivate the P1SetVillagerCount trigger).

You don't have to modify the scenario file to use custom triggers. You add custom triggers to your collection of triggers in the typetest.xml (or separate .xml) files in the trigger2 directory (more information can be found in the trigger request thread FAQ). And don't worry, adding custom triggers is absolutely not the same as modding the game. You're just expanding the set of tools you can use for when you're creating triggers. Once you really get into designing scenarios, you will find that the basic triggers are too limited or inefficient for what you want to create.

One simple example is the Diplomacy basic effect. Let's say you want to set player 1 as an ally to 6 other players and vice versa. You would have to use 12 basic Diplomacy effects as opposed to just 1 custom Diplomacy effect that can set diplomacy rules for multiple players.

I (and every other designer here) really couldn't do without custom triggers.

@eine_gurkensalad: I didn't loop the trigger because I don't want the game to keep reactivating the trigger if the conditions aren't met yet.

What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]
posted 23 October 2017 09:52 AM EDT (US)     11 / 20  
Listen to Yeeb, your problem is most likely a syntax error, like an invalid or odd character like $#@& etc in either a message effect or a chat effect. Email me the scenario and I'll take a look as soon as I can, might not be for a few days. I saw this earlier and wanted to take a look but I couldn't. I just don't want you changing so much about the scenario when the problem could just be one little character. At least save a version for me (the original one) so I can look at it. I am very good at deducting these kinds of things and have helped alot of people in the past.

posted 23 October 2017 11:19 AM EDT (US)     12 / 20  
I may be wrong, but I always thought the syntax errors only cause problems when loading the scenario? For instance, if you use the % symbol in a chat or dialog it causes an instant crash to desktop. And if you wrongly use the ' " symbols, all the triggers will stop working.

What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]
posted 23 October 2017 11:38 AM EDT (US)     13 / 20  
@eine_gurkensalad:
Thank you! This is exactly what I need! I'm a real trigger-noob you see, but I'm getting better :P

@Yeebaagooon and @That AoM Guy:
U think _ is even supposed to prevent crashes. When searching for a file, the computer system always has an easier job when using _ instead of a blank. So I thought (and still do) calling it open_fight would make it easier than open fight.

Edit:
Oh and the name can't be the problem, because to test the scenario outside the editor I use a file named _test which I also used for other scenarios that worked perfectly.

[This message has been edited by Niley (edited 10-23-2017 @ 11:51 AM).]

posted 23 October 2017 12:04 PM EDT (US)     14 / 20  
Certainly in AI scripting, you can include syntax errors which compile fine and only blow up when run. The biggest culprit for this is using only a single = when making comparisons: if (something = false) { stuff(); } which yields the really helpful "error executing code on line [number] in file [path]".

I don't see that as being relevant to the OP's problem though, unless they've been delving into custom stuff.

[This message has been edited by Loggy (edited 10-23-2017 @ 12:11 PM).]

posted 23 October 2017 12:51 PM EDT (US)     15 / 20  
Updated the triggers, but still got the same error. I have a feeling though it's got something to do with some units or techs. Maybe imaybe some of them don't like eachother or intersect? I enabled all players to train Gastrapheres, Myrmidons AND Hetairos, but an error here seems unlikely as the ai only uses the unit bound to their primary god and I did aswell.
For the techs: I activated litterally every tech that increases hp, attack and defense for buildings including safeguard (norse tech), sundried mudbrick (egyptian) and ballista tower (egyptian). However I don't see why the game would crash suddenly after almost one hour.
posted 23 October 2017 02:19 PM EDT (US)     16 / 20  
Ok - if you still can't fix do the brute force approach: deactivate all your triggers and activate a few at a time until you find the culprit.
posted 23 October 2017 02:22 PM EDT (US)     17 / 20  
I'm a real trigger-noob you see, but I'm getting better :P
I was like you not more than 6 months before
And I'm now finishing an entirely new civilisation with the editor ans his triggers
So yes you can progress fast but you REALLY need to Install new triggers, including the editor superpack and the target protunit query which is for me the greatest reference to act simply on unit even if they aren't here at the begining.
All this new triggers offer new possibilities and enable your imagination to think very big (if it is a correct ebglish ;'))
posted 24 October 2017 05:50 AM EDT (US)     18 / 20  
Okay now I'm definitely sure it has something to do with me attacking. The game crashed almost exactly at the same point as it did yesterday.
My opponent was using peltasts and prodromoi, so I decided to attack with 15 of each hippikons, gastraphetes and hoplites. I managed to take down half of the buildings before te game crashed. Gonna try not allowing to train all special units for all gods...
posted 24 October 2017 06:21 AM EDT (US)     19 / 20  
You mentioned you added send chat effects to every trigger. Did you find any correlations with a trigger being activated just before the crash occurs?

Does the crash keep happening after around 1 hour of playtime? If none of the triggers seem to be directly related to the problem, then that might also indicate it's just an issue with the poor optimization of the game if the crash just occurs out of the blue at random occassions. Some other guy described a similar problem that you have and someone else answered the following:
This game has always had a memory crash issue. It has been going on long before the latest updates. I have found over the years that some maps are more prone to crashes than others. It doesnt matter how many opponents, which operating system, video card, amount or RAM or machine platform.....guaranteed to give you a random crash eventually when you are already invested in playing.
If you designed the scenario in AoM:TT you could also try to playtest the scenario on Voobly to validate if the problem is AoM:EE-related.

If disabling the special units doesn't fix your problem, you can always follow That AoM Guy's suggestion to share the scenario with him (or us) so he (or we) can have a look at the scenario to see if anything could be causing the issue.

What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]

[This message has been edited by Lewonas (edited 10-24-2017 @ 06:43 AM).]

posted 26 October 2017 04:45 PM EDT (US)     20 / 20  
I sent you an email, Niley.

Age of Mythology Heaven » Forums » Scenario Design » Custom scenario crash
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Mythology Heaven | HeavenGames