Progress update 2019-10-19:
Well, maintenance breakdowns and other things were next on my list but I decided to heck with that, that's no fun, let's play with lasers!! Q4X now officially has combat!*
*Limited to Turreted Lasers. Spinal mounts and ship mounts are still todo, as well as missiles and all other weapon types. But with the exception of missiles, all these other things are just easy variations on code that is now in place!
Here's a sample of the event log zipping by while this is happening:
And an event log sample that's holding still:
Just for reference, the combat overview at the beginning:
And a 'No Interrupts' checkbox that I added a few updates ago but forgot to highlight. It's useful for making these animated gifs, and will be good to have later on when watching the AIs battle each other in extended fights:
Latest build has been pushed. Here's what was implemented:
- Shield Recharging
- EM Sensors detect shields
- Alien shield strength intel
- Ship to ship laser combat
fire weapons according to target and fire control assignments when in range
check for sufficient power
chance to hit calculations
damage amount calculations
apply damage
event logging
update political modifiers
nearby ships detect weapon impacts
record power spent
- Show Weapon Impacts on system map and in contact lists
- Energy weapons recharge
- Damaged weapons stop recharging and are removed from fire control
- Damaged power plants cause reduced weapon recharge rates
- Shorten sub pulse length when necessary to allow weapons to fire asap
A few more of the remaining unfinished UI bits are now functional:
- Technology Report > Lasers
- Combat Overview > Assign Contact as Target section > contact list, Assign button, Clear, and Clear Fleet
- Combat Overview > Show Hostile Contacts Only checkbox, Open Fire, Cease Fire, Fleet Open Fire, and Fleet Cease Fire
- System Map (F3) > Contacts tab: Show/Hide Active IDs checkbox
A4X Bugs dodged:
- contacts disappear after restarting the game and are all rediscovered after the next tick
- a couple incorrect values displayed for shields in the game logs
There's obviously a lot still left to do in combat, not just adding the rest of the weapon types but implementing more of the combat configs like sync fire, auto fire, copying various settings around and so on. But! Enough is done now that combat should be fully possible using just lasers and shields. I haven't yet decided what to work on next, so you'll just have to stay tuned. I'm going to take another day or two of a break, then, onward!