Sunday, February 27, 2011

Planets

I've been working on the planet screen a bit, but I'm really just avoiding the fact that I need to tear apart how I'm doing planets and make some major changes. I'm not currently storing enough information about each planet square to make it interesting at all, so I need to be able to store the terrain type, secondary type, and a short description if there is something there besides the default terrain. I also need to rebuild the GM tool used to build planets, since it's currently not user-friendly at all and eventually I'll need help building the hundreds of planets the game will have to start with.

Friday, February 18, 2011

Ship Configuration Update

I've spent most of my time lately on cleaning up some bugs I've found in the code and tweaking a few small items here and there. I did rework the Ship Configuration screen and now have it pretty much in its final form. I added sortable tables for each section and a lot more useful information for each module is being displayed. I also added more safeguards to prevent cheating since until today it was possible to pass a direct URL and add more modules than you should be able to for a given ship section. The only thing I still need to do for this screen is to make the module names links to the Item Details screen, but I haven't implemented that yet so I'll go back and add the links once I do add that screen to the game.

The ship functionality is slowly getting closer to completion, so I should be able to start working on resources and colony functionality within a few months.

Monday, February 14, 2011

Ship Speed

Ship speed is now being calculated based on the type and number of Slipdrives installed on the ship, instead of just being hardcoded in the database. I just need to determine the final base speeds of certain actions like entering/leaving orbit and landing on planets.

The preliminary times I'm probably going with are:

Entering/Breaking Orbit : 10 minutes
Landing/Taking Off : 15 minutes
Docking : 5 minutes
Entering Asteroid Cluster: 10 minutes

These are all based on a 1.0 speed ship. I'd like to make some of the times also be based on how big an object is that is being orbited, so smaller worlds would take less time to land or take off from.

Sunday, February 13, 2011

Cargo Moves

I've got the basic Ship Cargo screen finished. A ship can now land at a colony that is owned by the same player and move cargo between the ship and the colony. While I was working on this, I decided to make a fairly major design change to simplify my life in coding and in the way the game is played.

I had planned for ships to take a certain amount of time to unload/load cargo. So it might take 10 minutes to unload a module, in which time the ship would be placed in Cargo Handling status for 10 minutes and wouldn't be able to initiate any other actions other than moving another item, which would extend the time out by 10 minutes. The item being moved to the colony would then not be available to the colony for until those initial 10 minutes was up.

I had planned on doing this by having an "available" column in the item table in the database, so when a ship moved a Command Module over to a colony the "available" column for that item would be set to a Unix timestamp 600 seconds in the future, and the colony would not be able to have access to that item until after that amount of time had passed. This is fine for modules and the like, which aren't stackable, but for things like ore, it would mean a ship moving a stack of 100 ore over to a colony that already had ore on hand would create a new stack of ore in the colony that wouldn't be available for 10 minutes and then the colony owner would have to consolidate those stacks. At an active colony this could lead to dozens of stacks of the same type of ore, and it would be more complicated to figure out which stack of ore to use first for production and such.

So, I've made the decision to just have the ships alone pay the time penalty for moving cargo. Anything moved from a ship to a colony will be instantly consolidated into the colony inventory and be available at the point the item was moved, while the ship will still have to wait for the action to complete before it can do anything else. This won't really matter when moving things from a colony to a ship since the ship will have to wait out the cargo action regardless.

It's not really the way I'd like to do it, but it makes things a lot simpler and will lead to getting the game playable sooner.

So here's a list of things a ship can currently do in the game.

1. Land on a planet at a certain square or at a colony.
2. Lift off into orbit of a planet.
3. Leave orbit of a planet.
4. Perform an overall mineral scan of a planet.
5. Perform a scan of a certain square on a planet. (Reveals that square on the planet map.)
6. Move to a new space square on the System Map.
7. Jump to a new star system via an Interstitial Access Point (IAP).
8. Perform a system scan to put the System Map in the library and reveal the distance to the closest IAP. If performed in the same space square as an unknown IAP, this will add the IAP to the library.
9. Install/Uninstall ship modules.
10. Move Cargo to/from a colony with the same owner.

Upcoming Ship Actions
1. Harvest comets.
2. Scoop Gas Giants.
3. Buy/Sell at colony markets.
4. Scan other ships.
5. Attack other ships.

Thursday, February 10, 2011

Cargo

Today's project is to finally finish the cargo move functionality, which is going to involve a lot of code refactoring. This will let ships move items from their cargo holds into the cargo area of colonies that are also owned by the player. I had a half-assed version of this done a while back, but the data tables have changed a bit in the meantime and it never really worked right anyway.

This is fairly complicated functionality, since a player will want to move partial stacks of items, which is different from moving an entire item. So for example, if a player has 100 Precious Metals ore on their ship, they may only want to move 50 of them, which involves possibly creating a new stack of that item in the colony unless there is already a stack of Precious Metals there in which case it would just add 50 to it.

At least I already have the interface in place, I just need to get all of the functions behind the scenes working correctly now.

Wednesday, February 9, 2011

Ship Configuration Update

I've got the basic functionality of the Ship Configuration screen working now. A player can now install modules from the Cargo Area into either the Command, General, or Engine section, depending on what type of module it is.

So all of the necessary modules for a basic ship are now in the game, but they don't currently actually affect anything. The next step will having the installed modules effect the ship, so the ship's maximum cargo will be calculated based on how many Cargo Modules are installed, and the ship's movement speed will be calculated on what Slipdrives are installed and what those drive modules are rated.

Here's a screenshot of the current Ship Configuration with my test ship shown. I'm going to make this a little prettier very soon, but it does what it needs to do.

Tuesday, February 8, 2011

Ship Configuration

My current focus is on the Ship Configuration Screen.

Each ship will be composed of three major sections: Command, General, and Engine.

Each section will slots that will hold modules. The number of module slots a ship has is based on its class. So a 0.1 starter ship will have 1 Command Slot, 1 General Slot, and 1 Engine Slot. If you upgrade your ship to be Class 0.2, it will gain one extra General slot and another General Slot for each advance up to 1.0, at which time you will gain one extra Command and Engine slot.

So a Class 1.1 ship will have 2 Command Slots, 11 General Slots, and 2 Engine Slots.

General Slots will hold Cargo Modules and more specialized modules like Fighter Bay Modules, Weapon Modules, etc. Each Cargo module you have installed will allow your ship to carry 500 mass units of cargo.

Command slots will hold things like Command Modules and other modules I haven't invented yet, but possibly things like Sensor Modules and things that make a ship fight better. It will also be able to hold Science modules that let ships perform better research out in the field.

Engine Slots hold either Slipdrives or Jump Drives. Slipdrives are rated from 1.0 to 10.0 and the speed of your ship will be determined on the rating of your Slipdrive compared to how many modules are installed on your ship. Each slipdrive can push up to 10 modules at full speed, so a 0.5 Class Ship with a 1.2 rated Slipdrive could move at 1.2 Space Squares per Hour when traveling on the System Map.

Right now I'm working on players being able to install and uninstall modules on a ship that is landed at a colony. After that I'll be able to modify the new ship creation to have basic modules installed upon ship creation.

Saturday, February 5, 2011

New Player Setup

Except for a few small details, I've got the basic new player setup complete. You name your ship and the captain on the same screen and the new captain starts with 0.1 in all but the basic science skills. The basic 0.1 Class Ships will be able to fly with just a captain on board, who can handle routine tasks, but the captain won't be able to get skill advances for positions he's covering for.

So a captain will start with 0.1 in Astrogation, but won't be able to advance that skill by jumping to new systems. Only personnel assigned to the Navigator position will be able to do so. The Captain will be able to advance Tactics and Command. This is all tentative of course, and could definitely change.

As ships get larger they will require more crewmembers, but I haven't exactly worked out how that will be in the game as of yet.

Here's a screenshot of a new ship Captain I created today.

Friday, February 4, 2011

New Player Setup

I've got the basic version of the New Player setup working now. It creates a new ship and a new employee as the captain and the ship starts out landed at a colony. This is actually nice for me since up until this point I've been creating ships directly in the database. This was also a good path for me to work on right now since I found a problem with the way the ship code was handling unassigned personnel and was able to fix that as well.

Now I just need to add a few finishing touches like giving the new captain a few default starting skills and then I can start working on adding ship engines to the game and having ship speed be based on what engines are installed in the ship.