# 3H-GDC m.V: Something Special (winner: BeanDog)

## Recommended Posts

capn_midnight    1707

# 3H-GDC m.V

Winners:
1. BeanDog
2. d000hg
3. DrPetter
Summary: For the fifth competition I want to do something special. Some of my fondest programming memories began years ago with a copy of an old Borland C compiler (4.52, to be precise, with worse C++ support than VC6) that had a wonderfully featureful CONIO library. You can actually see one of my efforts from those days in my Showcase -- the ASCII Fish Tank. So, this time you will all be competing on a level playing field in terms of graphical quality. ASCII art is not the Theme of this competition, that is still to be determined, but submissions must fit this style. Hopefully with the focus taken completely off graphics, some deeper gameplay can be developed. Date/Time: The contest will be held on Saturday, February 11th, 5PM Eastern Standard Time (2200 GMT). Prizes:
1. a Pi T-shirt or a Perl T-shirt. (courtesy of the right-honorable Frunicus Maximus)
2. 3 months of GDNet+ (via the pockets of capn_midnight)
Sumbission: Previous Submissions can be found on the contest website. Theme: The Stars The past four contests were "Black and White," "Fire," "Crackers", and "CARTS". The emphasis is originality in interpretation. With the Crackers theme there were entries that featured fire crackers, saltines, people "cracking" windows open to prevent leathal doses of methane gas, and southern honkeys. ADDITIONALLY: this particular contest will be an ASCII "graphics" competition. There are plenty of ASCII art libraries available, though I highly suggest the .NET 2.0 Console Class. It has everything you will need, and even has a Beep method! W00t! If you decide to use a graphics API and copy the style of a console application, your program must be as near of an emulation to a real console application as possible. In general, this usually means a minimum of using a monospaced type-font, 16 foreground colors and 8 background colors, and 80 columns by 25 rows, though there are many console applications that are capable of higher performance. Rules:
1. Submissions must meet a predetermined theme (which will be revealed 15 minutes before the beginning of the contest)
2. Any Language (C, Java, C#, Python, javascript, Brainf***, I don't care) or API (SDL, Allegro, PyGame, JOGL, etc) are acceptable, as long as you handle all distribution yourself (Ideally include all assemblies. You *may* link to a direct download, but a download page is UNNACEPTABLE. One click should be all I need to download the components I need). Do not assume the Judges have any particular machine setup. Judges will inform users of their machine setups.
3. So called "Game Makers" are NOT acceptable. The process must require you to write a significant portion of code to produce a stand alone executable. If you are not certain if your particular system constitutes a "Game Maker," then ask in the thread. Judges reserve the right to disqualify entries that they deem were made with an unnaceptable "Game Maker" based on their own subjective definition of the term.
4. You may use any base code that you have written. You may post this code in a source tag in the forum on Friday night before the competition to keep the playing field even (anyone may use it if they want), if you so choose.
5. Judges will judge on a full binary version of the software. They will not compile the software. Source code is not required, though you may request source code to be posted with your submission.
6. Judging will be conducted by a panel of non-competitors
7. Judging will be based mostly on overall gameplay and originallity of game design. Graphics will be a minor part, but mainly in the fluidity of the graphics (stuttering, tearing, flickering graphics will be very bad)*. We understand that content will be light, that graphics will be underdeveloped, that input MIGHT be a bit akward. Gameplay is the key.
8. prizes (when available) are listed above
10. we will attempt to pursue full legal action against nefarious ne'er-do-wells (those that would upload destructive code).
Three hours is plenty of time to make a classic arcade game, or something new with simple gameplay. Check out the previous contest to see what was done. Gameplay is what this contest is about. If anyone wants to volunteer as a Judge, please post here and list your machine specs as well as your pertinent software running on your computer. For example, I'm: Processor: Pentium4 2.4GHz Memory: 768MB RDRAM GFX: Radeon 9800 Sound: SB Audigy 2 OS: Windows XP Pro SP2 Other Software: Java 5, .Net 1.1, .Net 2.0, DX9c (October 05), MDX 9 (August 05) *this time, everyone's graphics will be practically the same. [Edited by - capn_midnight on February 15, 2006 7:40:51 AM]

##### Share on other sites
Daerax    1207
Quote:
 Original post by capn_midnight*this time, everyone's graphics will be practically the same.

Not if Ben Ryves chooses to enter.

He summons functionality (from another plane?) that simply should not be possible into devices that one would normally not think capable of subtraction or addition. Like 3D raytracers. On watches. Analogue Wrist Watches. Hehe.

##### Share on other sites
Rixter    785
Are you saying the graphics have to be ascii? Or they have to be asciiish in spirit? Or have you decided?

##### Share on other sites
capn_midnight    1707
Quote:
Original post by Daerax
Quote:
 Original post by capn_midnight*this time, everyone's graphics will be practically the same.

Not if Ben Ryves chooses to enter.

He summons functionality (from another plane?) that simply should not be possible into devices that one would normally not think capable of subtraction or addition. Like 3D raytracers. On watches. Analogue Wrist Watches. Hehe.

I should note that I expect ASCII *art* graphics, not regular graphics rendered in shaded ASCII characters.
Quote:
 Original post by RixterAre you saying the graphics have to be ascii? Or they have to be asciiish in spirit? Or have you decided?

No, they need to look exactly like a console window using a monospaced type-font, 16 foreground colors and 8 background colors. I say "look like" because traditionally I don't care *how* you do things, just as long as the desired *outcome* is correct. This compares to there being no language restriction, as long as I don't have to do anything extra to run the game (i.e., you must be able to distribute the game in such a form that I double-click one file and I'm ready to play the game). So, if you render this as OpenGL quads with textures from a bitmap font, as long as I can't easily distinguish it from any old console window, I don't care.

However, I like the idea of "in the spirit" of ASCII art, and might consider this for the future. It would be interesting to see a 3D game that is ASCII stylized. The game Darwinia is similar in concept, except it's stylized after 70's era video games.

##### Share on other sites
benryves    1999
Quote:
Original post by Daerax
Quote:
 Original post by capn_midnight*this time, everyone's graphics will be practically the same.

Not if Ben Ryves chooses to enter.

He summons functionality (from another plane?) that simply should not be possible into devices that one would normally not think capable of subtraction or addition. Like 3D raytracers. On watches. Analogue Wrist Watches. Hehe.
Heh, I think you're safe (I can't enter, not to mention that it's ASCII art).

##### Share on other sites
capn_midnight    1707
Quote:
Original post by benryves
Quote:
Original post by Daerax
Quote:
 Original post by capn_midnight*this time, everyone's graphics will be practically the same.

Not if Ben Ryves chooses to enter.

He summons functionality (from another plane?) that simply should not be possible into devices that one would normally not think capable of subtraction or addition. Like 3D raytracers. On watches. Analogue Wrist Watches. Hehe.
Heh, I think you're safe (I can't enter, not to mention that it's ASCII art).

yeah, it's a little late for the Atlantic zone people. I'm trying to make it available for the Pacific coast peoples that were not able to compete last time.

##### Share on other sites
Michalson    1657
I'm just probing further on the ASCII/console requirements...

It seems we are using standard VGA "mode 0x03" text mode, which was an 80x25 textmode with 16 foreground colors and 8 background. On a standard VGA card it was possible to:

Display 256 different characters - for example when you actually set it on the screen rather then passed it through a library that interpretted control characters, the return carrage (13) was a musical note (more famously character 1 and 2 are smiley faces).

Display characters using 16 foreground colors, 8 background colors, and a blink attribute (making up a 1 byte attribute for each 1 byte character).

Switch into a 80x50 character submode, in which a half height (8x8 instead of 8x16) character set was used.

Getting advanced, it was actually possible to change the bitmaps used for each character by uploading the data (for example 80x25 used 8x16 characters [16 bytes per character], while 80x50 used 8x8) into video memory.

Getting even more obscure, some people may know that it's possible to manipulate the palette - what they might not know if that through VGA voodoo it's possible to canibalize the blink bit, either to allow for up to 16 background colors (unlock the "bright" colors as background colors), OR to unlock a 512 character mode (to make this display anything but garbage you need to upload and manage a second character font into video memory).

Finally, the most insane modification, and one that stretches the concept of text mode, is that the VGA timing registers can be messed with to actually change the drawing offsets on a per pixel line basis. Using a Cos/Sin function, you can actually create an animated "wave" effect.

Now obviously not all of this is practical on a modern machine - I don't think modern monitors would even tolerate the wave effect, and you'd need to be in true 0x03 mode (fullscreen with direct hardware access) to do a lot of the other modifications.

The question is, assuming we where to recreate properly functional hardware text mode in a manner compatible with modern operating systems (say emulate it with DirectDraw), how far could we go?

##### Share on other sites
ApochPiQ    23063
I won't be able to do this one, but if anyone wants some C++ base code, help yourselves to the CartRunner source from 3H-GDC m.IV.

##### Share on other sites
capn_midnight    1707
Quote:
 Original post by MichalsonThe question is, assuming we where to recreate properly functional hardware text mode in a manner compatible with modern operating systems (say emulate it with DirectDraw), how far could we go?

I think maybe that's going a little too far out of scope (the wavy stuff). Sure it would be impressive... *IF* you were actually doing it in the real way. If you implement it in DX just to get that wavy effect, I don't think it's as impressive. I think by now we understand the spirit of this contest.

On extended character sets: I know that character sets differ depending on what system you're using, for example I just did this example in .NET 2.0
using System;namespace A{	class B	{		public static void Main(string[] args)		{			for(int b = 0; b < 8; ++b)			{				Console.BackgroundColor = (ConsoleColor)b;				for(int f = 0; f < 16; ++f)				{					char c =(char)(b*16 + f);					Console.ForegroundColor = (ConsoleColor)f;					Console.Write(c);				}				Console.WriteLine("");			}		}	}}

and it created this output:

The first row is mostly composed of control characters, including the newline and beep, so they don't print too well.

Now, with other libraries I've used, all those question marks WERE shade characters and icons that you could use to draw primitive borders. The ASCII part of the character set is actually only the first 128 characters, everything after that is extra. I'll insist that the first 128 characters be the actual ASCII set, and the last 128 be a "real" extended set, whatever that may be.

As for the screen buffer size, any "standard" combination of columns and rows are acceptable, most libraries I've seen allow the selection of an aribitrary number of columns and rows, so this is acceptable.

[Edited by - capn_midnight on February 1, 2006 3:09:27 PM]

##### Share on other sites
benryves    1999
If we're chucking resources into the mix, this might be a handy starter's reference for people using C/C++ and plain Win32.

##### Share on other sites
capn_midnight    1707
If you have .NET 2.0 installed, the path "X:\WINDOWS\Microsoft.NET\Framework\v2.0.xxx" (replace X's appropriately) contains compilers for C#, VB, and JScript.

##### Share on other sites
nagromo    676
This looks great!

Does anyone know if it's easy to use the mouse with the console in .Net like it is in Win32?

##### Share on other sites
capn_midnight    1707
Quote:
 Original post by nagromoThis looks great!Does anyone know if it's easy to use the mouse with the console in .Net like it is in Win32?

if something isn't readily available you could p-invoke the original win32 function.

##### Share on other sites
Extrarius    1412
Quote:
 Original post by capn_midnight[...]8 background colors.[...]
So we can't make full use of the windows console subsystem, which eliminated the 'blink' attribute in favor of 4-bit(16 colors) background color?
What is the minimum OS that must be supported? XP added a few quite-useful console functions.

##### Share on other sites
capn_midnight    1707
Quote:
Original post by Extrarius
Quote:
 Original post by capn_midnight[...]8 background colors.[...]
So we can't make full use of the windows console subsystem, which eliminated the 'blink' attribute in favor of 4-bit(16 colors) background color?
What is the minimum OS that must be supported? XP added a few quite-useful console functions.

I was not aware that 16 bg colors were enabled. I've updated my .NET example.

the minimum OS that must be supported is the minimum OS of the judges. So, if everyone is using XP, then it'll be okay. I mainly mentioned those parameters for people that would try to emulate a console system in a graphical application. If you are using a console system, then whatever is available to it is free. I'll edit the rules to make it clearer.

unfortunately, if Sander comes along, he'll muck everything up with his luuunix :)

##### Share on other sites
alnite    3438
If I can find my old copy of Turbo C++ 3.0, I'd be programming in real console. Is that acceptable?

##### Share on other sites
capn_midnight    1707
yeah, that's fine.

##### Share on other sites
matt_j    106
So, there's no theme announcement, it just has to be a text-graphics game? So, it's okay if we have all this time to plan?

##### Share on other sites
capn_midnight    1707
Quote:
 Original post by matt_jSo, there's no theme announcement, it just has to be a text-graphics game? So, it's okay if we have all this time to plan?

no, there will still be a theme.

##### Share on other sites
Orbviper    263
Quote:
 Original post by matt_jSo, there's no theme announcement, it just has to be a text-graphics game? So, it's okay if we have all this time to plan?

My understanding is that there will still be a theme, but the game just has to be in ascii grahpics. The N/A after the Theme: part in the OP is just because the theme hasn't been announced yet.

Edit: beaten by capn_midnight

##### Share on other sites
d000hg    1199
Interesting idea. I like that I can still use D3D and quads - makes it easier to just draw 'character C at (X,Y)'. I shall definitely go this way I think. If I were to go full-screen, would that be OK - of course DOS was full-screen?!

Would you mind specifying what limits on foreground/background colours and special abilities like blinking and beeping are acceptable? And maybe the maximum 'resolution' in rows and columns - it makes sense to use the most we can get away with!

A console app could use proper sound and music normally - are these OK for this contest or just a BEEP?

Is mouse/joystick support allowed - you'd expect not to see it in a classic console app I guess?

Thankyou.

##### Share on other sites
capn_midnight    1707
Quote:
 Original post by d000hgInteresting idea. I like that I can still use D3D and quads - makes it easier to just draw 'character C at (X,Y)'. I shall definitely go this way I think. If I were to go full-screen, would that be OK - of course DOS was full-screen?!

Fullscreen mode is fine, but remember that it does not affect the actual character resolution
Quote:
 Would you mind specifying what limits on foreground/background colours and special abilities like blinking and beeping are acceptable? And maybe the maximum 'resolution' in rows and columns - it makes sense to use the most we can get away with!

As a bare minimum I'd like to see a monospaced font (usually fixedsys or Lucida Console), and a window that is a fixed 80 columns by 25 rows. Color isn't strictly necessary for the format, but I will assume everyone will WANT color. As a minimum it will be 16 foreground colors and 8 background colors. You can also include a blink attribute. If you choose not to include blink, you can choose to go up to 16 background colors as well.
Quote:
 A console app could use proper sound and music normally - are these OK for this contest or just a BEEP?

yeah, sound of any type is fine.

I just found the System.Media.SoundPlayer class in .NET 2.0, if anyone else is interested in it. It looks to be identical in functionallity to the Win32 PlaySound function, so there is no need PINVOKE that anymore.

The Microsoft.DirectX.AudioVideoPlayback.Audio class is also very easy to use, much more featureful than System.Media.SoundPlayer, unfortunately it adds an extra dependency to your project, so you'll have to way those pros and cons.
Quote:
 Is mouse/joystick support allowed - you'd expect not to see it in a classic console app I guess?Thankyou.

I'm on the fence about mouse input, but joystick is a definite NO. It's just not standard hardware and I don't feel like tracking mine down.

##### Share on other sites
DrewGreen    370
I can judge if needed.

Couple of links that may or may not be useful/inspirational:

Basic ascii art tutorial

Text Mode Demo Contest site <- Got this from a link on these forums but can't remember where. Might have been ApochPiQ's journal. Check out "InnerFlux" by Crimson Shine from TMDC8 :) Haven't had a chance to look through them all yet though.
(try running it via 'demo.bat block' as well as the standard mode, as per the readme)

Don't forget to check out the TMDC links page for a few bits of useful code, such as TextFX4 & AALib.

##### Share on other sites
d000hg    1199
Thanks for the detailed response.

Quote:
 Original post by capn_midnightAs a bare minimum I'd like to see a monospaced font (usually fixedsys or Lucida Console), and a window that is a fixed 80 columns by 25 rows. Color isn't strictly necessary for the format, but I will assume everyone will WANT color. As a minimum it will be 16 foreground colors and 8 background colors. You can also include a blink attribute. If you choose not to include blink, you can choose to go up to 16 background colors as well.

Can I have total freedom with the palette - ie 16 shades of grey?

##### Share on other sites
capn_midnight    1707
Quote:
Original post by d000hg
Thanks for the detailed response.

Quote:
 Original post by capn_midnightAs a bare minimum I'd like to see a monospaced font (usually fixedsys or Lucida Console), and a window that is a fixed 80 columns by 25 rows. Color isn't strictly necessary for the format, but I will assume everyone will WANT color. As a minimum it will be 16 foreground colors and 8 background colors. You can also include a blink attribute. If you choose not to include blink, you can choose to go up to 16 background colors as well.

Can I have total freedom with the palette - ie 16 shades of grey?

no, I think that's against the spirit of the style.