VB formatting test

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Leon Marrick
    Sangband maintainer
    • Apr 2007
    • 31

    VB formatting test

    Code:
    [BC=black]
                                                                                                              
    [COLOR="#00F000"]Èomer        [/COLOR][COLOR="#FFFFFF"]##################################################################                           
    [/COLOR][COLOR="#00D0FF"]Adventurer   [/COLOR][COLOR="#FFFFFF"]#................................................................#                           
                 #................................................................#                           
    EXP [/COLOR][COLOR="#00F000"]98004606 [/COLOR][COLOR="#FFFFFF"]#......########[/COLOR][COLOR="#FFFF00"]8[/COLOR][COLOR="#FFFFFF"]...................##########....................#                           
    AU       [/COLOR][COLOR="#00F000"]444 [/COLOR][COLOR="#FFFFFF"]#......#########......########.....##########.......######.......#                           
    [/COLOR][COLOR="#909090"]K            [/COLOR][COLOR="#FFFFFF"]#......#########......#######3.....##########.......######.......#                           
    STR:      [/COLOR][COLOR="#00F000"]12 [/COLOR][COLOR="#FFFFFF"]#......#########......########.....##########.......######.......#                           
    INT:      [/COLOR][COLOR="#00F000"]15 [/COLOR][COLOR="#FFFFFF"]#......#########......########.....[/COLOR][COLOR="#FF8000"]7[/COLOR][COLOR="#FFFFFF"]#########.......[/COLOR][COLOR="#C00000"]6[/COLOR][COLOR="#FFFFFF"]#####.......#                           
    WIS:      [/COLOR][COLOR="#00F000"]13 [/COLOR][COLOR="#FFFFFF"]#..................................##########........@...........#                           
    DEX:      [/COLOR][COLOR="#00F000"]15 [/COLOR][COLOR="#FFFFFF"]#..................................[/COLOR][COLOR="#FF8000"]t[/COLOR][COLOR="#FFFFFF"]....................>........#                           
    CON:      [/COLOR][COLOR="#00F000"]13 [/COLOR][COLOR="#FFFFFF"]#................................................................#                           
    CHR:      [/COLOR][COLOR="#00F000"]12 [/COLOR][COLOR="#FFFFFF"]#............................................[/COLOR][COLOR="#FFFF00"]t[/COLOR][COLOR="#FFFFFF"]...................#                           
                 #................................................................#                           
    Cur AC     [/COLOR][COLOR="#00F000"]1 [/COLOR][COLOR="#FFFFFF"]#......................#####[/COLOR][COLOR="#0000E0"]5[/COLOR][COLOR="#FFFFFF"]#.......#######.....................#                           
    HP   [/COLOR][COLOR="#00F000"]11[/COLOR][COLOR="#FFFFFF"]/  [/COLOR][COLOR="#00F000"]11 [/COLOR][COLOR="#FFFFFF"]#......#######[/COLOR][COLOR="#909090"]2[/COLOR][COLOR="#FFFFFF"]#.......#######.......######[/COLOR][COLOR="#00D0FF"]4[/COLOR][COLOR="#FFFFFF"]......[/COLOR][COLOR="#C08040"]1[/COLOR][COLOR="#FFFFFF"]#########.....#                           
                 #......#########.......#######.......#######......##########.....#                           
                 #......#########.......#######.......#######......##########.....#                           
    [/COLOR][COLOR="#00F000"][Singing, h] [/COLOR][COLOR="#FFFFFF"]#......#########.......#######.......#######......[/COLOR][COLOR="#904000"]+[/COLOR][COLOR="#FFFFFF"]#########.....#                           
    [/COLOR][COLOR="#00F000"][Aimless-lo] [/COLOR][COLOR="#FFFFFF"]#....................................#######.....................#                           
                 #................................................................#                           
                 #................................................................#                           
    [/COLOR][COLOR="#909090"]Unknown      [/COLOR][COLOR="#FFFFFF"]##################################################################                           
    [/COLOR][COLOR="#00F000"]Luck                                                                                                      
    [/COLOR][COLOR="#606060"](no quest)                                                                                                
                                                                                                              
    [/COLOR][COLOR="#FFFFFF"]Regen: HP                                                                                                 
    [/COLOR][COLOR="#606060"](no target)                                                                                               
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                         [/COLOR][COLOR="#FFFFFF"]Town 
    [/COLOR][/BC]

    This works. But it could stand some improvement:

    1. I'd prefer not to have to use the "CODE" tag, but haven't figured out how to make spaces appear properly just using "TT".

    2. The screendumps are fairly large files, especially if the user has a large main Term or shows a picture with lots of color changes.
    Last edited by Leon Marrick; April 30, 2007, 01:57.
    S(all) W/D H+ D c+ f? PV++ s? d- P++ M+
    C S !I !So SQ RQ V+ F:<<buffer overrun>>
    http://angband.oook.cz/code
  • Leon Marrick
    Sangband maintainer
    • Apr 2007
    • 31

    #2
    Example for Angband

    Code:
    [TT][BC=black]
                                                                                    
    [color="#00FFFF"]Human        [/color][color="#808080"]###################################[/color][color="#FFFFFF"]#######[/color][color="#808080"]######################## 
    [/color][color="#00FFFF"]Warrior      [/color][color="#808080"]#..................................[/color][color="#FFFFFF"].......[/color][color="#808080"].......................# 
    [/color][color="#00FFFF"]Rookie       [/color][color="#808080"]#.................................[/color][color="#FFFFFF"].......[/color][color="#808080"]........................# 
    [/color][color="#FFFFFF"]LEVEL      [/color][color="#00FF00"]1 [/color][color="#808080"]#......##########.................[/color][color="#FFFFFF"]......[/color][color="#808080"]............######.......# 
    [/color][color="#FFFFFF"]EXP        [/color][color="#00FF00"]5 [/color][color="#808080"]#......##########................[/color][color="#FFFFFF"]......[/color][color="#808080"].............######.......# 
    [/color][color="#FFFFFF"]AU       [/color][color="#00FF00"]100 [/color][color="#808080"]#......##########.....#########.[/color][color="#FFFFFF"]....[/color][color="#C00000"]6[/color][color="#FFFFFF"]#[/color][color="#808080"]####..........######.......# 
    [/color][color="#C0C0C0"]|    [/color][color="#804000"]~       [/color][color="#808080"]#......##########.....########[/color][color="#FFFF00"]8[/color][color="#808080"].[/color][color="#FFFFFF"]....#[/color][color="#808080"]#####...[/color][color="#FFFFFF"]...[/color][color="#808080"]....######.......# 
    [/color][color="#FFFFFF"]STR:   [/color][color="#00FF00"]18/20 [/color][color="#808080"]#......2###[/color][color="#FFFFFF"]######..[/color][color="#808080"]...#########[/color][color="#FFFFFF"].....######......[/color][color="#808080"]....######.......# 
    [/color][color="#FFFFFF"]INT:      [/color][color="#00FF00"]13 [/color][color="#808080"]#.........[/color][color="#FFFFFF"]............#########..................[/color][color="#808080"]...3#####.......# 
    [/color][color="#FFFFFF"]WIS:      [/color][color="#00FF00"]10 [/color][color="#808080"]#.........[/color][color="#FFFFFF"].......................................[/color][color="#808080"]................# 
    [/color][color="#FFFFFF"]DEX:      [/color][color="#00FF00"]13 [/color][color="#808080"]#........[/color][color="#FFFFFF"].........................................[/color][color="#808080"]...............# 
    [/color][color="#FFFFFF"]CON:      [/color][color="#00FF00"]14 [/color][color="#808080"]#........[/color][color="#FFFFFF"]....................@....................[/color][color="#808080"]...............# 
    [/color][color="#FFFFFF"]CHR:      [/color][color="#00FF00"]14 [/color][color="#808080"]#........[/color][color="#FFFFFF"]...............>.........................[/color][color="#808080"]...............# 
                 #.........[/color][color="#FFFFFF"].#####[/color][color="#008040"]4[/color][color="#FFFFFF"]...................#####[/color][color="#0040FF"]5[/color][color="#FFFFFF"]#......[/color][color="#808080"]....[/color][color="#606060"]7[/color][color="#808080"]#####......# 
    [/color][color="#FFFFFF"]Cur AC     [/color][color="#00FF00"]0 [/color][color="#808080"]#..........####[/color][color="#FFFFFF"]##.......#####.......#[/color][color="#808080"]######..........######......# 
    [/color][color="#FFFFFF"]Max HP    [/color][color="#00FF00"]19 [/color][color="#808080"]#..........#####[/color][color="#FFFFFF"]#.....[/color][color="#808080"]..####[/color][color="#FFFFFF"]#.......#[/color][color="#808080"]######..........######......# 
    [/color][color="#FFFFFF"]Cur HP    [/color][color="#00FF00"]19 [/color][color="#808080"]#..........#####[/color][color="#FFFFFF"]#...[/color][color="#808080"]....####[/color][color="#FFFFFF"]#.......#[/color][color="#808080"]######..........######......# 
                 #..........#####[/color][color="#FFFFFF"]#.[/color][color="#808080"]......####[/color][color="#FFFFFF"]#.........[/color][color="#808080"]...............######......# 
                 #..........######.......##[/color][color="#C08040"]1[/color][color="#808080"]#[/color][color="#FFFFFF"]#..........[/color][color="#808080"]..............######......# 
                 #...........................[/color][color="#FFFFFF"]............[/color][color="#808080"].........................# 
                 #...........................[/color][color="#FFFFFF"].............[/color][color="#808080"]........................# 
                 ############################[/color][color="#FFFFFF"]#############[/color][color="#808080"]######################### 
                                                                             [/color][color="#FFFFFF"]Town   
    [/color][/bc][/tt]

    There are now two versions of the code: One for Angband 3.0.8:


    And one derived from Sangband:
    (being updated - not available)

    If your variant uses bigtile (you poor deluded fool), work off of the Angband version. Otherwise, use the Sangband version. If you develop another version that other maintainers might be interested in, let me have it and I'll post it here.


    Documentation

    Screenshots:
    There are three different ways to take screenshots from within the game.

    Pure ASCII screenshots (monochrome):
    Type ')' and choose text. Suitable for newsgroup and other pure-text
    environments.

    Forum screenshots (color):
    Type ')' and choose forum. Suitable for posts to the Angband Forum.

    HTML screenshots (color):
    Type ')' and choose html. Suitable for websites and browsing.
    Last edited by Leon Marrick; April 30, 2007, 14:01.
    S(all) W/D H+ D c+ f? PV++ s? d- P++ M+
    C S !I !So SQ RQ V+ F:<<buffer overrun>>
    http://angband.oook.cz/code

    Comment

    • pav
      Administrator
      • Apr 2007
      • 793

      #3
      Originally posted by Leon Marrick
      1. I'd prefer not to have to use the "CODE" tag, but haven't figured out how to make spaces appear properly just using "TT".
      I'll check if I can add code tag without the viewport thingie.
      Originally posted by Leon Marrick
      2. The screendumps are fairly large files, especially if the user has a large main Term or shows a picture with lots of color changes. The above example is more than 6K, uncomfortably close to the 10K per-post limit.
      I have bumped up the limit to 25,000 characters.
      See the elves and everything! http://angband.oook.cz

      Comment

      • pav
        Administrator
        • Apr 2007
        • 793

        #4
        Originally posted by pav
        I'll check if I can add code tag without the viewport thingie.
        Okay, I have beated CODE tag to behave (all with just clever reconfiguration in admin interface). Bad news is that vBulletin hardcodes 16px line height when computing the height of the code block. Hope that's tolerable.
        See the elves and everything! http://angband.oook.cz

        Comment

        • Kiyoshi Aman
          Scout
          • Apr 2007
          • 27

          #5
          This sort of thing also slows down scrolling on crappier machines [like my 1.66GHz Sempron 2400+...]

          Could you perhaps use GD or ImageMagick or something to convert to PNG?
          "The Earth...is for the living. The dead have neither rights nor powers on it." -- Thomas Jefferson
          "Aim above morality. Be not simply good, be good for something." -- Mark Twain

          Comment

          • Leon Marrick
            Sangband maintainer
            • Apr 2007
            • 31

            #6
            Originally posted by pav
            Okay, I have beated CODE tag to behave (all with just clever reconfiguration in admin interface). Bad news is that vBulletin hardcodes 16px line height when computing the height of the code block. Hope that's tolerable.
            It looks a whole lot better than I thought we were going to get at the start. Thanks for working with me!


            Originally posted by Kiyoshi Aman
            This sort of thing also slows down scrolling on crappier machines [like my 1.66GHz Sempron 2400+...]

            Could you perhaps use GD or ImageMagick or something to convert to PNG?
            Are you using a dial-up connection? If you are, I can easily imagine screenshots taking a moment or two to load.

            Graphics are larger. My tests indicate that the smaller of .gif or .png (sometimes one is better, sometimes the other) ranges between 25% and 200% larger than vB screenshots, depending on how graphics-intensive your screen is.

            Another advantage to vB screenshots is that the Forum hosts them for you. People who want to display graphics need to have a provider. Many free providers try to turn your images into .jpgs, which are lousy for typical *band screens.

            The disadvantage of vB screenshots is that they show nothing but text. For showing exactly what you see, graphics are the only way to fly.
            S(all) W/D H+ D c+ f? PV++ s? d- P++ M+
            C S !I !So SQ RQ V+ F:<<buffer overrun>>
            http://angband.oook.cz/code

            Comment

            • Pete Mack
              Prophet
              • Apr 2007
              • 6883

              #7
              Originally posted by Leon Marrick
              Example for Angband

              There are now two versions of the code: One for Angband 3.0.8:
              Note that V no longer uses get_default_tile. I stole the hack from UnAngband that clears all preferences before doing the dump and restores them after, and uses get_tile instead.


              If your variant uses bigtile (you poor deluded fool), work off of the Angband version. Otherwise, use the Sangband version. If you develop another version that other maintainers might be interested in, let me have it and I'll post it here.
              Yeah, yeah, 3x2 tiles are on the schedule for V, just not in 3.0.8. There's a lot of work to do it properly.

              Comment

              • Leon Marrick
                Sangband maintainer
                • Apr 2007
                • 31

                #8
                Originally posted by Pete Mack
                Yeah, yeah, 3x2 tiles are on the schedule for V, just not in 3.0.8. There's a lot of work to do it properly.
                S(all) W/D H+ D c+ f? PV++ s? d- P++ M+
                C S !I !So SQ RQ V+ F:<<buffer overrun>>
                http://angband.oook.cz/code

                Comment

                • Pete Mack
                  Prophet
                  • Apr 2007
                  • 6883

                  #9
                  Further note: the current V implementation uses white as the default foreground color by default, which allows for a lot fewer <font="0xffffff"></font> pairs, and probably cuts the file size by 20&#37;.

                  I'm integrating the changes now.

                  Comment

                  • Pete Mack
                    Prophet
                    • Apr 2007
                    • 6883

                    #10
                    Another test embedded html

                    Test of V angband
                    OK, this is now in V. There are 3 differences with Leon's version
                    • get_default_tile removed; now works by resetting the preferences and using Term_what() (UnAngband)
                    • No COLOR= emitted for change to white.
                    • No COLOR= emitted for color "change" for unknown grid (' '); color change is deferred to next visible character. This makes a big (20%) difference, at least in V.


                    Code:
                    [TT][BC=black][COLOR=white]
                                                                                                                          
                    [color="#00FFFF"]Dwarf        [/color]#                                                                                        
                    [color="#00FFFF"]Paladin      [/color]#                                               #################                        
                    [color="#00FFFF"]Knight       [/color]#                                               #               #                        
                    LEVEL     [color="#00FF00"]29 [/color]#          #####%###############                #               #                        
                    NXT    [color="#00FF00"]13396 [/color]#          #                   #                #               #                        
                    AU      [color="#00FF00"]4446 [/color]#          #         s         #                #       [color="#00FFFF"]TT      [/color]#                        
                    [color="#C0C0C0"]|[/color][color="#C08040"]}[/color][color="#00FF00"]=[/color][color="#C00000"]=[/color]"[color="#FFFF00"]~[/color][color="#808080"][[/color][color="#008040"]( [/color][color="#804000"]][/color][color="#C08040"]]] [/color]#          #                   #                #      [color="#00FFFF"]TTT      [/color]#                        
                    STR:  [color="#00FF00"]18/100 [/color]%          #     [color="#00FFFF"]"             [/color]#                #-     [color="#00FFFF"]TTT      [/color]#                        
                    INT:       [color="#00FF00"]7 [/color]#          #                   #                #######[color="#00FFFF"]T[/color]#########                        
                    WIS:   [color="#00FF00"]18/61 [/color]%          ###%##%#### #########                      # #                                
                    DEX:      [color="#00FF00"]14 [/color]%                   #  #                              # #                                
                    CON:   [color="#00FF00"]18/82 [/color]%                   # ##                              # #                                
                    CHR:      [color="#00FF00"]10 [/color][color="#FF8000"]*                 [/color]%## #                               # #                                
                                 #                 %   #             ################# #[color="#C00000"]d[/color]#                                
                    Cur AC    [color="#00FF00"]22 [/color]####%#%#%%#       # ###             #     [color="#808080"],         [/color]# # #                     ########## 
                    HP  [color="#00FF00"]416[/color]/ [color="#00FF00"]416           [/color]#       % #               #               ### #                     #[color="#808080"]......... 
                    [/color]SP   [color="#FFFF00"]38[/color]/  [color="#00FF00"]66           [/color]#       # #               #               #   #######################......... 
                                           %       # #         #######               #...............@....[color="#C08040"]'[/color].[color="#C08040"]'[/color]............ 
                                       s   #       % #         #                     #[color="#C08040"]+[/color]####################[color="#C08040"]'[/color]####......... 
                                           %       % #         # # ########## ######## #                  #[color="#808080"].[/color]#  #[color="#808080"]......... 
                                 %[/color]## ####%%#       # #         # ###        # #      # #                  #[color="#808080"].[/color]############# 
                                   # #             % #         # #          # #      # #                  #[color="#808080"].    [/color]#         
                                   # [color="#808080"]%             [/color]% #         # #         ## #      # #                  ##### #         
                                   # [color="#808080"]%       [/color]##%%#%% #         # #         #  #      # #                      # #         
                                   [color="#808080"]% [/color]#       #       #         # #         # ######### ###########            # #         
                                   [color="#808080"]% [/color]#       # ##%####     ### # #    ###### #                   #            # #         
                                   # #       # #           # # # #    # [color="#C08040"]' +                      [/color]#            # #         
                                 ###[color="#C08040"]+[/color]######### %#%%%######## ###[color="#C08040"]+[/color]########[color="#C08040"]+[/color]####                   #            # #         
                                   [color="#C08040"]+ '                           + [/color][color="#FFFF00"]"    [/color][color="#C08040"]+ +  '  [/color][color="#008040"]d                [/color]#            # #         
                                 #############   ##########  ## #########[color="#C08040"]+[/color]####                   #            # #         
                                             ###[color="#C08040"]+[/color]#        #   # #       #:#  #                   #            # #         
                                               # #        ### # #       # ####                   #            # ###       
                                               #[color="#804000"]'[/color][color="#808080"]%          [/color]#   #    ####   ######################            #   ####### 
                                               # [color="#808080"]%          [/color]### #    #        #                               ###         
                                               #[color="#C08040"]+[/color]#            # #    ######## ##                                ######### 
                                               # #            # #        #     #                                        # 
                                               [color="#808080"]% [/color]#            # #        #     #                                        # 
                                                                                    Study 1800 ft                         
                    [/COLOR][/BC][/TT]

                    Comment

                    • pav
                      Administrator
                      • Apr 2007
                      • 793

                      #11
                      You may still want to set white foreground - it can get embedded into the page that redefines font color to something else, like light blue here on forums...
                      See the elves and everything! http://angband.oook.cz

                      Comment

                      • Leon Marrick
                        Sangband maintainer
                        • Apr 2007
                        • 31

                        #12
                        Originally posted by pav
                        You may still want to set white foreground - it can get embedded into the page that redefines font color to something else, like light blue here on forums...
                        Happily, this is an easy fix (also fixed the html version). Code updated.



                        Originally posted by Pete Mack
                        Test of V angband
                        OK, this is now in V. There are 3 differences with Leon's version
                        • get_default_tile removed; now works by resetting the preferences and using Term_what() (UnAngband)
                        • No COLOR= emitted for change to white.
                        • No COLOR= emitted for color "change" for unknown grid (' '); color change is deferred to next visible character. This makes a big (20%) difference, at least in V.
                        1. Excellent!
                        2. Yes, I shouldn't have changed that. It's back.
                        3. The code above does this and, yes, I discovered that it does give a slight reduction in file size versus the code previously in V. The line I changed was:
                        Code:
                        			/* Color change */
                        			if (oa != a)
                        to
                        Code:
                        			/* Color change -- only for non-space */
                        			if ((a != oa) && (c != ' '))
                        S(all) W/D H+ D c+ f? PV++ s? d- P++ M+
                        C S !I !So SQ RQ V+ F:<<buffer overrun>>
                        http://angband.oook.cz/code

                        Comment

                        • Pete Mack
                          Prophet
                          • Apr 2007
                          • 6883

                          #13
                          pav -- it's no worry, the entire block is also nested in [COLOR=white]
                          See the diff.

                          Leon; sorry about that; I didn't actually use your code, so I missed the fact you made that change too. I was just looking at the actual output and saw weird color-change stuff embedded in the middle of a sea of blank-space. I also used
                          Code:
                          const char *new_color_fmt = (mode == 0) ? 
                           		                           "<font color=\"#%02X%02X%02X\">" 
                           		                           : "[color=\"#%02X%02X%02X\"]"; 
                          const char *change_color_fmt = (mode == 0) ? 
                          	                                 "<\/font><font color=\"#%02X%02X%02X\">" 
                           		                            : "[\/color][color=\"#%02X%02X%02X\"]"; 
                          const char *close_color_fmt = mode ==  0 ? "<\/font>" : "[\/color]";
                          to tighten things up a little. (Extra backslashes put in to disable vBulletin)
                          Last edited by Pete Mack; April 30, 2007, 15:49.

                          Comment

                          • Kiyoshi Aman
                            Scout
                            • Apr 2007
                            • 27

                            #14
                            Originally posted by Leon Marrick
                            Are you using a dial-up connection? If you are, I can easily imagine screenshots taking a moment or two to load.
                            Nope. I'm complaining because of the scrolling being slow, not the page loading, which is just fine. Please take the time to read my posts through before replying blindly to them.

                            And my suggestion was for us to do the conversion from text to an image, rather than third parties [and image hosts which auto-convert to JPEG just aren't worth keeping around]. Which, believe it or not, is quite possibly assuming the PHP on angband.oook.cz has GD or ImageMagick support.

                            Re screen dumps: I think you could do a little CSS-style separation of colour from the dungeon, at least for dungeon glyphs. That may cut down on the file size still further.
                            "The Earth...is for the living. The dead have neither rights nor powers on it." -- Thomas Jefferson
                            "Aim above morality. Be not simply good, be good for something." -- Mark Twain

                            Comment

                            Working...
                            😀
                            😂
                            🥰
                            😘
                            🤢
                            😎
                            😞
                            😡
                            👍
                            👎