Thursday, September 12, 2013

Year 13 - Day 255

Still lots of combat work going on.  I'm doing some code refactoring as well while I'm working on the Retargeting Algorithm.  So far it works like this:

1.  Ship needs a new target.
2.  Is there only one ship left on the opposing side?  Choose that ship as target.  End.
3.  Get a list of all opposing ships.
4.  Sort the list by distance ascending.  Multiple ships at the same distance are sorted randomly.
5.  Pick the closest ship as the first "potential" new target.
6.  Check targeting preference for ship.  Does it prefer to target Armed or Unarmed.
7.  Check potential target vs. targeting preference.  If it does not match, choose next ship in list.  If it does match, set this ship as the Final target.
8.  After all ships are checked and none match preference,  set the original potential target as the Final target.

What this means is if the ship prefers to target Armed opponents, then if the closest ship is Unarmed it will go to the next closest ship and see if it's Armed.

Thursday, August 29, 2013

Year 13 - Day 241

I'm still working on the combat routine.  It was taking way too long for an armed ship to destroy the smallest unarmed, unarmored ship, so I adjusted the hit chances and damage up for Beam Lasers.  I'm afraid if it takes too long for combat to finish it will stress out the server too much if I ever manage to go live with the game.  It's going to require a lot of balancing regardless.  I may have to end up raising the damage and hit chances considerably or limiting the number of rounds that combat will run.

The latest code I've been working on is to create a page that will instantly create armed ships for testing purposes.  I've thought about rigging up an entire combat simulator, and I still may, but for now that would require a lot of extra work that I'd rather spend on just getting the combat routine completely fleshed out.

I'll end today's post with a recent screenshot of a ship that was destroyed in combat.  This is what you would see if you clicked on the name of a ship in your Dead Ship List.


Friday, August 23, 2013

More Combat Results

The following combat report is the first one that stops when it needs to, procedurally, rather than going for a set number of rounds.  The report is still messy and lacks any real formatting, but this means that 1 vs 1 ship combat with beam lasers is essentially finished other than debugging and making it look prettier.

I'll likely need to adjust the damage amounts on weapons upwards a bit.  This combat only took four rounds, but it had gone for 21 rounds just before this.  I'm not taking everything into account like the Weaponry or Tactics skills yet, but I don't want a very small unarmed ship to take 25 rounds of combat to be blown up.

Actually, that's not even correct either.  In this situation the unarmed ship should offer to surrender pretty quickly.  Whether the attacker is willing to accept surrenders will be up to the player, but this exact combat should result in a surrender after a few rounds after I've added all the options in.

-------------------------------------------------------------------------------------------------------------------

While orbiting the planet Oak in the Marvin system, the unarmed IND John C. Butler (42) was attacked by the IND Golden Rule (2).

The IND Goate Bucket (33) is unarmed and remains neutral.
The IND Mobile Bay (37) is unarmed and remains neutral.
The IND Reuben James (39) is unarmed and remains neutral.
The IND Szent István (44) is unarmed and remains neutral.
The IND Hatchass (57) is unarmed and remains neutral.

Order of Battle

Aggressor
IND Golden Rule (2)
Defender
IND John C. Butler (42)

Initial Targeting

Aggressors

The IND Golden Rule (2) targets the IND John C. Butler (42)

Defenders

The IND John C. Butler (42) targets the IND Golden Rule (2)

Begin Combat

**** Round 1 ****

Golden Rule (2) - IV: 3.4 Speed: 1.5   Damage (C: 0/500 M: 5/1000 E: 0/500)  Armor (ZOR 600/600/600)
The Golden Rule manuevers away from the John C. Butler at Speed 1 to a distance of 5.
 Turret #1 (2 x Beam Laser I) fires at the John C. Butler and misses.
 Turret #2 (2 x Beam Laser I) fires at the John C. Butler and hits the Engine Section for 93 damage.
  • Slipdrive I (98) takes 93 points of damage.

John C. Butler (42) - IV: 0 Speed: 0   Damage (C: 179/500 M: 204/500 E: 477/500)
The John C. Butler retreats at speed 0 to a distance of 5.

**** Round 2 ****

Golden Rule (2) - IV: 3.4 Speed: 1.5   Damage (C: 0/500 M: 5/1000 E: 0/500)  Armor (ZOR 600/600/600)
The Golden Rule maintains a distance of 5.
 Turret #1 (2 x Beam Laser I) fires at the John C. Butler and misses.
 Turret #2 (2 x Beam Laser I) fires at the John C. Butler and hits the Command Section for 55 damage.
  • Command Module (96) takes 55 points of damage.

John C. Butler (42) - IV: 0 Speed: 0   Damage (C: 234/500 M: 204/500 E: 477/500)
The John C. Butler retreats at speed 0 to a distance of 5.

**** Round 3 ****

Golden Rule (2) - IV: 3.4 Speed: 1.5   Damage (C: 0/500 M: 5/1000 E: 0/500)  Armor (ZOR 600/600/600)
The Golden Rule maintains a distance of 5.
 Turret #1 (2 x Beam Laser I) fires at the John C. Butler and misses.
 Turret #2 (2 x Beam Laser I) fires at the John C. Butler and misses.

John C. Butler (42) - IV: 0 Speed: 0   Damage (C: 234/500 M: 204/500 E: 477/500)
The John C. Butler retreats at speed 0 to a distance of 5.

**** Round 4 ****

Golden Rule (2) - IV: 3.4 Speed: 1.5   Damage (C: 0/500 M: 5/1000 E: 0/500)  Armor (ZOR 600/600/600)
The Golden Rule maintains a distance of 5.
 Turret #1 (2 x Beam Laser I) fires at the John C. Butler and misses.
 Turret #2 (2 x Beam Laser I) fires at the John C. Butler and hits the Engine Section for 25 damage.
  • Slipdrive I (98) takes 23 points of damage and is destroyed.
  • Ship is Destroyed!

Combat Ends

AssetID: 42 was destroyed.

Monday, August 19, 2013

Year 13 - Day 231

Game development reached an important milestone yesterday evening when the first ship was blown up in the game by the combat routine.  The IND Mobile Bay had the honors of being the first ship lost to enemy fire in the history of Project Libertine.

Even though the ship was blown up, the combat routine still tried to continue, so work continues on making the combat end properly when there are no enemy ships left.  In addition the game doesn't currently show destroyed ships properly, so a lot of work on the interface remains before my first pass at ship combat can be considered complete.


Friday, July 26, 2013

Year 13 - Day 207

Working on combat again.  This is going to lead to a lot of secondary work that needs to be finished.  I've decided now that I need to add a Secondary Ship Status to the database to handle certain situations.  Up to this point I've been using Status as a blend of location description and status.  Under my new system Status will be mostly a description of where the ship is, like In Orbit, Landed, Taking Off, etc.  Secondary Status will describe things like Disabled, Derelict, Destroyed, etc.

This kind of stuff will take a good bit of code refactoring and debugging, so I'll likely be balls deep in that for the next week or so.

Wednesday, July 24, 2013

Year 13 - Day 205

I've officially finished off the Colony Market system so colonies can list buys and sells, and ships landed there can buy or sell items.  I'll revisit this at some point to add transactions to the database so players can keep up with their buys/sells and these will show up as a sort of Provenance for items.

Now I'm updating the Item screen and killing some bugs while doing that.  I've got a few major ones to track down so that may take a day or two.

I have actually started looking through the Combat code and getting myself re familiarized with how things are currently working.  I'm at the point where I need to be able to actually know when a ship is Disabled or Derelicted, and write up the functions that will Destroy a ship and Kill off crew members.  Sometime in the next week I should have the first official death of a crew member in the game.

Thursday, July 11, 2013

Year 13 - Day 192

Work on the Colony Marketplace is proceeding at a decent pace recently.  I had to rework some mechanics and kill some bugs in the Pickup/Transfer code first, and currently ships can sell items to colonies and money is changing hands on transactions.  Now I just need to finish up the code to let ships Buy items at colonies.

After that I'll probably take another stab at getting the first round of the combat code finished up.

Wednesday, May 22, 2013

Year 13 - Day 142

I'm back at it after an extended break.  Today I finished up most of the colony side of the Market system and killed a few bugs with it.  Next up is the ship side of the Market which will allow a ship to buy and sell items while landed at a colony.

I think for now I'm going to disallow buying and selling if the ship belongs to the same player as the colony.  I don't really see a point in it since ships and colonies all operate off the same money pool for the player.

Tuesday, January 15, 2013

Year 13 - Day 15

I'm slowly getting there.  I try to write at least a few lines of code each day.  The colony side of the Market system is almost finished.  Then I'll work on the Ship side of it before I get back to working on Combat.

Part of the complication lies in the way I'm handling items.  I have "stackable" items like mineral ore, which are basically one item with the quantity field set to > 1.  Non-stackable items have a damage rating, which ranges from 1 to the total mass value of the item.

This system works fine until it comes time to sell or buy non-stackable items.  The issues are:

1.  I'd have to list the current damage rating so the buyer can be sure they're not buying a damaged item.

Solution:  Can't sell damaged items on the market screen.  They'll have to be "sold" via colony pickups and money transfers.  This may actually lead to a little more complexity since I may have to add an escrow system, or I could let a player organization handle this.

2.  If I list that I want to buy 20 Jump Engine Modules, it becomes more complex to decide which 20 engines a seller wants to sell out of his inventory, both for the UI and the code behind the scenes.

Solution:  Items are "sold" to a colony from the ship's Inventory screen, where non-stackable items are listed individually and will have a price next to them if the colony is willing to buy that particular item.

3.  Listing multiple non-stackable items for sale will add a lot of clutter to the market screen.

Solution:  Not really sure on this one yet.  I guess I'll have to add some type of robust filtering system to the market screen.  I may have to play around with it a bit to see what works best.

Sunday, January 6, 2013

Year 13 - Day 6

I just finished off 95% of the colony Pickup Orders functionality.  I'm sure I missed something and I still have to test it out a lot, but right now a colony can issue an order to allow another player to pickup items at the colony.  A message is sent to the other player letting them know this, and he can send any ship he owns to the colony to pick the stuff up.

I still need to work on the UI of the colony end a bit, and item transfer itself still has a good chunk of work to be done, since right now transferring items takes no time to complete.  Eventually it will take an amount of time to transfer an item based on it's mass, with the Cargo skill helping to speed this up some.

Wednesday, January 2, 2013

Year 13 - Day 2

Happy New Year!

I'm almost finished with colony pickup orders.  It's all working except for stackable items, so I should finish it up very soon.  After that I'll probably stay on the same lines for a few days and finish up the Market system since a lot of the work I've been doing recently will help finish that also.

Then I'm back onto the combat system until I get it finished up with basic beam lasers.