Project of mine I've been working on for a few months.
Youtube clip of demonstrationGoogle Code project where you can download the work in progressRequires Java 1.6, might run in 1.5, haven't tried it. It's packaged on the Google Code page as an Eclipse project, so you can import it and have your way with it. Runs on windows, should run on linux and mac.
The video was recorded on my circa 2005 laptop where I'm doing the programming and it can run smoothly and a couple times faster than the nominal speed, despite Java. When I tried it at work, it ran at about 90% the nominal speed and was sketchy despite it being a more powerful circa 2008 machine.
Results may vary.
The interface will be kind of awkward until I get all the command buttons working - they're a fairly new addition.
* Left click units to select them.
* Left click a space to give a move command.
* Right click to deselect or cancel a unit placement command.
* Middle click the red command names on the edge of the screen to give commands.
uh....
Questions?
-----------------------------------------------
PS:
I don't know if there's going to much excitement about this as I've read about the repeated, crippling disappointments that have come from op2 clone projects in the past. I intentionally didn't post about it until I had gotten somewhere.
I have a habit of working on proofs at concept at work over lunch or just whenever I don't feel like working. I have PoCs concerning
* Map scrolling (current maps are only the size of the screen)
* Terrain editing and automatic tile annotation (related to map generation where tiles that go together have to be automatically selected)
* Tube connectivity <- works like a charm
* Networking (which is actually far-off, but I'm trying to think ahead structurally)
* More advanced pathfinding and automatic map annotation
* There are some others, I'm not at work.
--------------------------------------------------
PPS - About contributing:
So far, I've been extracting animation sequences from the op2art program into individual files - one frame per file - and writing info.xml files that contain information about them.
This is very tedious.
It also runs slow as the program has to load and read a couple 1000 individual files each time it starts.
So I might be asking for help with do the extracting and writing the info.xml files or I might be asking for help in loading the original op2_art.bmp/op2.prt files. I designed Moving Pictures to be modular enough that changing the sprite load sequence requires only the editing of a few lines. (Well, and the addition of a 1000 more for the actual load code, but whatever...)
I have considered writing my own binary file format to store each unit's sprite set and info about as I like the idea of modular sprite loading, which MP uses, but performance concerns at load time may make me go the op2_art.bmp route.
Oh, and please don't inundate me with feature requests. I know all about the features of the game and I'm keeping in mind things like variations on multiplayer, extensions to trading, around the world maps, tilesets, new units, etc. Right now, suggestions on more fundamental elements of the engine would be preferred, if anyone wishes to offer any.
-------------------------------------------------------------------------------------
Addendum: Graphics
Right now, the game's graphics kind of awkwardly relies on Java's built-in Event Dispatch Thread which is used to paint normal UI components like buttons and text fields and handle input events. And since the mechanics, which includes unit and environment behaviors, since mechanics also runs in the EDT, the program is primarily single-threaded. That's why, if sprites are set to load on demand, when you create a new type of unit (especially the cargo truck), the program will hang while the files are loaded, which ALSO occurs in the EDT.
Just some insight into how it works.
I tried implemented an asynchronous approach where mech and graphics and loading all run in different threads but it didn't run as smoothly as it does now.
---------------------------------------------------------------------------
Addendum: Audio
I found it most convenient to use javax.sound.sampled.Clip objects for the sound bytes since they have a simple start() stop() interface and mix together. However, each Clip instance has it's own thread associated with it, so when all the sounds are loaded the program is running in a couple hundred threads.
On top of that, I decided to include loading sounds modularity on demand, just like sprites and unit types, so the first time the meteor hits the ground, it has to load the sound and a bunch of sprites for the death of the units it strikes. Unchecking "load ____ on demand" when launching the sandbox might help to prevent this, although it varies by machine and Java version.
I'll work on more well-thought-out version of the graphics and audio, but I don't think I'll be jumping for native libraries as that would start to defeat one of the only benefits of using Java for a game. (for a GAME of all things!)