Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Text-Mode Demo Como 8

  1. #1

    Text-Mode Demo Como 8

    TMDC 8 Invitation has been released on http://www.taat.fi/tmdc.

    TMDC is a pseudo-annual demo-making contest held over the internet. TMDC8 is yet again organized by tAAt ry, registered non-commercial organization in Finland, which aims to promote demo-making culture.

    Text mode demos offer unique challenges for the demo maker which play a very insignificant role in other kinds of demo competitions. First of all, resolution and color spaces are rather limited, forcing the demo authors to consider different forms of anti-aliasing and careful adjustment of contrast and color balance.

    Additionally the demo authors will not have any hardware-assisted rendering, forcing them to create their own rasterization methods, while giving them a huge amount of CPU power per pixel. Things like per-pixel real-time raytracing are a realistic choice in text mode demos.
    I've heard that there are many experienced developers on PGD. Well, now is the chance to show that this wasn't just a bunch of empty words! No fancy artwork from your favorite artist will be of any help here; no third-party library like SDL or DelphiX will be able to assist you; it's all about [size=18px]your skill[/size]. Take Delphi or Free Pascal and show the evil C/C++ empire what a [size=18px]Pascal Programmer[/size] can do!

    [size=9px]Disclaimer: The meaning of this message should not be taken literally... [/size]

  2. #2
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Text-Mode Demo Como 8

    Having never done a Text demo before I dont really know where to start. How about giving us some guidelines on getting a basic Delphi template set up to do a text demo.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  3. #3

    Text-Mode Demo Como 8

    Relating to just Windows textmode:
    [pascal] ScreenBuffer: HWND;
    Console: HWND;
    Src, Dimentions: COORD;
    outrect: SMALL_RECT;
    Output: array of CHAR_INFO;
    //create
    Src.X:= 0;
    Src.Y:= 0;
    Dimentions.X:= Width;
    Dimentions.Y:= Height;
    outrect.Left:= Src.X;
    outrect.Top:= Src.Y;
    outrect.Right:= Dimentions.X-1;
    outrect.Bottom:= Dimentions.Y-1;
    SetLength(Output, Height*Width);
    AllocConsole;
    ScreenBuffer:= CreateConsoleScreenBuffer(GENERIC_WRITE, 0, nil, CONSOLE_TEXTMODE_BUFFER, nil);
    SetConsoleActiveScreenBuffer(ScreenBuffer);
    SetConsoleScreenBufferSize(ScreenBuffer, Dimentions);
    SetConsoleMode(ScreenBuffer, 0);
    SetConsoleTitle(PChar(title));
    Console:= GetConsoleWindow();
    ShowWindow(Console, SW_MAXIMIZE);
    //destroy
    CloseHandle(ScreenBuffer);
    //present
    WriteConsoleOutput(ScreenBuffer, Output, Dimentions, src, outrect);[/pascal]
    You?¢_Tre probably better off jumpstarting with something like Lifepowers textmode component.

  4. #4

    Text-Mode Demo Como 8

    First of all, I think it won't be enough to write a paper on ASCII art to describe a *good* method of representation. Indeed, the greatest challange I found so far making TMDC entries is how to represent 24-bit RGB image in Text Mode using ASCII characters. Drawing RGB image in ASCII can get as simple as 20 mins of work (and it will look awful!) or you can do what we did for TMDC 7 - extensive mapping, 4x antialias, error diffusion, sharp filtering (and still it may look awful! ) What I have learned so far is that you should find the best average - use good rasterizer and a combination of nice & clean colors to make the image look good.

    However, the theory is pretty simple. In text mode you have 15 background and 15 foreground colors (before in MS-DOS days there were actually 8 background colors and another set of the same background colors blinking). If you take a character like #177 (), you can see that it's 50% foreground and 50% background. You can use this property to get more than just 16 colors in text mode. For instance, take white background (r:255, g:255, b:255) and draw blue (r:0, g:0, b:255) character #177 on it. You'll get a result of an average of both colors: (r:127, g: 127, b: 255), which is a new bright blue color. Now, take another character #176 (). It's mostly background with few foreground pixels (16 out of 64). You can use this character to mix a set of two colors, which with our previously used colors would give (r: 191, g: 191, b: 255) very bright blue color. By using characters #176, #177 and #32 (which is pure background) and by mixing the entire palette, you can get few hundred colors to work with (note: character #178 is an "inverse" of character #176 and character #219 is inverse of character #32 and thus are redundant). In fact, this is the palette you get (278 colors in total):


    Now, some of you could remember old MS-DOS days where you have to convert an RGB image to 256-color palette and this is exactly the case! You have to "approximate" a true 24-bit RGB color to one of the existing ones. In order to do this in real-time, some lookup table will be needed.

    Finally, you have a limitation of 80x50 resolution which is another challange. However, this can be worked out easily by rendering everything in 160x100 and then simply reduce it to 80x50 by using average of each 4 pixels.

    In few weeks I will release some package to rasterize in Text Mode but I really ask you people to try to do this yourself and perhaps we can come up with the best solution here on PGD

    Also, you can use my TWinConsole component which helps you configure and output text in Text-Mode.
    Download it at: http://www.afterwarp.com/downloads/winconsoles.pas.

    You can access the screen buffer directly by using TWinConsole.ScreenBuffer pointer and then display it using TWinConsole.Flush(). Each cell on the screen is represented as TCharInfo (Windows.pas?) Settings colors is a bit tricky, but you can use TWinConsole.Color2Attrib() function which receives a pair of Delphi standard colors (clWhite, clBlue, clNavy, etc...) and returns the attribute you can set in TCharInfo.

    Here is an image of all letters in 8x8 font used with 80x50 mode (437 codepage used in TMDC):


    Hope you find this large post useful...

  5. #5
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Text-Mode Demo Como 8

    Thanks Guys - I will see if I can think of something to do.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  6. #6

    Text-Mode Demo Como 8

    Great stuff Lifepower, news item posted.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  7. #7

    Text-Mode Demo Como 8

    Hi,

    That looks interesting, (didn't know it existed) and i might give it a try.
    Atleast i'll go see what i'm able to do with drawing text quickly and colours and textmodes and things.

    regards

  8. #8

    Text-Mode Demo Como 8

    After messing around with this for a couple of hours, I decided to go "old fashioned" way, using 1-year old rasterizer package

    I've uploaded the entire package which can get you working in Text-Mode in just few minutes. It uses Software Mode (asm with MMX) from old Asphyre 1.5.2. This is pretty advanced stuff (remember - it won 3rd place ), I hope someone can make a good use of it...

    Here are two screenshots, showing popular Lena image:

    (The first one uses characters #176, #177 and #219, the second one uses entire 255-character palette).

    Download the package:
    tmdc-dev.rar (1.21 Mb).

    You will have to install Asphyre 1.5.2 from \Source folder (aww, I almost feel nostalgic :cry, add path to Library too.
    Then, just open Hello2Ascii project and hit compile.

    Don't forget that there's a source code for our Armageddon TMDC entry:
    armageddon.zip (EXE, 1.51 Mb)
    armageddon-src.zip (Source, 99 Kb)
    I know, it's a crappy entry, but it was our first time


    By the way, if someone is entering this context, let us know to put you in our greetings

  9. #9

    Text-Mode Demo Como 8

    Perhaps nobody cares, but here's some funny ascii conversion table I've managed to create. It includes some weird characters, musical notes and happy faces :lol:



    [size=9px]P.S. Sorry for big image - if I make it smaller, individual characters get blurred...[/size]

  10. #10
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    Text-Mode Demo Como 8

    Thanks for these. I am interested - but am working on another contest entry at the moment (for a local South african contest).

    If I'm finished In time I might try something small for the Text Mode contest (Basically finding a way to just print various images to the screen - possibly with some sort of transition effect).
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •