Better country/team selection screen

You can add your ideas on how to make Bygfoot better here.
Locked
MarkC
Posts: 96
Joined: Tue Mar 29, 2005 10:34 pm

Better country/team selection screen

Post by MarkC »

I think it'd be a lot nicer to replace the contents of the country selection list (currently country_england.xml, country_germany.xml and so on) with proper country names. The <name> tag from the country def. file would be ideal. This is kind of an obvious suggestion, so I understand if it's being left this way on purpose while development is still ongoing.

Also, is it possible to replace the simple choice of "top league / current league / bottom league" with a drop-down list containing all the leagues of the country? I imagine it working like this. Every time you select a new team, the league choice is set to that team's current league. You can then change the league before adding the user.

This way, the user could choose to start in a low but not rock-bottom position (e.g. league 4 in England), with any team of their choice.

Mark
vector
Posts: 449
Joined: Sat Dec 18, 2004 11:26 pm
Location: Australia, Victoria

Post by vector »

jolly good thought
I second the motion!
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Re: Better country/team selection screen

Post by gyboth »

MarkC wrote:I think it'd be a lot nicer to replace the contents of the country selection list (currently country_england.xml, country_germany.xml and so on) with proper country names. The <name> tag from the country def. file would be ideal. This is kind of an obvious suggestion, so I understand if it's being left this way on purpose while development is still ongoing.
the problem with this idea is that we'd have to load all country files we find in the support directories (just so that we can access the country name). that would make the startup slower, would require more memory and we'd have to free all the unneeded countries after the user chose a country and team (we have 9 countries already and this number won't decrease, only increase).

One thing we could do is to remove 'country_' and '.xml' and capitalise the rest (country_france.xml -> France). this'd be a bit nicer, but i'm not sure it's worth it (we'd have to do the reverse procedure as well to know which file the country the user selected corresponds to).
Also, is it possible to replace the simple choice of "top league / current league / bottom league" with a drop-down list containing all the leagues of the country? I imagine it working like this. Every time you select a new team, the league choice is set to that team's current league. You can then change the league before adding the user.
yep, this is a nice idea. maybe i'll add it before the release (not before saturday, though).

gyözö
Press any key to continue or any other key to quit.
MarkC
Posts: 96
Joined: Tue Mar 29, 2005 10:34 pm

Re: Better country/team selection screen

Post by MarkC »

the problem with this idea is that we'd have to load all country files we find in the support directories (just so that we can access the country name). that would make the startup slower, would require more memory and we'd have to free all the unneeded countries after the user chose a country and team (we have 9 countries already and this number won't decrease, only increase).
Yes, I see the point. Would we need to load the whole country, though? Couldn't we use a simpler xml parser that "cheats" and only reads each country file as far as the name tag? I don't imagine that this would be too much of a performance problem, even for a large number of countries.
One thing we could do is to remove 'country_' and '.xml' and capitalise the rest (country_france.xml -> France). this'd be a bit nicer, but i'm not sure it's worth it (we'd have to do the reverse procedure as well to know which file the country the user selected corresponds to).
Hmm, why reverse the procedure? I imagined making two arrays, one with the filenames and another with the country names in the same order. Then we just look up the filename corresponding to the chosen country.

I was just thinking that some countries with long names (perhaps two words or more) will have clunky filenames and/or look ugly in the selection list.
yep, this is a nice idea. maybe i'll add it before the release (not before saturday, though).
Great :-)
vector
Posts: 449
Joined: Sat Dec 18, 2004 11:26 pm
Location: Australia, Victoria

Post by vector »

Couldn't we use a simpler xml parser that "cheats"
yeah I hate to say this again, but even tho you guys are way ahead of my programming prowess and I bow to your better judgments,I had a quick look at XML when Gyboth first mentioned it and with "Python" even I was conducting XML symphonies. I have even had an odd look at using python to read the current string of bygfoot xml files with the intention of making a front end for them but then one has to ask why? (like getting history data out) but i have little time to chase such pursuits :cry: .
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
MarkC
Posts: 96
Joined: Tue Mar 29, 2005 10:34 pm

Post by MarkC »

vector wrote:
Couldn't we use a simpler xml parser that "cheats"
yeah I hate to say this again, but even tho you guys are way ahead of my programming prowess and I bow to your better judgments,I had a quick look at XML when Gyboth first mentioned it and with "Python" even I was conducting XML symphonies.
Ah, I didn't mean to suggest an entirely new parser for everything. I just meant another set of functions written in C like we already have, but simply for getting names out rather than constructing the whole country definition.

You're quite right though, C is far from the best language for processing text of any kind :-) Languages like Python are just made for it, and I believe it's quite easy to call Python modules from C code. But it would make bygfoot dependent on having the Python interpreter available, and for a small project like this it's probably not worth the effort to start linking languages together.
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Re: Better country/team selection screen

Post by gyboth »

MarkC wrote:Yes, I see the point. Would we need to load the whole country, though? Couldn't we use a simpler xml parser that "cheats" and only reads each country file as far as the name tag? I don't imagine that this would be too much of a performance problem, even for a large number of countries.
of course this is a possibility, but i'd say just to make the startup screen look a bit better it's a bit too circumstantial. in C, at least.
Hmm, why reverse the procedure?
to get the file name from the country name (France -> country_france.xml).
I imagined making two arrays, one with the filenames and another with the country names in the same order. Then we just look up the filename corresponding to the chosen country.
that would involve putting the arrays into the combo box, and in such a way that the user doesn't see the filename parts. again, it's not really worth it, i'd say. there are other parts of the program that need improvement a lot more.
I was just thinking that some countries with long names (perhaps two words or more) will have clunky filenames and/or look ugly in the selection list.
yes. i'd say let's stick with the xml filenames (and avoid clunky filenames for countries to come). that's clear for the user, too (e.g. if he makes a new def and copies it into the support dir, the file name appears next time he starts the game) and with the flags it doesn't look that bad either.

gyözö
Press any key to continue or any other key to quit.
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Re: Better country/team selection screen

Post by gyboth »

MarkC wrote:Also, is it possible to replace the simple choice of "top league / current league / bottom league" with a drop-down list containing all the leagues of the country?
:arrow: this is added now.

gyözö
Press any key to continue or any other key to quit.
MarkC
Posts: 96
Joined: Tue Mar 29, 2005 10:34 pm

Re: Better country/team selection screen

Post by MarkC »

I imagined making two arrays, one with the filenames and another with the country names in the same order. Then we just look up the filename corresponding to the chosen country.
that would involve putting the arrays into the combo box, and in such a way that the user doesn't see the filename parts.
Ah, ok. I'm not familiar with GTK. I thought you'd just be able to put the country names into the combo box and the filenames into a separate array. Then if you user picks row 3 from the combo box, you look up row 3 in the filename array.
again, it's not really worth it, i'd say. there are other parts of the program that need improvement a lot more.
Agreed!
Also, is it possible to replace the simple choice of "top league / current league / bottom league" with a drop-down list containing all the leagues of the country?
:arrow: this is added now.
Excellent, that looks really good :-)
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Re: Better country/team selection screen

Post by gyboth »

MarkC wrote:Ah, ok. I'm not familiar with GTK. I thought you'd just be able to put the country names into the combo box and the filenames into a separate array. Then if you user picks row 3 from the combo box, you look up row 3 in the filename array.
oh, separate arrays. i didn't think of that :oops: that would work of course. but it'd lead to some new global variables which won't be needed later at all.

gyözö
Press any key to continue or any other key to quit.
Locked