So I was thinking I could share a bit of my workflow with you guys today.
I give you,
---The BI-dashboard for Escape From Chernarus - HulaZone---
I've been working for the most part in this now pretty gigantic excel document for the most part when adding new items (and now balancing them, their drop chances and magazine amounts). This might seem like a pain at first, and it to some extent is, but what it enables me is to quickly scan off and change a huge number of values, and automatically get a complete code string that I can add into the class list for the mod, as well as get an overview of the direct effects for the end users.
The following is the main page, which feeds into the others. Among other things it gives me a better overview of the spawn chances, and if you take a look at P(X) you might have noticed that that is the chance of an item appearing at least once within 4 ammo depots, as well as its specified probability.
As you could see in the above picture the P(X) values are generally quite high, and due to the large amount of new weapons I've added (the number of weapons, backpacks and equipment - excluding grenades, regular binoculars, mines, charges and navigational equipment - that can spawn at the ammo depots now total 180) I've noticed you can sometimes receive an overwhelming amount of different TYPES of items, rather than their individual amounts. This has led me to do a statistical analysis (as I have perfect data) where I can view the percentage chance of the count of unique drops per category per ammo depot. As you see these are all following normal distributions, although not a perfect bell shape, as the probabilities range from 40-1 % per item.
To accomplish this I originally sought to go with not only perfect data, but also perfect calculation to retrieve the exact figures as a bit of a mathematical and statistical experiment (I study business and economics, so that's kind of why :P). It turns out though that as you increase the number of unique entities, as well as especially increasing the number of allowed probabilities (and I wanted my sought after model to allow for as many probabilities as there are entities) this grew increasingly complex. When you only have one probability, but up to a near infinite number of entities you can go for a binomial distribution to calculate it (which is an extension of combinatorics), and I could then have used a binomial distribution for each probability class. This however means that I cant get a grand total of the actual ammo depot, but only for each class (which is fine for some purposes, and I might actually use it soon, but not for this). So I looked at combinatorics itself and quickly realized that this would grow overly difficult to accomplish, with papers written on a high level in the Academia about it (search for multinomial distributions, or look at this page: http://en.wikipedia.org/wiki/Multinomial_distribution). This of course frustrated me a bit as I want a clean way to calculate it, however after talking to a friend of mine who masters in AI we both agreed that for the ends of this task it would just save me a great deal of trouble to go for a bit more a brute force and statistical method (simulation model) rather than calculating probabilities fully (combinatorics). This, now that I actually fully read the wikipedia page ended up with being more or less what the talk about under "To simulate a multinomial distribution", although we never viewed that beforehand.
Here is a snapshot of one of the random number generators. As you see I've made a list that automatically retrieves the latest version of the probabilities. It then transposes the formula, without distorting the references (which was a bit of a pain, but I found a nice guide online). A random number generator giving integers between 0 and 99 is then setup, going the same number of columns as the entities, and then repeated to slightly over 10 000 rows to give a lower statistical error due to sampling issues. A IF code then checks the randomly generated number (which I can iterate freely) to the probability (just like the mission code) and gives a 1 for spawn, and a 0 for no spawn. A SUM is then made of each row for the true/false values to count the number of spawned items in the ammo depot for that sample. This is then fed into the pivot table shown in the previous image where I can get some nice numbers, and graphs, of the probabilities for the number of unique spawned items for each category in the ammo depot.
As you see the expected value for the number of special weapons is quite high right now, which I will change before the next update is out to make it a bit more authentic, and difficult for the players. The same probably has to be done to the basic weapons and only a tiny bit to the launchers (there are doubles there). Thus I am a bit of a turning point if I will actually continue with spawning everything more or less random like this, only with different probabilities, or if I instead should go for a bit more realistic (though maybe a bit boring) version where a number weapon categories are chosen instead by random, where you are certain of a fair number of weapons spawning, but all from the same weapon family (like AKs). This would be a viable solution with the high number of scoped versions and whatnot (e.g. AK-family would then include have a first check for AK-47/AK-74/SA-58, a second for AEK/AK-107/AN-94/AK-12 and Vityaz/Magpul or something, and then do checks for scoped versions or not, here with another set of probabilities to make each category of depot slightly different).
This is however still very much in the air, and I will definitely not implement weapon families until after this balanced update. I would however very much like to hear your feedback. If you also have any feedback on the classification of weapons, or their relative chance of appearance, that would be great =)
---------- Post added at 12:56 ---------- Previous post was at 11:33 ----------