Ship Equipment & Item Generation
In this news post i'd like to look at how item generation is achieved in MetaSpace. So let's take a look at weapons. First of all we have several different weapons such as Cannons, Repeaters and Snipers. Each of these will generate different base stats, naturally the repeater has a much higher rate of fire than a Cannon or Sniper. The base stats for weapons currently include damage, rate of fire, stun chance, critical chance and mass. Based on how good these base stats are the value is also calculated. I'm using a lot of random_range functions here.
Now that we have the base stats for the weapon there's a high probability that it will be assigned a trait and a type. Some weapons may have a type and a trait, some may one and some may have neither. Now for weapons traits include things such as "Burst" weapons. Burst weapons have reduced damage but fire 3 shots. So If your weapon has the burst trait you can do more damage overall though as the damage is split over 3 different projectiles the enemy also has a greater chance at avoiding some damage. So Traits are generally things that affect how the weapon fires or interacts with the enemy. Weapon types on the other hand just affect the base stats of the weapon by a certain percentage and they include things such as "Heavy" and "Mini" weapons.
Now the weapon is assigned an element which is partly based on the trait it has. A weapon with the Photon trait for example is very likely to be an Explosive or Energy based weapon. Different elements will be more effective against certain types of enemies. Enemy weapons also have elements so equipping different shield types will give you a stronger defense against certain enemies.
After that we then get to assigning the weapon a condition such as "New" or "Malfunctioning" which then effect the stats by a percentage amount yet again. Then there is a chance that the weapon will be a rare, epic or legendary item and with that we change the stats by a percentage amount one last time. Rare items are obviously much more valuable and are more powerful than common weapons, but a rare weapon doesn't always mean it's going to do more damage. You may get a weapon with an insanely high critical chance, or greatly reduced mass instead.
So in summary... a weapon has a randomly calculated base stats, it then gets a trait and type assigned to, an element to make it strong/weak against certain enemies and then a condition and rarity. Then we do some calculations to combine all of this information into one final set of stats for the weapon.
This makes for a very large combination of weapons. In fact there are 43,008 different Tier 1 weapons in the game currently and even if by some miracle you get the same weapon twice it'll still have different stats. But there's not just weapons! Shields, engines and secondary weapons are all generated in a very similar way. Then there's devices and ship mods as well which are handled slightly differently but still have some randomly generated stats.
So what if you have a really great item and want another? With so many options you'll never be able to find it again! Luckily you can craft duplicates of items in your inventory by paying scrap which is the universal currency in MetaSpace. You can also craft entirely new items out of scrap as well, you just choose the tier of item you wish to craft and then pay a handsome amount of scrap and poof. A randomly generated weapon appears in your inventory, let's hope it's a good one!
Well that's all for now, i'll try not to disappear again. Also under the images section you can see the updated GUI for the Ship Designer!
Next news article i'll discuss how items affect your ship and examples such as why you would sometimes want a fast weak ship over a massive slow hunk of metal death. Unless something else takes my fancy!
Thanks for reading the next update will be soon... I promise!