for anyone interested my brief and hacky way of getting to the above was by making a function which "shuffled" the "alien presence" field of starmap_array in plandata.c. Then I called that function in InitGameStructures of globdata.c.
The meaty part is actually only a few lines of code:
There were also a few helpers and fixups for places that later relied on hardcoded stuff.
There are a bunch of problems still to be solved with an approach like this:
- dialogue correction (hard)
- placing special stars (like the ship vault, the mycon trap star, the precursor bomb etc) within the right space (easy-ish)
- making sure that related spheres of influence are close (easy-ish)
- making fleets move to the right place for special events like pkunk returning to yehat (not sure how hard).
I also never tried to actually play through so like someone mentioned above I'm not sure how much it will break on save/reload.
It's really just a proof of concept hack and not real solution. BUT I think all the above CAN be sorted out, with dialogue being the hardest nut to crack.
There is already some support in the code for insertions - for inserting your captain name, your ship name, and the alliance name.
For example in starbas.c there is the following code:
construct_response (
shared_phrase_buf,
tell_me_about_fuel0,
GLOBAL_SIS (ShipName),
tell_me_about_fuel1,
(UNICODE*)NULL);
which references this struct:
typedef struct
{
SIS_STATE SIS_state;
GAME_STATE Game_state;
} GLOBDATA;
It shouldn't be too hard to add some more state for the positions of all the shuffled stuff and set it up when randomizing the locations. Any dialogue that references that stuff would have to have some code added to it's comms file to use construct_phrase, but that shouldn't be too hard, just kind of tedious. It might be possible to write a better solution but that would take some more architecting whereas just doing what they do for ship/captain name could work with some brute force.