Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faces: not hardcoding number of items in image #77

Open
GoogleCodeExporter opened this issue Mar 15, 2015 · 3 comments
Open

Faces: not hardcoding number of items in image #77

GoogleCodeExporter opened this issue Mar 15, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

I've been looking through the code, mainly in order to play around with the 
face generator. As far as I can see, the number of items in each source image 
(e.g. hairs_64b.png) is hardcoded in game.cpp (e.g. as faceGen.nHairs = 17).

It would be a lot more flexible to have this number as a field in the mod XML 
input, e.g.:

<image assetName="faceHairs" filename="hairs_64b.png" number="17" 
dither="false"/>

The builder might even check that the file height is actually evenly divisible 
by the number.

Is there a reason not to change these numbers, e.g. for saved game 
compatibility or whatever? If the soldier faces are just kept in a FaceParam, I 
think it should not matter if the number of elements increases, as long as the 
original images stay in the same order, right? The new images would only be 
used in the randomizer, to make new soldiers with extra variation...

Original issue reported on code.google.com by [email protected] on 23 Oct 2011 at 4:05

@GoogleCodeExporter
Copy link
Author

Save file compatibility is the big issue. Every unit has a seed/body that is a 
31 bit random number, that determines name & appearance. However, I made a very 
silly mistake, and didn't zero-out the unused bits. :( To add extended range, 
takes a version check.

For better or worse, there is a solution to the code. Check for 'version' and 
LAST_NAME_EXT. When version >= 1, it uses the LAST_NAME_EXT bit which double 
the # of potential last names.

You would have to use the same trick to add more face parts.

Which is also why this stuff isn't in the XML - it takes logic to make it work. 
(The zero thing really was a stupid mistake. Oh well.) 

Original comment by [email protected] on 24 Oct 2011 at 4:15

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 31 Oct 2011 at 11:35

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 27 Jul 2012 at 12:01

  • Changed state: Accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant