The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2023, 11:35:08 pm
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

  Show Posts
Pages: [1]
1  The Ur-Quan Masters Re-Release / General UQM Discussion / Re: Randomizing locations on: September 18, 2017, 03:54:43 am
The main problem you would run into is that you would need to make it so it would only randomize once and save that particular random seed in each save file so it could be recalled.

The code I posted above broke due to something along these lines.  What I did to fix it was add a field to the global data that has a list of all the "special stars" and what star-index they should be remapped to.  This gets saved when the global data gets saved, and upon reloading I "patch" the starmap_array.
2  The Ur-Quan Masters Re-Release / General UQM Discussion / Re: Randomizing locations on: September 18, 2017, 03:25:16 am
I'd keep the Sa-Matra near the middle, because it's… pretty central, and makes getting around a little less convenient.

Yeah that might be true.  This could be something baked into whatever "rules" there are (like saying supox and utwig have to be close together, there might be a rule saying sa-matra has to be somewhat central.

You could definitely get into some unwinnable games where key early game stuff was in urquan space - or worse, as in the screenshot above, where urquan overlaps sol.
3  The Ur-Quan Masters Re-Release / General UQM Discussion / Re: Randomizing locations on: September 18, 2017, 03:19:38 am
Just using coordinates would definitely be a little bit easier, but I think most of the dialogue falls into a few buckets:
  • a specific "special star" (like the exact home star)
  • just the constellation that a special star is directly in
  • a constellation NEAR to a special star
  • coordinates near the special star

The constellation NEAR a star is hardest but if I add a function like "give me all the star indices of stars in your sphere of influence" and then just pick one randomly that should work.

I think what I can do is build a special string table that has an entry for each of the buckets, for each of the special stars, and then insert that into dialogue.

There might also be a few edge cases where they name specific directions like "coreward" or phrase things in a fluffy way like "the third star of gemini" or something that I might just hack out the dialogue like you suggest (change it to be one of the buckets above).
4  The Ur-Quan Masters Re-Release / General UQM Discussion / Re: Randomizing locations on: September 17, 2017, 11:51:00 pm
The urquan sphere of influence is defined by the location of the sa-matra, which I do shuffle in that code.

edit to add: I want to reiterate that what I posted is pretty hacky, it gets the star map I showed above, but is pretty far from a complete solution.
5  The Ur-Quan Masters Re-Release / General UQM Discussion / Re: Randomizing locations on: September 17, 2017, 11:31:16 pm
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:

Code:
construct_response (
shared_phrase_buf,
tell_me_about_fuel0,
GLOBAL_SIS (ShipName),
tell_me_about_fuel1,
(UNICODE*)NULL);

which references this struct:

Code:
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.
6  The Ur-Quan Masters Re-Release / General UQM Discussion / Re: Randomizing locations on: September 17, 2017, 10:19:46 pm
I did some work on this a while ago, and managed to get randomized placement of alien "fleets" and home planets without too much pain.



As others have said the real difficulty would be updating the in game text to be dynamic and match the new star system.

There's also the issue of placing things meaningfully - the pkunk should be close to the ilwrath, the ZFP should be within urquan space, etc.

I'm thinking about returning to this soon if I have time but I think updating the dialogue system might be a huge task.  It would probably be a better use of time to abstract out a lot of this stuff rather than trying to get it to work within the existing system.
Pages: [1]


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!