player faces extended - in trunk since r11269

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

BigBB
Engineer
Engineer
Posts: 106
Joined: 07 Aug 2007 20:39

player faces extended - in trunk since r11269

Post by BigBB » 21 Sep 2007 00:46

Since I begin to play TT I hate it to create a face. And in OTTD it's still the same procedure. So I decided to create a patch to change it.

Original:
  • you have the two gender buttons
  • and a random button for new faces
  • nothing else
Only the european males have 80,621,568 different faces and during you press the "New Face" butten there are random afrikan faces between the european ones. So good luck to get "your" face.


With this patch:
  • you have two gender buttons, too
  • you have two ethnicity buttons
  • a random button, but now you can define your ethnicity and don't have a random one
  • 2 checkboxes to enable/disable glasses and for male moustache or for females earring
  • and then 10 switching buttons to change all sorts of face-variables
So it's easy and fast to create your face. And as bonus you have:
  • a save button
  • a load button
  • and the possibility to enter the face nummber direct
The face number will be saved in the openttd.cfg and has a value between 0 and 0xFFFFFFFF but not all values have a face. So it's advisable not to edit it if you don't know what you do (if you enter a invalid value it will be make valid).
With the face no. button can you see your current face no. and/or enter a new one without need to editing openttd.cfg.


If you don't like this patch? No problem. By default is the normal (old one) face selection window showing. Only if you press the expand or 'advanced' button you have the new possibilities.


The look is inspiratedional by a patch from jez and the suggestions in the thread.

Internally is the code completely dynamic. So if there comes some new (e.g.) chins you don't need to edit the code for the window.


After v1.5 skidd13 spend much time to find bugs and to make me many suggestions how the code looks much better (coding and documentation style). He help me a lot, thank you very much!

Flyspray task

Have fun,
BigBB

Edit: the 7z-file is the win32 exe.
Attachments
player_faces_extended_v1.7.png
player_faces_extended_v1.7.png (20.29 KiB) Viewed 9152 times
Last edited by BigBB on 04 Nov 2007 12:06, edited 10 times in total.
OpenTTD-patch(es) in development: missing shores (new version of: completely shore), road lamps for each position

User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Re: player faces extended

Post by XeryusTC » 21 Sep 2007 08:17

Someone made this kind of patch already, which also had a smaller interface but the same functionality. The problem was that it wasn't backwards compatible because it changed the format of how the faces were stored. If you use the same (old) format you should document it and try to fix the other patch IMO. Otherwise you should try to figure out the old format anyway and apply it to your own patch so it has a chance to go in trunk.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image

Gramble
Engineer
Engineer
Posts: 45
Joined: 09 Sep 2007 17:35
Location: near Cologne

Re: player faces extended

Post by Gramble » 21 Sep 2007 08:18

Thank you very much! I've been waiting for a long time for a patch like yours.

MfG Thomas

BigBB
Engineer
Engineer
Posts: 106
Joined: 07 Aug 2007 20:39

Re: player faces extended

Post by BigBB » 21 Sep 2007 10:26

XeryusTC wrote:Someone made this kind of patch already, which also had a smaller interface but the same functionality.
If you can post a link will be nice. I've never heard about it.
XeryusTC wrote:The problem was that it wasn't backwards compatible because it changed the format of how the faces were stored. If you use the same (old) format you should document it and try to fix the other patch IMO.
The face will be stored in a "uint32" and every option has their own 1-4 bits. I don't change it (the GUI only manipulate these 1-4 bits for each option) so you can load every old game, it's backwards compatible.

And why should I document it? In "player_face.h" is the function of this uint32 already ducumented. Or mean you something else?
OpenTTD-patch(es) in development: missing shores (new version of: completely shore), road lamps for each position

Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: player faces extended

Post by Rubidium » 21 Sep 2007 10:42

What XeryusTC meant is a patch the is on bugs.openttd.org which does roughly the same, but it was implemented before I rewrote the "storage" backend of the player's face. And then the author of the patch wasn't interested anymore. So "simply" fixing his patch is a lot of work.

However, your patch has some "issues" that the other version did have too. You can find the list of issues on the "bug" tracker ticket of that old patch.

BigBB
Engineer
Engineer
Posts: 106
Joined: 07 Aug 2007 20:39

Re: player faces extended

Post by BigBB » 21 Sep 2007 11:53

Thanks Rubidium I have a look at it.
OpenTTD-patch(es) in development: missing shores (new version of: completely shore), road lamps for each position

Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: player faces extended

Post by Roujin » 21 Sep 2007 12:27

for anyone interested: http://bugs.openttd.org/task/351

btw, i like your gender & ethnicity buttons more than the combined option in the old patch

good luck with future development :)
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage

BigBB
Engineer
Engineer
Posts: 106
Joined: 07 Aug 2007 20:39

Re: player faces extended

Post by BigBB » 21 Sep 2007 14:10

Roujin wrote:i like your gender & ethnicity buttons more than the combined option in the old patch
I too. Atm I rewrite my patch and change a litle bit funktion and look and try to integrate all suggestion from the devs in the flyspray and tt-forums posts.
Roujin wrote:good luck with future development :)
Thank you :).
OpenTTD-patch(es) in development: missing shores (new version of: completely shore), road lamps for each position

User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Re: player faces extended

Post by White Rabbit » 21 Sep 2007 21:54

That man with the black shades looks like an old Kelsey Grammer. Same hairstyle, same face shape, same cleft chin... :shock: The only thing that's different is the moustache.

EDIT: The picture's gone now... :(
Last edited by White Rabbit on 25 Sep 2007 10:22, edited 1 time in total.
Image

User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: player faces extended

Post by athanasios » 21 Sep 2007 22:21

I like this patch and its interface. And it would be nice if we could include the yellow faces without replacing the African.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.

BigBB
Engineer
Engineer
Posts: 106
Joined: 07 Aug 2007 20:39

Re: player faces extended

Post by BigBB » 22 Sep 2007 15:44

Here now the rewritten Code v1.1. Some code and the look was inspirational by the patch from jez.

The look is different to v1.0 and some functions work different but the most works equal to v1.0.

Have fun.

Edit:
athanasios wrote:And it would be nice if we could include the yellow faces without replacing the African.
It's possible but I will do it as a next step.
OpenTTD-patch(es) in development: missing shores (new version of: completely shore), road lamps for each position

BigBB
Engineer
Engineer
Posts: 106
Joined: 07 Aug 2007 20:39

Re: player faces extended

Post by BigBB » 23 Sep 2007 22:43

uploaded v1.2


There is a problem with "Yellow Faces", it's Copyrighted. It's a part of "Transport Tycoon World Editor" more precisely it's into the file "TRHCOM2.GRF". My target is that the patch get into trunk and then needs everybody who want to play OTTD this file and a legal copy of TT-WE and I think the devs don't want this ?!
OpenTTD-patch(es) in development: missing shores (new version of: completely shore), road lamps for each position

User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: player faces extended

Post by athanasios » 24 Sep 2007 01:05

True that is an issue. Yet we still need a third option for Asians. I suggest when you finish with your patch to work on this as a next step. So the capability will be there when someone gets the inspiration to make new graphics.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.

User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Re: player faces extended

Post by bobingabout » 25 Sep 2007 07:56

here are 2 previous projects for a face costomisation patch.

http://www.tt-forums.net/viewtopic.php?f=33&t=24939
http://www.tt-forums.net/viewtopic.php?f=33&t=27545

Also, i started a small project on remapable hair, to add more colours aswell as making sure for example, you can't have a guy with a brown eyebrows, a black tash, and ginger hair, well, i supose you could let people create this if you wanted to. i didn't get very far, but, here is what i have incase you want to use any of it.

http://bobingabout.gamemod.net/OpenTTD/faces3.GIF

as you can see between some of the versions there, the same hair can look different between colours... making conversions a little hard. also, some colours like black don't have 8 colours, and others like grey have more than 8, making choosing a remap very hard, however, i've chosen the pallete remaps already, mainly based on what was already there. (Darkest colour first)

Black (used on all but 1 whiteguy skins.(blue tint))
215, 128, 129, 131, 132, 133. thats only 6, so, i made it 8 by going
215, 216, 128, 129, 130, 131, 132, 133
Brown
215, 104, 105, 53, 107, 113, 114, 109 (53 is an alternate because 106 is grey)
Black2 (used by most blackguy skins, and 1 whiteguy skin)
215, 216, 136, 88, 106, 32, 40. only 7 so changed to
215, 216, 136, 88, 106, 32, 33, 40
Ginger
215, 60, 72, 123, 74, 75, 76. again only 7, and was hard to find a gap, so added 1 to the end
215, 60, 72, 123, 74, 75, 76, 77
Blond(there were 2 versions, so i chose the better version)
104, 105(178), 60, 53, 61, 62, 63(75), 192
Grey
88, 106, 32, 33, 40, 245, 10, 11, 12. cut down to
88, 106, 32, 33, 40, 245, 10, 11
grey2 (slightly darker)
216, 136, 88, 106, 32, 33, 40, 245, 21. cut down to
216, 136, 88, 106, 32, 33, 40, 245
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]

BigBB
Engineer
Engineer
Posts: 106
Joined: 07 Aug 2007 20:39

Re: player faces extended

Post by BigBB » 25 Sep 2007 09:34

I like the idea and you're right, I will integrated it if you're finished it.

But there is the "copyright-problem". The hairs are from original TTD so if you breach the copyright your hairs (and my changed patch for your hairs) don't get into trunk. I hope you make some not-copyrighted GPL hairs (and eyebrows if you make them too) in an extra grf-file (not newGRF). Then I love it :).

A similar problem are the "yellow faces" a few posts above.
OpenTTD-patch(es) in development: missing shores (new version of: completely shore), road lamps for each position

User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Re: player faces extended

Post by bobingabout » 25 Sep 2007 10:32

TBH i can't be bothered anymore(doing too many other projects, plus i'm not much of a graphics artist), but, the idea is there, and so are some good remap colour codes.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]

User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Re: player faces extended

Post by skidd13 » 26 Sep 2007 18:03

I had a quick look at your patch. I really like it.

Its a huge amount of small functions in "player_face.h".
What about an enum which specifys the attributes and 2 functions:
one to set the attribute and one to get the value of the attribute.

And you should check the documentation style.
The dev's commit only patches which fit into the style.
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy

Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: player faces extended

Post by Rubidium » 26 Sep 2007 18:16

skidd13 wrote:What about an enum which specifys the attributes and 2 functions:
one to set the attribute and one to get the value of the attribute.
Like the ones already in player_face.h?

BigBB
Engineer
Engineer
Posts: 106
Joined: 07 Aug 2007 20:39

Re: player faces extended

Post by BigBB » 26 Sep 2007 18:28

skidd13 wrote:Its a huge amount of small functions in "player_face.h".
What about an enum which specifys the attributes and 2 functions:
one to set the attribute and one to get the value of the attribute.
Thank you for your comment. I used already the enum but your right I can combine all get and set functions. I change it immediately.
skidd13 wrote: And you should check the documentation style.
The dev's commit only patches which fit into the style.
I have a look at it, again :).


Edit: new version uploaded
OpenTTD-patch(es) in development: missing shores (new version of: completely shore), road lamps for each position

BigBB
Engineer
Engineer
Posts: 106
Joined: 07 Aug 2007 20:39

Re: player faces extended

Post by BigBB » 29 Sep 2007 13:17

Another update (v1.5). For details see first post.
OpenTTD-patch(es) in development: missing shores (new version of: completely shore), road lamps for each position

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Gord and 2 guests