Ojcar, I can tell you pretty much what is causing the problem. The building system of the AI.
I decided to give you guys a clearer picture of how engine works and how things are done in the map, so we would not have to argue about this again, and so that we would understand one another. Besides, Those who are planning to start on mapmaking for Majesty may find this information more or less useful. Let us begin.
As you might know, the map mechanics are made from triggers. A trigger is a special tool that makes events happen. A trigger consists of two parts: a condition and an action. Condition is an event that launches the trigger. There is a limited amount of conditions in the game, which also causes some problems and limitations, I will discuss this in more detail later. For example, a condition may be the specific day. Say, on day 10 the triggers starts working. An action on the other hand, is the event that occurs after launching the trigger. The action could be pretty much everything: building a building, spawning a hero, changing fractions, etc, etc.
All game AI's are trigger-based. The only difference is, their trigger are scripted in a separate file, or files. The cleverer the AI, the more complicated is the structure. The AI I made is on the level of Red Alert 2 AI, not very "clever", repetitive, but still quite fun. The "cleverness" of the AI is determined by the amount of patterns that it can use. These include, but are not limited to: building, defence, economy, assault and free roaming patterns. Could I add more than one pattern to this map? Of course. Would that be a good idea? No. In a normal game, the engine executes the AI, and resources are spread equally between map and other functions. Here, the AI is integrated into the map, meaning that the map has triple workload. Adding another, say, assault pattern (another ~20 triggers) would kill the game that is barely alive now.
Let us return to the triggers. As mentioned before, the map hang on Majesty 2 v.1.0 due to the building spawn. There are several reasons why a map could hang from a trigger:
1. The action is incompleteable. This is one of the reasons why the game might crash. For example. You cannot build a building on a place where enemy is. Imagine, that the AI has a specific zone where it builds, and there is only one free place left in that zone, and there are enemies there. The trigger shoots, the program tries to put a building to that place, but it cannot due to restriction. What happens? Ding. This problem is unsolvable.
2. The action leads to nowhere. For example, if I make an action to trigger another trigger, and then rename that trigger. The program will search for that trigger with a specific name and won't find it. Ding. This is solvable, its a mechanical bug.
3. Double reference. If the same entity is named differently (multiple names or "tags" are given) and the trigger calls them up at the same time, the game will hang. Solvable, another bug due to lack of attention.
4. Loading entities that are not added to the game. For example u made a new hero model, but you did not put all the required references. The game will hang.
There are more, I just dont remember them all now. There are plenty of ways to kill a map, and 90% of them are due to lack of attention. But as with issue #1, there are several things that you cannot control.
Let us examine the loading example. The problem is that the load file has a different structure than the map file. It reads and understands triggers in a different manner. For example, If I name a mission in the editor "gather gold", I will be able to play the game okay, but if I save, and continue from the save, the game will crash. The savegame file does not recognize the "gather gold" name. For the savegame it should be "gather_gold". Such small and seemingly irrelevant things are very hard to notice and recognize, and the savegame file is plenty of them. Now, as I have told you before, the savegame reads triggers differently. Savegame does not consider the cooldown for some reason. This is interesting, because the cooldown is an action, too. When time is X do action DELAY X seconds. The DELAY comand is ignored, meaning that the savegame does not understand it, meaning that there are contradictions in the engine.
The worst situation with the savegame is that it just hangs. When there is a crash, the game gives an error log, from which there is a slight chance to understand what is going on. If I could get the error log from this issue, I would 80% be able to solve it.
Thats all.