Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (429)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (467)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Cremelian War X  (Read 2645 times)
0 Members and 1 Guest are viewing this topic.
Offline marinepower

Junior Member


Projects: 2



« Posted 2009-05-26 04:39:17 »

Here is Cremelian Wars X, a turn based strategy game that puts you right in the action as you command and grow your army to defeat all that oppose you.  This game features over 20 unit types, scriptable game play, a fully functional game editor, a custom sound track, and traditional pixel art!


Current Gameplay screenshot:

Download Link
http://cremelianwarsx.googlecode.com/files/Cremelian%20Wars%20X%20v0.19b.zip

Completion:
[||||||||||] 46%


Version 0.12 (5/25/09)
Click Here to Download!

- initial release


Version 0.13 (5/27/09)
 Click Here to Download!

-added some trigger implementations
-added 4 more maps to play (I'd recommend starting on level 1, they get progressively harder)
-added more units


Version 0.19b (7/18/09)
Click Here to Download!

-added a main menu
-added undo move
-factories and airports can now build units
-infantry can now enter transports
-updated runner.html



Still to be done:
- (64%) Scripting
- (85%) (+19%)Mp3 play back
- (31%) (-42%) Map editor
- (01%) Online play
- (28%) (+6%) Sprites
- (55%) Additional sound effects
- (00%) AI
- (94%) (+9%)Pathfinding


If you download, please post what your first impressions were, as well as the fps, ups, and any errors you might have encountered. Suggestions about how to improve this game and make it more fun are always welcome, too.
Thanks

(PS, this is a two player game, so try to find a friend or coworker to play with.)
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11


Game Engineer


« Reply #1 - Posted 2009-05-26 20:28:17 »

Looks cool. I'll give it a go when I get back from work.

If I were you, I'd look into OGG and EasyOGG instead of MP3.

See my work:
OTC Software
Offline Red27

Junior Member


Medals: 2
Projects: 2



« Reply #2 - Posted 2009-05-26 21:10:25 »

If you simply must use MP3, then use the JMF mp3plugin.jar from http://java.sun.com/javase/technologies/desktop/media/jmf/mp3/download.html

You include it on your classpath using -Djava.library.path=<lib where jar is> etc.

Then use some code like this:

      AudioInputStream din = null;
      try {
         SourceDataLine line;
         do {
            AudioInputStream in = AudioSystem.getAudioInputStream(<mp3Filename>);
            AudioFormat baseFormat = in.getFormat();
            AudioFormat decodedFormat = new AudioFormat(
                  AudioFormat.Encoding.PCM_SIGNED,
                  baseFormat.getSampleRate(), 16, baseFormat.getChannels(),
                  baseFormat.getChannels() * 2, baseFormat.getSampleRate(),
                  false);
            din = AudioSystem.getAudioInputStream(decodedFormat, in);
            DataLine.Info info = new DataLine.Info(SourceDataLine.class, decodedFormat);
            line = (SourceDataLine) AudioSystem.getLine(info);
                        
            if(line != null) {   
               int nBytesRead;         
               line.open(decodedFormat);
               byte[] data = new byte[1024];   

               // Start
               line.start();

               while ((nBytesRead = din.read(data, 0, data.length)) != -1 && !fadeComplete) {   
                  line.write(data, 0, nBytesRead);
               }               
            }            
            // Stop
            line.drain();
            line.stop();
            line.close();
            din.close();            
         } while(loopMusic);
      } catch(Exception e) {
         e.printStackTrace();
      } finally {
         if(din != null) {
            try { din.close(); } catch(IOException e) { e.printStackTrace(); }
         }
      }

Awesome Soccer World 2010 | Red27 Studios | Blog

[IMG]http://www.red27studios.com/images/footer4.png
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline marinepower

Junior Member


Projects: 2



« Reply #3 - Posted 2009-05-27 05:01:21 »

Thanks for the info.  I tried doing something similar with a package called JLayer, but it consistently gives me the following error message:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
Exception in thread "Thread-14" java.lang.NoClassDefFoundError: javazoom/jl/player/Player
   at CremelianWars.ResourceManagement.MP3$1.run(MP3.java:54)
Caused by: java.lang.ClassNotFoundException: javazoom.jl.player.Player
   at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClassInternal(Unknown Source)
   ... 1 more
Caused by: java.io.FileNotFoundException: C:\Documents and Settings\Eugene Zhurilo\Desktop\javazoom\jl\player\Player.class (The system cannot find the path specified)
   at java.io.FileInputStream.open(Native Method)
   at java.io.FileInputStream.<init>(Unknown Source)
   at java.io.FileInputStream.<init>(Unknown Source)
   at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
   at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
   at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
   at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
   at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   ... 5 more
basic: Removed progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@21b6d
Exception in thread "Thread-15" java.lang.NoClassDefFoundError: javazoom/jl/player/Player
   at CremelianWars.ResourceManagement.MP3$1.run(MP3.java:54)


This is the .html file, with the JLayer package inside of the CremelianWars package.  Could there be a problem with the way the .html is set up?

1  
2  
3  
4  
5  
<APPLET CODE=CremelianWars/CremelianWarsDemoMap.class
     ARCHIVE="CremelianWars.jar"
     WIDTH=800
     HEIGHT=600>
</APPLET>
Offline Red27

Junior Member


Medals: 2
Projects: 2



« Reply #4 - Posted 2009-05-27 12:37:05 »

Few questions:

1) Are you working off the desktop, ie is your base .html file located there?

2) What's in the CremelianWars.jar file?

3) Is the jlayer.jar on the desktop also? (or contents extracted?)

Awesome Soccer World 2010 | Red27 Studios | Blog

[IMG]http://www.red27studios.com/images/footer4.png
Offline Mike

JGO Ninja


Medals: 69
Projects: 1
Exp: 5 years


Java guru wanabee


« Reply #5 - Posted 2009-05-27 15:29:55 »

FPS was quite stable around 60 and I didn't get any errors (except for the exception you wrote above).

Isn't it better to put it on a website though? Tongue

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline appel

JGO Wizard


Medals: 49
Projects: 4


I always win!


« Reply #6 - Posted 2009-05-27 16:48:37 »

Screenshot not working Sad

Image host probably blocked at work.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline marinepower

Junior Member


Projects: 2



« Reply #7 - Posted 2009-05-27 23:06:12 »

@Red27

The .html file was on the desktop, as well as the JLayer jar.  However, when I deleted the JLayer package off the desktop, the error remained the same.  I'm not sure what you want to know from the contents of the CremelianWars.jar file, but it contains all the necessary graphics, classes, and files to run the game, which are all subdivided into folders.  The JLayer jar was placed inside a folder called ResourceManagement.  You could extract the contents and take a look if you want.

@Mickelukas
Thanks for testing!  I'm relieved that the fps is a lot higher than the 8 fps I'm used to.
There are plans on getting this game set up on its own website, but there isn't much of a need for that until we implement multiplayer capability. 

@appel
Does the screenshot simply not load, or is it resized?  Regardless, you could see how the game looks like by just running it.  It takes about 5 seconds to load the game from start up.
Offline marinepower

Junior Member


Projects: 2



« Reply #8 - Posted 2009-05-28 03:53:56 »

Time for an update.  I spent most of today working on this, and have a couple of things to show for it.  First off, there is finally someone to do the pixel art, which is a big plus.  Secondly, the game loads a bit faster, and any additional levels that are loaded after the first should now be able to take advantage of the resources used in the last map to furthur decrease the map loading time.

Some basic scripting has also been implemented.  This part is fairly exciting, since doing a good job on the scripting, and eventually releasing a map editor, can allow a game to really thrive.  The scripting engine is based around triggers, which will execute all their actions(commands) if all the preconditions are first met.

These conditions have been coded:
Always, Never, Accumulate, Bring, and Control.
Which can impact the map in the follow ways:
Defeat, Draw, Victory, Preserve Trigger, and Resource Modification.

Enjoy.
Offline Red27

Junior Member


Medals: 2
Projects: 2



« Reply #9 - Posted 2009-05-28 22:51:53 »

Sure, I'll take a look....is it within the current Jar, or do you need to create a special version for me to download?

Awesome Soccer World 2010 | Red27 Studios | Blog

[IMG]http://www.red27studios.com/images/footer4.png
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline marinepower

Junior Member


Projects: 2



« Reply #10 - Posted 2009-05-28 23:38:08 »

lol that's interesting...  I extracted the contents of cremelianwars.jar, and apparently it didn't have a jlayer jar file in it.  Strange.

Anyways, you can take a look at the source code here:

http://cremelianwarsx.googlecode.com/files/CremelianWars.zip

I've never actually gotten any .mp3s to play, since java raises a security exception when running in an ide, and has never successfully loaded any in a signed applet, but I assume the JLayer package is working like it should.
The main runner file is called CremelianWarsDemoMap, and it tries to pass the song names on line 98 to a class called MP3, which is located in the ResourceManagement folder, during init().

Thanks for your help.  Anyone else is free to take a look if they want, too.
Offline Red27

Junior Member


Medals: 2
Projects: 2



« Reply #11 - Posted 2009-05-29 00:20:28 »

Ok - I've downloaded and will try and take a look. 

One suggestion though, don't include Thumbs.db files within your final jar; adds unnecessary size to the distribution and is only relevant for Windows users.  You can exclude them via your build script (assuming you use an Ant task to do this).  It's only a few hundred KB saved, but it's good practise and if you had a large collection of images, the size of the thumbs.db files can get quite large.

Awesome Soccer World 2010 | Red27 Studios | Blog

[IMG]http://www.red27studios.com/images/footer4.png
Offline marinepower

Junior Member


Projects: 2



« Reply #12 - Posted 2009-05-30 03:04:18 »

Thanks.  It seems that I might have deleted the actual jar from the source code package, so you can download it here:
http://www.javazoom.net/javalayer/javalayer.html

Interesting tip about the thumbs files too.  Always wondered why those were created.
Offline marinepower

Junior Member


Projects: 2



« Reply #13 - Posted 2009-06-02 23:11:46 »

Alright, extremely basic mp3 audio works now!  The problem seemed to be packaging the jlayer file inside the cremelianwars jar.  Now to work on some game scripting.
Offline marinepower

Junior Member


Projects: 2



« Reply #14 - Posted 2009-07-18 22:19:55 »

Hi guys, I've recently had the opportunity to work on this again, and have put in a couple of new features that I'd like you to try out.

First off is the menu system, which is shown when you aren't playing a game.  It has three options, play the campaign, play custom maps, and input map data.  Here's how they work.  The campaign option leads you on five different missions that are supposed to take place one after another.  I've disabled victory so that you can try out the custom maps, so this option does not work as of now.

 The next and most important part of the menu is the custom map design, which works by taking in the name of the map and loading it.  The following maps have been made and are playable:
custom.map
level[1-5].map (ie level2.map etc)
versus[1-2].map (You can build on these!)

The last option on the menu is where you input map data, which allows you to resume a game that you didn't have time to finish.  While playing, press 's' to open up a dialogue box with the map data for the current map you're playing.  You can them copy and save this code somewhere, and paste it into the load map data option when you want to resume playing.  This should recreate the map you were playing perfectly.  If it doesn't, paste the map code here and I'll try to correct the problem.

I hope you guys try out this version!  (ARG dang broken message posting... makes it impossible to type out a message longer than this Sad
Pages: [1]
  ignore  |  Print  
 
 

 
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!