Wednesday, January 26, 2011

Ship ahoy!

In light of yesterday's realization that I need to spend less time paralyzed by indecision over how to structure my code I went home last night with one goal in mind.  "I will draw a ship on the ocean, dammit".  I was fairly close already, having adapted a lot of the window opening and image loading from the Space Invaders tutorial.  I found a ship image online and focused on displaying it.

It took me a little more than an hour during which my fiancee correctly identified that I was paying less than full attention to any attempts at conversation.  (Sorry!)  But before I went to bed I did indeed prevail.

The following is a screenshot of a ship on the ocean-ish. 

Tuesday, January 25, 2011

One small step...

Found another great tutorial.  Rather than copying it verbatim I'm using it as an example.  It is a recreation of space invaders and can be found here.  They do some interesting things with resource management and I've learned about learned a fair bit about loading images into Java. 

Also, I found an interesting article about game loops and screen refreshing.  That article is here.  The original exploration had very little animation, and a very blocky refresh rate.  It will be simple enough to recreate, and not much harder to smooth out.

As with most ventures I find I keep hesitating during startup.  I keep falling back to doing more research into Java game programming instead of moving forward with my best guess.  I need to remind myself there is no cost associated with failure and I can always go back and optimize later. 

Currently I'm opening up a window, but not putting anything on the screen.

Wednesday, January 19, 2011

Taking off the training wheels

This past week I have worked my way though the online Java tutorial and reached a point of diminishing returns reading through Java in a nutshell.  The further into Java I get, the more I've come to second guess my decision.  The embedded programmer in me is appalled by the JVM which is a total black box.  Talking to other engineers in the office it sounds like most software development is just taking a collection of black boxes and stitching them together.  I plan on continuing with Java for the time being, mostly as a learning exercise.  I think that I will likely want to restructure the project at some point and the lessons learned before then will be valuable.  Besides, half of the challenge was to learn object oriented programming, and I should make an honest attempt before I return to the safety of C.  Hardened software developers are probably shaking their heads at that.
In the upcoming week I look forward to getting my teeth into the real project, not just a tutorial example.  I installed the original exploration game to have it for a reference.  It is impressive that software exists to get a DOS based game to run on a 64bit Windows 7 platform.  I tip my hat to the people behind the DOSBOX project. 
 This is a screenshot from the original game 'Exploration'.  It shows the map, currently the ship is in port, the castle looking building, and it's info is listed off to the bottom left.  A screenshot roughly looking like this is what I hope build 0.2 will look like though with much rougher looking graphics for the shape of the land and sea.

Monday, January 10, 2011

Java Crash Course

I am sad to say not much has been developed in the past week though not to say I have not given the project any attention.  I'm still wrapping my head around the object oriented platform, method overloading, inheritance, and other ins and outs of java.  Java in a nutshell has proved to be a handy reference.  I've also found a great tutorial online that supplements it quite nicely.  For anyone curious, it is here

This tutorial sets up a GUI, which I'll then morph into build 0.1 of the game.  My goal for 0.1 is to have a ship that the user can move around the ocean.  Should be simple enough.  Looking forward to 0.2, I'd like to incorporate the land and the ice where ships can't sail, discrete turns, expeditions, home port, and the inventory system. 

To put a timeline to my goal, I'd like to draw a blue ocean by next week.  Wish me luck!

Monday, January 3, 2011

Back from the holidays

This post will read more like an 'owning up to little accomplishment' rather than a triumphant achievement.  I have spent close to two weeks back in Ontario visiting with family and celebrating Christmas.  Initially I pictured quiet afternoons where I could dig through my texts, instead it was a series of rushing from one family members house to another and visiting.  I do not wish to make this sound like a complaint.  I thoroughly enjoyed the past two weeks, however I was unable to get more than a few hours deeper into Java in a nutshell.

I have had some time to think on the end goal of the project though.  The more I think of the game exploration, the more I see it's short comings.  The game begins with 5 or less cities on the map (depending on the number of human and computer players), the rest of the map is undeveloped with the exception of a series of indian and incan villages dotted around randomly.  This leads a player to found a colony in the heart of India, China, or even the Middle East and fill the surrounding areas with plantations and mines.  There are no other civilizations or cities to trade with or otherwise occupy these places.  I think this may be why other games such as Colonization limited the play map to just be North America. 

The more I though about this the more I want the game I write to be a hybrid of the exploration, trade, and strategy games I played growing up. 
  • I greatly admired Colonization for its replayability, ease of learning, and having an ultimate end goal. 
  • The Merchant Prince had a supply and demand model for trade married to a historic exploration model. 
  • Railroad Tycoon 3 had resources moving across the map automatically between raw material mills, production facilities, and consumers. 
  • Sid Meier's Pirates put the player in a first person role as a captain giving the world a more dynamic feel since world events would play out without your influence or knowing (until you sailed back to your favorite Dutch Port only to find it occupied by England). 
  • Europa Universallis had a complete political world map with all Far East, Middle East, and New World civilizations present (even playable) as well as an unparalleled historical accuracy and detail.
  • The Patrician had a rags to riches story of the player starting with one ship and building a flourishing trade empire while competing with other ships and merchants profiting off of supply and demand of goods.
  • Finally, Exploration gave the feeling that you were really achieving something once you had enough ports and ships that you could set up trade routes, and I always found the graphics and sound track to be endearing. 
Each game had its own strengths but no single one seems to combine all of what I was ever looking for.  I am excited by the thought of taking some of the first person individualism of 'The Patrician' and 'Pirates' and integrating it into 'Colonization' while still trying to capture the feel of 'Exploration'.  That is what I ultimately want to port to the iPhone.  I'll still plan on recreating Exploration as a stepping stone and learning tool, so that is what will occupy me in the meantime.

Happy New Year!