Laserbrain Studios

Games Forum Blog Contact

Author Topic: Ascii Sector Development Updates  (Read 30750 times)

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Ascii Sector Development Updates
« on: June 29, 2010, 11:31:18 PM »
Below is a list of the stuff I want to implement for the 0.7.x versions of the game. This list will be updated and changed as development progresses.


Fleets:

- Each faction has persistent fleets (a group of ships), except merchants and bounty hunters.

- Factions can take control of systems by having a fleet in that system (and no other faction has a fleet there).

- Randomly generated ships in a system is partly based on the faction controlling it.

- Abstraction algorithms to determine outcomes of fleet battles (when the player isn't present at the battle).

- Information about faction control of systems in the player's Quine, as well as news updates when fleets clash and systems change hands.

- If pirates, retros or Kilrathi control a system, production on all planets and bases in that system will drop considerably.

- Procedures for a fleet returning to a base and getting destroyed ships replaced (and damaged ships repaired) after it has won a battle.

- AI for controlling fleets and making strategic choices.

- Fleets in your system should show up in the nav computer and you should be able to select them as a destination for the autopilot.


Stuff before persistent ships:

- Fix AI issue when a ship's path is blocked by another ship and they're flying in approximately the same direction.

- Fix AI issue with an enemy ship that has a damaged maneuvering jets and therefore just circles the player at high speed instead of slowing down in order to point at the player.

- Shots fired from rear turrets should have their range decrease the faster the ship is moving. Likewise, shots fired from front guns should have their range increase the faster the ship is moving. This is so that when ships are chasing another ship with a rear turret, the chased ship's rear gun won't have a longer relative range due to the movement of the ships.

- If an enemy ship has "run off" once, the chance of it doing it again should be very small (to stop the AI from sometimes annoyingly continue to run off until its shields have recharged, then return for a single attack or two).

- Commodity event balancing: When simulating commodity sales, take commodity events in same and adjacent systems into account (i.e. decrease amounts of commodities in systems at and adjacent to a commodity event).

- If a Confed/Milita ship is under attack, it shouldn't start scanning the player for contraband.

- Not completely full Ultimate and Brilliance canisters should be able to be combined like ammunition.

- Add a check when you start a conversation with a fixer so that he'll tell you if his mission has expired (instead of the player being able to accept already expired fixer missions).

- For transport/deliver cargo missions to ships, you shouldn't transport more cargo than the target ship can carry.

- Shouldn't be able to transfer captives to the casino ship.

- Five new systems.

- One of the new systems will be the sector's capital planet, where the player will be able to pay off fines.


Persistent ships:

- Storing information about persistent ships across systems and scenes (quest ships, wingman, bounty hunter nemesis).

- Controlling persistent ships in other systems and moving them throughout systems.

- Bounty hunter nemesis sent to kill the player if fines are high and haven't been paid in time.


Remaining stuff:

- Be able to purchase a temporary ID hack that will change your ship's faction (if you for example need to move through a pirate controlled system).

- NPCs should be able to throw grenades.

- NPCs should move away from grenades thrown at them.

- Different AI tactics for character combat instead of all hostiles always just rushing towards you.

- Be able to ask friendly ships to not attack your target (if you for example need it alive for a bounty mission).

- If you're being scanned and attempt to land or jump, a message box will tell you that you'll be fined and ask for confirmation.

- 'L'ook should list things on the ground as well as names (ship types) of landed ships.

- For "intercept cargo" fixer missions, you should be able to board the target and transfer the cargo as well.

- New character combat weapons. Some with poison effects.

- Medkits!
« Last Edit: February 01, 2015, 08:37:55 PM by Christian Knudsen »

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #1 on: July 05, 2010, 12:55:04 PM »
Retros and militia will most likely switch faction colors in v0.7.

I've played around with displaying the faction control of systems on the quadrant map. This has required me to change up the colors of the map a bit. A confed controlled system is dark blue, pirate controlled red, Kilrathi controlled yellow, and retro controlled purple (and player controlled will be green, but that won't be added until v0.9). The white color for retros didn't work very well as it was hard to distinguish from the gray of systems not controlled by any faction. The player's current system and route is now in light blue, as the yellow color belongs to the Kilrathi.



If a system is disputed, its marker will blink in the colors of the warring factions.

(Cheops controlled by retros and Halfway controlled by Kilrathi in the picture are just examples. They won't initially be controlled by those factions in v0.7.)

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #2 on: July 12, 2010, 10:12:35 PM »
I've completed the basic framework for fleets: placing them when entering a system and storing information about them when exiting. I had a weird bug with fleet ships not firing their turrets, and it took a long time before I figured out that it was because their experience and morale wasn't set.

I'll be doing the placement of the initial fleets next. These are the fleets that are hardcoded into the game and will be the same whenever you start a new game. What happens to them and what new fleets get built to replace destroyed fleets will be somewhat random. There probably won't be all that many fleet confrontations in v0.7, as fleets will pretty much stick to their initial systems, probably just moving to an adjacent uncontrolled system or if an initially controlled system gets taken over by another faction. It won't be until halfway through the main storyline (when the player gets the chance to buy his own base and start building up a fleet) that the factions and fleets will start working to take over the entire sector.

Another thing that's popped up that I'll likely do for v0.7 is improving the ship AI. I don't want the player being able to destroy a fleet on his own, so the AI needs to get better. One thing that I'll probably add is AIs not always firing directly at the target ship, but taking the target ship's velocity and direction into account. It should be a fairly simple calculation.

But I'm still working on fleets for now... :)

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #3 on: July 17, 2010, 02:15:32 PM »
Here's a movie of an encounter with a Confed fleet moving from one nav point to another in the New Beijing system:

fleet.zip (0.4 MB)

I've made it so that fleets will ignore single hostile ships unless they attack them or are part of another fleet. Fleets will only attack other fleets (unless provoked). This means that you'll still be able to land at pirate bases, for example, as any pirate fleets won't attack you unless you attack them. The randomly generated pirate ships will still attack you, so it'll probably be pretty much as hard/easy as it is now.

When that fleet in the movie turns hostile on me, it also becomes pretty clear that the AI really needs improving. And friendly missiles shouldn't hit you (I think 5-6 AI ships are taken out by friendly missiles without me doing a thing!). Maybe friendly gunshots shouldn't hit either. That'd definitely make it easier for a group of ships to engage a single target, as they wouldn't have to worry about friendly fire.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #4 on: July 26, 2010, 04:33:59 PM »
Today I completed most work on assigning orders to fleets and having the fleets carry them out. I had a Confed fleet in Loye system that I gave the order (in the code -- you won't be able to order around Confed fleets in the game, of course) to go attack a Pirate fleet in TC-101. I followed the Confed fleet as it navigated to the jump point to Vortex Prime, jumped through (one ship at a time, but as soon as the first ship has jumped through, you can jump to the next system and the entire fleet will already be through), then navigated to the jump point to TC-101 and jumped through, and on the other side navigated to the Pirate fleet, engaged it when close enough and wiped it out.

This should have resulted in TC-101 becoming Confed controlled, but I haven't added that yet. It should be pretty easy, though. I'll just run a check whenever a fleet ship is destroyed; if it's the last ship in its fleet, I'll check if there's another fleet in the system and change the system control if necessary... and then have a news item in the player's Quine informing him that the system has changed control (I'll probably also have a news item about the Confed fleet entering the Pirate controlled system, so you'll know that something is going to happen and can decide to go have a watch/help out if you want).

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #5 on: August 03, 2010, 06:00:35 PM »
I've got the news entries for fleet events pretty much working now:



There's a minor issue with a fleet engagement news entry being posted twice -- once for each faction in the battle -- but that should be easy to fix. Systems now also change control correctly when the fleets move around and destroy each other. The system faction control still doesn't have any effect on the randomly spawned ships or the production of bases, though, as I haven't programmed that in yet.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #6 on: August 05, 2010, 12:30:57 PM »
I managed to make fleets automatically rearrange themselves if one of their leading ships gets destroyed today. It was a bit of a hassle, but I finally just got it working. Fleets are made up of a hierarchy of ships, with the first ship not escorting anybody, but carrying out the fleet's order, and then every other ship in the fleet escorting/following either the first ship or one of the other escorting ships. The problem was that if one of the leading ships (a ship that has escortees) was destroyed, the escorting ships would no longer follow the fleet's order as their "link" to the first ship was destroyed. So I had to make it so that another ship would take the place of the destroyed ship and give the escorting ships a new ship to follow. It sounds simple in theory, but it proved a lot harder to program than I thought.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #7 on: August 15, 2010, 12:54:05 PM »
With persistent fleets and ships that can move about in systems that you aren't in, some things are beginning to happen that the game wasn't designed with in mind. For example, ships will now be able to jump into a system you're in, not just jump out of it. This presents some extra design/coding challenges that I haven't initially thought of. How do I for example make sure that there isn't a ship inside the jump point about to jump out when another ship jumps in? The way I've done it with the wingman is that he'll only jump in when nobody's in the jump point. If you have a wingman, you'll notice that you can stay in the middle of the jump point as long as you want after having jumped to a new system. The moment you move out of it, your wingman will jump in. This has worked fine for your wingman, but it won't work for fleets. If a fleet won't jump in if there's a ship in the jump point, you'd be able to block enemy fleets from jumping in simply by sitting in the jump point. So, a ship in a jump point shouldn't be able to block a ship from jumping in. But how then to avoid a ship suddenly jumping in on top of you when you're about to jump out? Traffic lights! :D

I'm currently playing around with having colored traffic buoys around jump points. If it's green, you can use the jump point, but if it's yellow, another ship is about to jump in and you should clear the jump point. You'll get a fair bit of warning, so it'll be yellow for a while before turning red a few seconds before the other ship jumps in. A ship that hasn't cleared the jump point will either be destroyed or severly damaged when the other ship jumps in on top of it.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #8 on: August 18, 2010, 09:14:02 PM »
I've now got fleets moving about in systems that the player isn't currently in. I've also managed to implement fleets jumping into the system the player is in. Here's a movie showing me following a fleet part of the way to a jump point, but going on ahead, jumping into the other system, and then waiting for the fleet to jump into the system:

injump.zip (0.7 MB)

Unzip the file and place it in the "movies" folder of your game directory. The movie will also demonstrate the new traffic buoys around jump points and a fleet jumping in with a group of ships at a time.

Next, I'll probably start work on the abstraction algorithms of fleet battles in systems the player isn't present in.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #9 on: September 05, 2010, 08:45:51 PM »
The algorithms and procedures for assigning damage to fleet ships in a battle in a system the player isn't present in (or if the player isn't in space in that system) have now been implemented. I can now sit on a base while a fleet battle rages in space, and when I read in my Quine that the battle is over, I can launch into space and check out the damage inflicted upon the victorious fleet.

It still needs a bit of tweaking, though, as the battle results that these procedures result in don't exactly match those that happen when you're actually present at the battle and the ships really fight each other. Specifically, the most powerful fleet doesn't suffer quite as much damage through a calculated battle as through an actual battle. But it's working and it shouldn't be too difficult to get the results to match better.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #10 on: September 15, 2010, 11:31:44 AM »
I got the results of calculated battles to resemble actual battles a bit more. As I said in my previous post, the problem was that an overpowered fleet would wipe out an underpowered fleet during the first "round" of the calculated battle, which meant that the overpowered fleet would receive practically no damage and lose no ships. This didn't match what would happen when these fleets met in actual battle, where the overpowered fleet would actually receive some damage and lose some ships. I implemented a simple fix today (the simplest solution is often the hardest to think of!): For the first two "rounds" of the calculated battle, all fleets won't deal more damage than the lowest powered fleet does. This will allow for all fleets to receive some damage before the battle is over. I'll probably still have to tweak it a bit when I improve the AI, as that will likely change the outcomes of battles a bit, but that should only be a matter of changing a couple of numbers.

I've also changed how ship variables are stored in the code. Before, there could be a maximum of about 60 fighters and 20 capitals active at the same time, I think. That's much too small of a number when fleets will be flying around, so I've now increased that to 250 for both fighters and capitals and may have to increase it even further. This means that the procedures for controlling AIs and autopilot are really slow now, so I'll have to do some optimization for that. One thing I plan to do is divide the space map up into smaller squares and track which ships are in which square. That would mean that I wouldn't have to for example check a ship's proximity to all active ships but just the ships in the same map square, which should speed up the process a lot. I'm also currently storing the ships in dynamic arrays, which means that the memory usage is never higher than the number of active ships, but dynamic arrays are notoriously slower than static arrays (which on the other hand always take up the max amount of memory), so I'll probably switch to static arrays.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #11 on: September 18, 2010, 05:57:04 PM »
The randomly generated ships are now based on the faction controlling the system. This means that if the pirates decide to move their fleet from TC-101 to Vortex Prime (which won't have a Confed fleet in it at first), they'll take control of Vortex Prime and that system will be swarming with pirates the next time it's generated. That situation will also mean that all production of goods on Hooper's Hope will stop, as I've now made it so that when a system is "occupied" (meaning that it is controlled by a faction different from the faction it starts out with being controlled by) it'll no longer produce goods. Consumption of goods will continue though, so the stores will eventually be emptied. At some point the Confeds will of course launch a counter-offensive and hopefully take back the system and return production levels to normal. I may change it so that production won't halt entirely but just decrease considerably, but that's all for future balancing.

Next up is having fleets replenish and repair their destroyed and damaged ships after a battle. One way is to return the fleet to a faction base (retros and Kilrathi will also have bases at some point), but I also need to figure out a system that doesn't require a fleet to return to a faction base -- otherwise a faction that has lost control of all its bases will be unable to rebuild fleets and will effectively have lost.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #12 on: September 23, 2010, 10:23:18 PM »
Fleet repairs are now working. The way it currently works is that after each fleet battle has ended, the game will check how much damage and how many destroyed ships each remaining fleet has, and based on that and a random factor for some fleets it will be decided that they need repairs and their destroyed ships replaced. The fleet will then first check if there's a base belonging to its faction (i.e. naval bases for confeds and pirate bases for pirates) anywhere nearby. If not, it'll check for any base in a system its faction controls. And if it can't find that either, it'll just go to the nearest system it controls and do its own repairs. How fast the repairs happen is also determined by this: The fastest is at a faction base, then at a controlled base, and then just in a controlled system without a base.

Replacing destroyed ships is still not in and neither is rebuilding completely destroyed fleets, but that shouldn't be too hard to add now that I've got repairs working. For now, the fleet will just be motionless next to the base when it is being repaired, but for some future 0.7.x version, I'll probably add small repair ships that go from ship to ship to indicate which ships are being repaired.

Another thing I've noticed while testing this new stuff is that it can be quite a problem with fleets taking over systems as soon as they've destroyed all other fleets. At one point, I went to sleep in a hotel and when I woke up, the system had been taken over by pirates, so when I launched into space, it was swarming with pirates. That can be a problem. So what I'll probably do is have the system be "occupied" for a period of time before it becomes completely controlled by the new faction, giving the player ample time to leave the system before the hordes of pirates/retros/kilrathi start spawning.

Oh, and I think I encountered my longest variable reference name today:

Fleet[FleetNumber].Ship[Fleet[FleetNumber].Repairing].Damage[Fleet[FleetNumber].Ship[Fleet[FleetNumber].Repairing].Damages - 1].Value

I could clean it up, but I think I'll just leave it as is. :D

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #13 on: October 07, 2010, 11:16:03 AM »
Time for another update. This fleet stuff is taking longer than anticipated, mostly because of bugs that are hard to fix. I thought I had fleet repairs/rebuilds working, and repairing does works fine, but I'm currently trying to track down a problem that happens when the lead ship of the fleet gets rebuilt. The way it works is that if the lead ship (or actually any ship that has escorts) gets destroyed, another ship in the fleet will take its place. That part works fine. The problem is when the destroyed ship gets rebuilt, the ship that took its place should go back to its original position in the fleet hierarchy and all the ships that were escorting this ship should now escort the rebuilt lead ship instead. For some reason, when the lead ship gets rebuilt, this doesn't happen like it should and all the ships of the fleet go zooming off towards some undefined point in space. It's a bit of a puzzler. I'll run some more tests to see what orders and targets the ships are given to make them zoom off like that.

Beyond that, I got everything related to fleets, fleet battles and system control to save correctly. This should make it a bit easier for me to test stuff, since so far I had to generate the situations I'd want to test from scratch each and every time. Now I can just reload the save game with the situation and replay it until I've fixed whatever bugs there may be.

I've also made some optimizations to how NPC ships see and react to other ships. Previously, an NPC ship would cycle through all other active ships to check for new targets and imminent collisions and stuff, which was a pretty big waste. Now, the playing field is divided into smaller squares and each ship's position is tracked within these squares. So when an NPC ship has to check for imminent collisions, instead of cycling through all active ships, it just cycles through the ships in the adjacent squares. This has improved CPU usage quite a bit. Autopilot is still a bit too slow, though, but I believe that's because I'm still using a dynamic array for storing ships. I'll change that to a static array (which will use a lot more RAM, but be a lot faster) so hopefully the autopilot will run at an acceptable speed.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Development Updates
« Reply #14 on: October 09, 2010, 01:57:03 PM »
Finally figured out what was wrong with the fleet rebuilding stuff that caused the entire fleet to go zooming off into deep space. As is the case most of the time with these things, it was something different from what I thought it would be (which is why it took so long to find a pretty simple bug). The lead fleet ship was getting placed at some random spot in space because the code couldn't figure out which nav point the fleet was repairing/rebuilding at. I had just had the code cycle through the nav points in the system and check which one was within 8000m of the fleet, since the fleet will come to a stop somewhere around 6000m away from the nav point when going there for repairs and rebuilding. However, when you leave the system or land and then go back out into space, when the fleet is spawned, it's not spawned at the exact same spot it was saved at (this is on purpose). If I did this a couple of times, the fleet would no longer be within 8000m of the nav point, which is why the code couldn't figure out which nav point it was at and where to spawn the new ship. So, instead of having the code cycle through all nav points and check which one is within 8000m, I now just get the nav point by looking at the fleet's orders (which contain info about which system and nav point to go to for repairs). I'm glad it's fixed but also slightly annoyed that I spent a lot of time on a pretty simple and stupid bug. But that's programming in a nutshell, I guess...