PDA

View Full Version : Picking a Player


Nikos Beck
07-31-2007, 01:26 PM
What functionality do players need to support a game with several profiles?

Clearly players need to pick their name from a list. The list needs to be scrollable to support an arbitrary number of players. I don't think a fixed number of slots is an option. The list can be moved with arrows or a scrolling widget or both. An "Ok" button to accept the selected players name. A "Cancel" button to back out and not pick a player. A "New" button to add a new player. A "Delete" button to delete the selected players name. A "Rename" button to rename the currently selected player.

Are all of these buttons necessary? Is there a way to arrange them intuitively? For example, "Ok" at the bottom centre and other buttons arranged horizontally under the list in the order "Cancel", "Delete", "Rename", "New".

Should clicking "New" open a dialog window or add a new item to the top of the list and present the player with a blinking cursor? Should there be a text box with the name of the currently selected player?

Is "Rename" even necessary? Can I assume the player will spell their own name correctly?

What is a reasonable capacity for the name? Eight characters? Twelve? Three like a classical arcade game?

I'm looking for discussion about a screen we all have to implement. There might be approaches I haven't even thought of that present this more clearly to the player.

ZeHa
07-31-2007, 02:21 PM
Three like a classical arcade game

You certainly won't make a scrollable list to support an arbitrary number of players, but then limit the player's name to three letters... :rolleyes:

Unless it's a real hardcore arcade game (which in turn wouldn't be in need of player profiles), I wouldn't limit the player's name length to anything below 16 characters. I remember I was annoyed from time to time in Worms 2, where the worms' names were also limited in length, because using funny names was what setting up a team was all about ;)

datxcod
07-31-2007, 02:27 PM
I'm at that stage right now in one of my projects. I would say that all you need in the main screen is:

If the game is running for the first time on the user's computer (you can check that by using an ini file or perhaps having a dummy profile in the "profiles" folder and checking if it's the only profile on that folder) you would pop up a window asking their name. I think a nice feature would be to ask "are you sure" after clicking every possible button that makes all changes done visible.

Clicking "new" inside the "profiles" screen should definitely push a new user into the list and ask the player for the name. IMOH you could handle renaming by just letting the user click the right "user name" and then focus the keyboard on the current control which could be edited by directly writing or deleting characters, there would be no need for an extra pop up window, etc.

About the capacity I would allow as many character as possible that can fit into your list box (horizontally), 12 to 15 characters, it really depends on the size of your listbox widget.

And I would definitely limit the amount of players in the game, make it something like 30, otherwise you would have to handle resizing of your widgets.

As you can see you need a nice GUI lib to make what looks like the simplest screen in a game. In one of my projects I'm using PTK but since I suck major ass at structuring a nice GUI system (I've tried before) I had to change libs. I even asked people who I know are using PTK if they had a GUI system in place but none of them responded with available code. So I found a great library that contains a nice GUI system. In two-threeish days I had all the profile screen and logic done (it supports scrollable lists, buttons, textboxes, etc).

ZeHa
07-31-2007, 10:56 PM
If the game is running for the first time on the user's computer [...] you would pop up a window asking their name

This could even be enhanced further, I think it would be very cool if you read the username from the environment variables and set it already as the default text in the widget, though being in edit mode of course.

There are many people who just want to play the game immediately and are maybe annoyed if they have to think of and enter a username. It's the same for me, mostly I hate creating profiles, I just want to jump directly into the game. So that would be a really cool feature, since you could then just hit "enter" and start playing.

ChrisP
08-01-2007, 01:33 AM
As you can see you need a nice GUI lib to make what looks like the simplest screen in a game.

Oh, yeah, for sure. I ended up growing (not designing) my own GUI system for Mayhem Intergalactic - I didn't look into other GUI systems because I figured it would be pretty easy. I mean, all I needed was buttons and stuff. No sweat, right? But then over time I realised I needed textboxes (which really are surprisingly fiddly to do properly), sliders, list boxes, combo boxes, word-wrapping text... so I grew those features as I needed them. The end result is a mountain of yuck. The ideal course of action would be to rip it all out and replace it with CEGUI or similar, but it's such a big job that I don't think I'll ever bother to touch it.

Oh, and it's not at all data-driven, so there's a 1000 line switch statement(!) containing the setup for all the various UI screens, and about 800 more lines of code to copy data back and forth from the widgets. Like I said; YUCK. Never doing that again. :rolleyes: It's hands-down the absolute worst part of the code. Also completely non-reusable.

The moral of the story: Don't roll your own GUI system. Just don't. :)

Making the user's username the default is a really nice touch, I'll second that.

datxcod
08-01-2007, 05:47 AM
... The ideal course of action would be to rip it all out and replace it with CEGUI or similar, but it's such a big job that I don't think I'll ever bother to touch it.

Yep, I have tried CEGUI before but IMHO it's too big for integration with any simple library. It would be nice if you could just plug the lib in your game, but You'll have to design the whole game and "engine" around CEGUI instead of the other way around.


The moral of the story: Don't roll your own GUI system. Just don't. :)


Unless you have done it before with some success.

Nikos Beck
08-01-2007, 06:50 AM
I think a nice feature would be to ask "are you sure" after clicking every possible button that makes all changes done visible.

I agree with you 100%. Every action has a popup with "Cancel" so the player can back out.

Clicking "new" inside the "profiles" screen should definitely push a new user into the list and ask the player for the name. IMOH you could handle renaming by just letting the user click the right "user name" and then focus the keyboard on the current control which could be edited by directly writing or deleting characters, there would be no need for an extra pop up window, etc.

Do you mean clicking with the right mouse button or clicking on the name in the list? What about one click to rename or double-click to select. Clicking once and clicking "Ok" would be the same as a double-click.

There are many people who just want to play the game immediately and are maybe annoyed if they have to think of and enter a username. It's the same for me, mostly I hate creating profiles, I just want to jump directly into the game. So that would be a really cool feature, since you could then just hit "enter" and start playing.

Excellent point. Using the user's environment sounds like a good default. It's probably best to avoid "Player" or "New Player" because they're so generic. I suppose one could choose a name based on the theme like "Kermit" in a Frogger remake or is Kermit too much of a rip off?

Spiegel
08-01-2007, 07:01 AM
Mess up with any kind of profile stuff but please implement some kind of ability to order profiles...

I really hate lets say in guild wars to have 3 of 4 avatars and playing with one that is on the bottom of the list, I should be able to reorganize the list and make it the first of them all... its not crucial but still darn annoying... allow players to order they're profiles...

for a messed up person like me that's something that its appreciated...:cool:

ZeHa
08-01-2007, 07:22 AM
Excellent point. Using the user's environment sounds like a good default. It's probably best to avoid "Player" or "New Player" because they're so generic. I suppose one could choose a name based on the theme like "Kermit" in a Frogger remake or is Kermit too much of a rip off?

Well, depending on the funnyness of the game, that would also be a cool idea. Perhaps display some random name out of a list of 10, and each of them could be e.g. a name that's rather unusual in today's world, or maybe the first names of some famous presidents, or whatever. This may add a smile on the player's face, but of course, it really depends on what type of game it is.

Just remember how "You don't know Jack" gave us some stupid names when it took too long ;)

datxcod
08-01-2007, 10:10 AM
Do you mean clicking with the right mouse button or clicking on the name in the list? What about one click to rename or double-click to select. Clicking once and clicking "Ok" would be the same as a double-click.



I saw that in a game but I don't remember its name. Every item in the list once selected can be edited by just using the keyboard, you don't have to double click or right click. You just select the name of the profile and if you want to change the name just use the delete key and write the new name. So each element in the list is sort of a text box, instead of a static string, that can be edited whenever the user wants. I thought that it was a nice feature, you'd probably want to put some instructions like "select the profile and use the keyboard to delete or modify the name".

Captain Wingo
08-01-2007, 12:11 PM
We tried reading the default name from the environment and registry, but it was intrusive. It freaked people out. "How did it know my name?"

This was for a casual game, so know your target audience.

ChrisP
08-02-2007, 05:29 AM
Yep, I have tried CEGUI before but IMHO it's too big for integration with any simple library. It would be nice if you could just plug the lib in your game, but You'll have to design the whole game and "engine" around CEGUI instead of the other way around.
I'll take your word for it. I haven't actually looked at CEGUI at all beyond glancing over the website, so I know practically nothing about it!