XNA Creators Club Online
Page 1 of 1 (10 items)
Sort Posts: Previous Next

Designing Custom Avatars

Last post 12/06/2009 5:54 by Dean. 9 replies.
  • 12/06/2009 2:54

    Designing Custom Avatars

    Hi,
    I really didn't want to be that guy posting questions about Avatars on the first day of XNA 3.1, but I guess I will be =(.

    I've been playing around with the Avatar system (not really making a game, just seeing what stuff we can do with them), and as far as creating an avatar, we seem to need a AvatarDescription. These seem to be made in one of three ways:

    • AvatarDescription.CreateRandom()
    • Loading an Avatar off a player's Gamer profile
    • Loading in a saved byte array from an already created Avatar

    I'm just wondering if I'm just dumb and am missing the ability to create a new Avatar that isn't random, but specific in what they look like. (IE similar to the creation of an Avatar on the Xbox, but through code) or if it just doesn't exist. If it doesn't that;s cool, I'm just wondering. I'm not complaining at all =D.

    Thanks to the XNA team for delivering us great updates. You guys rock!
    Kyle Zimmerman
    Anti-Force
    Follow me on Twitter! : Twitter
    Working on: ElectroStatic | AntiForce Editor
  • 12/06/2009 3:11 In reply to

    Re: Designing Custom Avatars

    Take a look at Dean's blog.  I believe it touches on what you're looking for:

    http://blogs.msdn.com/dejohn/

    The specific comment that might address your need (though I haven't tried it yet) is:

    Loading a avatar designed by the developer
    The final scenario allows the developer to design a specific avatar for use as a character in their game. This can be done by creating the desired look for the avatar in the Xbox 360 dash avatar editor. Then use an Xbox 360 XNA Game Studio game to load the AvatarDescription object from the SignedInGamer.Avatar property for the profile associated with the avatar you want to use. Put a breakpoint somewhere in your code after loading the AvatarDescription. Debug the code and put the AvatarDescription object you created in the watch window in Visual Studio.
  • 12/06/2009 3:16 In reply to

    Re: Designing Custom Avatars

    Ah ok. I read the stuff on his blog, I guess I missed that part >_<. How silly of me.

    I just tested that, and it does indeed work. Although it's not exactly what I was looking for. This would work great for the developer designing specific Avatars, but if I wanted the user to say, create a custom party member or something, the only way to do that would be to either make a bunch in advance to select, or just keep creating new random ones until they find one they like. Oh well.

    Thanks for the reply!
    Kyle Zimmerman
    Anti-Force
    Follow me on Twitter! : Twitter
    Working on: ElectroStatic | AntiForce Editor
  • 12/06/2009 3:48 In reply to

    Re: Designing Custom Avatars

    Since you can load them from a byte array, wouldn't a designer like what you want be completely doable using a screen that assists the user in putting values into the byte array that generates the character?
  • 12/06/2009 4:02 In reply to

    Re: Designing Custom Avatars

    I was actually thinking the same thing. I've been looking through the byte array trying to figure it out, and so far I'm not having much luck. There doesn't appear to be any documentation on it (yet, it is just the first day after all). I've written a bit of an app that's running through the array trying to find patterns. Everything that turns up either breaks the Avatar (nothing shows up) or makes absolutely no change. If I find anything I'll let you know, and if anyone finds anything, please let me know =D.
    Kyle Zimmerman
    Anti-Force
    Follow me on Twitter! : Twitter
    Working on: ElectroStatic | AntiForce Editor
  • 12/06/2009 4:24 In reply to

    Re: Designing Custom Avatars

    You might have better luck generating a lot of random avatars and comparing their byte arrays. Probably a faster way to figure out what does what since you're likely going to start seeing repeat clothing, hair, and such which would help you single out what each part of the array represents.

    I don't care enough to join in the pursuit, but god speed and let us know what you find. :)
  • 12/06/2009 4:38 In reply to

    Re: Designing Custom Avatars

    With a thousand items in that array, I can see how it would be tough to find your way around! I bet they'll map it out for us. If you're driven to experiment with the array and try to map some properties yourself, maybe I can suggest a technique that might help speed up your search. Let's say you want to know which item in the byte array affects the face's texture. Write a short program that changes the value of half the items and generates the resulting avatar when you press the button. 

    If no avatar loads, "roll" again until you get a set of values that produces an avatar then examine the result. If the face texture changed, the item you want is in the selected set. Otherwise, your item is in the ignored set. Lock the set of properties you know the face variable is not in and roll again, this time changing half the values only in the unlocked sub-set of the array. Keep narrowing the search until you're down to one item.

    Oh, and if a propert is in the changing set, make sure it really changes. A simple RNG might return a value of 16 but if the value is already 16 it could influence your results.
  • 12/06/2009 4:45 In reply to

    Re: Designing Custom Avatars

    The format of the avatar description byte array is intentionally not documented, and manually editing these descriptions is not supported. The only ways to create an avatar description are those described by Dean on his blog.

    I wouldn't recommend spending too much time trying to reverse engineer the description format, as I don't think you'll get too far with that approach  :-)
    XNA Framework Developer - blog - homepage
  • 12/06/2009 5:28 In reply to

    Re: Designing Custom Avatars

    Thanks for letting me know before I spent too much time on it. I really don't plan on using Avatars very much, it just seemed like a fun thing to try and a nice thing to share.

    Either way, thanks for sharing that info :-)
    Kyle Zimmerman
    Anti-Force
    Follow me on Twitter! : Twitter
    Working on: ElectroStatic | AntiForce Editor
  • 12/06/2009 5:54 In reply to
    • (244)
    • premium membership Team XNA
    • Posts 202

    Re: Designing Custom Avatars

    As Shawn mentioned manually editing the bytes in the array is not supported.

    Something that would be time consuming but possible would be to identify what characters you want in your game and with what combinations of items and clothing. You can then create each of those in the avatar editor in the dash and save out the byte array as described in my previous blog post.
    Dean Johnson, XNA Framework Developer - Blog: Nerd Herder
Page 1 of 1 (10 items) Previous Next