Jump to content

How are game generated turret appearances done?


FuryoftheStars

Recommended Posts

I think this is more a question for the devs, but if anyone else happens to know this....

 

I'm working on a mod that, among other things, will hopefully allow a player to pick the look of their turret at turret factories.  IE, they can pick the seed that's used.

 

In looking into this, I see in weapongenerator.lua where weapon.appearenceSeed is set to a random signed 32 bit integer.  So, that's over 4 billion possibilities.

 

I'd really rather not have users scrolling through 4 billion + possible numbers and I'm guessing (though I could certainly be wrong!) that the game won't actually generate 4 billion + unique weapon designs for each weapon type.

 

My question here is, assuming the above is true, could the devs, or anyone else who's experimented with this and gained some knowledge, share some of the inner workings here?  Specifically, my assumption here is that there is a function/formula in the core of the game that takes this appearenceSeed value and is somehow pairing it down to the actual number of unique weapon designs that the game can do.  If this could be shared, it'd allow me to limit the user to only going through 0 - x (being the limit of the weapon designs the game does), and then I can set the needed value to appearenceSeed that would generate this.

 

I hope that makes sense.  :-\

 

Thank you!

Link to comment
Share on other sites

Hello, i'm the creator of High Efficiency Turrets mod (HET) and I use this line to show to me what is the seed of a turret. After a large amount of tests I chose some numbers that represent a execly turret design and save it. So all weapons will have that design.

 

-- use this line to get the right seed of a weapon.
-- print(string.format("(HET) [weaponName] seed: %d", weapon.appearanceSeed))

Link to comment
Share on other sites

Yup, I got that in there now. It’s how I confirmed that they had such a large range of seed values.

 

Just hoping to get something more definitive so I’m not wasting a lot of time trying or recording different values. With me, there’d be a high chance of me missing a few, too.  :P

Link to comment
Share on other sites

Well, if they share how they use that value core side, then we can use that to figure out all valid combinations.

 

Edit: Should say, rather than all valid combinations, all unique combinations.  If they had a simple formula they could share (not sure if it is that simple... hoping), then that'd solve everything. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...