Welcome, Guest. Please Login or Register.  • Help
SMF Underground
+ SHMUP-DEV » SHMUP DEV GAMES SHOWCASE » WINDOWS
|-+ Prototyp "tribute"

Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read March 30, 2007, 04:28:26 pm #0
nicolas_bol

Prototyp "tribute"

About a year ago, i came across http://www.shmup-dev.com, discovering the "Horizontal Shooter with Boss Competition".

I played "Prototyp" and rediscovered how much I loved shoot'em up. I quicky noticed that the winner(X-Out) adopted the carmack attitude and was kind enough to release the source code.
At first I didn't even think of looking at it. But then I started thinking that despite my Master in Computer Science and my 4 years experience in Java/J2EE, i had absolutely no clue how to start and achieve a game like "Prototyp".

So many questions flushed in my brain....

How are animations working ?
How the heck is he doing collision detection ?
How does this distortion effect is working when the Orb is charging ?
How is the orb performing these georgous lightning effects ?
What is a timer ?
What is actually openGL ?
Is java fast enought for a game ? I mean i played UltraTron and these puppygames guys for sure rocks, but can a rookie game developer do something that wil be descent ?

I worked 2 month on Prototyp source code and this is what I produced. This is not really a game but rather a proof of concept. I thought it may help anybody willing to write a game with LWJGL (Java's binding for OpenGL).


Thank so much X-Out, l've learned A LOT from your source code Cheesy !
I was amazed to see that LWJGL/Java were fast enought to have 3000 animated units and as much bullets displayed without slowdown.

Controls:

Arrow Key: move
Z (maintain pressed): Untie the orb so you can move around
Space Bar: shoot, maintain pressed to charge
F1: Start the enemy wave
F2: Start homing missile wave
P: Pause !

PS: You are invincible Wink !

TRY IT:
http://www.shmup-dev.com/forum/index.php?action=dlattach;topic=1125.0;attach=770




« Last Edit: March 30, 2007, 08:16:04 pm by nicolas_bol »
Offline  
Read March 30, 2007, 07:26:50 pm #1
jony

Re: Prototyp "tribute"

I was amazed to see that LWJGL/Java were fast enought to have 3000 animated units and as much bullets displayed without slowdown.

Thats  becaus java isn't really doing it, its openGL that is.  That is the beauty of higher languages they can be used as, more or less, scirpting languages for lower level languages.  It is an important point that I'm very sure not everyone understands.  As long as you use openGL for the visual end of things, which is getting easier every year with libs like LWJGL, you can use pretty much any language you want for the logical end of things.

Just to be really crazy Joshua and I plan on using Jython with the LWJGL.  Just so everyone can follow this:
Jython = python binding for java
LWJGL = java binding for openGL
Offline  
Read March 30, 2007, 08:09:39 pm #2
nicolas_bol

Re: Prototyp "tribute"

jony,

Even though Java is not directly in charge of the display, i was suspicious for several reasons:

1. LWJGL/JOGL are JNI binding to openGL library, there is a big overhead for a JNI call and this kind of game is 100% JNI.
2. Java structure and syntax involves a lot of casting, this has a small CPU cost than can become a major drawback if you check 3000*3000 collisions 200 times per seconds. Java 1.5 templates helped a lot in this concern.


Anyway, i still think that the game is slower than a pure c++ implementation would be.....but i won't port it to c++ Wink !
Offline  
Read March 30, 2007, 09:58:51 pm #3
jony

Re: Prototyp "tribute"

You're right it is, most likely, slower than pure C++.  I don't know the numbers on java, however I do know python; using pure python (as is standard in 2D games) its around 30 to 60 times slower than C++.  However, python using OpenGL is only marginally slower than pure C++.  Unless you're attempting to make a game for next generation computers there isn't much of a need to worry about that marginal gain.

It is important to show case it though, its easy to convince people like me who are relatively new to programming but for people who have been around awhile, and write the books and teach the classes... its important to show case just how far higher level languages have come, at least when you use bindings that take advantage of lower level languages at the bottle necks!
Offline  
Read March 31, 2007, 01:21:07 am #4
X-0ut

Re: Prototyp "tribute"

Hehe cool
Unfortunately I couldnt get it to run Sad

You may be interested to know I've been working on a commercial version for the past few months. Smiley
Technically, every aspect is superior to the original.

When I have more to show I'll throw some screens about.
Offline  
Read March 31, 2007, 03:12:48 am #5
nicolas_bol

Re: Prototyp "tribute"

Glad to read we may enjoy an improved version !

If the game is not running, I tried it on a Windows and MacOS X environnement with Java 1.5:

http://java.sun.com/javase/downloads/index_jdk5.jsp

What was wrong when you tried to run it ?

Offline  
Read March 31, 2007, 11:41:54 am #6
oNyx

Re: Prototyp "tribute"

>i still think that the game is slower than a pure c++ implementation would be

Depends where the bottleneck is. You also don't need more fps then hz. If you meet that frame rate on your target system, then there is nothing to worry about - it's fast enough then.

>if you check 3000*3000 collisions

...then you most likely check more then you need. A simple optimization is to use separate lists for different entity types and then only check those against each each other, which you have to check (rule opt). Eg you don't have to check if a bonus collides with an enemy ship usually or enemy ships vs enemy bullets etc.

>there is a big overhead for a JNI call

The overhead is in fact tiny. Even with immediate mode rendering it rarely matters.

Speaking of lists... you may want to take a look at the evil Bag class:
http://www.javagaming.org/forums/index.php?topic=14938.msg119340#msg119340
(It's like an unsorted ArrayList... w/o any sanity checks [in case you do something stupid you get some OOB exception anyways].)
Offline  
Read March 31, 2007, 08:38:04 pm #7
jony

Re: Prototyp "tribute"

3000 * 3000 collisions is, I'm sure over kill for the 'game' aspects of the program, however the game isn't the point.  The point is to push java hard, therefore having overkill on the collisions is good.
Offline  
Read April 01, 2007, 12:24:01 am #8
relsoft

Re: Prototyp "tribute"

x-out released the source for prototype?


Hello
Offline  
Read April 01, 2007, 01:40:30 pm #9
Carnacki

Re: Prototyp "tribute"

Glad to hear that there (will be, probably be) may be a commercial version of Prototype coming out.  Sign me up for two copies  Wink

Seriously, that is great news. Is it too early to inquire re platform? I would assume PC, but a Dreamcast version (in addition) would be very well received, kind of how 'Last Hope' was made for Neo-Geo and Dreamcast.

Super inquiring minds want to know
Offline  
Read April 02, 2007, 11:57:32 pm #10
X-0ut

Re: Prototyp "tribute"

For now I'm targetting PC and Mac, but who knows, Xbox is a possibility now with XNA.
Offline  
Read April 21, 2007, 09:26:56 pm #11
X-0ut

Re: Prototyp "tribute"

http://xout.blackened-interactive.com/dump/new/ProtoType_src.zip
There you go, source code. Forewarning: It's messy.
Offline  
Pages: [1]   Go Up
Jump to:  

Page created in 0.135 seconds with 20 queries.