Astrox Imperium

Astrox Imperium

评价数不足
Custom Ship Stat Generator
由 Kjell 制作
WIP: 11-20-2019
I will be updating this over the next few days. When completed it will no longer say "WIP". Until then, there will be parts missing as I work on them.

This is a guide for the process I used in creating a ship stat generator. This guide will not be a specific generator tool, rather it will be a guide for creating your own tool using any program or coding language you are familiar with. I personally used Excel when I created my own, though in the future I will be using C# to create such tools.

This guide assumes you have knowledge of the ship files, algebra, coding knowledge (any language). I will use examples when possible and do my best to explain other ways of accomplishing the same tasks.
   
奖励
收藏
已收藏
取消收藏
Selecting and Assigning Stats
The first thing to decide is what stats you will want included for the generator. I decided to use the ship class as the main property for determining which formula would be applied when generating stats. This might be different depending on your specific use. This guide will be written using the ship class as the main property.

So the first variable that will be needed is ship class. This will be used to sort and determine which formula to use in our generator.

string SHIP_class

We then decide which stats we want the generator to include. I used the following:

float SHIP_base_shield float SHIP_base_armor float SHIP_base_energy float SHIP_base_cargo float SHIP_base_turn float SHIP_base_thrust float SHIP_base_mass float SHIP_active_slots float SHIP_passive_slots float SHIP_base_lifesupport float SHIP_base_engine_burn float SHIP_base_recharge float SHIP_base_scan_speed float SHIP_base_scan_max_targets float SHIP_base_scan_pulserange float SHIP_base_scan_pulsespeed float SHIP_base_price float SHIP_impact_resistance float SHIP_energy_resistance float SHIP_explosive_resistance float SHIP_base_drones

There are a few extra variables we will be using, so declaring them now will be useful.

float GEN_points_total float GEN_points_current float GEN_points_cost float GEN_points_multiplier float GEN_points_range

There are likely a few variables I have missed and I will add them in here when they are encountered further into the guide. This should be a good starting point though.
Generator Variables Overview
To have the generator work, we need to set the variables used in generating the stats. I will break down each variable and explain how we figure out what the value should be.

• GEN_points_total
This is the total points available when creating a new ship. This mechanic will be explained later in the guide.

• GEN_points_current
This is the current points available when creating a new ship. This mechanic will be explained later in the guide.

• GEN_points_cost
This is the points required for adding a single unit to a particular stat. This mechanic will be explained later in the guide.

• GEN_points_multiplier
This is the multiplier used to calculate our values based on the current ship class. This mechanic will be explained later in the guide.

• GEN_points_range
This is the range that our values can vary. A higher range will result in a larger variety of stats per class of ships. A smaller range will result in a smaller variety of stats per class of ships. Be careful, if the range is too high you will have ships of one class having stats higher than the class above it or stats lower than the class before it. If the range is too low you will have ships that feel almost identical to all other ships in their class. This mechanic will be explained later in the guide.

Feel free to experiment with these variables, the one I would experiment with first would be GEN_points_range. This variable will have the largest impact on the generator and will be used when calculating the other variables. Through my own testing, I have found 0.15 to be a great starting point (15% plus/minus the average, or 30% total).

To figure out what our default values should be, we will use all the existing ship files and calculate the averages for each ship class and each variable for those ship classes. You can either do this manually, or you can use a script/program to do this for you. I personally imported each ship file into Excel then calculated the averages using formulas inside Excel. Another option is to have your generator do this, perhaps as a setup button.

I will go over including this in the next section.
Generator Variables Calculation Part 1
If you are wanting the stat generator to adapt to the current ship balance, we can use the existing ships to calculate an average for each stat. We accomplish this by dividing all the ships by their class. We then take all the ships in a specific class and calculate the average for each stat.

For example, we want our generator to create stats for only the shield, armor, energy, cargo, active slots, and price. There are 3 ships currently in the game that we want our new ships to be balanced against. Their stats are as follows:

Ship: Ship One Class: Frigate Shield: 750 Armor: 500 Energy: 600 Cargo: 300 Active Slots: 3 Price: 540000 Ship: Ship Two Class: Frigate Shield: 850 Armor: 550 Energy: 450 Cargo: 250 Active Slots: 5 Price: 586000 Ship: Ship Three Class: Frigate Shield: 950 Armor: 700 Energy: 700 Cargo: 275 Active Slots:4 Price: 672000

So we get the average of each stat. The averages for our example:

Shield: 850 Armor: 583 Energy: 583 Cargo: 275 Active Slots: 4 Price: 599333

For the system I created, I used 10000 as my category multiplier. You can use any number you want since the math should still work out. For our example, I will assign 10000 points for each category and divide it by the current stat. For the price, I divide by the total points (GEN_points_total).

Shield: 10000 / 850 = 11.76 Armor: 10000 / 583 = 17.14 Energy: 10000 / 583 = 17.14 Cargo: 10000 / 275 = 36.36 Active Slots: 10000 / 4 = 2500 Price: 599333 / 50000 = 11.99

This will give me the cost per point when generating a new ship and the price increase per point used. So when creating a new ship, I will have a total of 50000 points (GEN_points_total) available to use. For each point to shield I will subtract 11.76 from my total available points. After calculating I usually round the number to the closest whole number. For example:

Shield: 800 * 11.76 = 9408 Armor: 500 * 17.14 = 8570 Energy: 550 * 17.14 = 9427 Cargo: 300 * 36.36 = 10908 Active Slots: 3 * 2500 = 7500 // GEN_points_current Point Cost: 45813 Price: 45813 * 11.99 = 549298

With the above example, I still have just under 5000 points still available. If I were to assign those points then we would have a "perfectly" balanced ship, but having all the ships balanced to an exact value does not create a balanced "feel". I will explain this further in the guide.

This will create prices that are similar to the other ships currently in the game. Simply apply this logic and use the values from the existing ships when calculating the values. This only creates the prices though, we want the generator to create all the stats for us. The next section will explore one approach to doing just that.
Generator Variables Calculation Part 2
This section will add a new component to our stat generator. I referred to this variable as the GEN_points_range. This will add more variety to our generator and can be employed in more than one way. This first will employ this as a global that is applied to each stat. GEN_points_range is the percentage that a stat can vary when employing a random number generator. It will be used to find our upper and lower limits. We will continue with our earlier example:

// This will create a variance of 15% GEN_points_range = 0.15 Shield = Random Number between (average_Shield) - (average_Shield * GEN_points_range) and (average_Shield) + (average_Shield * GEN_points_range) Armor = Random Number between (average_Shield) - (average_Shield * GEN_points_range) and (average_Shield) + (average_Shield * GEN_points_range) Energy = Random Number between (average_Shield) - (average_Shield * GEN_points_range) and (average_Shield) + (average_Shield * GEN_points_range) Cargo = Random Number between (average_Shield) - (average_Shield * GEN_points_range) and (average_Shield) + (average_Shield * GEN_points_range) Active Slots = Random Number between (average_Shield) - (average_Shield * GEN_points_range) and (average_Shield) + (average_Shield * GEN_points_range)

Generator Variables Calculation Advanced
We now have the generator working with some basic mechanics, though we might want the generator to be a bit more advanced with the calculations and variety of ships. Perhaps we want the stats to cost more per point as you add more points into that stat? Perhaps we want to calculate the cost for ship buffs or to get points back for adding a debuff? Perhaps we want certain stats to have more weight/impact than other stats?

We can implement any or all of the above by changing our formula slightly. We will start by changing the weight/impact of certain stats. Continuing with our 3 ship example, we have decided that there should be 3 main categories to calculate. We will have "Core Stats", "Auxillary Stats", and "Slots". We want the Core Stats to include the shield and armor, the Auxillary Stats to include energy and cargo, and finally, the Slots to include our active slots. We will still use 10000 for our category multiplier, but instead of 6 categories, we now have only 3 categories. So our GEN_points_total = 30000.

GEN_category_multiplier / (Shield + Armor) = GEN_points_cost_corestats 10000 / (850 + 583) = 6.98 GEN_category_multiplier / (Energy + Cargo) = GEN_points_cost_auxillarystats 10000 / (583 + 275) = 11.66 GEN_category_multiplier / (Active Slots) = GEN_points_cost_slots 10000 / (4) = 2500

With this, adding an additional active slot still costs 2500, but we only have 30000 instead of our 50000 using the non-weighted formula before. This also makes our energy cost much higher considering our GEN_points_total of 30000.

Now if we want to have the points cost more per point used in a specific category, we need to decide how much each point should increase in cost. For this example, we will want each point to cost 0.1% more than the last point. So our formula will be:

Current Shield = 850 GEN_points_cost_corestats = 6.98 Point Cost for Shield = 5933 // We need to know how many points it costs to have 900 shield using our 0.1% increase modifier. New Shield = 900 // This is our formula. Point Cost for Shield = (GEN_points_cost_corestats) + ((new_shield - current_shield) * (GEN_points_cost_corestats) * increase_modifier) 6.98+((900-850)*6.98*0.001) = 7.33 // New cost for shield Point Cost for Shield = 6596 // The cost for shield without using our new formula would have been. Point Cost for Shield = 6282

As you can see, this new point cost increase modifier really changes how many points we can add to our stats. Feel free to play around with this number to see what kind of results you get, though be careful not to set this number too high. In my experiments, a number between 0.1% - 0.5% will work best.

As for the last scenario I gave above, dealing with ship buffs and debuffs, we can approach this in many ways.
4 条留言
jeffs72 2023 年 3 月 21 日 上午 9:09 
rip guide
Kjell  [作者] 2020 年 3 月 2 日 上午 6:56 
Not sure when I will be able to get back to this. Hopefully there is enough info to build your own tool though.
falsetruth1988 2020 年 2 月 29 日 上午 7:55 
Well no rush
Kjell  [作者] 2019 年 12 月 12 日 上午 9:11 
I have not forgotten about this guide. I will be finishing it eventually and likely creating a simple version of this tool to share with others.

You can use it as a template for your own tool, or use it as is if it's enough for your purpose. Love to hear any input/suggestions.