Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Sep 02, 2010 5:53 pm

All times are UTC




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: player faces extended - in trunk since r11269
PostPosted: Fri Sep 21, 2007 12:46 am 
Engineer
Engineer
Offline

Joined: Tue Aug 07, 2007 8:39 pm
Posts: 106
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 3187 times ]

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


Last edited by BigBB on Sun Nov 04, 2007 12:06 pm, edited 10 times in total.
Top
 Profile E-mail  
 
 Post subject: Re: player faces extended
PostPosted: Fri Sep 21, 2007 8:17 am 
Tycoon
Tycoon
User avatar
Offline

Joined: Mon May 02, 2005 11:05 am
Posts: 14336
Location: localhost
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
Image
OpenTTD: manual
#openttdcoop: blog | wiki | public server | NewGRF pack | DevZone | Coopetition ladder
My screenshots
Image


Top
 Profile  
 
 Post subject: Re: player faces extended
PostPosted: Fri Sep 21, 2007 8:18 am 
Engineer
Engineer
Offline

Joined: Sun Sep 09, 2007 5:35 pm
Posts: 45
Location: near Cologne
Thank you very much! I've been waiting for a long time for a patch like yours.

MfG Thomas


Top
 Profile E-mail  
 
 Post subject: Re: player faces extended
PostPosted: Fri Sep 21, 2007 10:26 am 
Engineer
Engineer
Offline

Joined: Tue Aug 07, 2007 8:39 pm
Posts: 106
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


Top
 Profile E-mail  
 
 Post subject: Re: player faces extended
PostPosted: Fri Sep 21, 2007 10:42 am 
OpenTTD Developer
OpenTTD Developer
Offline

Joined: Thu Feb 09, 2006 7:15 pm
Posts: 3181
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.


Top
 Profile  
 
 Post subject: Re: player faces extended
PostPosted: Fri Sep 21, 2007 11:53 am 
Engineer
Engineer
Offline

Joined: Tue Aug 07, 2007 8:39 pm
Posts: 106
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


Top
 Profile E-mail  
 
 Post subject: Re: player faces extended
PostPosted: Fri Sep 21, 2007 12:27 pm 
Tycoon
Tycoon
Offline

Joined: Sun Apr 08, 2007 4:07 am
Posts: 1824
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


Top
 Profile  
 
 Post subject: Re: player faces extended
PostPosted: Fri Sep 21, 2007 2:10 pm 
Engineer
Engineer
Offline

Joined: Tue Aug 07, 2007 8:39 pm
Posts: 106
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


Top
 Profile E-mail  
 
 Post subject: Re: player faces extended
PostPosted: Fri Sep 21, 2007 9:54 pm 
Tycoon
Tycoon
User avatar
Offline

Joined: Wed Jun 22, 2005 7:15 pm
Posts: 1723
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... :(

_________________
Image
Say hello to the cake parade!
ImageImageImageImage


Last edited by White Rabbit on Tue Sep 25, 2007 10:22 am, edited 1 time in total.

Top
 Profile E-mail  
 
 Post subject: Re: player faces extended
PostPosted: Fri Sep 21, 2007 10:21 pm 
Tycoon
Tycoon
User avatar
Offline

Joined: Thu Jun 23, 2005 12:09 am
Posts: 3138
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.


Top
 Profile  
 
 Post subject: Re: player faces extended
PostPosted: Sat Sep 22, 2007 3:44 pm 
Engineer
Engineer
Offline

Joined: Tue Aug 07, 2007 8:39 pm
Posts: 106
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


Top
 Profile E-mail  
 
 Post subject: Re: player faces extended
PostPosted: Sun Sep 23, 2007 10:43 pm 
Engineer
Engineer
Offline

Joined: Tue Aug 07, 2007 8:39 pm
Posts: 106
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


Top
 Profile E-mail  
 
 Post subject: Re: player faces extended
PostPosted: Mon Sep 24, 2007 1:05 am 
Tycoon
Tycoon
User avatar
Offline

Joined: Thu Jun 23, 2005 12:09 am
Posts: 3138
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.


Top
 Profile  
 
 Post subject: Re: player faces extended
PostPosted: Tue Sep 25, 2007 7:56 am 
Tycoon
Tycoon
User avatar
Offline

Joined: Sat May 21, 2005 3:10 pm
Posts: 1850
Location: Hull, England
here are 2 previous projects for a face costomisation patch.

viewtopic.php?f=33&t=24939
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]


Top
 Profile  
 
 Post subject: Re: player faces extended
PostPosted: Tue Sep 25, 2007 9:34 am 
Engineer
Engineer
Offline

Joined: Tue Aug 07, 2007 8:39 pm
Posts: 106
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


Top
 Profile E-mail  
 
 Post subject: Re: player faces extended
PostPosted: Tue Sep 25, 2007 10:32 am 
Tycoon
Tycoon
User avatar
Offline

Joined: Sat May 21, 2005 3:10 pm
Posts: 1850
Location: Hull, England
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]


Top
 Profile  
 
 Post subject: Re: player faces extended
PostPosted: Wed Sep 26, 2007 6:03 pm 
OpenTTD Developer
OpenTTD Developer
User avatar
Offline

Joined: Thu Mar 03, 2005 10:49 am
Posts: 522
Location: Germany
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


Top
 Profile  
 
 Post subject: Re: player faces extended
PostPosted: Wed Sep 26, 2007 6:16 pm 
OpenTTD Developer
OpenTTD Developer
Offline

Joined: Thu Feb 09, 2006 7:15 pm
Posts: 3181
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?


Top
 Profile  
 
 Post subject: Re: player faces extended
PostPosted: Wed Sep 26, 2007 6:28 pm 
Engineer
Engineer
Offline

Joined: Tue Aug 07, 2007 8:39 pm
Posts: 106
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


Top
 Profile E-mail  
 
 Post subject: Re: player faces extended
PostPosted: Sat Sep 29, 2007 1:17 pm 
Engineer
Engineer
Offline

Joined: Tue Aug 07, 2007 8:39 pm
Posts: 106
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


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: Klaatu and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Cash Advance | House Insurance | Camcorders | Breast Enlargement | Debt Help
Powered by phpBB © 2000-2009 phpBB Group

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2010.
Hosted by Zernebok.