Klick hier für Seite auf Deutsch

Missions (Scenarios) for P3D

Introduction | Why | Missions | Tutorial | FIP | Once | Memory | More

Diary Memory Flight Creation:

Ever since TicTacToeFlug, I had been thinking about creating another game.

For a long time, I didn't know what kind of game to make, because chess, checkers, or similar games are impossible, and a sliding puzzle is also much too complicated.

Recently, I came up with the game Memory, which is probably very complex, but feasible.
I spent a long time studying a few problems:
- What should the playing field and the game pieces look like?
- How should I randomly distribute the game pieces on the playing field?
- After that, I also have to evaluate which game piece is where and whether the player finds the right pair.

I quickly found a solution for the playing field and game pieces, but I just couldn't figure out everything else in my head; it was too complex.
That's why, after 3 other missions, I decided to just give it a try, because once you can see the playing field and game pieces, hopefully the rest will fall into place.

Note: Some of the images shown below can be viewed in a larger size by clicking on them.
The larger image will be displayed in a new tab. Simply close this tab to return to this page.


So let's get started:

What should the playing field look like?

A grid frame measuring 2x4 | 3x4 | 4x4.

  

When approaching the playing field from the other side, all symbols are reversed.
How does the player know which side of the playing field they are viewing?
By inserting a few squares below the playing field, it is now easy to see.

 

Which symbols do I need?
- 4 | 6 | 8 game pieces, depending on the level of difficulty or size of the playing field.
So these symbols:
Gray square | Gray vertical line | Gray horizontal line | Gray plus sign
Black square | Black vertical line | Black horizontal line | Black plus sign

Each symbol is needed twice to make a pair.

- White area (which marks the field that has just been activated and for which the duplicate is now to be found).
- 2 green areas (which are displayed next to the 2 symbols when the correct duplicate has been selected).
- 2 red areas (which are displayed next to the 2 symbols when the wrong duplicate has been selected).

In the further development of the game, I reduced it to a white, green, and red area.
Deactivating the white area and activating two green or two red areas would have required a disproportionate number of additional elements.
Now, a white and green area is displayed for “correct,” or a white and red area for “incorrect.”

- A hangman, which is displayed/hanged step by step with each mistake.

I lined up all these symbols next to the playing field so that I could keep an eye on them while creating them and see what happens when I move them.
Finally, I will hide these pieces in the ground because they should not be visible during the game.


Incidentally, the playing field, symbols, colored areas, and hangman consist simply of RectangleAreas.
RectangleAreas can be used as invisible, bordered, or filled. For areas filled with color, you can use an action to switch the color to transparent (= invisible).

Unfortunately, I have to move the symbols; I cannot simply switch from visible (color “black”) to invisible (color “transparent”). Transparent means invisible (and is indeed invisible in P3dv4), but from P3dV5 and in P3dV6, a very thin line is always visible in invisible areas.
Can you see the thin white lines in the shape of a plus sign?

So I have to move the icons, which involves more effort and causes problems.
Moving works like this: A symbol is placed somewhere in the world. To let the symbol “know” where it needs to be moved, an area is placed at the destination. A “ChangeObjectPlacementAction” tells the symbol where to go.

All symbols should be placed in the center of the correct area of the playing field, so I have marked the target positions with invisible square areas on the playing field.
For illustrative purposes, the positions are shown here with thin black lines.

Placing a square is easy because it is the same size as the target position. A vertical line is narrower and a horizontal line is less tall than the target position. So the symbols would be aligned bottom-left and left-aligned with the target position.
The plus (+) symbol consists of two areas, one horizontal and one vertical.
For illustrative purposes, the two areas are colored differently here.

When I move the two areas for a plus sign, they are positioned as follows:

Whenever a plus sign needs to be displayed, I have to move two areas, which would require two ChangeObjectPlacementActions.

That's why I placed an invisible area (shown here with a red frame) around the plus sign and connected the two lines (shown here in gray and black) to this red frame. Now I only have to move the red frame to the target location and both lines follow the red frame.

Each object can either have a fixed position in the world (AttachedWorldPosition) or be attached to another object (AttachedWorldObject). When an object is attached to another object, the former follows all movements of the latter.

This way, I only need one ChangeObjectPlacementActions per symbol, and the symbols are always perfectly centered.


Once the playing field and symbols were ready, I moved on to the next “simple” task, as I'm sure I'll be able to solve the big problems later. Psychologists probably call this problem avoidance.

Just like TicTacToeFlug, MemoryFlug should be playable with any aircraft. The playing field is large enough that even the AN225 can easily fly through the individual fields.

Gliders should also be able to be used, so I imported the corresponding group from TicTacToeFlug and adapted it.

After the playing field size has been selected, the player is prompted to choose any aircraft. A 10-second timer is displayed, and another aircraft must be selected within this time. There is plenty of time, because as soon as you switch to the aircraft selection, the flight and timer stop. A trigger then asks how many engines the aircraft has. If there are zero engines, it is a glider and a text appears telling you how to call a tow plane (Ctrl+Shift+Y). At the same time, thermals around the playing field are activated and a few birds appear in the corresponding areas as a visual aid.

To ensure that you never lack lift, there is a weak basic thermal (red) in the area below the playing field, which allows the glider to climb at about 500 ft/min. The thermals in front of and behind the playing field (marked blue here) are medium-strength thermals that allow the glider to climb at about 1000 ft/min. To the left and right of the playing field are strong thermals (green) that allow a climb rate of about 1500 ft/min.


Then I made a hangman game, and I had the crazy idea of animating the hangman so that it could call for help. I spontaneously realized this sub-project.

This means that the hangman is built up further with every mistake:

Galgen.mp4

As soon as the left arm appears, the hangman calls for help every 20 seconds.

Displaying the individual elements was already a complex task, but the arm movement and the lettering “HELP” surpassed everything.
Removing the lettering “HELP” alone required an additional 22 objects, not to mention displaying them step by step.

Here, still without links to the individual font elements.

When linked, it looks like this (43 objects are now linked together):

In total, the fade-in of the left arm, including animation and the word “HELP,” required 144 objects.


Now it gets tricky, because how do I fill the playing field with randomly placed symbols, or how do I save which symbol is in which position? Without scripting, I have to find a way to save something. So I placed a whole fleet of airplanes at the nearby airport, each of which saves different things.

- The 16 aircraft on the far left represent the 16 squares on the playing field.
- The 8 aircraft in the middle “remember” whether the symbol visible above them is already occupied, or more precisely: free | occupied once | occupied twice.
- The single aircraft on the right remembers how big the playing field is (2x4 | 3x4 | 4x4) and is queried with LMS Easy | Medium | Hard

How does an aircraft store this information? It's simple:

For the playing field position:
- For each symbol (black square | black vertical line | black horizontal line | black plus sign | gray square | gray vertical line | gray horizontal line | gray plus sign), I activate a different light (panel | strobe | landing | flash brake | taxi | beacon | nav | logo) on the corresponding aircraft. So I have “invented” something like a 1-bit memory. ;-)
After testing, I had to replace “Flash” with “Brake” because the light wasn't working, see below.

- I could query the game field planes to find out whether and how often a symbol is already present on the game field, but that would be a huge query (16x8 symbols, i.e., 128 queries). That's why I separated it and moved it to the 8 planes (with symbols above them).
Incidentally, the symbols above the aircraft are only there as a visual aid for me and have no other function.

But now to filling the playing field randomly using Random Action:

At first, I wanted to randomly select one of the 16 playing fields and fill it in sequence with the symbols “square,” “vertical line,” etc. If a field is already occupied, the random selection would have to be restarted. In the end, it would take an incredibly long time if 15 fields were occupied until the last free field was finally selected at random.
So I reversed it and fill the playing fields A1 | A2 | A3 | A4 | B1 | B2 | B3 | B4 | C1 | etc. in sequence.

The principle: One of the four symbols is selected at random, in this case the vertical line, which is queried with the three property triggers (red) to see whether there is already a 0 (none), 1, or 2 vertical line anywhere on the playing field. The property triggers query the corresponding aircraft with the matching symbol to determine whether “Light Wing” and/or “Light Cabin” is active.
- If 0, “Light Wing” is activated on the “Senkr Strobe” aircraft (blue left) and the “A Senkr” symbol is placed on the playing field (the orange areas are responsible for this and “OnComplete” activates a light on the corresponding aircraft).
- If the result is 1, “Light Cabin” is activated on the aircraft “Senkr Strobe” (blue left) and the symbol “B Senkr” is placed on the playing field (orange areas and light activation, as above).

- If the result is 2, the random is executed again because a different symbol must be placed.
The marked objects are responsible for the query. Blue and orange objects are also used in all other queries, so they only exist once.

Aircraft A1 (bottom left) is assigned the vertical line symbol, and the marked aircraft on the right stores how often the vertical line has already been used.

This is what the group of elements looks like that is needed just to fill field A1.
Once field A1 is filled, the program moves on to field A2 and triggers the next random assignment there.
I have to create these 46 elements seven more times for the complete 2x4 playing field.

The problem is that the 3x4 field would require another 12 such groups, which would consist of 69 elements each rather than 46, and the 4x4 field would require another 16 groups with 92 elements each.
That's a total of 2668 elements just to fill the playing field!
My biggest mission so far had 2238 elements. With 2000 elements or more, SimDirector becomes very slow and crashes can occur.

So I had to rethink my approach...
That's why I placed the additional aircraft (LMS) on the runway, which “stores” the active playing field size. Now I “only” create the 16x92 elements, which adds up to a total of 1472, and for each random query, the playing field size is queried beforehand and only 4, 6, or 8 different symbols are selected accordingly. This way, I can get by with a few additional elements for this query and significantly fewer elements for filling the playing field.

With the additional queries, I am now at 99 elements, so probably a total of 1584 for the finished field allocation.

Duplicating 99 elements and renaming each one (removing the suffix “- Copy 1” and changing “A1” to A2) is pure drudgery.

So for now, I've only duplicated and renamed the whole thing once to test whether it will actually work in the mission later on.
While doing this work, I had a few thoughts.


---Thoughts---
How do I evaluate the player's field selection?

- With the 16 aircraft available on the playing field:
1st field activates a 9th light... too complicated, 16 lights have to be extinguished on the 2nd pass.

- With 1 additional aircraft:
Taxi off = 1st pass, taxi on = 2nd pass.

How do I recognize during the 2nd pass that both symbols are correct/incorrect?

- Query all 16 aircraft to see which lights are on... Because some were already switched on before, this is not possible, unless...

When the field is flown through, a 9th light is switched on for the corresponding aircraft, which indicates that this aircraft is “meant.”

Now simply create 16 queries (1 per aircraft) that have switched on the 9th light; the query can be used again and again. I don't think that works.

- Create 2 additional aircraft that only remember the symbol. First fly-through square = taxi, 2nd fly-through = beacon, doesn't fit, display red symbols, reset aircraft, extend hangman, etc. Probably doesn't work either, because it's not reusable...
---/Thoughts---


Since I am currently unable to make any progress with the above issues, I am focusing on other matters.

It occurred to me that I need to show and hide the playing field depending on its size.

Unfortunately, the playing field is not a single object, such as a house, airplane, or similar, but consists of many individual parts.
Only the black frame lines are visible; 6 lines are needed for the 3x4 expansion, and 12 invisible areas are added, which include the position of the symbol, the flight area (which displays the appropriate symbol when flying through and evaluates whether the field is already occupied, etc.) and other elements.
For the 4x4 playing field, the same number of elements are added again.

Unfortunately, the “ChangeObjectPlacementAction” cannot be used to move all 18 objects to the desired location at the same time; the action can only move a single object. So the first move action must move Object1 and “OnComplete” must trigger the next move action for Object2, and so on.
Another 18 objects are added because the “ChangeObjectPlacementAction” requires two positions: 1. the starting point of the object to be moved and 2. the destination point. So I have to “park” the playing field lines somewhere so that I can move them to their destination when needed. The parking positions are 18 objects, so I need 18 more to mark the destination position.
This means that 18 actions and another 18 areas are needed to expand the 2x4 playing field to a 3x4 playing field (and, of course, the same again for a 4x4 field).

This means that the original 18 objects suddenly become 54 objects, which looks like this when linked:

Only the marked objects were present.

Once the game is over, you should of course be able to start a new game, so all objects must be moved back to their original positions, which in this case (for the playing field) requires 18 actions.
I don't even want to think about everything else I have to reset, starting with all the airplane lights, which I can only turn off individually, so in case of doubt, all 128 lights, because I don't know which ones are really active), then all the symbols, the hangman, etc.

It would be easier if the user restarted the flight, but that's not convenient...
Given the size of this project, I unfortunately had to decide not to reset the game in the end. Furthermore, CounterTrigger cannot be reset. The user must therefore reset the game to start a new one.


Displaying the playing field size as needed works, so now it's time for the hard work.
Fields A1 and A2 are already filled randomly, now I have to duplicate, rename, and adjust everything for fields A3-D4.
First, I only finished the first row, i.e., fields A3 and A4.

By the way, the fields are numbered as follows:

To optimize the whole process, I redesigned the SimDirector view so that the paths with the mouse are not so long.
If only a handful of objects need to be renamed, my previous method worked well, but with more than 1500 objects, you are bound to overlook some.
If there are only a few objects, I select an object in the visualization area (red) and rename it in the object property area (green).

To make sure I don't overlook any objects, I now select the objects one by one in the object area (orange) and then rename them in the green area. As you can see, the distance between 1 and 2 is extremely long when using the mouse.

So I redesigned the view, hiding the visualization area and moving the object properties area right next to the object area.

After renaming, the individual objects must of course also be assigned to other areas and aircraft. I usually make these reassignments in the normal view, with the visualization area in the middle of the screen.

SimDirector always displays the newly linked object in the visualization window and also changes the group. For small missions with up to 500 objects, this works quite well and quickly. Currently, this mission already has over 800 objects, which means that each link takes 1-2 seconds until SimDirector has updated the visualization and the next link can be made. With 2000 objects, it even takes 4-5 seconds. It feels like an eternity when you could double-click 25 triggers in quick succession in a single ObjectActivationAction without moving the mouse, but always have to wait 5 seconds in between for the visualization to update.

I am already familiar with this problem, so I simply deactivate the visualization and have all 25 objects linked in a few seconds.
The problem, however, is that SimDirector crashes with 90 percent certainty when I reactivate the visualization. Even if SimDirector does not crash, it takes several minutes to calculate the visualization display.

I now have a safe and quick solution for this: before reactivating the visualization, I simply save the mission and then reload it. This updates the project, which only takes a few seconds, and when I activate the visualization, there are no problems.

After a successful test with fields A1-A4, further duplication should be faster.

By optimizing the code, I was able to reduce the number of objects from 99 to 91 per field. That may not sound like much, but with 16 fields, that's a total of 128 elements saved. This time, I didn't duplicate a single group (A1), but an entire row (A1, A2, A3, A4). That's 364 objects, which fortunately retain their connection to other groups. This increased the number of objects from 899 to 1263.

Here are the four new groups.

The overview currently looks like this.

Today I was busy and renamed all 365 objects:
To do this, I had to remove “Copy 1” from the end of each object name and replace ‘A’ with “B” at the beginning. It was monotonous work, but it only took about an hour.

The 224 objects were more time-consuming, because each one had to be individually assigned to the correct object. Because these objects are not located in the same directory, you have to search for them across groups (among the current 1263) of existing objects. I have developed a fairly simple search method for this; sometimes the search term “A” or “wa” (for wagr) is sufficient, but linking is still time-consuming and exhausting. It is also prone to errors: If “square” and “square gray” or “A place” are confused with “B place,” unexpected errors occur: An object suddenly disappears during the construction of the playing field, or the construction of the playing field stops unexpectedly.
The following objects had to be linked:
- 32 objects with the correct playing field aircraft
- 64 actions with the correct airplane symbol
- In addition, the links for symbol movement had to be adjusted, meaning another 128 links (start and end point symbols had to be defined).

Of course, linking has an impact on visualization. The view shown above, which was still quite clear, turned into this:

Somehow, this view scares me, because I haven't even reached half of it yet. Anyway, the 2x4 field is now ready, so I can test the random symbol assignment.

The first test was successful and also pleasantly fast, taking about 6 seconds to set up the playing field.
Here you can see a video of the test:

2x4RandomTest.mp4

Of course, I did a second and third test to see if the symbols were really distributed randomly. Unfortunately, or should I say thankfully, the game board got stuck on the fourth field. Otherwise, I might never have discovered the error, or only at the very end.

So I did 50 more tests and took a screenshot of each result, hoping that this would help me find the error. For example, if the setup always stops after the second horizontal line, there is a link error that tells the random generator that the game board setup is complete, or something similar.

Here are the 50 attempts:

In experiments 14, 35, and 43, the setup got stuck. Does anyone see a pattern? I certainly don't. However, I did notice something interesting.

1) In trial 35, the structure stopped at the second symbol, while in trials 11, 19, 28, 30, and 37, the structure ran through even though the first two symbols are identical. It can't be due to a specific symbol.
35                                          11                                          19         
     

28                                          30                                          37         
     

2) It can't be due to a specific playing field either, because the setup always stops at a different field.
14                                          35                                          43
     

So the error can only be in the random action.


A random action can be used in three ways:
1) You set only one action in “Actions” (e.g., engine failure) and use “ProbabilityPercent” to determine the probability with which this action is triggered (0-100% chance that the engine will fail).
2) You set several objects in “Actions” and one of these objects is selected and activated 100% of the time, provided that “ProbabilityPercent” is set to 100%, of course.
3) You set several objects in “Actions” and use “ProbabilityPercent” to determine the probability with which an action is triggered.
If 50% is set, only every second object is selected and activated; in the other case, nothing is activated.

So I checked all random actions, and for all of them, the 4 possible objects are entered in “Actions” and “ProbabilityPercent” is set to 100% everywhere.
What now? Apparently, the random action does not work 100% reliably.
I suspect this is a general problem with P3d, because 100% does not seem to exist. For example, a power lever of 100% is evaluated as 99.999999%. If this is similar with the random action, it cannot work 100% of the time.
However, 3 errors in 50 attempts is 6%, and at 99.999999%, the error should occur very rarely.
Who knows how the random action is evaluated in the background? Maybe 100% is evaluated as 95.555555?


---By the way---
I had the same problem with the Tic Tac Toe flight, but I couldn't figure out why it sometimes didn't work.

Quote from the Tic Tac Toe flight explanation:
"For some inexplicable reason, this only worked in 95% of cases, so I had the RandomAction triggered again with a 0.5s delay. If the field is free, this delayed action is immediately deactivated."

At the time, I used a complex method to catch the error, which had the side effect of delaying the AI's next move by at least 0.5 seconds (up to 5 seconds in extreme cases). It also required around 90 additional elements.

MemoryFlug is structured slightly differently and is larger, so the above solution would require around 450 additional elements and the game board setup for the 2x4 field would take up to 40 seconds instead of 6. For the 4x4 field, this would be 120 seconds, or 2 minutes, which is unacceptable.
---/By the way---


In any case, I ran a few more tests on the game field setup to confirm my suspicion. I activated the “ProgressLog” to see where the setup was getting stuck.
I normally hide the log because this additional real-time display slows down P3d considerably. However, it is useful here because I can see exactly which action was activated before it stopped.
In this case, on the 4th field:

The log looks like this:

Too small? Here's a detail:

A4Random2x4 is triggered, but none of the 4 characters are activated; it simply does not proceed.

This is how it should look:
B4Random2x4 (does the same as A4Random2x4 above) randomly selects one of the 4 actions, in this case “B4 + one,” which evaluates with the 3 triggers below it whether the “+” symbol is free or occupied.
B4 + 2 recognizes that 2 “+ symbols” have already been assigned and therefore triggers “B4 + Random again”.

My idea for solving this problem is to use a timer that restarts the random action when it expires.
The random action should randomly select one of the four objects, and once that has happened, the random action can trigger an “OnCompleteAction.”

So I inserted a dummy action that is supposed to trigger the random action as soon as it is finished (OnCompleteAction).
It took a lot of testing before this one random action finally failed, did not trigger any symbol, and stopped. However, the log showed that the “OnCompleteAction” was triggered.
Theoretically, it should work, now I just have to figure out when and where I can insert the timer.

I found a solution that only requires 4 additional elements per playing field (i.e., a total of 64 elements). To integrate this, I have to create or adjust 8 links; with 16 playing fields, that's 128 links. After that, I'll see if it really works 100%.
This is what the solution looks like:
I created this graphic for myself so that I don't forget any links when adjusting all the playing field groups.

- The 3 Random Actions activate the “Random Timer On” action in “OnComplete,” which in turn activates, or rather starts, the timer.
- Random LMS (which checks which playing field size is active at the beginning and each time the random action is restarted) resets the timer at the same time.
- Random off (which is always activated when a symbol has been successfully assigned to a playing field) deactivates the random timer.
- Note: The timer starts when a game piece is selected and only stops when a game piece has been found. Even in extreme cases where it takes 10 seconds, the timer never reaches the end time of 2 seconds. If everything runs correctly, the evaluation is completed in 0.01 seconds and, if the symbol is occupied, the timer is reset (i.e., it starts again at 0) and the random action is restarted. Only if the random action fails does the timer trigger another random action.

The solution looks good, so I added and linked the new objects. After lots of testing, I'm now sure that it works 100%, because the timer has started several times and triggered the randomizer again.

Now it's time for some more hard work, because two more game board rows need to be added for the medium and hard modes. That's 8x95 objects, a total of 760 objects, which then have to be renamed and linked correctly.
Just duplicating the objects took SimDirector about 5 minutes. Incidentally, this mission already has a total of 2064 objects, which is why SimDirector is now responding so sluggishly.

Newly duplicated groups

Complete overview without new links:

Overall view after aircraft, symbols, and areas have been linked:

Now it's getting extremely confusing. Mind you, only the groups are displayed here, considering that many groups contain 95 or more objects.
Here is the section marked in red from the above display:

An initial test in SimDirector with the preview function was disappointing, as it took a long time (30-60 seconds) to load the playing field. So I tested it directly in P3d and, surprisingly, it only took about 10 seconds to load the playing field there.

4x4RandomTest.mp4

The SimDirector shows me the progress log in real time during the preview, which consumes a significant amount of performance. I deactivated the log, and SimDirector is now almost as fast as P3D again. Of course, it's still slower because SimDirector has to display not only the P3D display but also the 2064 objects, the object properties of the selected object, and the conditional logic (which displays the current value in real time).

Since expanding from 2x4 to 4x4, I have had the problem that after setting up the 2x4 field, the random action continues endlessly and desperately tries to occupy the next field, which does not exist. So I have to find a suitable “exit point” that tells the random action that the game board setup is complete and the game can begin.

The last action when the 2x4 field is finished is “B4 Random Timer off.” This then starts the next random “C1 Random LMS,” so I have to intervene there at the latest. LMS decides between easy, medium, and hard. With “L” (easy), there is no third row, so the random action stops right there. So I can remove a few elements because they are unnecessary. From the 4th row onwards, there is also no “M” (medium), so the LMS query could be omitted completely from there.

That's the theory, but in practice, removing unnecessary objects is dangerous because you may not have thought through all the situations and a functioning system suddenly makes mistakes. Anyway, I removed what I could. The success of the deletion operation is modest; from 2064 objects, I was only able to reduce to 2036 objects, so only 28 fewer.


---By the way---
I am slowly beginning to understand why programmers do not always optimize their programs completely, but instead build on old routines rather than optimizing them. With such a conversion, many entry and exit points have to be adjusted. If something goes wrong, the program no longer works. Because computers are getting faster and faster, they can process even the old (slow) routines quickly enough.
---/By the way---


Now it gets tricky: how do I evaluate the fields?

---Thoughts---
1) I fly through any field, e.g., A1, which first asks whether a 9th light is on for the corresponding aircraft.
- If yes, the text “Playing field has already been revealed” is displayed. (Nothing else needs to happen.)
- If not, query: Does aircraft A already have a light (there will be aircraft A and B for comparison).

1a) Does aircraft A already have a light: If not, query which symbol (should work with 8 queries), depending on the light, temporarily display the corresponding symbol (e.g., panel = square) in the playing field and also the white area. Also display the text “Now select the matching counterpart.” Additionally, activate the light panel for “Aircraft A.”

1b) If aircraft A already has a light: If yes, query which symbol, depending on the light, temporarily activate the corresponding symbol (e.g., panel = square). For “Aircraft B,” activate the corresponding light.

1c) Now check whether aircraft A/B have activated the same lights (this should be possible with two checks, but the logic becomes quite complex).

2) Once it is clear that the symbols are a pair (or not), I have to remove the areas (white | green | red) and, if “incorrect,” also the corresponding symbol.
- If correct, remove the white area and activate 2 green areas. (But how do I know where?)
- If incorrect, remove the white area and activate 2 red areas. (But how do I know where?)

It's like chess: I can plan 1-2 moves in advance, and once the game has progressed further, I can tackle the next move. The only thing that helps is trial and error.
---/Thoughts---


I realized that, in addition to the 8 lights for the corresponding game piece and the 9th light (for revealed), another status must be stored for the playing field aircraft (for temporarily revealed).
This is how the lights are now used:
- Lights 1-8 store which of the 8 different game pieces was randomly assigned to the field.
- Light 9 “Wing” stores whether the field has already been revealed.
- Light 10 “Recognition” (short “Reco”) temporarily stores whether a field has been revealed.

My theory:
Right after the game starts, the 9th light is not active anywhere yet. As soon as a pair is successfully revealed, only 2 game field aircraft have activated this light, and more will follow as the game progresses.
The next time I fly over the field, I can check whether it is occupied or free. If it is “free,” I activate light 9 (Cabin) and temporarily light 10 (Reco).
Each time I fly over the field, Cabin is checked. If it is “occupied,” the text OCCUPIED appears; if it is “free,” Cabin and Reco are activated again.
After every second flight, the two aircraft A + B are compared; if correct, only Reco is activated; if incorrect, Reco and Cabin are deleted.
This should ensure that only correctly revealed fields have the 9th light “Cabin” activated.

I have also added two more aircraft (A + B) for comparing the pair.

Whether this will actually work remains to be seen.
I simply started implementing the above ideas:

1) First, I created a query for field A1 “A1 Occupied,” in which I query whether the 9th light is active.
The logic behind this is simple: if Light Cabin is on (i.e., =1), display the text “The field has already been revealed, select another field.”
Of course, another query is needed to check whether the 9th light is inactive. So I added a second query (red element on the right) and named it “A1 Free.”

This second element activates the query as to whether a light is already activated on aircraft A.
The required logic query is somewhat more extensive, as it queries whether one of eight lights is active. Of course, a second query is required, which is triggered when none of the eight lights are active.

1a) Aircraft A is free, so the player reveals the first square. The symbol stored in the square that was flown over is then queried. There are 16 symbols, but only 8 different ones, because each one appears twice. Therefore, 8 PropertyTriggers are sufficient, each of which queries a light (panel, strobe, etc.). Only one of the 8 triggers will fire and activate a SetPropertyAction, which activates the corresponding light on aircraft A and then activates a ChangeObjectPlacementAction. The action moves the appropriate game piece to the field and then activates an ObjectActivationAction, which deactivates the 8 triggers and activates another ChangeObjectPlacementAction. This action in turn activates the white area and a text (Now select the corresponding counterpart.).

1b) Aircraft A is occupied, so the player reveals a second field. I have therefore copied the complete query for aircraft A and adjusted everything so that the corresponding light is set for aircraft B.

1c) At the end of the “1b) query,” a comparison is made to see if the two symbols match. This requires only two PropertyTriggers.
The logic for the “equal” query is very large, with 57 elements.

The logic of the “not equal” query is even larger, with 113 elements.

I created steps 1a-c of my thoughts on a trial basis for one field (A1), and 73 objects are required for this. I have to duplicate the 73 objects for all other fields (A2-D4) and adjust all links (15x73=1095 additional objects).

This image shows 103 objects, but there are actually only 73 objects in the group. The remaining visible objects (all orange, some purple, and 3 blue) are in other groups but are linked to this one.


---By the way---
In many groups, more objects are visible than are actually present.
In this group, for example, there are only 49 objects, but 342 are visible, which activate the orange areas (from other groups).

This is what this group looked like before the external links were added.

I digress, back to the topic.
---/By the way---


Before I copy 73 objects 15 times, rename them, create links, and adjust the references for triggers, I would like to know if I can also manage the evaluation somehow.

In step “2)”, the current objects must be hidden accordingly, depending on whether they are “correct/incorrect,” and if they are incorrect, the hangman must also be gradually displayed.

If the two revealed symbols match, the first step is to check whether the playing field is completely revealed.
To do this, the playing field size LMS (easy | medium | difficult) is first queried and two PropertyTriggers are activated accordingly, which check whether all lights are on or not.
If all lights are active, the playing field has been successfully solved and is therefore finished.
The logic for the large playing field requires 49 elements.

- If the playing field is unsolved, a text is activated (Well done. Select the next free field.), the white and green areas are removed, and the reco light is switched off for all aircraft.
- When the playing field is completely solved, a text is activated (Congratulations, you have solved the game.), the white and green areas are deactivated, and the goal is marked as completed.
This evaluation can be used again and again and requires only 46 elements.

If the revealed game pieces do not match, things get more complicated:

First, a text is displayed (Unfortunately, the symbols do not match.) and a part of the hangman is drawn. To do this, LMS queries the size of the playing field and activates certain counters depending on the size.
On a 2x4 board, 3 mistakes are allowed; on the 4th mistake, the man is completely hanged and the game is lost. On a 3x4 board, 5 mistakes are allowed, and on a 4x4 board, 7 mistakes are allowed. This means that 4, 5, or 7 counters are needed.

The 4 counters for the 2x4 field have different start values (4,3,2,1) and count down to zero (0). A CountAction gives all 4 counters an impulse, whereupon they reduce their value by 1. The counter with the start value 1 will fire first and activate the drawing of the gallows pole; from then on, the counter is inactive. At the next pulse of the CountAction, the counter with the start value 2 will fire and continue drawing the gallows man, and so on.
This error evaluation requires 33 objects.

The next step is to remove the white and red areas and the incorrectly revealed symbols. To do this, all 16 aircraft on the playing field are checked to see if they have a Reco light switched on. If so, the Reco and Cabin lights on this aircraft are switched off and then the 8 lights representing the different symbols are checked. The PropertyTrigger with the corresponding light activates two ChangeObjectPlacementActions, which remove both game pieces (e.g., square A and square B). I remove both because I don't know whether symbol A or B was placed.

For clarity, I have divided this query into 4 groups, each representing one row of the playing field, in this case the group for fields A1/A2/A3/A4, which contains 48 objects (the query requires a total of 192 objects).

Subsequently, all PropertyTriggers that were activated during the above queries are deactivated. This is necessary to prevent activated triggers that have not yet been fired from suddenly firing later in the game when the next playing field is flown through. To do this, I started a timer at the beginning of the error evaluation, which deactivates all PropertyTriggers after one second. The entire error evaluation should actually only take about 0.2 seconds, but I will have to test this later. If necessary, I can set the timer to 2-3 seconds. The timer triggers an ObjectActivationsAction, which deactivates 145 objects.

Finally, the corresponding lights on aircraft A and B must be deleted so that they are ready for the next field flight.

A total of 298 objects are required for step 2.

So that I can now test whether everything works, I have duplicated the query for field A1 (73 objects) and adjusted all links for A2.
Because there are so many adjustments, I have made myself a cheat sheet so that I don't forget anything.


---Cheat sheet---
1) PropertyTrigger A1 Pass = Area A1 Pass Position
2) A1 Occupied Off = Text Occupied On
3) A1 White Place = Text Counterpart On
4) A1 Green Place = PlayingFieldResolvedQuery LMS On
5) A1 Red Place = 10sTimerSymbolsAway On
6) PropertyActions
A1 A Cabin 1 (A1 B Cabin 1, A1 A Reco 1, A1 B Reco 1) = A1
7) A1 Green Place = Field Green (top), A1 Field Position (bottom)
(Same with A1 Red Place and A1 White Place)
8) A1 A Square Place = A Square (top), A1 Position (bottom)
(A1 B Square Place + all other symbols as well) (16x)
9) A1 A Square 1 = A (A1 B Square 1 = B)
(All other symbols as well) (16x)
10) A1 A Square (A1 B Square and all other symbols): Adjust logic to A2 - D4 (16x)
(A1 Free and A1 Occupied as well)
(Replace the red A1 with the respective field A2 - D4)
---/Cheat sheet---


After doing this, I ran a few tests and had to make various adjustments until it finally worked without any errors.

I currently have 2493 objects and SimDirector is already unbearably slow. I just hope that SimDirector can handle it, because crashes are becoming more frequent. Even with simple actions such as “clicking on the Save button,” SimDirector can crash (fortunately only after saving the changes).

When I consider that at least 1022 more objects will be added, I get scared and anxious. At least 3515 objects are expected to be needed. So far, I have only created the first query (steps 1a-c of my thoughts) for fields A1 and A2, and now I have to duplicate it for the remaining 14 fields.


---Test---
Somehow, I'm afraid that SimDirector will suddenly report that the maximum number of objects has been reached when I reach 3000 objects.
That's why I duplicated groups A1-D4 (a total of 1504 objects) as a test. SimDirector calculated for about 4 minutes, and in the end there were 3997 objects.
The number of objects is not a problem, so I duplicated another 1504 objects. I'm curious... After about 8 minutes, there were 5501 objects, so it must have worked. In the meantime, the screen flickered alarmingly, as if it were about to crash.
Let's try again: copy 1504 objects. Eight minutes later, there were 7005 objects, so at least there is no upper limit up to that point. The only problem is my 10-year-old computer, which is probably too slow for such large tasks.
Can SimDirector handle 10,000 objects? So I copied another 3008 objects. After just under 17 minutes, there were 10013 objects.
---/Test---


After this test, I created two more fields (A3 and A4) and tested them again. Only now was I able to test what happens after a pair is correctly uncovered, or whether the game continues correctly afterwards.

Unfortunately, a strange error occurred: The next field uncovered, which is actually the first one for the pair search, was treated as a second uncovered field and, according to the evaluation, it is incorrect. What was it compared to and why?

After some searching, I found the cause: The two triggers that evaluate whether the two fields match are both activated, but only the “correct” trigger fires. The other trigger, “incorrect,” remains active and fires as soon as another field is passed through.
So I added two more elements that deactivate the two triggers after one second. Further tests confirm that it now works.

Next, I duplicated the evaluation of fields A1–A4, renamed them all to B1–B4, and adjusted everything else according to the cheat sheet.
After that, I was able to test the entire game in easy mode. After extensive testing and a few bug fixes, the game now runs smoothly in easy mode.

As a final step, I duplicated fields A1–B4 and adjusted everything for C1–D4. After making some final additions and corrections, the game is complete and working. There are 3,565 objects in total. I'm probably the only crazy person who has ever created such a large mission.

To give you an idea of the size of this mission, here are a few pictures.

This is what the group overview looks like:

Here is a detail of the above view:

A closer view of the above image:

Here is the content of the group B4Random marked above:

Finally, I wanted to know what the mission looks like when I cancel group view.

Group view

View, without grouping

Incidentally, SimDirector took more than two hours to calculate this view. I thought SimDirector had crashed.
Unfortunately, it was not possible to zoom in closer; SimDirector crashed when I tried. In any case, it is impossible to work with this view; you would never be able to find the right object or understand which other objects it is linked to.

Introduction | Why | Missions | Tutorial | FIP | Once | Memory | More