December 31, 2010

Hooray!

I've managed to get a colored square to appear on the screen, then make it change color by left-clicking the mouse.  Sounds pretty boring, doesn't it?

But this means that the following subsystems work:

3D rendering
Input manager
Game event handling
Basic GUI interface system

First the 3D engine and input manager (keyboard presses, mouse clicks, etc.) are loaded.  (Note:  I'm skipping many other subsystems that all come with the Java Monkey Engine [JME]--but these are the important ones).  Then the event manager is loaded and all basic game events are registered with it.  I currently have just one event for testing... :).  Next, the GUI state manager is loaded, which in turn creates the "Main Menu" state and the "Second Menu" states.  Main Menu contains a blue colored square on the screen while Second Menu contains a green square.  The Main Menu registers the action of left clicking the mouse with the input manager, then registers the GUI state manager as a listener for the click event.  The GUI state manager is told how to handle any messages coming into it and knows that the event should signal it to swap out the Main Menu for the Second Menu, thus changing the square from blue to green.

What this means is when the application is started, a black background appears with just a blue square in the lower left.  When the mouse is clicked, the "Main Menu" state sends a message to the input manager saying that a left-click occurred.  The input manager then sends a message to the game event manager, which the event manager then processes and sends to the GUI state manager.  The GUI state manager sees this message and swaps the Main Menu for the Second Menu, thus turning the blue square green.

Phew.  Sounds like a lot, but this loose coupling enables each system (input, events, GUI) to function independently and not worry about referencing and hooking into all the others.  It'll save a lot of time and effort when the game gets big and complex!

December 5, 2010

Kick-off

Hello everyone!  This blog has been created to keep any interested people updated on my progress in designing and coding the game Dark Matter.  This game is a turn-based strategy game set in space, similar in some ways to the Master of Orion, Galactic Civilizations, or Space Empires franchises.  I intend for the game's mechanics to differ somewhat from these mainstream games, though I'm not going to reveal exactly how until I've made much more progress coding.  Please also note that Dark Matter is a working title only and the real game's name will be different (since there is already an actual PC game named Dark Matter!).

I've been designing this game for several years now in an on-again off-again fashion and have come to the point where I need to get serious about coding it.  Designing on paper can only get me so far and the whole exercise starts to feel circular after the fourth revision of my tech tree...

I have a programming background, but its unfortunately in scientific/numerical methods and analysis--Matlab and C.  This means that I've had to teach myself object-oriented programming over the past few years.  I think I'm at a point where I can start coding Dark Matter now.  I'm going to write the game in Java using the Eclipse IDE and will probably use Java Monkey Engine 3 as an underlying engine for the game, with additional coding and game design help from Mike McShaffry's "Game Coding Complete, 3rd Edition."