Hi,
I've been trying to reverse engineer "Crusade in Europe" semi-recently and I've found this thread which seems to contains similar finding us I have.
I've managed to find a bit more information about this "inner" script language.
I'd guess it's a bytecode being a result of compilation of internal Microprose programming language mentioned here: https://www.atarimagazines.com/rom/issue3/interview.php
Implementation of bytecode functions are inside SIDTRAN.OBJ flie. First part are memory offsets of the functions and later there are machine code implementations.
Those functions range from standard stack language constructs: PUSH, POP, ADD, MUL, ... to higher level constructs such as various JUMPS, to opcodes implementing FOR LOOPS,
to opcodes that seem to be specific and common to all the Command Series games (Crusade in Europe, Decision in the Desert, Conflict in Vietnam).
The opcodes that are game specific opcodes, that I've found so far are:
find unit or city at specific coordinates
count number of adjacent units of given coordinate
compute some kind of evaluation function for a coordinate
The last of those functions is quite complex and I dont't follow its logic very well.
My limited understanding is that:
for each hex adjacent to given one, it computes four element bitmap:
is_there_enemy unit there
is_there allied unit or "good"? terain there
is there an enemy unit at either previous adjacent hex or next adjacent hex
is there an allied unit at either previous adjacent hex or next adjacent hex
it treats this 4-element bitmap as a number [0;15] and looks up a number (score?) [0-5] in a hardcoded array for given bitmap
it counts how many of each scores appeared among six adjacent hexes
it return sum of coefficients for all [score_value, score_count] pairs
Coefficients seem to taken from HEXES.DTA file (at least that's what I found in one case). Probably it may use different coefficients for different orders or other factors, but I couldn't verify it.
I don't know how to progress further.
My initial plan was to understand and rewrite the whole logic in a higher level language, but I seem to lack skills that would allow decompiling this custom language to a more understandable format.
Later I thought that maybe I could create an engine which would allow playing games using modern controls and maybe modern UI.
It would consist of writing interpreter for this custom bytecode and writing a UI around it.
Unfortunately, lately I have pretty limited time for this, so we'll see.
Maybe I should just ask Sid Meier for the source code?
Best,
Piotr