Coder Diary #5 -- Code Merge Mission Accomplished!

John Tiller's Campaign Series exemplifies tactical war-gaming at its finest by bringing you the entire collection of TalonSoft's award-winning campaign series. Containing TalonSoft's West Front, East Front, and Rising Sun platoon-level combat series, as well as all of the official add-ons and expansion packs, the Matrix Edition allows players to dictate the events of World War II from the tumultuous beginning to its climatic conclusion. We are working together with original programmer John Tiller to bring you this updated edition.

Moderators: Jason Petho, Peter Fisla, asiaticus, dogovich

Post Reply
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

Coder Diary #5 -- Code Merge Mission Accomplished!

Post by berto »


Coder Diary #5 -- Code Merge Mission Accomplished!


[:D]

Image
ORIGINAL: berto

When I first got access to the Campaign Series code in early March, there were two separate codebases

[*]the inherited Campaign Series codebase
[*]the inherited Modern Wars codebase (a fork of the Campaign Series codebase)

Since early March, I have been working with a copy of the latter inherited Modern Wars codebase

...

So now, we have a third codebase

[*]my Modern Wars codebase (a fork of the inherited Modern Wars codebase)

That's three codebases in total. It gets to be rather hard to manage, not to mention confusing.

It is absolutely vital that I merge the codebases! And the sooner the better.

No, just by throwing the appropriate IDE switches, we want the capability to rebuild the entire Campaign Series of games (including Modern Wars and all future titles) in an hour or two -- the time required for the Microsoft Visual Studio IDE to compile and link the half dozen or games in the current lineup (EF, WF, RS, and the future ME, VW, and others). With all new features and bug fixes etc. in perfect sync.

...

By now, I am more than half way through the code merge process. I anticipate finishing up by sometime next week. Then I re-import back into the MS Visual Studio IDE, and I get to see if the whole thing blows up! [:D]
So a couple of days ago I had finished the code merge, and vetted the results.

Mission accomplished!

Then I re-imported back into the MS Visual Studio IDE. And of course the whole thing blew up! [:D]

Hundreds and hundreds of compiler errors. Um, what's wrong here? [&:]

...

Doh! But of course. Because I had introduced hundreds and hundreds of new '#if defined(MIDDLE_EAST) ... #endif' (for example) constructs to dozens of files, those files needed the addition of

#include "../../version.h"

lines in order to capture the defines in version.h:

// v e r s i o n . h
//
// Common version specification file.

#ifndef _VERSION_H

#define _VERSION_H

// begin edits
//#define MIDDLE_EAST
//#define VIETNAM_WAR
//#define KOREAN_WAR
//#define NATO_WAR
#define EAST_FRONT
//#define WEST_FRONT
//#define RISING_SUN
#define verYear "2013"
#define verVersion "Alpha 20130614"
// end edits

[...]
For without those defines, the '#if defined(MIDDLE_EAST) ... #endif' directives would never activate, meaning that code snippets and sections would be absent from the preprocessed code, implying all sorts of holes in the code (e.g., missing variable declarations).

By means I won't describe here, I readily identified all files lacking the needed '#include "../../version.h"' directives, then edited in the missing #include line into all relevant files.

I then retried the ME builds, and ... a few more errors and glitches, easily fixed (and not worth detailing).

Then, another retry, and ... success!

Then, an attempted build of VN, and ... more success!

Great! With the merged codebase, I verified I can build the Modern Wars .exe's. What about the earlier Campaign Series .exe's?

...

After another day or two of tweaking, I have achieved a successful build of East Front, as evidenced by the above screenshot. (4 out of 5 EF .exe's now build successfully, with just the game frontend still to tweak). West Front & Rising Sun build just as successfully.

Whew! I'm glad the code merge has worked out so well. I am ever so glad to put that tedious, boring work behind me.

I end this Coder Diary #5 with the reminder:
ORIGINAL: berto

And more gain. By merging now, we have greater flexibility in our release schedules. (Hint, hint. [;)])

...

Among other considerations, the ability to advance the release schedule of 1.05 is one of the biggest reasons for my undertaking the CS/MW codebase merge described in my Coder Diary #4. For that reason, future post-1.05 patches should come out faster too.

How long do we all have to wait? It's not for me to decide. But it's assuredly a matter of months, not a year or more. That I think it's safe to say.
[:)]

Until the next time ...
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
junk2drive
Posts: 12856
Joined: Thu Jun 27, 2002 7:27 am
Location: Arizona West Coast

RE: Coder Diary #5 -- Code Merge Mission Accomplished!

Post by junk2drive »

That's a big screenshot on a single monitor.
Conflict of Heroes "Most games are like checkers or chess and some have dice and cards involved too. This game plays like checkers but you think like chess and the dice and cards can change everything in real time."
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Coder Diary #5 -- Code Merge Mission Accomplished!

Post by berto »

ORIGINAL: junk2drive

That's a big screenshot on a single monitor.
It's actually the screenshot from a portion of my 3840X1080 dual-monitor display, cropped off at the right.

Oh, and if any of you are dreaming of expanding the game window across multiple monitors -- doesn't work, I'm afraid. You can do it, but attempting to run the game across more than one monitor introduces graphics glitches, and sub-optimal mouse behaviors. So, you are effectively restricted to running the game in a single monitor -- either full-screen on that single monitor, or resized smaller as you please (and as I did in the screenshot above).
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
dogovich
Posts: 9
Joined: Wed Oct 26, 2005 10:55 pm

RE: Coder Diary #5 -- Code Merge Mission Accomplished!

Post by dogovich »

Looks pretty nice.
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Coder Diary #5 -- Code Merge Mission Accomplished!

Post by Crossroads »

That's a HUGE picture right there in pixel size, any chance you could crop it down in detail? I am having problems downloading it...

EDIT: never mind, it seems my browser got stuck, it loaded immediately in a new session.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
wings7
Posts: 4586
Joined: Mon Aug 11, 2003 4:59 am
Location: Phoenix, Arizona

RE: Coder Diary #5 -- Code Merge Mission Accomplished!

Post by wings7 »

Thanks berto and amen to you![&o]

Patrick
Please come and join and befriend me at the great Steam portal! There are quite a few Matrix/Slitherine players on Steam! My member page: http://steamcommunity.com/profiles/76561197988402427
scottintacoma
Posts: 192
Joined: Fri Jan 25, 2008 1:15 am

RE: Coder Diary #5 -- Code Merge Mission Accomplished!

Post by scottintacoma »

Berto,

Many thanks and continued good luck.

And to your predecessors. Thanks for keeping this going.
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Coder Diary #5 -- Code Merge Mission Accomplished!

Post by berto »


Here's something you don't see every day:

Image

[:D]

I had a devil of a time getting the frontend .exe's to build -- East Front, West Front End & Rising Sun, also Middle East & Vietnam War. (No problems with the game engine or the editors.) I could get the Campaign Series frontend .exe's to build, but that would break the Modern Wars frontend .exe's (wouldn't compile, else wouldn't decrypt the OOB and map files properly). Then I fixed the Modern Wars .exe's, but that broke again the Campaign Series .exe's. Back and forth it went, tweak after tweak, a cut here, a paste there, until ... finally I decided that bandaids weren't enough. Major surgery was needed.

The problem was a tangled, confusing mess of merged legacy encryption code. Ugly!

But that screenshot above -- ain't she pretty? [8D]

Both game patient and code doctor are recovering nicely. I can now rebuild all five .exe's for all five games from the same unified codebase in about an hour or so. A coder's dream come true!
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
Zap
Posts: 3628
Joined: Mon Dec 06, 2004 7:13 am
Location: LAS VEGAS TAKE A CHANCE

RE: Coder Diary #5 -- Code Merge Mission Accomplished!

Post by Zap »

Exciting things indeed for JTCS
User avatar
Arkady
Posts: 1261
Joined: Fri May 31, 2002 1:37 pm
Location: 27th Penal Battalion
Contact:

RE: Coder Diary #5 -- Code Merge Mission Accomplished!

Post by Arkady »

awesome [&o]
Image
User avatar
junk2drive
Posts: 12856
Joined: Thu Jun 27, 2002 7:27 am
Location: Arizona West Coast

RE: Coder Diary #5 -- Code Merge Mission Accomplished!

Post by junk2drive »

bump 5
Conflict of Heroes "Most games are like checkers or chess and some have dice and cards involved too. This game plays like checkers but you think like chess and the dice and cards can change everything in real time."
Post Reply

Return to “John Tiller's Campaign Series”