Mythruna
May 11, 2024, 03:35:46 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Asteroid Panic...  (Read 13038 times)
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« on: August 12, 2013, 11:03:52 PM »

Totally unrelated to Mythruna... but might be interesting to some of you.

One of the popular game architectures these days is based on an "Entity System"... sometimes "Entity Component System".  (Mythruna uses one heavily.)  Anyway, one of the open source packages I put out was a ES framework compatible with jMonkeyEngine (though not really JME specific).  It's called Zay-ES.

Entity Systems are hard for most programmers to wrap their heads around when they are unfamiliar with them.  Such a heavily "data driven" architecture eschews many standard OOP principles and trying to hold on too tightly to OO messes up most ES implementations.  I kept threatening to put together a simple example using a simple concept like an Asteroids clone.  An ES is technically a little overkill for such a simple game but it does allow for some nice extension points.

Anyway, the past couple of nights, I finally wrote one.  I'll be posting the code soon for jMonkeyEngine/Zay-ES users but I thought maybe some of you would be interesting in seeing the result:
http://mythruna.com/temp/Panic/AsteroidPanic-Windows.zip
http://mythruna.com/temp/Panic/AsteroidPanic-Linux.zip
http://mythruna.com/temp/Panic/AsteroidPanic-MacOSX.zip
https://jmonkeyplatform-contributions.googlecode.com/svn/trunk/zay-es/examples/AsteroidPanic/release/AsteroidPanic-Windows.zip
https://jmonkeyplatform-contributions.googlecode.com/svn/trunk/zay-es/examples/AsteroidPanic/release/AsteroidPanic-Linux.zip
https://jmonkeyplatform-contributions.googlecode.com/svn/trunk/zay-es/examples/AsteroidPanic/release/AsteroidPanic-MacOSX.zip


It's kind of funny how disproportionately time-consuming painting vector-style sprites was.  I was trying to capture the nostalgia of the old vector displays (no pixels) but I just couldn't leave it monochrome.  I may make it an option in a future version.

No sound yet but it wasn't really needed to illustrate an ES.  Latest version has sound and music.
« Last Edit: August 15, 2013, 01:33:40 PM by pspeed » Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #1 on: August 12, 2013, 11:06:55 PM »

What is look like:


« Last Edit: August 12, 2013, 11:09:08 PM by pspeed » Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #2 on: August 13, 2013, 12:46:19 AM »

For developer types, I posted the code and a project description here:
http://hub.jmonkeyengine.org/forum/topic/zay-es-full-example/
Logged
belgariad87
Donators
Hero Member
***
Posts: 507


RPG player for life


View Profile
« Reply #3 on: August 13, 2013, 10:15:03 AM »

i used to love asteroid
Logged

Specs for future reference:
Windows 7 64bit ; Intel Quad Core ; 8GB RAM ; AMD Radeon HD 6800 ; TB HD
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #4 on: August 13, 2013, 10:36:52 AM »

I might decide NOT to look over that code, considering that it is completely using an engine Tongue
I wonder if I will ever decide to use an engine to run a game on.. *thinks for the future* would be less time-consuming and easier but I would want to make my games from scratch.

Paul that's epic Smiley
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #5 on: August 13, 2013, 01:15:02 PM »

I might decide NOT to look over that code, considering that it is completely using an engine Tongue
I wonder if I will ever decide to use an engine to run a game on.. *thinks for the future* would be less time-consuming and easier but I would want to make my games from scratch.

Paul that's epic Smiley

By "use and engine", I assume you mean that it is using jMonkeyEngine... which isn't really an "engine" in the sense that "Unreal" is an engine.

It handles the open GL garbage so that you don't have to spend 2 years becoming an OpenGL expert just to be productive.  That stuff will get picked up over time, anyway.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #6 on: August 13, 2013, 01:18:45 PM »

i used to love asteroid

It's a classic.  It's also about the simplest game I can conceive of... I even had a discussion with someone recently about how it's simpler than one player Pong.  I think it's also more fun.

Double-nostalgia-trip, when I was 10 or 11 years old, the second really playable game I ever wrote was called "Asteroid Panic".  You had a ship that you moved around with the joystick to avoid the asteroids.  They didn't bounce off of each other and you couldn't shoot them.  It was the sequel to my first playable game called "Submarine Panic" in which you were a submarine trying to avoid sea monsters... no coincidence that the only difference between these games was the graphics. Smiley

I'm curious to see who is the first to care about getting higher than level 4. Smiley
Logged
Moonkey
Hero Member
*****
Posts: 1587

This is probably a picture.


View Profile
« Reply #7 on: August 13, 2013, 03:05:07 PM »

I died at level 4.  I don't know why but level 3 cost me my 2 lives.
Logged

Mythruna: Don't you dare read any posts I made before 2014.
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #8 on: August 13, 2013, 04:19:52 PM »

I died at level 4.  I don't know why but level 3 cost me my 2 lives.

I usually lose at least one life before level 3.  I stay in one place too much, I think.

Each level adds another starting asteroid and that exponentially increases the level of chaos in general... but especially if you go for all of the big ones first.  I try to shoot one big one and its spawns at a time... unless one is barreling right at me. Smiley

Looking into sound effects next.  It's too quiet... even for space.
Logged
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #9 on: August 13, 2013, 06:58:44 PM »

Wow.. I was hoping it didn't require GLSL and OpenGL2 :/
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #10 on: August 13, 2013, 08:12:36 PM »

Wow.. I was hoping it didn't require GLSL and OpenGL2 :/

It's a default jme application and I can't be bothered to add the OpenGL1 support just for an example.  Sorry.
Logged
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #11 on: August 13, 2013, 10:18:41 PM »

Wow.. I was hoping it didn't require GLSL and OpenGL2 :/

It's a default jme application and I can't be bothered to add the OpenGL1 support just for an example.  Sorry.
I was expecting it to be something you had to import Tongue

Lets get back to talking about Asteriod Panic ->
I love how the lines aren't pixelated at all, mainly a smooth line Smiley
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #12 on: August 13, 2013, 10:27:02 PM »

Wow.. I was hoping it didn't require GLSL and OpenGL2 :/

It's a default jme application and I can't be bothered to add the OpenGL1 support just for an example.  Sorry.
I was expecting it to be something you had to import Tongue

Lets get back to talking about Asteriod Panic ->
I love how the lines aren't pixelated at all, mainly a smooth line Smiley

Thanks.  That was tricky to get right.  As mentioned, I was trying to emulate the old vector displays which didn't have pixels.  My understanding is that they basically used the cathode-ray to directly draw the graphics on the screen using lines.  That's why even the score lettering and stuff in the original Asteroids is all line graphics.

Emulating this on modern hardware required some tricks.  Rather than writing custom filters or anything weird that would also have had glitches, I just made a sprite sheet with them exactly the way I wanted them to look.  The bonus was that I could give them a nice phosphor glow to punch them up a little.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #13 on: August 13, 2013, 10:28:09 PM »

Wow.. I was hoping it didn't require GLSL and OpenGL2 :/

It's a default jme application and I can't be bothered to add the OpenGL1 support just for an example.  Sorry.
I was expecting it to be something you had to import Tongue

Because I've used only standard JME shaders, there is some way I can set the application up to use OpenGL1... but I don't know if it automatically selects the best one or would drop down to GL1 for everyone and didn't feel like poking into it yet.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #14 on: August 15, 2013, 01:49:56 AM »

For what it's worth, these are the latest download links:
https://jmonkeyplatform-contributions.googlecode.com/svn/trunk/zay-es/examples/AsteroidPanic/release/AsteroidPanic-Windows.zip
https://jmonkeyplatform-contributions.googlecode.com/svn/trunk/zay-es/examples/AsteroidPanic/release/AsteroidPanic-Linux.zip
https://jmonkeyplatform-contributions.googlecode.com/svn/trunk/zay-es/examples/AsteroidPanic/release/AsteroidPanic-MacOSX.zip

And the latest version includes basic sounds and music.

This is the in-game ambient track if you are curious:
https://jmonkeyplatform-contributions.googlecode.com/svn/trunk/zay-es/examples/AsteroidPanic/assets/Sounds/panic-ambient.ogg

I couldn't resist wasting time on it.  It's outside of my normal type of music to write so it was kind of interesting.
« Last Edit: August 15, 2013, 01:56:09 AM by pspeed » Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!