Jump to content

Randomising Enemy Unit Stats


lamaros

Recommended Posts

should be pretty easy on run time, working on it now for my Second wave mod to complement the NCE i have there too, my main problem is to balance out the changes to the enemies with a formula.

 

On the start of each mission you can gather all the enemies (or even each turn/on event activated if you want zombies and reinforcements) by getting them from history and checking their ETeam stat. From there it's a simple matter of Unit.SetMaxBaseStat and Unit.SetCurrentStat which i already perfected with NCE. really all i'm left here is figuring out what formula to use to determine the amount of randomisation on the stats

Edited by Guest
Link to comment
Share on other sites

should be pretty easy on run time, working on it now for my Second wave mod to complement the NCE i have there too, my main problem is to balance out the changes to the enemies with a formula.

 

On the start of each mission you can gather all the enemies (or even each turn/on event activated if you want zombies and reinforcements) by getting them from history and checking their ETeam stat. From there it's a simple matter of Unit.SetMaxBaseStat and Unit.SetCurrentStat which i already perfected with NCE. really all i'm left here is figuring out what formula to use to determine the amount of randomisation on the stats

 

Hmm, I think I follow, but doesn't that mean you'd need to considerably extend it if you wanted to vary different units in different ways?

Link to comment
Share on other sites

 

should be pretty easy on run time, working on it now for my Second wave mod to complement the NCE i have there too, my main problem is to balance out the changes to the enemies with a formula.

 

On the start of each mission you can gather all the enemies (or even each turn/on event activated if you want zombies and reinforcements) by getting them from history and checking their ETeam stat. From there it's a simple matter of Unit.SetMaxBaseStat and Unit.SetCurrentStat which i already perfected with NCE. really all i'm left here is figuring out what formula to use to determine the amount of randomisation on the stats

 

Hmm, I think I follow, but doesn't that mean you'd need to considerably extend it if you wanted to vary different units in different ways?

 

Not Really, using point system it's quite easy to get stuff like a sectoid with tons of psi offense but little health or a more agile berserker but with less HP.

my problem is a system to allocate the points since a +2 to hp is a considerable number for an advent trooper it's not that consequential for a gatekeeper

Link to comment
Share on other sites

 

 

should be pretty easy on run time, working on it now for my Second wave mod to complement the NCE i have there too, my main problem is to balance out the changes to the enemies with a formula.

 

On the start of each mission you can gather all the enemies (or even each turn/on event activated if you want zombies and reinforcements) by getting them from history and checking their ETeam stat. From there it's a simple matter of Unit.SetMaxBaseStat and Unit.SetCurrentStat which i already perfected with NCE. really all i'm left here is figuring out what formula to use to determine the amount of randomisation on the stats

 

Hmm, I think I follow, but doesn't that mean you'd need to considerably extend it if you wanted to vary different units in different ways?

 

Not Really, using point system it's quite easy to get stuff like a sectoid with tons of psi offense but little health or a more agile berserker but with less HP.

my problem is a system to allocate the points since a +2 to hp is a considerable number for an advent trooper it's not that consequential for a gatekeeper

 

 

Yeah that's what I meant, if you want to allow Sectiods to vary in health by 2 health, but Troopers only by 1, and have gatekeepers vary in armor by 2 but mutons not to vary at all in armor, etc...

Link to comment
Share on other sites

 

 

 

should be pretty easy on run time, working on it now for my Second wave mod to complement the NCE i have there too, my main problem is to balance out the changes to the enemies with a formula.

 

On the start of each mission you can gather all the enemies (or even each turn/on event activated if you want zombies and reinforcements) by getting them from history and checking their ETeam stat. From there it's a simple matter of Unit.SetMaxBaseStat and Unit.SetCurrentStat which i already perfected with NCE. really all i'm left here is figuring out what formula to use to determine the amount of randomisation on the stats

 

Hmm, I think I follow, but doesn't that mean you'd need to considerably extend it if you wanted to vary different units in different ways?

 

Not Really, using point system it's quite easy to get stuff like a sectoid with tons of psi offense but little health or a more agile berserker but with less HP.

my problem is a system to allocate the points since a +2 to hp is a considerable number for an advent trooper it's not that consequential for a gatekeeper

 

 

Yeah that's what I meant, if you want to allow Sectiods to vary in health by 2 health, but Troopers only by 1, and have gatekeepers vary in armor by 2 but mutons not to vary at all in armor, etc...

 

i should get it working over the weekend, along with improvements to NCE and hopefully finally implement UI (and learn how GameState works) watch out for that on my mod on steam (Second Wave Reborn) i should hopefully come back on sunday with some enlightenments

Link to comment
Share on other sites

My thinking now on the best way to do this is to have the enemy you want modified, the stat you want modified, and how you want it modified, in three arrays.

 

EnemyRandom[0]=AdvTrooperM1

EnemyStatRandom[0]=eStat_HP

StatRandomAmount[0]=1

EnemyRandom[1]=AdvTrooperM2

EnemyStatRandom[1]=eStat_HP

StatRandomAmount[1]=2

 

...

 

2. Then update those values in the XComGameState_Unit?

 

So your final output is

 

currentStat=(Rand(StatRandomAmount[n]+1));

RandomStats.addItem(EnemyRandom[n].getBaseMaxStat(EnemyStatRandom[n])+currentStat)

 

EnemyRandom[n].setBaseMaxStat(EnemyStatRandom[n],RandomStats[n]);

EnemyRandom[n].setCurrentMaxStat(EnemyStatRandom[n],RandomStats[n]);

 

until the end of the array? Does that make sense logically? Obviosuly the code itself would be.. not this.

Edited by lamaros
Link to comment
Share on other sites

In situations like this, I would advice to use only one single array which then contains a struct. That way:

  • if you want to pass the information around you dont need to pass multiple values
  • if need for an aditional value arises, its very easy to edit it in

 

I'm thinking about something like this

struct RandomChange
{
  var name Target;
  var ECharStatType StatType;
  var float Amount;
}
var array<RandomChange> RandomChanges;
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...