Global
This page it's about to explain how this asset work globally
Mechanics
First it's good to know this Gasha Draw mechanics take object from Rarity slot weight chance and not the prize chance weight himself
In this assets we have 4 Rarity followed of her weight chance :
- N -> 0.5
- R -> 0.3
- SR -> 0.15
- SSR -> 0.05
The weight it's stored in the datatable DT_GSD_Rarity
It's important that the total of additionned weight it's equal to 1.0 (0.5 + 0.3 + 0.15 + 0.05).
So if by example you change SR with 0.2 (so 20% chance) you will need to ajust one of other rarity to get a total of 1.0
The mechanic of draw it's into the function DropDrawItem in BP_GSD_DrawManager
GetClosedRarity it's about to get the Rarity we will drop, and then take randomly an object with the same Rarity
Where are the list of possible prize ?
The list of possible prize are stored into the DataTable DT_GSD_DrawList
It's contain only :
- id
- type
- rarity
We will retrieve the detail associated to the prize only after the draw from her type
Map the draw result to detail prize
When you get the draw item (with only have id and rarity data) we need to get the associated object of the draw
It's good to work like that because this means we can have a variety of draw type (Summon, Character, Weapon, etc)
The function it's MapDrawItemToDetail after the DropDrawItem call (in PerformOneDraw)
If you look into, you will see for example i map the draw item depend of the type (Weapon or Character in the asset example)
It's also here i stock the prize to player data inventory too and make custom logic like can't have duplicated character and etc
Where are stored the drawable weapon and character data list example ?
As is a template the default data are stored in a DataTable, located to
Content > SomndusStudio > GachaDraw > Game > Core > Data > DataTable
They are retrieve from a DAO instancied in the BP_GSD_GameInstance
Effectively in professionnal project, the data should be stored in external database and retrieved via a API Service
About where are stored the Player Inventory, it's in the GameInstance for the example
You will see two Int array (one for possessed weapon and the other for character), it's for the example, possessed prize id into here
Another Question ?
If you have another question, let me know in the Discord Server in #faq channel