Been a rough start to the year. Got divorced. Had triple bypass surgery. Covid-19. I've been stuck at home a lot for the last 11 weeks so I've gotten back to work on the game after another long break.
To start with, my host upgraded the PHP version so I've had to remediate thousands of lines of code just to get back to basic functionality. Add to that not seeing the code for several years and I've been balls deep in my own crappy PHP code for weeks now. I've even found lines of comments where I was trolling myself from years ago.
Anyway, I've finally got just about everything remediated and I've been cleaning up the code as well, trying to save myself some technical debt down the road. I've actually started working down the huge list I keep on Trello and adding some new functionality to colonies and to ships.
Most of it revolves around building new colony modules and exploring comets. I've also started pondering the way I want to implement the tech tree again and have made a few other decisions around combat, but I haven't started touching that mess of code yet.
Anyway, no idea when/if I'll finish, but it helps keep me sane and distracted in this crazy ass year 20.
Showing posts with label combat. Show all posts
Showing posts with label combat. Show all posts
Wednesday, April 1, 2020
Tuesday, March 17, 2015
Year 15 - Day 76
I'm very very close to having the initial pass at the combat system complete. So far it only features Beam Lasers as weapons and ships cannot surrender yet. However, combat is being completed and the delayed messages are being sent out.
I also realized that I currently have no way for players to mount Beam Weapon Turrets on their ship hard points, so that will have to be addressed as well.
Still, it feels good to be even this close to finishing up this major section of the game.
I also realized that I currently have no way for players to mount Beam Weapon Turrets on their ship hard points, so that will have to be addressed as well.
Still, it feels good to be even this close to finishing up this major section of the game.
Thursday, February 12, 2015
Year 15 - Day 43
I've been pushing at least some code every day for the past week or so. In the last day or so I've mostly been working on Admin functionality. I added the ability to randomly create asteroid fields based on the density given when I create them. This leads me to needing to be able to also randomly generate mineral deposits at the same time, so that functionality is coming next.
I've also been doing a lot of pondering on the current Combat code. I'm going to go ahead and integrate the current combat into the game after I figure out how to make ships surrender. I'll still have to tweak weapon accuracy and damage to shorten things up a bit, but it's getting close to being ready.
I've also been doing a lot of pondering on the current Combat code. I'm going to go ahead and integrate the current combat into the game after I figure out how to make ships surrender. I'll still have to tweak weapon accuracy and damage to shorten things up a bit, but it's getting close to being ready.
Thursday, February 5, 2015
Year 15 - Day 36
I've been away from the game for quite a while. There's various reasons for that, but I'm slowly getting back into it again. My current job has me programming again on a daily basis with Java, so my coding habits have gotten better recently. As a result, I see that my code base for the game is a horrendous mess. I should have made an effort to use objects, but I didn't and at this point I'm not going to try to go back and fix that. I am, however, in the process of doing a lot of tedious code remediation that will make my life a lot easier in the future.
In the process of this, I'm finding a lot of bugs I didn't know about. I'm also avoiding the Combat code for a bit, although I have been looking at it again. The next step I need to do for combat is to decide how and win a ship surrenders.
The easiest example to consider here is a starting ship vs. any armed ship. So I'm thinking it will go something like this:
1. Armed Ship(AS) begins combat against unarmed Newbie Ship(NS).
2. Friend vs. Foe lists are checked.
3. If no ships come to the aid of the NS, a Morale Check will immediately happen. If it fails, NS Surrenders.
4. If it passes the MC, the NS will Flee since it is Unarmed.
5. After one round of combat, the NS will know how fast the AS is.
6. If the NS is faster, it will continue to flee.
7. If the NS is slower, it will Surrender. This will also apply if the NS gets damaged and becomes slower than the AS in later rounds.
In the process of this, I'm finding a lot of bugs I didn't know about. I'm also avoiding the Combat code for a bit, although I have been looking at it again. The next step I need to do for combat is to decide how and win a ship surrenders.
The easiest example to consider here is a starting ship vs. any armed ship. So I'm thinking it will go something like this:
1. Armed Ship(AS) begins combat against unarmed Newbie Ship(NS).
2. Friend vs. Foe lists are checked.
3. If no ships come to the aid of the NS, a Morale Check will immediately happen. If it fails, NS Surrenders.
4. If it passes the MC, the NS will Flee since it is Unarmed.
5. After one round of combat, the NS will know how fast the AS is.
6. If the NS is faster, it will continue to flee.
7. If the NS is slower, it will Surrender. This will also apply if the NS gets damaged and becomes slower than the AS in later rounds.
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.
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.
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.
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.
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.
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.
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.
Sunday, December 23, 2012
Year 12 - Day 357
I just returned from a 9 day trip out of state including a week in Disney World, so work on the game has been on hiatus for about two weeks. Fortunately, a friend has started doing some play testing for me, so I'm getting a lot of feedback and finding some serious bugs that never would have shown up without multiple people playing at the same time. The fact that someone is actually willing to spend some time playing the game is exciting to me also, since it means it's close to being a real game that people will be interested in playing.
My focus for the next few days will be to get colony pickup orders working, so I can transfer some material to the test accounts. This will let me avoid having to create items directly in the database and transferring them over, which should save some time and also get important functionality up and running at the same time.
Then I'll get back to the combat program. It's progressing nicely so far, and actual damage is being done to ships. Ships aren't quite being destroyed yet, but that should be in soon. I'm hoping to reach a point in the next week or so where I can let combat run past the hard 5 turn limit I have now and end programmatically instead.
My focus for the next few days will be to get colony pickup orders working, so I can transfer some material to the test accounts. This will let me avoid having to create items directly in the database and transferring them over, which should save some time and also get important functionality up and running at the same time.
Then I'll get back to the combat program. It's progressing nicely so far, and actual damage is being done to ships. Ships aren't quite being destroyed yet, but that should be in soon. I'm hoping to reach a point in the next week or so where I can let combat run past the hard 5 turn limit I have now and end programmatically instead.
Friday, November 9, 2012
Year 12 - Day 313
I made more progress on the combat system today. Actually, it involved a lot of code remediation and ripping out whole sections for a rewrite, but I've almost got the friend vs. foe functionality finished and soon there will be multiple ships involved in combat.
Saturday, October 20, 2012
Year 12 - Day 293
I'm making some progress on both the market system and ship combat at this point. I've been switching between them when one gets too frustrating. Both are very complex and are going to require a lot of coding, testing, and debugging.
At first I thought I was just going to do 1 ship vs. 1 ship to get things started, but so far I've been putting in a lot of the code to handle multiple ships in a battle, so it looks like multiple ship combat will be available right from the start.
At first I thought I was just going to do 1 ship vs. 1 ship to get things started, but so far I've been putting in a lot of the code to handle multiple ships in a battle, so it looks like multiple ship combat will be available right from the start.
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.
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.
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.
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.
Tuesday, May 22, 2012
Weapon Systems Coming Online
I created the first weapons in the game yesterday, which were a few Beam Lasers. Sometime later today they should be installed on a starship for the first time.
I was going to just develop the starship combat first for 1 vs. 1, but I've decided to go ahead and have it account for other ships joining in since it would involve a lot of rework later on. This means I'll have to do a little more pre-work before I get started on the combat, but should be much more satisfying when it's done.
All combat will begin by one ship clicking Attack on another ships, but then friend vs. foe lists will be checked for any other ships/colonies at that location so if you have the defending ship on your Defend list, you will join in on their side. Conversely, if you have the attacking ship on your Support list, you'll join that side.
I was going to just develop the starship combat first for 1 vs. 1, but I've decided to go ahead and have it account for other ships joining in since it would involve a lot of rework later on. This means I'll have to do a little more pre-work before I get started on the combat, but should be much more satisfying when it's done.
All combat will begin by one ship clicking Attack on another ships, but then friend vs. foe lists will be checked for any other ships/colonies at that location so if you have the defending ship on your Defend list, you will join in on their side. Conversely, if you have the attacking ship on your Support list, you'll join that side.
Wednesday, May 9, 2012
Side Tracks
I got bored with all the graphics stuff, so for the last day or so I've been wandering off doing some other things. I fixed some bugs and I added the ability for a user to change their language. Right now the only options are English and German, and only a few labels are changed to German, but I thought I might as well do some of it as I go along so it won't be a huge chore somewhere down the road. I'm not sure what other languages I'll translate it to, but I would imagine French and Italian may be forthcoming. I'd love to translate it to Chinese, but it's such a different language than what I'm used to that the task is daunting to me. At least with German I can almost follow along.
I also took another look at ship combat, but this made me realize that I'm really not ready to start writing the combat code since I haven't even added weapons to the game and don't have the ability for players to set some basic tactics for their ships. Eventually you'll be able to tell your ship what distance it should try to maintain to the target, or what round to flee on if you want to stay and fight for a few rounds then try to escape. I've got the framework or the Ship Combat Orders up, and once I create a few lasers I can start making the combat more complex. The combat system is probably the one part of the game that is going to require the most work, even from deciding exactly how it's going to work.
I also took another look at ship combat, but this made me realize that I'm really not ready to start writing the combat code since I haven't even added weapons to the game and don't have the ability for players to set some basic tactics for their ships. Eventually you'll be able to tell your ship what distance it should try to maintain to the target, or what round to flee on if you want to stay and fight for a few rounds then try to escape. I've got the framework or the Ship Combat Orders up, and once I create a few lasers I can start making the combat more complex. The combat system is probably the one part of the game that is going to require the most work, even from deciding exactly how it's going to work.
Monday, April 25, 2011
Hiatus Over
After a short hiatus for the holidays, I'm back at work on the game today. I did some work on the ship combat program, basically getting more of the initial ship information loaded up and the basic loop for combat rounds going.
This is still a very nebulous area as far as some of the specifics go, but right now I'm going with the following basic combat format:
1. Determine Initial Distance based on Sensors vs. Signature
2. Determine Maneuver Options for Attacker and Defender
3. Begin Combat Rounds
4. Attacker and Defender Move
5. Any weapons that are in firing range fire.
6. Assess Damage
7. Determine New Ship Characteristics
8. Check Sensors vs. Signature to see if Attacker can still see Defender
9. Check Surrender Conditions
10. Begin Next Round at Step 3
11. Continue Rounds until one side is destroyed or surrenders or escapes.
This is still a very nebulous area as far as some of the specifics go, but right now I'm going with the following basic combat format:
1. Determine Initial Distance based on Sensors vs. Signature
2. Determine Maneuver Options for Attacker and Defender
3. Begin Combat Rounds
4. Attacker and Defender Move
5. Any weapons that are in firing range fire.
6. Assess Damage
7. Determine New Ship Characteristics
8. Check Sensors vs. Signature to see if Attacker can still see Defender
9. Check Surrender Conditions
10. Begin Next Round at Step 3
11. Continue Rounds until one side is destroyed or surrenders or escapes.
Wednesday, March 30, 2011
Begin...
The title of this post comes from the name of an old game we used to play way too much back in the mid-80's at the University of Alabama on the dorm computers. We always loved the simple title of it. Just "Begin".
I bring this up because I began the process of adding ship vs. ship combat in the game today. It's still got a very long way to go, but you can click on an enemy ship now and bring up the combat screen, even though it doesn't do anything right now except check that the two ships are in the same location and don't belong to the same player. I'm trying to build the distrust of the data passed to the screen in from the very beginning this time.
So after I got that basic setup done, I went back and started adding a few things I'll need for combat, like ship signatures and sensor ratings. Basically, a ship's signature is calculated by CLASS + ARMOR - CLOAKING. So a new Class 0.1 ship would have a signature of 0.1. Cloaking can take this to a negative value, but new ships won't start with cloaking. So then if you take the signature value and add to it the Sensor value of the opposing ship, if that value is over 0.0 then the opposing ship can see you. So without some time of cloaking, all ships will be visible.
I can then use that derived value to help determine how close the two ships are to each other when combat starts, modified by certain things which I haven't fully fleshed out yet.
Lots of progress has been made in March. I'm looking forward to seeing what I can get done in April.
I bring this up because I began the process of adding ship vs. ship combat in the game today. It's still got a very long way to go, but you can click on an enemy ship now and bring up the combat screen, even though it doesn't do anything right now except check that the two ships are in the same location and don't belong to the same player. I'm trying to build the distrust of the data passed to the screen in from the very beginning this time.
So after I got that basic setup done, I went back and started adding a few things I'll need for combat, like ship signatures and sensor ratings. Basically, a ship's signature is calculated by CLASS + ARMOR - CLOAKING. So a new Class 0.1 ship would have a signature of 0.1. Cloaking can take this to a negative value, but new ships won't start with cloaking. So then if you take the signature value and add to it the Sensor value of the opposing ship, if that value is over 0.0 then the opposing ship can see you. So without some time of cloaking, all ships will be visible.
I can then use that derived value to help determine how close the two ships are to each other when combat starts, modified by certain things which I haven't fully fleshed out yet.
Lots of progress has been made in March. I'm looking forward to seeing what I can get done in April.
Subscribe to:
Posts (Atom)

