Hi,
I would like to try and add a unit pool system to my map. In my map you get 4 units to pick from in your shop per roll. At the moment the randomisation is done by a simple "if int = 1 , pick unit 1" etc etc
Teamfight Tactics and Auto Chess/Auto Battle all use a unit pool system that means players can't all use the same types of units, I would like to do something similar (or the same) to make my map a little less RNG.
At the moment I have created arrays for each rarity type and filled them with each unit type I want, my idea is that I can run each of these at the start of the map to define how many of each rarity will be available in the map. This bit I think will work fine.
One of the issues I've thought of is that you can't have 2 of the same unit in the shop at one time, I've got past this issue in my current setup by saving the units rolled and checking whether the type of the chosen unit matches any of the currently rolled units. If it matches then fire the trigger again, eventually this will pick a unit that hasn't already been picked.
If I use a unit pool however this could potentially lead to a crash? If the only units left in the pool are matching types I cannot keep rolling the trigger as this would cause an infinite loop?
I might be overthinking this and need to just go for it but at the moment I'm really not sure the best way of making a unit pool work easily and effectively!
Has anyone else done anything like this before and how would you recommend I make this system?
I would like to try and add a unit pool system to my map. In my map you get 4 units to pick from in your shop per roll. At the moment the randomisation is done by a simple "if int = 1 , pick unit 1" etc etc
Teamfight Tactics and Auto Chess/Auto Battle all use a unit pool system that means players can't all use the same types of units, I would like to do something similar (or the same) to make my map a little less RNG.
At the moment I have created arrays for each rarity type and filled them with each unit type I want, my idea is that I can run each of these at the start of the map to define how many of each rarity will be available in the map. This bit I think will work fine.
One of the issues I've thought of is that you can't have 2 of the same unit in the shop at one time, I've got past this issue in my current setup by saving the units rolled and checking whether the type of the chosen unit matches any of the currently rolled units. If it matches then fire the trigger again, eventually this will pick a unit that hasn't already been picked.
If I use a unit pool however this could potentially lead to a crash? If the only units left in the pool are matching types I cannot keep rolling the trigger as this would cause an infinite loop?
I might be overthinking this and need to just go for it but at the moment I'm really not sure the best way of making a unit pool work easily and effectively!
Has anyone else done anything like this before and how would you recommend I make this system?