Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3] 4
  ignore  |  Print  
  40x30 EGA Contest  (Read 19108 times)
0 Members and 1 Guest are viewing this topic.
Offline dishmoth
« Reply #60 - Posted 2010-04-13 20:45:41 »

Try opening a paint program and create a 40x30 pixel image. Start drawing a few pixels and I think you will amazed at how many ideas start flowing.

It's so true!

I can't resist showing off my concept art.  40x30 Knight Lore, anyone?

Simon

Offline jimsmi6

Senior Newbie





« Reply #61 - Posted 2010-04-13 20:55:05 »

Yeah I completely agree with fruitmaze. I don't like the whole open source bit... my engine is proprietary and as a result I'll have to obfuscate the code before putting the applet up. But, I guess I could post some snippets to prove I'm abiding to the EGA rule if it's so important. Worst case scenario, someone could write a tool that processes a screenshot of everyone's game and checks for EGA colors, but that seems a bit extreme Tongue.

Also, regarding sound, I think it's pretty common sense to use sounds that fit the style. And a while back when browsing this forum I stumbled upon this app called "SoundGen" made by someone on this forum (I don't remember who it was, sorry) but here's the link: http://code.google.com/p/rugl/source/browse/SoundGen/
Offline ShannonSmith
« Reply #62 - Posted 2010-04-13 21:04:11 »

Ok, in the interest of avoiding confusion and people worrying about having to open source anything I'll drop the requirement and we'll just rely on the honour system. But I would encourage people to use one of the open frameworks that are sure to emerge as it will be much easier to get all the entries on a single screen ensuring they all play nice.


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline jimsmi6

Senior Newbie





« Reply #63 - Posted 2010-04-13 22:10:14 »

Ok, in the interest of avoiding confusion and people worrying about having to open source anything I'll drop the requirement and we'll just rely on the honour system. But I would encourage people to use one of the open frameworks that are sure to emerge as it will be much easier to get all the entries on a single screen ensuring they all play nice.

Can we have Journal  threads like in the JGO Comp?
Offline ShannonSmith
« Reply #64 - Posted 2010-04-13 22:16:15 »

Of course, we have a sub-forum now and I would strongly encourage it.
Offline bobjob

JGO Knight


Medals: 10
Projects: 4


David Aaron Muhar


« Reply #65 - Posted 2010-04-14 01:08:29 »

In regards to sound. I was looking for ways to program using the PC speaker, and came across a class that mimics the PC speaker with the sound card:
Or rather it generates tones at runtime, so no sound resources are required.
example applet: http://users.on.net/~bobjob/test_tone.html
source: http://users.on.net/~bobjob/tone_source.zip

simple to use you just make static call to the Tone class as follows:
1  
Tone.sound(int tone,int time,double volume);


edit: added a method to queue sound, for music and such:
1  
Tone.soundQueue(int tone,int time,double volume);


My Projects
Games, Webcam chat, Video screencast, PDF tools.

Javagaming.org with chat room
Offline jimsmi6

Senior Newbie





« Reply #66 - Posted 2010-04-14 03:05:23 »

In regards to sound. I was looking for ways to program using the PC speaker, and came across a class that mimics the PC speaker with the sound card:

example applet: http://users.on.net/~bobjob/test_tone.html
source: http://users.on.net/~bobjob/tone_source.zip

simple to use you just make static call to the Tone class as follows:
1  
Tone.sound(int tone,int time,double volume);



I don't know why but my sound on Java is completely broken (I'm using Ubuntu). I really wish I could try that.
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #67 - Posted 2010-04-14 06:51:35 »

A simple rule to prevent cheating could be that if anyone can produce a (reproducible) screenshot of a game that contains more than 16 colors or any non-EGA color, that game gets disqualified. Also, a screenshot containing more than 40x30 or 30x40 pixels would also lead to disqualification.
But reproducible, I mean that you need to provide instructions on how you got that screenshot so other people can verify it.

I'd still want to open source my framework, but this way you don't force everyone else to do it while still keeping it fairly easy to distribute the verification and possibly even allowing automated tools to do it.

Play Minecraft!
Offline CzarSquid

Innocent Bystander





« Reply #68 - Posted 2010-04-14 13:08:19 »

So as long as it fits on a 40x30 screen we are good (with EGA graphics). This might be great for a first time game making experience.

Count me in, I've always wanted to make a tiny Zelda remake.
Offline fruitmaze
« Reply #69 - Posted 2010-04-14 13:33:35 »

So are these the colours that we may use in the game:
http://en.wikipedia.org/wiki/File:6-bit_RGB_uniform_palette_with_black_borders.svg
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #70 - Posted 2010-04-14 14:36:23 »

Yep, and only 16 of those at a time.

Play Minecraft!
Offline Wyrframe

Senior Newbie





« Reply #71 - Posted 2010-04-14 16:22:21 »

I'm definitely interested; as soon as I have a game in mind, I'll get started.

Proposed end date is during July?
Offline ShannonSmith
« Reply #72 - Posted 2010-04-14 16:36:49 »

Quote
Proposed end date is during July?

End of August, putting it exactly 6 months apart from Java4k.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #73 - Posted 2010-04-14 19:02:24 »

Click to Play


wow, how the hell did you pull that off? Smiley
awesome stuff
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #74 - Posted 2010-04-14 20:05:15 »

Paint.net and patience. It's actually playable, but I wrote a framebuffer -> animated gif converter thing that spat out that thing Cheesy

Play Minecraft!
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #75 - Posted 2010-04-15 06:04:26 »

So far I've mocked up top-down, 2D platformer and 3rd person not-quite isometric, which all look possible.  Getting a good look for 1st person 3D has so far eluded me.  The coarse resolution and 16 colours isn't giving enough scope to antialias to get smooth camera movement.  More thought required.

On the framework front, I've created a program to generate a palette based png with an indexed palette containing the 64 EGA colours.  It's quite easy to create a BufferedImage with a bespoke ColorModel to do this.  All drawing on the Buffered Image is forced into the EGA colour set, although this is probably quite a slow operation.

Creating a BufferedImage with a 16 colour indexed palette to mimic the screen is proving more of a problem.  I can't see how to update the colours in the palette once the BufferedImage is created.  It appears I need to create a new BufferedImage, which will be a bit painful on garbage collection.  Also I suspect drawing on the image may be slow due to the need to convert pixels from one ColorModel to another.

As an alternative, maybe I should used ARGB BufferedImages throughout, grab the DataBuffer and write low level routines to manipulate it.  For instance a Validate method to force all colours into the EGA 64 colours.  Or maybe go the whole way and write all the line drawing, image and font routines.  This is more work, but should go reasonably fast.  One idea is to create an EGAImage class based on BufferedImage.  getGraphics() returrns an all new GraphicsEGA class, which may (or may not) extend Graphics.  This will have additional methods to handle palette control.

Maybe go for an EGAImage class based on a 64 colour EGA palette BufferedImage, which returns a GraphicsEGA class, based on Graphics, which overrides SetColor, to enforce selection of a colour within the 16 colours of the current palette.  Then we can use all the existing drawing primitives from Graphics.  There is still a problem with drawImage, as it won't be forced to convert to the 16 colour palette, but will allow the full 64 colour EGA palette.

Maybe a GraphicsEGA class is more trouble than its worth and I should just write a Validate method on EGAImage, which checks that there are no more than 16 colours in the Image and that they all lie in the 64 colour EGA palette.  If they don't, then generate an error.  This means ensuring compliance with the EGA colour scheme needs to be built into the code as a whole, rather than using a class to represent the screen to fix everything.

Overall, I think using indexed palettes will be fast enough given the small screen size.  Managing the 16 colour palette elegantly is currently eluding me.  Any suggestions.  Got to go to work now.

Time flies like a bird. Fruit flies like a banana.
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #76 - Posted 2010-04-15 09:59:54 »

I'm going to use a simple int[] for a virtual screen, and an int[] palette, then assemble a bufferedImage like this:

for (int i=0; i<40*30; i++) bufferedImageRaster=palette[virtualScreenBuffer];

I won't be using Graphics at all, but rather will write my own rendering functions.

Play Minecraft!
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #77 - Posted 2010-04-15 10:15:04 »

I'm with Markus on this one - you'll want fast per-pixel access and manipulation, so storing it in a handy int[] or similar is going to be much easier. In terms of rendering functions most of those provided from Graphics2D are going to be useless anyway due to the resolution (eg. rotation) or colour depth (anti-aliasing).

I suspect that all you'd need in EgaGraphics2D would be drawPixel(), drawLine(), drawCircle() and drawText(), all of which are pretty simple to write, and you'd get the advantage of being able to write EGA palette-aware versions. The resolution is so small that it'll be plenty fast enough doing everything CPU side.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #78 - Posted 2010-04-15 10:58:27 »

I'm going to use a simple int[] for a virtual screen, and an int[] palette
Ah that gives me flashbacks  Smiley It is almost worth entering just for that fact  Cheesy You used a similar technique with left 4k dead? But mouse ctrl seems just wrong on many levels for this compo, but left 4 tiny dead?  Wink

Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #79 - Posted 2010-04-15 13:49:28 »

Haha, great idea Cheesy

Play Minecraft!
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #80 - Posted 2010-04-15 17:34:02 »

@Marcus, Orangy Tang,

I think you're right, custom drawing routines are the way to go.

Time flies like a bird. Fruit flies like a banana.
Offline mike_bike_kite
« Reply #81 - Posted 2010-04-15 19:31:20 »

I join the comp if I may - most of my games look like they're from the 80's any way!

Will there be a parameter passed to the applet to say whether it should get focus and start playing sound? If we all use that then we could have all the apps on a single screen and playing nicely. Are there any devices (ie something like a chumby or a digital watch that could run these games when we're finished or is it worth setting up a large pixelated projection screen and running them on that!

Mike

Arcade swarm
Board Chess - Checkers - Othello
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #82 - Posted 2010-04-15 22:22:41 »

Will there be a parameter passed to the applet to say whether it should get focus and start playing sound?

I think polling Component.isFocusOwner() or setting up a FocusListener with Component.addFocusListener(FocusListener) would do the trick.
We also need to detect loss of focus and stop hogging the CPU and turn off the sound.  I was wondering whether we should free up any temporary data structures as well, in case we are sharing a virtual machine.

Time flies like a bird. Fruit flies like a banana.
Offline mike_bike_kite
« Reply #83 - Posted 2010-04-16 23:14:12 »

Another quick question: does the game have to be playable in 40*30 mode - I just tried my little idea for a game out and felt my eyes just weren't good enough to play at that resolution. For those that are a bit slow on the Java side is there a list of colours that are ok - ie Color.blue etc.

Arcade swarm
Board Chess - Checkers - Othello
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #84 - Posted 2010-04-16 23:31:15 »

Another quick question: does the game have to be playable in 40*30 mode - I just tried my little idea for a game out and felt my eyes just weren't good enough to play at that resolution. For those that are a bit slow on the Java side is there a list of colours that are ok - ie Color.blue etc.

I think x4 or x8 scaling of the basic 40x30 mode will be best.  This is explained in the rules.

These standard java colours are also in the EGA colour palette.

    public final static Color white               = new Color(255, 255, 255);
    public final static Color black    = new Color(0, 0, 0);
    public final static Color red                  = new Color(255, 0, 0);
    public final static Color yellow    = new Color(255, 255, 0);
    public final static Color green    = new Color(0, 255, 0);
    public final static Color magenta   = new Color(255, 0, 255);
    public final static Color cyan    = new Color(0, 255, 255);
    public final static Color blue    = new Color(0, 0, 255);

Of course you can define your own colours too.


Time flies like a bird. Fruit flies like a banana.
Offline Galaxy613

Senior Newbie





« Reply #85 - Posted 2010-04-17 03:08:41 »

Man, if people continue posting engines in the TinyGame Resources thread, and other sources in this thread.... and if I get a crapton of luck.... I might be able to make a game or something! Shocked

I donno, I've always loved restraints, but this is a bit over the top, limited resolution AND limited color... I'm going to try some of those EGA tests in the other thread and see if I can get something working. Don't expect much yet. :S

*Edit* Yay! I got Notch's Ega test running with little problems. I'm inclined to work off of his framework because it's already applet-savvy.

*Edit2* Got a tentative name, "Tiny Star Fighter", or "TSF". Writing a real simple keyboard poller class.

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #86 - Posted 2010-04-19 12:21:17 »

This is way too much fun. Rendering stuff at normal size, then shrinking it back and using dithering is really giving nice results. Thanks Markus for the idea. Now I gotta come up with a game...

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline teletubo
« League of Dukes »

JGO Ninja


Medals: 48
Projects: 4
Exp: 8 years



« Reply #87 - Posted 2010-05-12 01:02:15 »

Seriously, you were using Slick (like a few megabytes of libraries + OpenGL) to fill in 40x30 pixels.

Fontwise you can actually do a readable font in 3x5, it relies a bit on your brains use of shape to recognize words so you probably want to use lower case characters.
Click to Play



I know I'm a little late here, but would you be so kind and post here the true-size version of this fonts ? (I mean not scaled up) ?

thanks

Offline ShannonSmith
« Reply #88 - Posted 2010-05-12 16:47:16 »

I encoded each of the characters in the lower 15 bits (3x5) of an int (starting at ASCII 28 for some reason I forgot):
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
   private static final int[] FONT = new int[]{
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x2000,0x17D9,
      0x2B6A,0x749A,0x772A,0x38A3,0x49ED,0x39CF,0x2ACE,0x12A7,0x7BEF,0x39AA,
      0x0410,0x1410,0x4454,0x0E38,0x1511,0x252A,0x0000,0x5BEA,0x3AEB,0x2A6A,
      0x3B6B,0x72CF,0x12CF,0x2B4E,0x5BED,0x3497,0x5AED,0x7249,0x5B7D,0x5FFD,
      0x2B6A,0x12EB,0x456A,0x5AEB,0x388E,0x2497,0x2B6D,0x256D,0x2FED,0x5AAD,
      0x24AD,0x72A7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x6B50,
      0x3B59,0x6270,0x6B74,0x6750,0x25D6,0x3D50,0x5B59,0x2482,0x1482,0x5749,
      0x2492,0x5BF8,0x5B50,0x2B50,0x1758,0x4D70,0x12C8,0x1450,0x24BA,0x2B68,
      0x2568,0x7F68,0x54A8,0x3D68,0x77B8,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
   };

The least significant bit of each int is the top left pixel of the character, bit 15 is the bottom right pixel.

Here is the code I use for drawing:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
   public void drawString(String s, int x, int y, int color){
      for(int i = 0; i < s.length(); i++){
         int value = FONT[s.charAt(i) - 28];
         for(int j = 0; j < 3*5; j++){
            int px = x + j%3 + i*4;
            int py = y + j/3;
            if (((1 << j) & value) != 0 && px < WIDTH && py < HEIGHT && px >= 0 && py >= 0){
               setPixel(px, py, color);
            }
         }
      }
   }

Offline kaoD

Senior Newbie





« Reply #89 - Posted 2010-08-17 10:42:02 »

I encoded each of the characters in the lower 15 bits (3x5) of an int (starting at ASCII 28 for some reason I forgot):
Is the letter misplacement in the array intentional, or is it unintended and caused only on my computer for some reason?
Pages: 1 2 [3] 4
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (46 views)
2014-10-17 03:59:02

Norakomi (37 views)
2014-10-16 15:22:06

Norakomi (29 views)
2014-10-16 15:20:20

lcass (32 views)
2014-10-15 16:18:58

TehJavaDev (62 views)
2014-10-14 00:39:48

TehJavaDev (62 views)
2014-10-14 00:35:47

TehJavaDev (52 views)
2014-10-14 00:32:37

BurntPizza (70 views)
2014-10-11 23:24:42

BurntPizza (40 views)
2014-10-11 23:10:45

BurntPizza (82 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!