Guys, I have a very technical question on events. Do you have some tricks to simplify the structure of big-complex events, to avoid overloading ?
So I got into writing events for fun, and I made some huuuges structures. For example a browser similar to the one of the Mod testing environment:
http://www.ftlgame.com/forum/viewtopic.php?t=22613
When I test some of them (at first beacon), the game takes forever to charges, or even freezes. It is not that the events have tipos (I checked several times), they are just too huge to load. I am so sad my browser was fun
First some definitions so we agree (and you can correct me):
- An event is a"XML tree". It can loosely look like that for example (sorry for the extra dots):
......................|-->event2-->event3-->event10-->event11-->event12-->event13
event0-->event1--|.........................................................|
......................|-->event4-->|-->event5-->-->|....................|----->|-->event8
......................................|...................|-->event7-->event6-- >|
......................................|-->event6-->-->|............................|-->event7
- The event tree starts from a root (event0), with possible branches (for example event0-->event1), bifurcations (event1-->event2 or event1-->event4), regroupments (event5-->event7 and event6-->event7), etc. The most important rule is that you can never loop back to a former event.
- Bifurcations (|) in particular can be either be "selected" or "random". For a selected bifurcation the player chooses next event through a choice list, while for random bifurcations the next event is randomly picked from an eventList.
Now a complex event can have a huge XML tree structure, which is too heavy to load. With respect to that, I found that:
- Branches are not costly. This makes sense as you just browse unique events.
- Selected bifurcations are EXTREMELY COSTLY. I observed that on a tree having selected bifurcations with something like 2-8 choices, each calling 2-8 new choices, regrouping eventually, etc: it wasnt too complex, but still it simply didnt load. The Mod testing environment is a milder example where that happens.
- Oddly enough, random bifurcations are NOT COSTLY AT ALL. I observed that on a tree with a random bifurcation having like 50 random possibilities (branches were regrouped just afterwards), that was repeated like 200 times, it just works like a breeze (its the mod SCRAMBLE on my page).
So my questions are :
- Is there some tricks to make "selected bifurcations" more lightweight ?
- Why are "selected bifurcations" much more costly than "random bifurcations" ? It shouldnt necessarily be the case, that just puzzles me.
- All those finds are from messing around with the code, but maybe there is a proper XML documentation you can redirect me too.