Creating a computer-aided version of WCTO

Okay, the first 1/4 of the combat phase engine is coded. It theoretically now handles standard and missile weapon fire. this is untestable until I build the matching parts of the combat pre-engine to allow us to submit orders in. That will be the next phase, before I move on to the Cap-ship weapons (which are, once again, an exception). The code as-written currently assumes all targets given to weapons are valid (i.e. I could shoot across the map), but the pre-engine should limit the possible submissions to the valid ones only. My biggest surprise when coding the movement engine was the pre-engine. It took more than 60% of the coding time on its own; this will be just as true for the combat pre-engine. We've got a ways to go before this phase is done, or even testable!
 
Sounds like a lot of work indeed... And I heard that QuailPilot would like to play TacOps during the upcoming chat event on September 18. :p
On a more serious note, do you think it would be possible to include a "ghost marker" of a ship's position in the last turn for the current alpha? Would make life a lot easier when checking ship movement, I guess. Currently you have to take a screenshot or switch back and forth between turns to see if ships did what you ordered them to do. If that would be holding you up too much, though, I'd rather stick to it.
 
Unfortunately, with the current coding method, there is no direct correlation between one turn and the next; the game doesn't know which icons represent the same ship across multiple turns. I suppose I could do it by doing a check against the ship->name variable, but that would force every ship to have a unique callsign. (This doesn't seem to me to be a significant limitation, but right now, you can still have multiple 'Bravo 2' ships if you wanted in the same game).

As far as development goes, it is too much of a detour off the work I'm currently doing to make ghost icons for the moment; I can look into them once I pull my head out of the current combat engine work. Missiles launching is almost ready to go (although remember that the actual missile attack calculations are an end_phase_engine issue).

Right now, I'm working on the combat_preengine, which is what creates the order pop-up box. It is about 25% done. My biggest problem that I can forsee is going to be flak cannons. The actual firing is easy, but the user-input method is a pain; ideally we want it to be a click-interface to target a cell, but in practice, that's a whole new module to build. Alternatively we can do it by coordinate entry until I have time to enter that module, but that means I need to relay the coordinate system through a transparent overview to the commander; another new piece of code.

Chances are this will go a lot like it did with the movement engine, in that I'll release the code to let you fire missiles and guns on regular ships, and then after a few days, update it to work with the flak cannons.

The Anti-Matter guns and other heavy weaponry on cap ships are just regular guns with multi-turn charging. The plan, right now, is just to have them constantly try to charge up, and then be fireable when fully charged. That's relatively trivial to code. If you want the command to need to issue a 'start charging' command, I can put that in too, but it seems unnecessary.

Also, right now, we're pretty much married to the orders-on-a-popup-window system, but I've started to visualize a better user interface which involves tabs that slide out from the right side of the screen (or left?). I won't even begin to code that until after I get the whole game working with the current plan, though.
 
New Question:

For the purposes of firing an HS missile, what is considered 'behind' the target? I know the target must be within 120deg arc in front of you, but from the target's point of view, can you be anywhere in the rear 180deg? The rear centered 120deg?
 
I'll answer your missile question first: You have to be in the target's 120° rear arc. So as a rule of thumb: If a target can hit you with its aft turret, you can fire an HS missile at it. ;)

Don't worry about ghost ships, then. It's only relevant for debugging, anyway... However, you could implement a "tracking" function which logs every ship's current coordinates and heading in each turn. That way, we might be able to generate animated replays of the battle. Again, somewhere down the line... ;)

Now for the "fun" part - flak cannons. Two ideas came to my mind when I read your thoughts. I'll start with the clunkier solution, followed by what I'd like better. (You'll have to judge whether any of it is feasible at all.)

a) When ordering a flak cannon to fire, four buttons (left, right, up, down) and possibly two textfields (X coord, Y coord) pop up instead of the "target selector" drop-down menu. It's probably best to show a flak marker on top of your own ship. You could then enter any coordinates or click on the buttons until the flak symbol appears where you want it. (Since the flak range is currently 10 hexes, you'd have coordinates of -10 to 10, with the firing ship centered.) As soon as you click on "Fire," you're set.

b) Instead of buttons and textfields, the firing order window closes, and the targetable hexes around your ship get illuminated (e.g. half-transparent layer in green). If you click on one of the illuminated hexes, this is where your flak fire will go (as soon as you click "Fire" in the reappearing window). If you click outside of the flak's range, you'll just get back to the orders window without the opportunity to fire. (I guess that's along the lines of what you had in mind with the new module...)

Since ships usually tend to have more than one flak cannon, both solutions can become a chore, though...

Oh, and yes - no "start charging" command for capship guns needed. :)
 
Your two concepts for flak firing are more or less what I was thinking; I really like concept 2) as well, but that will involve developing a click interface (and an overlay for highlighting), two things I want to do anyway, but was hoping to push off in a post-release update.

Firing multiple times won't be bad; that's just a loop.
 
To be honest, I think no one would mind if the first release just included fighter combat and no capships at all. Which would be an easy way to postpone the flak issue altogether. ;)
Just saying...
 
hmm... Yes, I could just stop supporting cap ships for the time being... although while I'm deep in the code it is a good time for me to do the work instead of re-learning what I wrote in a month or two.

I'll think on it. The flak cannon is the biggest issue; I might just go without it for now... (The other two cap ship weapons are fairly straight forward, just have multi-turn charging, which I've already dealt with when I had to develop multi-turn missile locks).

I was hoping to release a 'v1.0RC' as my first "full" game, but maybe I'll just have to make the first playable version the 0.8 or something, and call it a beta.

Also, it is currently no longer in my scope to develop the campaign editor before I release the game. This means that, for the short term, only I will be able to make *new* games, and I'll do so by manually editing the database. The actual 'new game' editor won't be too bad, but it is just an entirely unrelated piece of code. Actually, for that matter, any coders out there that want to work on it in parallel are welcome to. The only info they need is all the database formats, and I can supply those. None of the other coding I've done so far would be influenced by its development, and it doesn't even need to be in the same language as the main game; it just has to play nice with mysql.

I'm now about 60% done the combat pre-engine. I hope to get it done by the weekend, along with the combat order submitter, meaning we could test combat by then! (although we'll be dropping static missiles for now, as pretty icons that won't go anywhere until the end-phase engine is built)
 
combat pre-engine is now in the debugging stage. I have to build the order-submitter, and once that is done, we can start combat debugging.

At the moment, the movement alpha demo is toast, as the combat updates are blocking everything. (For project contributors, I haven't committed any of this yet, since it isn't stable).
 
Hit some real life business, which has slowed down development.

I am still having trouble with the combat pre-engine, but I realized most of my problems were because I forgot to code the `no valid target`scenario. Going to fix that for both missiles and weapons, then forcefully line up the ships for combat.
 
Hit some real life business, which has slowed down development.
Yes, real life tends to have a bad habit of interfering with these things... ;)
My summer break's almost over now, and I have to rehearse more these days, but I'm really looking forward to test the combat alpha whenever it's ready! :)
 
Ruling question:

Do we want FF`s to lock onto Phase-shield protected ships that are viewed as 'Enemy' to the missile?
 
Very good question... I'm not sure if I ever saw an FF missile lock on a target with phase shields, but I think you could fire them at transports. Hm. I'll try this out in Academy later today, just to be sure...
 
Well, according to Wing Commander Academy (the game, not the animated series), FF missiles DO lock onto capital targets. I fired one and it turned right towards the next Ralatha... Of course, it didn't do any damage, but this means that enemy ships with phase shielding (or friendlies with a damaged IFF transponder) can act as decoys to FF missiles chasing you. :p
 
Great; makes my life easier (since that involves no code change)! That's about what I'd have expected, anyway.

I think I've resolved all the 'you have no valid target' problems, and now I just need to line up some ships and start firing.

Also, it is now official that whatever I release is going to end up being a verison 0.7 or 0.8 instead of a 1.0. The following list of features are the minimum that are being dropped until a later revision:
  • friendly fire
  • game will ignore if you try to fire at targets past line-of-sight items
  • the flak cannon (and flak)
  • environmental objects (no asteroids for now)
  • cap ships will not block line-of-sight
  • tailing results (you will be able to declare tail, and see if you rolled correctly, but I won't implement the actual intel reporting)
  • Ship overlapping selection resolution
  • Non-browser back-foward navigation controls for turns and phases.
  • Cleaner/clearer "report" messages (they will remain dumped at the top for now, and I'll add their div/css later)

That should still make this a very playable fighter-combat game even at the v0.7 or so. Those things aren't particularly hard to do (except the flak gun's firing mechanism) just in the way of faster development. The flak itself is easy to do, it is only the firing that worries me.


Keep in mind I have to first finish and debug the combat engine, and THEN do the end-phase engine's 3 parts. Mind you, a lot less happens in the end-phase engine, but I will have to handle all the missile flight stuff.

My current estimate on release at this rate of progress is about 3 weeks to accomplish everything else, without more help.
 
And so through the power vested in me by being the game coder, I hereby decree that the ferret is in fact beside the rapier.

And it was so.

And much weapon testing began.

edit:
ugh. apparently they can't see each other as they both believe there are no nearby targets. This may take a while.
 
Okay, fixed bugs with ranging, completely re-wrote bearing calculation. I originally borrowed the bearing calculation off the 'net, and it was this horribly long, ugly set of case statements that only worked on discrete sets. It also didn't work very well, and wasn't adaptable to my rotated coordinates. Then I remembered I'm an engineer by trade, and that I should have laughed at it weeks ago. Re-wrote it in 3 lines using atan2, and solved a number of problems.

Now we're back to debugging the pre-engine (instead of the combat support functions) meaning it is back to the slower-to-fix javascript/jquery bugs... but we're close! Ships are correctly aknowledging they have targets, but I'm not getting their target lists to show (but I think the lists are generating).
 
Ah. I knew trigonometry would be useful for something. (:

(I actually enjoyed high school maths, I found it objective and quite easy compared to something subjective like English.)
 
So, I'm making good progress again.

After more debugging, looks like weapon ranging/bearing and targetting is now working (based on a sample size of 1). Missile targets also appear to be generating correctly, but I've got a jquery typo somewhere preventing them from appearing; should be easy to fix.

Once that works, I need only quickly build the order submission parser, and we can finally do tests of the actual combat_phase_engine (which takes the -- theoretically correct -- orders and processes them).

This is the phase where you guys will be able to help, as we fly ships around and fire them. Note, though, that we'll be dropping missile icons that won't fly yet, since that needs the end-phase stuff.

Also, as soon as I get the combat order submission script working, I'll be committing everything, including whatever bugs it may contain, so if you're waiting on me for that, it'll come soon.

I'll keep everyone posted here.
 
Back
Top