Standalone avatar image generator + JavaScript Closets [Rev35]

Page 1 of 2 12 LastLast
Results 1 to 25 of 40
  1. #1
    Elite Member Tsuka is offline
    Member +Rank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Standalone avatar image generator [R63]

     

    Is there a demand for now I do'nt know but, it was released because I almost completed.
    I hope you will find it helpful.

    Is not dependent on the generator of official server, I made a generator of complete standalone.
    It works by using the GD library in PHP.
    It is extracted from SWF of revision 63 figure image used for resource.

    use image cast revision: LASTEST



    * This JavaScript is one of the use cases. To use the PHP code that is distributed, must be incorporated into the code yourself.

    Habbo Standalone Avatar Generator | HABOX LABS


    Update

    * need first run "resourse_update.php".

    May.10.2015 / version 1.2.8 beta release
    - supports more options for part-generator
    - fixed alpha blend
    - fixed renderer for large size
    - fixed resource_update.php
    - fixed bugs (indicated by Jer)

    Apr.14.2015 / version 1.2.5 release

    - support R63 casts.
    - rewrite many code for processing speed. (successful to less than 100ms)
    - included swf dump tool "resource_update.php".
    Last edited by Tsuka; 10-05-15 at 11:08 AM. Reason: version 1.2.8 beta release


  2. #2
    Elite Member Tom Lammers is offline
    Member +Rank
    Dec 2012 Join Date
    Westerzicht, ZeLocation
    144Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Nice! I'm going to put this on retroripper.com

  3. #3
    :joy: Jonteh is offline
    Grand MasterRank
    Apr 2007 Join Date
    New York, USALocation
    3,372Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Needed something like this for a while. Hopefully someone can extract the r63 clothes for you so we can start using our own hosted avatars.

    Big ups, Tsuka - surprised you're still around. I remember using your customs and hotel views when I was 12 and 13. Being Japanese, I can see why you base your stuff around cars :P

  4. #4
    ☮TAKU???? seanrom is offline
    Grand MasterRank
    Nov 2009 Join Date
    1,004Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Creds for the json structures? ^^

    I could extract from r63

  5. #5
    :joy: Jonteh is offline
    Grand MasterRank
    Apr 2007 Join Date
    New York, USALocation
    3,372Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by oleaa View Post
    Creds for the json structures? ^^

    I could extract from r63
    Please do! This is probably one of the most worthwhile projects in the Habbo section right now.

  6. #6
    Newbie anb505 is offline
    MemberRank
    Dec 2006 Join Date
    3Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Very nice project!

    I have a similar script who uses SWF and XML files. Its development is not finished yet so there are still some errors, but extraction from SWF works fine. If you need help I am available ;)

    Here is the thread of my project (on a French board):

  7. #7
    <insert title here> Shorty is offline
    Grand MasterRank
    Feb 2007 Join Date
    United KingdomLocation
    1,857Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Holy fuck, can we all just take a moment to all hail Tsuka?

  8. #8
    "(still lacks brains)" NoBrain is offline
    Grand MasterRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Jesus, that must have taken a while to do. Looks good

  9. #9
    Evil Italian Overlowrd Droppy is offline
    Grand MasterRank
    Feb 2012 Join Date
    /home/droppyLocation
    2,080Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Jesus Tsuka! Nice job you've maded in there! Each day we are progressing, and needing less of habbo resources!

    I'll open a oldskool and I'll embed this in register/image change (and make via RCON to exec the :poof command automactly)!

    Thanks a lot for this man!

  10. #10
    Elite Member Tsuka is offline
    Member +Rank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by oleaa View Post
    Creds for the json structures? ^^

    I could extract from r63
    I wrote a program that automatically output unique JSON format... :P
    and performance problems, it might change in the method to read the XML directly.

    Now developing program that generates resources by automatically dump the SWF of R63.

    - - - Updated - - -

    Quote Originally Posted by anb505 View Post
    Very nice project!

    I have a similar script who uses SWF and XML files. Its development is not finished yet so there are still some errors, but extraction from SWF works fine. If you need help I am available ;)

    Here is the thread of my project (on a French board):
    good. similar project :D

    my project is likely take a long time, because I don't know the figure parts structure of R63.
    I'll unhurriedly analyzes... :P

  11. #11
    En Français? Bjork is offline
    Grand MasterRank
    Apr 2007 Join Date
    854Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    That's a very unique project, and interesting stuff here since a while! Nice work Tsuka :)

  12. #12
    Grand Master PR0 is offline
    Grand MasterRank
    Mar 2007 Join Date
    1,206Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    TSUKA! Konnichiwa!

    Good to see you back on here :) This has made my day. I have no idea what this can be used for though because I'm a junior dev.

    Can anyone explain in noob-friendly detail with what this is for, what it does, and what it is used for?


    Thanks! !!!
    @Tsuka

    Hey so I check into your blogs that you have every once in a while and they always have the most unique development I can find on there! Can you give an update to some new and unique features you've made so far?

    That's a cool driving simulation setup you have too btw. haha.
    Last edited by PR0; 30-03-15 at 08:39 PM.

  13. #13
    Grand Master Emily is offline
    Grand MasterRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Tsuka, goddamn! I've always loved your resources and this is a very useful one. I can't thank you enough for this!

  14. #14
    Newbie anb505 is offline
    MemberRank
    Dec 2006 Join Date
    3Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    @Tsuka: I can send you my avatar imager for the body parts if you want.

    I've written a little script to extract data from SWF files.
    Maybe it can help you or someone else to understand how SWF files are structured ;)

    Spoiler:
    PHP Code:
    <?php

    /**
     * Extraction of tags from SWF file
     *
     * @author Antoinee <anb505.spam@outlook.fr>
     * [MENTION=316612]Version[/MENTION] 0.0-20150804
     * [MENTION=585868]Lice[/MENTION]nse [url]http://opensource.org/licenses/MIT[/url] MIT License
     */

    define('INPUT_FILE''input.swf');
    define('OUTPUT_DIRECTORY''./output');

    chdir(__DIR__);

    function 
    swf_read_DefineBitsLossless2($raw_data) {

        
    // Data length
        
    $data_length strlen($raw_data) - 7;

        
    // Assuming that BitmapFormat = 5
        
    $tag unpack('vsymbol_id/Cformat/vwidth/vheight'$raw_data);
        
    $data gzuncompress(substr($raw_data7));

        if (
    $tag['format'] != 5) {

            echo 
    "BitmapFormat = {$tag['format']}\tSkip this tag\r\n";
            return [];
        }

        
    $im imagecreatetruecolor($tag['width'], $tag['height']);
        
        
    imagefill($im000x7fffffff);

        for (
    $y 0$y $tag['height']; $y++) {

            for (
    $x 0$x $tag['width']; $x++) {

                list(, 
    $color) = unpack('N'$data);
                
    $data substr($data4);

                
    imagesetpixel($im$x$y$color);
            }
        }

        
    $tag['im'] = $im;

        return 
    $tag;
    }

    function 
    swf_read_SymbolClass($raw_data) {

        
    // Read the number of symbols
        
    list(, $number_of_symbols) = unpack('v'substr($raw_data02));

        
    $raw_data substr($raw_data2);

        
    // Read all symbols
        // for ($symbols = []; count($symbols) < $number_of_symbols; ) {
        
    for ($symbols = []; strlen($raw_data); ) {

            
    extract(unpack('vsymbol_id/Z*symbol_value'$raw_data));
            
    $symbols[$symbol_id] = $symbol_value;

            
    $raw_data substr($raw_datastrlen($symbol_value) + 1);
        }

        return 
    $symbols;
    }

    function 
    swf_read_DefineBinaryData($raw_data) {

        
    // Data length
        
    $data_length strlen($raw_data) - 6;

        return 
    unpack('vsymbol_id/V/Z' $data_length 'data'$raw_data);
    }

    function 
    swf_extract($swf_file) {

        
    // Read SWF file
        
    $raw_data file_get_contents($swf_file);

        
    // Uncompress SWF data
        
    if (substr($raw_data03) == 'CWS') {

            
    $raw_data 'F' substr($raw_data17) . gzuncompress(substr($raw_data8));
        }

        
    // File length
        
    list(, $file_length) = unpack('V'substr($raw_data44));

        
    // Header length
        
    $header_length ceil(((ord($raw_data[8]) >> 3) * 3) / 8) + 4;

        
    // Output arrays
        
    $pngs = [];
        
    $xmls = [];

        
    // Read tags
        
    for ($cursor $header_length$cursor $file_length; ) {

            
    // Read tag header
            
    list(, $tag_header) = unpack('v'substr($raw_data$cursor2));
            
    $cursor += 2;

            list(
    $tag_code$tag_length) = [$tag_header >> 6$tag_header 0x3f];

            
    // Read long tag header
            
    if ($tag_length == 0x3f) {

                list(, 
    $tag_length) = unpack('V'substr($raw_data$cursor4)); // Must be signed!
                
    $cursor+= 4;
            }

            
    // Read tag body
            
    switch ($tag_code) {

                
    // DefineBitsLossless2
                
    case 36:
                    
    $tag swf_read_DefineBitsLossless2(substr($raw_data$cursor$tag_length));
                    
    $pngs[$tag['symbol_id']] = $tag['im'];
                break;

                
    // SymbolClass
                
    case 76:
                    
    $symbols swf_read_SymbolClass(substr($raw_data$cursor$tag_length));
                break;

                
    // DefineBinaryData
                
    case 87:
                    
    $tag swf_read_DefineBinaryData(substr($raw_data$cursor$tag_length));
                    
    $xmls[$tag['symbol_id']] = $tag['data'];
                break;
            }

            
    // Go to the next tag
            
    $cursor+= $tag_length;

            
    // Exit loop if End tag
            // $tag_code != 0 ? : break;
        
    }

        foreach (
    $xmls as $symbol_id => $xml) {

            
    $name = isset($symbols[$symbol_id]) ? $symbols[$symbol_id] : 'symbol_' $symbol_id;

            
    // if (file_exists(OUTPUT_DIRECTORY . '/' .$name . '.xml')) {

            //     $name.= '_' . substr(md5(microtime(true)), 0, 8);

            //     echo $name,PHP_EOL;
            // }

            
    file_put_contents(OUTPUT_DIRECTORY '/' $name '.xml'$xml);
        }

        foreach (
    $pngs as $symbol_id => $png) {

            
    $name = isset($symbols[$symbol_id]) ? $symbols[$symbol_id] : 'symbol_' $symbol_id;

            
    // if (file_exists(OUTPUT_DIRECTORY . '/' .$name . '.png')) {

            //     $name.= '_' . substr(md5(microtime(true)), 0, 8);

            //     echo $name,PHP_EOL;
            // }

            
    imagepng($pngOUTPUT_DIRECTORY '/' $name '.png');
        }
    }

    swf_extract(INPUT_FILE);

  15. #15
    Elite Member Tsuka is offline
    Member +Rank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by anb505 View Post
    @Tsuka: I can send you my avatar imager for the body parts if you want.

    I've written a little script to extract data from SWF files.
    Maybe it can help you or someone else to understand how SWF files are structured ;)

    Spoiler:
    PHP Code:
    <?php

    /**
     * Extraction of tags from SWF file
     *
     * @author Antoinee <anb505.spam@outlook.fr>
     * [MENTION=316612]Version[/MENTION] 0.0-20150804
     * [MENTION=585868]Lice[/MENTION]nse [url]http://opensource.org/licenses/MIT[/url] MIT License
     */

    define('INPUT_FILE''input.swf');
    define('OUTPUT_DIRECTORY''./output');

    chdir(__DIR__);

    function 
    swf_read_DefineBitsLossless2($raw_data) {

        
    // Data length
        
    $data_length strlen($raw_data) - 7;

        
    // Assuming that BitmapFormat = 5
        
    $tag unpack('vsymbol_id/Cformat/vwidth/vheight'$raw_data);
        
    $data gzuncompress(substr($raw_data7));

        if (
    $tag['format'] != 5) {

            echo 
    "BitmapFormat = {$tag['format']}\tSkip this tag\r\n";
            return [];
        }

        
    $im imagecreatetruecolor($tag['width'], $tag['height']);
        
        
    imagefill($im000x7fffffff);

        for (
    $y 0$y $tag['height']; $y++) {

            for (
    $x 0$x $tag['width']; $x++) {

                list(, 
    $color) = unpack('N'$data);
                
    $data substr($data4);

                
    imagesetpixel($im$x$y$color);
            }
        }

        
    $tag['im'] = $im;

        return 
    $tag;
    }

    function 
    swf_read_SymbolClass($raw_data) {

        
    // Read the number of symbols
        
    list(, $number_of_symbols) = unpack('v'substr($raw_data02));

        
    $raw_data substr($raw_data2);

        
    // Read all symbols
        // for ($symbols = []; count($symbols) < $number_of_symbols; ) {
        
    for ($symbols = []; strlen($raw_data); ) {

            
    extract(unpack('vsymbol_id/Z*symbol_value'$raw_data));
            
    $symbols[$symbol_id] = $symbol_value;

            
    $raw_data substr($raw_datastrlen($symbol_value) + 1);
        }

        return 
    $symbols;
    }

    function 
    swf_read_DefineBinaryData($raw_data) {

        
    // Data length
        
    $data_length strlen($raw_data) - 6;

        return 
    unpack('vsymbol_id/V/Z' $data_length 'data'$raw_data);
    }

    function 
    swf_extract($swf_file) {

        
    // Read SWF file
        
    $raw_data file_get_contents($swf_file);

        
    // Uncompress SWF data
        
    if (substr($raw_data03) == 'CWS') {

            
    $raw_data 'F' substr($raw_data17) . gzuncompress(substr($raw_data8));
        }

        
    // File length
        
    list(, $file_length) = unpack('V'substr($raw_data44));

        
    // Header length
        
    $header_length ceil(((ord($raw_data[8]) >> 3) * 3) / 8) + 4;

        
    // Output arrays
        
    $pngs = [];
        
    $xmls = [];

        
    // Read tags
        
    for ($cursor $header_length$cursor $file_length; ) {

            
    // Read tag header
            
    list(, $tag_header) = unpack('v'substr($raw_data$cursor2));
            
    $cursor += 2;

            list(
    $tag_code$tag_length) = [$tag_header >> 6$tag_header 0x3f];

            
    // Read long tag header
            
    if ($tag_length == 0x3f) {

                list(, 
    $tag_length) = unpack('V'substr($raw_data$cursor4)); // Must be signed!
                
    $cursor+= 4;
            }

            
    // Read tag body
            
    switch ($tag_code) {

                
    // DefineBitsLossless2
                
    case 36:
                    
    $tag swf_read_DefineBitsLossless2(substr($raw_data$cursor$tag_length));
                    
    $pngs[$tag['symbol_id']] = $tag['im'];
                break;

                
    // SymbolClass
                
    case 76:
                    
    $symbols swf_read_SymbolClass(substr($raw_data$cursor$tag_length));
                break;

                
    // DefineBinaryData
                
    case 87:
                    
    $tag swf_read_DefineBinaryData(substr($raw_data$cursor$tag_length));
                    
    $xmls[$tag['symbol_id']] = $tag['data'];
                break;
            }

            
    // Go to the next tag
            
    $cursor+= $tag_length;

            
    // Exit loop if End tag
            // $tag_code != 0 ? : break;
        
    }

        foreach (
    $xmls as $symbol_id => $xml) {

            
    $name = isset($symbols[$symbol_id]) ? $symbols[$symbol_id] : 'symbol_' $symbol_id;

            
    // if (file_exists(OUTPUT_DIRECTORY . '/' .$name . '.xml')) {

            //     $name.= '_' . substr(md5(microtime(true)), 0, 8);

            //     echo $name,PHP_EOL;
            // }

            
    file_put_contents(OUTPUT_DIRECTORY '/' $name '.xml'$xml);
        }

        foreach (
    $pngs as $symbol_id => $png) {

            
    $name = isset($symbols[$symbol_id]) ? $symbols[$symbol_id] : 'symbol_' $symbol_id;

            
    // if (file_exists(OUTPUT_DIRECTORY . '/' .$name . '.png')) {

            //     $name.= '_' . substr(md5(microtime(true)), 0, 8);

            //     echo $name,PHP_EOL;
            // }

            
    imagepng($pngOUTPUT_DIRECTORY '/' $name '.png');
        }
    }

    swf_extract(INPUT_FILE);
    thats interesting.

    I also developed process of similar dump program before, but more of your code is light.
    I developing extract tool now using it.


    http://labs.habox.org/figuredata_dump.php

  16. #16
    ☮TAKU???? seanrom is offline
    Grand MasterRank
    Nov 2009 Join Date
    1,004Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    holy shit this is bringing it to a whole new level

  17. #17
    Grand Master PR0 is offline
    Grand MasterRank
    Mar 2007 Join Date
    1,206Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by Tsuka View Post
    thats interesting.

    I also developed process of similar dump program before, but more of your code is light.
    I developing extract tool now using it.


    http://labs.habox.org/figuredata_dump.php
    The forever loading figuredata dump hurts my brain!!

  18. #18
    Elite Member Tsuka is offline
    Member +Rank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    where "draw-order" at R63?
    I can't find definition for the draw order determining...

  19. #19
    Live Ocottish Sverlord Joopie is offline
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by Tsuka View Post
    where "draw-order" at R63?
    I can't find definition for the draw order determining...
    Did you look inside the Habbo.swf? I beleave it's there.

  20. #20
    Elite Member Tsuka is offline
    Member +Rank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by Joopie View Post
    Did you look inside the Habbo.swf? I beleave it's there.
    finding from Habbo.swf but have not been found yet...
    for now, developing DoABC analyzer to extract it.

  21. #21
    Live Ocottish Sverlord Joopie is offline
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by Tsuka View Post
    finding from Habbo.swf but have not been found yet...
    for now, developing DoABC analyzer to extract it.
    You can use RABCDAsm and extract all the binary data using binexport.

    I'm sure it's in there.

  22. #22
    Elite Member Tsuka is offline
    Member +Rank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by Joopie View Post
    You can use RABCDAsm and extract all the binary data using binexport.

    I'm sure it's in there.
    I need analyzer(*dumper) that runs in PHP because it is desirable to generate dynamically defined data from the official SWF resources.

  23. #23
    Live Ocottish Sverlord Joopie is offline
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,773Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by Tsuka View Post
    I need analyzer(*dumper) that runs in PHP because it is desirable to generate dynamically defined data from the official SWF resources.
    It's not that recomment to dump the Habbo.swf as it contains lots of binary "tags". I suggest (if you really want i) to decompress the swf and do a regular expression to fetch the xml.
    But if I was you, I would just copy it by hand to a new file draworder.xml.

    Also, take a look at this if you want. http://shares.jospiek.nl/s#667ca017-...l/FurniViewer/

    SWFObjectReader.class.php line: 87

  24. #24
    Elite Member Tsuka is offline
    Member +Rank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    Quote Originally Posted by Joopie View Post
    It's not that recomment to dump the Habbo.swf as it contains lots of binary "tags". I suggest (if you really want i) to decompress the swf and do a regular expression to fetch the xml.
    But if I was you, I would just copy it by hand to a new file draworder.xml.

    Also, take a look at this if you want. http://shares.jospiek.nl/s#667ca017-...l/FurniViewer/

    SWFObjectReader.class.php line: 87
    ty, but xml and image cast dump tool has been completed :P
    I will included source code when next version release.

    - - - Updated - - -



    Provisionally I tried to support the R63.
    But, have problems because it doesn't implement process of draw order...

    By improving the process was heavy load, processing time becomes less than 100ms.

    http://labs.habox.org/generator-avatar

  25. #25
    Elite Member Tsuka is offline
    Member +Rank
    Jul 2007 Join Date
    Japan, YokohamaLocation
    125Posts

    Re: Standalone avatar image generator + JavaScript Closets [Rev35]

    version 1.2.0 preview
    support R63 casts.
    and rewrite many code for processing speed. (successful to less than 100ms)
    included swf dump tool, source code download coming soon...



    http://labs.habox.org/generator-avatar



Page 1 of 2 12 LastLast

Advertisement