Sunday, June 24, 2012

Year 12 - Day 175

I'm still working on the manufacturing system, and I also got side-tracked with a UI design overhaul.  UI design is extremely painful for me since I don't think I have a very good feel for what's attractive or what colors go with what.  Eventually I'll have to hire someone that is artistic to completely redo it, but for now I think it's better than it was.  See the screenshot below.

I've also started working on Mining, and the first deposit has been created in the database.  Next I'll have the colony that is on top of the mine extracting minerals from it, and then I'll work on the GM tools to place new deposits.


Monday, June 18, 2012

Year 12 - Day 169

So after what was pretty much a lost weekend due to Dreamhost screwing up the servers all weekend long I was able to finish off most of the Manufacturing functionality today.  I've still got to make it actually use up materials and do some more polishing, but right now I can pick an item from a list and have the colony start working on it.

So far I've worked it that you will build Factory Modules at your colony.  The module can have a number of build queues equal to it's integer level.  So a 1.2 module can have one queue, and a 2.7 module can have two.  Once you start building, any needed materials are moved into "Reserve" status, so they still take up space in the Warehouse, but can't be used for anything else.

If you choose to build 200 Structural Units, then it will build each one individually until they're all completed.  Partial builds will be available as soon as they're completed, so if you start building 200, then about five minutes later you'll have 1 new Structural Unit in your warehouse, and 199 left to build.

I've also nailed down the item hierarchy.  It will consist of four levels:

I : Raw Materials (example: Base Metals Ore)
II : Processed Materials (example: Processed Base Metals)
III:  Manufactured Components (example: Electronics, Structural Units)
IV: Manufactured Items (example: Jump Drive, Laser Cannon I)

Each level will be composed of 1 to 3 different types from lower levels.  So Processed Base Metals will take 2 Base Metals Ore.  There will likely be Technology that will lower this ratio.  Structural Units may take 1 Processed Base Metal and 1 Refined Hydrocarbons.

Here's a screenshot of some build queues in action.


Tuesday, June 12, 2012

Accurate Javascript Timers

While working on manufacturing today, I finally became fed-up with the fact that my javacript countdown timers in the game weren't very accurate.  I did some Google research and experimented on my own and finally came  up with a satisfactory solution for the timers to stay pretty accurate.

I did it by sending the desired end time derived from the PHP time() function as a variable to the javascript function, then using the Date().time() javascript function for the script to derive how many seconds it has left.  So a timer should never be more than a second out of sync now, but it does rely on the user having their system time set accurately.  This doesn't really matter since the game only shows the timers to the player as a convenience and doesn't actually use them to do any changes to the database.

Monday, June 11, 2012

It's Alive!

Earlier today, the colony Fort Jackson in the Marvin(1) system finished the first manufactured items in Project Libertine:  It created 26 units of Processed Metals Ore.

Of course, I had to manually enter the build order into the database, but it is currently chugging away on that build queue, creating a new unit every 600 seconds.  It's also not using raw materials yet, but that's just nitpicking, right?

I'm hoping to have the manufacturing code wrapped up by the end of the week, and then dive right into writing the Mining code, which should involve a lot of copying and pasting of code, so hopefully it will go faster.

I also created the first 1000 Human Colonists today, but they're not doing anything as of yet.  Eventually they will provide man-hours needed by the factories and mines.

Sunday, June 10, 2012

Manufacturing Started

As I thought I might, I decided to start working on manufacturing today.  I made some good progress, but you can't build anything yet.  Colonies will be able to build Manufacturing Modules, which are rated from 0.1 to 10.0.  The levels from 0.1 to 0.9 are considered Under Construction and the modules are not active.  At 1.0, you gain the ability to use your first Build Queue to construct items.  So you can add a queue to process 500 units of raw ore, or have it start building 10 Jump Modules.  At 2.0 you get another queue, etc.

I got the queue table designed in the database.  At first I went one direction where each module would have permanent queues that hold build instructions, but I decided to go a different direction where you just add queues as you need them and they disappear after they're finished.

My current target is to have the first item manufactured by the end of this week, so stay tuned for news and screenshots.

Saturday, June 9, 2012

Friend or Foe Wrapup

I finished off the Friend or Foe functionality today and killed a few other bugs I found.  Each list is now limited to 10 entries, and I added error messages to let the user know why a ship didn't get added.  When the game eventually goes live, one of the perks for being a paying "Member" of the game is that the size of the Friend or Foe lists will be bigger.  I haven't even started adding any of that to the game yet, though.

To test the lists, I had to create a bunch of new ships.  None of them are armed, and to arm them I'd have to create a bunch of weapons by hand in the database.  So I think this might be a good point to veer off for a bit and work on the manufacturing part of the game for colonies.  I'll decide when I sit down at the computer tomorrow afternoon and fire up the editor.

Thursday, June 7, 2012

Friend or Foe?

As part of my current effort to actually have ships shooting at each other in the near future, I've been working on getting the Friend or Foe lists completed on the Ship Combat Programming page.

Basically, how it works is that each asset you own (ship, colony, or expeditionary force) has a Combat Programming page.  At the bottom of this page are three lists: Support, Defend, and Enemy.

If you're in the same location as an asset on your Support List, you'll join in on their side if they attack someone else.

If you're in the same location as an asset on your Defend List, you'll join in on their side if they are attacked.

The Enemy list will not let you automatically attack someone, since I'm going to require you to actually click a button to attack someone.  However, it will be useful in giving you more visual indicators that there's a possibly hostile ship in the same location as you, and will probably give you a small advantage if you're attacked by someone on your Enemy list.  I haven't worked all of that out yet.

Unarmed ships don't have a Combat Program, other than attempting to flee on round #1 or maybe an option to surrender immediately.  I'm still working out the details on that part as well.  You don't have to put your own ships on the lists, since an armed ship will automatically Support/Defend other ships belonging to the same player and/or faction.

Here's a screenshot of a current Combat Program page showing the Friend or Foe lists.  The top part of the page is still under construction.


Monday, June 4, 2012

Back

I spent last week on the beach near Gulf Shores, Alabama, and I was almost completely offline, so no work on the game happened, although I did come up with a few new things while I was relaxing on the beach.

Today I did some small polishing work on stuff like the Reports page to keep one part of my mind occupied while I mull over how to do a few things.  I started goofing around with the ship combat code a little and made a little progress there.  I can tell already that to get the combat the way I want it is going to be a huge pain in the ass, but it should be worth it.

I think I mentioned it before, but I decided to go ahead and write the combat code to include multiple ships per side.  I was going to do 1 vs. 1 to get started, but I think that to rewrite it afterwards would be almost as bad as coding it up in the first place.  So to do that, I'll have to code up more on the Ship Combat Programming, but that's a good thing.

Hopefully soon I can post a few initial combat reports.  Right now they're mostly just debugging statements.