• There seems to be an uptick in Political comments in recent months. Those of us who are long time members of the site know that Political and Religious content has been banned for years. Nothing has changed. Please leave all political and religious comments out of the forums.

    If you recently joined the forums you were not presented with this restriction in the terms of service. This was due to a conversion error when we went from vBulletin to Xenforo. We have updated our terms of service to reflect these corrections.

    Please note any post refering to a politician will be considered political even if it is intended to be humor. Our experience is these topics have a way of dividing the forums and causing deep resentment among members. It is a poison to the community. We appreciate compliance with the rules.

    The Staff of SOH

  • Server side Maintenance is done. We still have an update to the forum software to run but that one will have to wait for a better time.

DCG + QBasic

Ettico

Charter Member
Some of you may have noticed the conversation I was having earlier with Pen32win. I've been working on a QBasic program intended to kick up Lowengrin's Dynamic Campaign Generator a couple of notches by editing the DCG "Mission" file after a mission is generated. As far as I can tell, the program is now successfully performing the following tasks:

1. changes fighter formations from echelon left to finger four, which is more realistic and appears to greatly reduce collisions.

2. spreads bomber formations vertically, greatly reducing collisions.

3. changes mechanized ground formations to column formations so they will stay on the roads and railroad tracks.

4. allows the player to quickly and easily change the payloads of every plane in the player formation.

5. re-assigns spare CAP's as escorts when strike missions originate from their airfields or carriers, thereby better protecting bombers and facilitating long range strategic bombing missions. Both bombers and fighter strikes will get escorts when spare CAP's are available. When no targets are within fighter range but long range bombers are present at an airfield, all the fighters, including the player squadron, will accompany the bombers as escorts/fighter sweeps, excepting one fighter squadron, which will CAP the airfield.

6. finds and fixes two DCG bugs.

The program is very BETA at the moment. I haven't had time to test it in different kinds of campaigns and situations yet. I flew a test mission in Europe as soon as I got the program working right. It was a long range strategic boming scenario, focused on the Hamburg area, flying out of Bodney. At Bodney were 5 squadrons of B-24's and 6 squadrons of P-51's. 6 squadrons of 190's and 109's were defending. The primary targets were the Salsbergen refinery, the Harburg refinery, and the Kiel shipyard. Two airfields were secondary targets. All the German targets and airfields were out of DCG fighter range. Here's what happened:

At mission start, 5 squadrons of B-24's were airborne over Bodney, lined up abreast, south to north. 2000 feet above each bomber squadron was a squadron of P-51's, including the player squadron. All 10 squadrons began lumbering toward Hamburg. There was one collision between 2 fighters just after mission start, but that was the only collision in the mission. I noticed the fighters couldn't fly slow enough to stay with the bombers, so I warped through the first 2 waypoints to keep the strike together. I arrived at the marshalling point, 15 miles west of the Harburg refinery. 3 squadrons of B-24's bombed the refinery without opposition except for heavy flak. One B-24 shot down another B-24 for some crazy reason. I took a flak hit which seemed to knock out my radio. I couldn't communicate with my flight. Then a squadron of 190's appeared. They didn't seem much interested in attacking the retreating bombers. 2 of the 190's made a half-hearted lunge toward the big flock of bombers, then turned away. I tried to engage my flight, but couldn't communicate. I engaged one of the 190's. Before long I noticed my flight had mysteriously disappeared, leaving me alone against 2 190's, both apparently aces. When I would get on one's tail, the other would get on my tail and start shooting. I traded shots with them, giving and taking damage, then decided the better part of valor was to book. The 190's didn't chase me very far. as I neared Salsbergen I saw a squadron of 109's in the distance, but they soon disappeared. I hit the "B" key, got a vector for home, and warped.

It wasn't the most exciting mission I've ever flown, but escort missions aren't supposed to be all that exciting. The Germans had several targets to defend, which probably explains the lone squadron of 190's. I don't know why the 190's weren't more agressive. They were agressive as hell in the other campaign I tested which was focused on western France and Belgium. They may have been low on fuel.

Mission results: some of the Harburg refinery got knocked out. 2 P-51's and 1 B-24 were lost, all as a result of mishaps. Basically a milk run.

But the point is, this has never happened before in the history of CFS2. There has never been a DCG-generated escorted strategic bombing raid into Germany. Never happened. Never could have happened until now.

Well, OK...some guy may have hand-edited a DCG mission file to make it happen. But it's never happened without hand-editing before. I clicked two buttons.:d
 
Don't try this at home, kids. If you set up a DCG campaign so that all the targets are out of fighter range, the fighters will attack their own airfields(!) and the player squadron will be assigned a CAP, presumably to observe the ridiculous proceedings. My program fixes that. Reassigns the stupid fighters as escorts/ sweeps and takes their loads off.

P.S. DCG limits fighters to a 200 nm radius in the ETO for some unknown reason. Now they can go deep.

P.P.S changed the program to put drop tanks on all re-assigned escorts and also all the defending CAP's. Flew a second test mission. This time my squadron stayed with me. We shot down 3 190's. The German fighters were considerably more hostile too. One of my squad was shot down.
 
He kept out-turning me and making head-on gun runs. Couldn't get a screenie of the head-on passes. Happened too quickly, and I was too busy dodging bullets.
 
And I high-tailed it in my pretty P-51c Malcolm hood with the pretty 354th markings, still in one piece. I was low, slow, and sluggish when the ref stepped in.
 
Forgot to mention - there were no collisions in this mission.:d

I think I messed up these two test missions by warping to the second waypoint. I still had 187 miles to go from the first waypoint, and didn't have the patience to fly it out. Ended up 15 miles from the target, and caught the German defenders flat-footed, out of position to intercept. By the time some of them got there, the bombers and their escorts were headed home.
 
"I noticed the fighters couldn't fly slow enough to stay with the bombers, so I warped through the first 2 waypoints to keep the strike together. "

Just one Word - Altitude - In CFS2 AI's at 200Knts at 4000' is not the same as 6000'. Take the A/C of your choice and create two AI formations. Set two WP's 20 miles apart. Set the speed for both formations the same but make one formation 2000' higher. Spawn both formations at the same time and trigger a sound or a message when each flight reaches the 2nd WP. The higher formation will always win.

Posting as I'm reading E...
 
"I noticed the fighters couldn't fly slow enough to stay with the bombers, so I warped through the first 2 waypoints to keep the strike together. "

Just one Word - Altitude - In CFS2 AI's at 200Knts at 4000' is not the same as 6000'. Take the A/C of your choice and create two AI formations. Set two WP's 20 miles apart. Set the speed for both formations the same but make one formation 2000' higher. Spawn both formations at the same time and trigger a sound or a message when each flight reaches the 2nd WP. The higher formation will always win.

Posting as I'm reading E...
Hi Pen,

I can change the cruising speeds in the escorts' waypoint paths. It won't be easy. Nothing has been so far. I just need to figure out how much to slow them down.

I don't think I care much if the fighters sweep ahead of the bombers. They'll get to the target areas first and should engage any defenders. But I'll go ahead and try to get them to stay with the bombers.
 
I am having the same problem you are with my Cactus campain.The fighters out run the bombers everytime even though they are set at the same speed.The reason I don`t use the escort command is because if the lead bomber for the flight that the fighters are assigned to protect is shot down the escort fighters are going to continue to orbet the area where said bomber was lost.This is kind of a nutty idea but what if someone made an invisable bomber with guns that didn`t fire and had a DP that couldn`t be damaged.You could place the invisiable bomber in the center of the bomber box, that way if one of the visiable lead bombers was shot down the friendly fighters would continue to follow the box insted of orbet the area where the lead bomber that it was attached to was shot down.:d
 
Here's the really nasty part of this deal. If you warp they will move along their assigned route at the same speed regardless of altitude, if you/they fly it the difference in altitude will show up in the speed at which they fly... I ran into this when building the Midway mission and trying to pace AI SBD's at 18,000'. The formation was AI led and even though they were set to fly at 140knts they were going going something like 180knts at altitude. It really made things rough when you came out of warp. You'd come out of warp at the correct speed and the AI's would take off like a Bat out of Hades.

I don't know what to do about it because different A/C and different altitudes have different effects....????
 
Thanx for the input, guys.

Hey, bob. Nothing is nutty if it works. You should try your idea out. If it works, you'll end up with the best escorts in the business.:d Hey, I've even gone so far as to create an invisible aircraft carrier to serve as a rendezvous point in enemy territory - just a starting point that's in range of a target. It worked, but it wasn't a very realistic fix.

You hit the nail on the head, Pen. They move at different speeds when warping than they do when flying. I hadn't thought of it, but the indicated airspeed would vary by altitude. At a given ground speed, indicated speed would be progressively slower as altitude increases. So if they're using indicated airspeed, they think they're going slower than they really are.

It is possible to change the horizontal coordinates instead of the altitude. But it is very tricky to write code to work with DMS coordinates within a program. You have to extract them, convert them to numbers, do the correct math, convert them back to DMS text format, and put them back in - all without a hitch, and no way to go wrong. Just about everything you do is ten times trickier to do with a program than it is to do manually. The difference is, the program can do it a million times faster.

I've already painted myself into several corners while constructing this program. So far I've managed to find a way out. If I had known when I started what I was going to run into I would have done the program differently. But now that it's done, anything that works stays put, no matter how clumsy it is.:d I know the thing is doing a lot of unnecessary repetitive stuff, but as long as it grinds to a proper conclusion, it doesn't matter. It's fast anyway.

I think I'll try the easy way out first. I'll try setting the escorts as nearly as possible to the same altitude as the bombers without risking collisions, and see how that works. I like the basic idea of having fighter sweeps double as escorts. Bob, you mentioned the problem with escorts. It's just a matter of keeping them all together.

I have a couple of other tinkering things I want to do, like changing the code to allow the player squadron to ground start when it's been re-assigned to escort duty. That should be simple enough. Just leave waypoint.0 in. Come to think of it, there may be no particular reason to change waypoint.0 for any of the re-assigned escorts. Making them catch up to the bombers will slow them down a bit. On the other hand, they'll be moving faster between waypoint o and waypoint 1. I'll try it and see how it works.
 
Problems solved

:d

I gave in and wrote some more code to make the re-assigned fighters true escorts instead of fighter sweeps masquerading as escorts. I also corrected a mistake I made. The program now leaves the fighters' waypoint 0 as is. IOW, they now start where DCG puts them instead of 2000 feet above the bombers. So, if you have ground start selected and your squad gets re-assigned to escort duty, you still ground start.

It was another grim struggle between me and the code, but it worked. I have the test mission on pause right now, and I've verified that the re-assigned fighters know they're escorts and act accordingly. They attach at waypoint 1. Since I left the DCG waypoint 0 intact, they fly considerably faster than the bombers between waypoints 0 and 1 and get way out ahead of them. However, they turn around and come back like good little escorts, and attach dutifully.

Again, no collisions despite the large numbers of planes. I have to say it was a beautiful sight to watch the big ( DCG ) escorted strike form up smoothly at waypoint 1 and head for Hamburg, after all the work I put in on this, not knowing for certain if I'd ever get it right.

The code might suck in the esthetic sense. I'm not a real programmer, so I don't really know. But it works. that's what counts.:d

But it's not finished. I've yet to tackle the really hard part. Somehow, I have to produce code to re-write the mission briefing. I already know it's going to be a B***h, and I'm not sure it's even within my capability. I may have to fudge it some. The program tells me everything I need to know when it runs. It prints some cryptic info on all the squadrons - their directives, airfield ID's, formation ID's, and a couple of other numbers that only mean something to me.
 
You Da' Man E!

Not a real programmer? Maybe not on paper but function is what really counts in the end. We Horse folks have an old saying. You Can't Ride Papers. :ernae:
 
You Da' Man E!

Not a real programmer? Maybe not on paper but function is what really counts in the end. We Horse folks have an old saying. You Can't Ride Papers. :ernae:

Thanks, Pen. I have a feeling you DCG guys will like this. DCG works well enough for carrier ops, but strategic bombing is now within it's reach. The addition of AI escorts is a game changer in any type of campaign as far as DCG goes, and there was only one collision reported in this mission, which involved close quarters maneuvering and fighting among 13 squadrons of planes. The test mission went really well. I didn't warp to waypoint 2 this time, and the Germans were up in force. As 3 squadrons of them approached the bombers, the escorts engaged and a huge dogfight erupted. I didn't participate this time. I was tired and wanted to observe anyhow. The bombers did not escape unblemished. Several of them were shot down. I guess you'd call the bomber losses moderate. But they would have been slaughtered if the escorts hadn't been there.

The campaign I'm using for testing is specially designed for long range bombing. All the targets are out of DCG fighter range, and all the attackers are at one airfield. The fighters have nothing to do but attack their own airfield:confused: The bombers have nothing to do but attack the small selection of targets available. The primary targets have multiple location markers on them to exert more pull on the bombers. Typically you get 3 squadrons of bombers hitting a primary target with a couple of squads hitting secondary targets. My program looks for and detects the fact that the fighters are assigned to use their own airfield for target practice, and promptly disarms them and re-assigns them as escorts.:d

In a normal campaign with targets in fighter range, many of the fighters will get legitimate strike missions, so fewer of them will be available for escorts. However, long range escorted strikes can still happen. But you won't get big focused strikes.

So, in the ETO, we can have several focused campaigns for hitting deep targets, and a diffuse campaign or two for areas within fighter strike range - including a ground support campaign for post D-day action. Each campaign can have it's own set of infrastrucure and defending fighter groups. The player can hop around from one mini-campaign to another and get plenty of variety and see all the scenery. And the campaigns won't produce the same mission twice.

I also plan to have truck convoys and trains running, and some armor and mech moving around on the roads.

After I get some mini-campaigns put together, my plan is to do some campaign-management code to meld all the mini-campaigns into one big one.

And anyone else can do whatever they want with my program. QBasic is very open-source. QBasic doesn't hide the code, but keeps it in view on the screen, available for editing. After I do some more testing and tinkering, I'll post the code here for beta testing. The code can be copied and pasted into a notebook file with a xxx.BAS extension, and QBasic can load and run it. You hit the "run" button once after you generate a DCG mission. That's all there is to it. The QBasic program is freeware. It's a small download. I think I got my copy from Microsoft support.

There's only one problem with all this. I know how I am. After I've finished writing some code and haven't fooled with it for a while, I completely forget how it works. In fact, I'm lucky if I can remember how it works from day to day. So I may not be of much use to people asking questions about how it works and why. I'll forget the "how", and the "why" is usually because that's the only way I could think of to make it work after repeatedly painting myself into various corners. It's kind of like Darwinian evolution. I just keep trying stuff until something works. :d
 
In addition, you can dedicate some of your fighters for escort duty by taking the strike loadouts out of their DP's. Without strike loadouts, these fighters will always be assigned as CAP's, and my program will re-assign them as escorts when they are stationed at an airfield with bombers.
 
I've been laboriously working on the mission briefing problem. :isadizzy:
As predicted, I fudged. I'm leaving the original DCG mission briefing in and having my program screen print a cryptic briefing of sorts after it makes its' changes. That's OK, because the DCG mission briefing does provide some useful info on the strike missions. My program never changes the strike missions.

It's almost done. I just need to solve the riddle of getting the squadron names and hopefully the target names into the briefing. Currently the altered mission briefing is just giving the mission directives (in plain English) and the target coordinates. Then I need to put the "change player squadron payloads" option after the mission briefing printout so the player will know what the mission is before changing payloads.
 
Back
Top