Page 1 of 1

Coder Diary #5 -- Code Merge Mission Accomplished!

Posted: Fri Jun 14, 2013 7:23 pm
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 ...

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

Posted: Fri Jun 14, 2013 9:00 pm
by junk2drive
That's a big screenshot on a single monitor.

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

Posted: Fri Jun 14, 2013 9:32 pm
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).

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

Posted: Fri Jun 14, 2013 10:36 pm
by dogovich
Looks pretty nice.

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

Posted: Sat Jun 15, 2013 5:40 am
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.

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

Posted: Sat Jun 15, 2013 11:24 am
by wings7
Thanks berto and amen to you![&o]

Patrick

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

Posted: Sat Jun 15, 2013 4:22 pm
by scottintacoma
Berto,

Many thanks and continued good luck.

And to your predecessors. Thanks for keeping this going.

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

Posted: Sat Jun 15, 2013 5:53 pm
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!

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

Posted: Sun Jun 16, 2013 7:54 pm
by Zap
Exciting things indeed for JTCS

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

Posted: Thu Oct 31, 2013 1:23 pm
by Arkady
awesome [&o]

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

Posted: Sat Nov 02, 2013 9:15 pm
by junk2drive
bump 5