The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
December 05, 2022, 01:29:06 am
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  General UQM Discussion (Moderator: Death 999)
| | |-+  UQM stars/races relocation mod?
« previous next »
Pages: 1 2 [3] 4 Print
Author Topic: UQM stars/races relocation mod?  (Read 16737 times)
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #30 on: November 21, 2015, 02:53:17 pm »

From these 242 mentions there are 2 kinds of cases:
** Simple - will be able to deal with them atomatically.
** Hard ones - will need to handle them manually. Mentions of constellations (22) and non-important stars (8 ).

I'll deal with simple cases first. After that will need to describe assumptions for the hard ones. If anyone wishes to participate - fill in the table here:
https://sourceforge.net/u/uqm-logarithm/sc2/ci/master/tree/tools/for-relocation/data/mentioned-assumptions.xls
The context game-texts are in same XLS (on first sheet).
« Last Edit: November 22, 2015, 02:11:17 am by logarithm » Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #31 on: November 22, 2015, 01:45:36 pm »

Finished and tested simple mentions (of important stars) with both communication files and lander messages. Dealing with Strings in C is really tricky and not easy at all - negative side of low level languages.
Finished analyzing mentioned constellations and semi-important stars. Also extracted some more assumptions about fleets and homeworlds.
Actually felt like a historican/archivist while reading through all that info. Cool Pleasant romantic work.

Hardest cases for positionining will be
>> 3 constellations in Arilou SoI (originally Chandrasekhar, Circini, Columbae). Will have to apply some simple maths here.
>> Horologii and Antares are already dealt with.
>> Lacaille and Krueger are to be placed in intersection of Pkunk and Ilwrath.
>> "the snake-like creature who has swallowed the elephantine beast"
>> Mira and Indi - inside Vux fleet, closer to Sol
Aldready have good math functions for most cases. The others mentions will be really easy to resolve.

I'll solve the hard-mentions extraction in the following manner:
** Will create 2 enumerations for them, similarly as important stars are enumerated (in gendef.h): important constellations and semi-important stars.
** There will be 2 dictionaries: [important constellation idx -> general constellation idx] and [semi-important star idx -> ptrStar], which will be filled as a result of relocation in a dedicated procedure solving assumptions.
** For non-relocational mode I'll fill those maps with semi-hardcoded stuff.
** The communication files will get inlined with variables (similarly like I dealt with important stars)
Code:
   
$${StarName:ImortantStarIdx=%d}
$${StarNameUC:ImortantStarIdx=%d}
$${StarName:SemiImortantStarIdx=%d}
$${StarNameUC:SemiImortantStarIdx=%d}
$${ConstelName:ImortantConstelIdx=%d}
$${ConstelNameUC:ImortantConstelIdx=%d}
« Last Edit: November 22, 2015, 11:49:44 pm by logarithm » Logged
CelticMinstrel
Enlightened
*****
Offline Offline

Posts: 522



View Profile
Re: UQM stars/races relocation mod?
« Reply #32 on: December 01, 2015, 12:06:43 am »

Does that mean that the hints towards the location of the Slylandro are not difficult or, perhaps, are even already dealt with?
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #33 on: December 01, 2015, 05:24:26 am »

Yeah, it was easy one.
(click to show/hide)

I'm currently in the middle of changing industrial project. Had to work overtime for whole weekend. Not much progress with the mod, thus.

In the mod currently finishing structuring 9-steps galaxy formation procedure, which involves steps like fleets placement, important stars placement, etc. Procedure will have two modes: step-by-step form original galaxy, and step-by-step form random one. It's filled with defensive structures, with intension to detect errors early. Once this procedure works fine for original map, I'll go on with making galaxy randomizer...
Logged
CelticMinstrel
Enlightened
*****
Offline Offline

Posts: 522



View Profile
Re: UQM stars/races relocation mod?
« Reply #34 on: December 01, 2015, 04:37:59 pm »

Eh? That's just the probes speaking the coordinates of the Slylandro homeworld, right? I meant the hints you get from other races, especially the ZFP, but also Thraddash and possibly Spathi. (Speaking of Spathi, the Arilou SoI would need to be near both Spathi and Umgah, since you get a hint about the Arilou from the Spathi, and they have contact with the Umgah.)
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #35 on: December 06, 2015, 08:45:43 pm »

CelticMinstrel
Yeah, I've dealt with those things. Everything mentioned here is dealt with.

As for distance assumptions in general (which are specified here). I will fill it more later. If you have anything to add there right now, I would be very grateful, if you do it in format used in the spec file.

The assumptions regarding Spathies are tricky. Melnormes mention, that they practiced colonization in Algol system (which is in Druuge SoI) and they are also aware of the Vux-related megabeast (which is by the north edge of galaxy). So the distance for them is not so much of a barrier. On other side, they didn't know about ZFP, until Mmrnmhrm (or Chenjesu (don't remember)) made an expedition to the centre of galaxy. Thus, I think these distance assumptions are not always to be dealt so strictly. But I've added the distance assumption between Spathi and Arilou (not yet committed).

-----------------
I had some unsuccessful trials with my code. Introduced some serious changes and hoped to debug/compile this in one blow. Well, that approach works with most of languages/projects, but not here. I got 10k or cyclicly reoccurring compile-time bugs with absolutely nonsensical descriptions... So I've lost few days on step-by-step reintegration of my solution into the project, and still have to spend 1-2 more days on that... An unpleasant part of work.

Actually, it's so damn cool, when you don't have the deadlines, like ones in industry.
« Last Edit: December 06, 2015, 10:31:11 pm by logarithm » Logged
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3868


We did. You did. Yes we can. No.


View Profile
Re: UQM stars/races relocation mod?
« Reply #36 on: December 11, 2015, 05:43:05 pm »

With the non-important systems, can't you place those names based on the important things they're conceptually linked to?
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #37 on: December 11, 2015, 09:29:34 pm »

Death 999
Sorry, didn't understand you.
Currently I separate 3 categories of stars:
** important ones - homeworlds and artefacts
** semi-important stars/constellations - mentioned in dialogues
** non-important ones - can be freely randomized

If you meant semi-important stuff - it will get templated in dialogue files, get randomized names, will respect names and locations of important stars and fleets...

-----------------------------------
If anyone wishes to help - I would really benefit from having a single C-file program, compilable with gcc, runnable from Cygwin shell, and which would
** draw a graphical square map for hyperspace with a grid (galaxy size is 10000x10000; no need to zoom - just simplest top-down view)
** have a function to draw array of POINTs
** have a function to erase array of POINTs
Need it to test dozens of upcoming stars positioning algorithms.
« Last Edit: December 12, 2015, 12:51:59 am by logarithm » Logged
CelticMinstrel
Enlightened
*****
Offline Offline

Posts: 522



View Profile
Re: UQM stars/races relocation mod?
« Reply #38 on: December 14, 2015, 06:03:56 am »

The assumptions regarding Spathies are tricky. Melnormes mention, that they practiced colonization in Algol system (which is in Druuge SoI) and they are also aware of the Vux-related megabeast (which is by the north edge of galaxy). So the distance for them is not so much of a barrier. On other side, they didn't know about ZFP, until Mmrnmhrm (or Chenjesu (don't remember)) made an expedition to the centre of galaxy. Thus, I think these distance assumptions are not always to be dealt so strictly. But I've added the distance assumption between Spathi and Arilou (not yet committed).
The distance for the Spathi/Arilou relation can be fairly large too - as I recall they just mention seeing a "star" that appears for three days each month (which refers to the Quasispace portal). As for the megabeast, I would suspect they know of it more from rumour (via Umgah and/or VUX, or even Thraddash) than personal experience. I wasn't aware about the Algol thing though; I'm quite surprised to hear that the Spathi ventured that far from their sphere of influence. I wonder if it was their own initiative, or something to do with the first Alliance-Hierarchy war (it's not that far from the Mycon after all, right?).

The only SC1 race that (directly) knew anything about the ZFP was the Chenjesu. If I recall correctly, the infodumps that Hayes has to offer include a mention of this. My guess is that the Spathi probably didn't know know of them because 1) the Spathi a fearful race who is unlikely to go out of their way to find other sentient races and 2) the ZFP may have gained hyperspace technology only very recently (for example, during or just before the first Alliance-Hierarchy war).
Logged
Death 999
Global Moderator
Enlightened
*****
Offline Offline

Gender: Male
Posts: 3868


We did. You did. Yes we can. No.


View Profile
Re: UQM stars/races relocation mod?
« Reply #39 on: December 16, 2015, 11:50:28 pm »

Death 999
Sorry, didn't understand you.

I don't see the things I remember replying to. I think I could have had a very out-of-date page access.
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #40 on: December 18, 2015, 11:37:23 pm »

Quote
I wasn't aware about the Algol thing though; I'm quite surprised to hear that the Spathi ventured that far from their sphere of influence.
Probably that's mistake by original devs. Or diplomatic trick(lie) by Melnormes - they mentioned this story about Spathies...
--------------
I've done quite some work for reorganizing code of galaxy initialization into 10-steps chain:
(1) Initialization of initial fleets
(2) Initialization of important stars
(3) Initialization of important constellations
(4) Initialization of semi-important stars
(5) Initialization of non-important constellations
(6) Initialization of non-important constellation-stars
(7) Initialization of non-important solo-stars
(8 ) Initialization of quasi-space locations
(9) Initialization of important coordinates
(10) Compilation of all previous steps results into a starmap

Most steps also produces dictionaries, which are required for templating dialogue files and for future relocation algorithms.
All this kitchen also requires to be saved/loaded with game saving/loading.
Also did alot of defensive programming, since my testing power is quite low.

Current structure works for original map, and contains placeholders for relocation algorithms, which should fit in easily.

I also made a prototype of graph-layouting algorithm based on springs. Works for simple cases, but fails to draw a house (medium-complexity case). I think it should suffice, if not, I'll refine it when introduce/test it in game.
---------------------------------------
Current plan:
(1) Finish templating of mentions in dialogue files of important constellations, semi-important stars. 90% done.
(2) Extract misplaced starmap initialization logics from game main-menu.

The latter one is an unpleasant surprise.
globdata.c has a InitGameStructures function, which initializes fleets and also turns on the START_INTERPLANETARY activity -
Code:
GLOBAL (CurrentActivity) = IN_INTERPLANETARY | START_INTERPLANETARY;
- which leads to call of ExploreSolarSys() in Starcon2Main(...).
ExploreSolarSys wants starmap and Sol to be already defined.
And all this is happening BEFORE game is actually started or loaded from main-menu.
I'll either have to introduce an ugly workaround for this, or redesign game initialization procedure, which is really-really complex. Both paths are painful. Undecided Most probably I'll just workaround this mess...

Only after those things are done, I can finally start filling in relocation algorithms (some of which are already successfully prototyped).
« Last Edit: December 20, 2015, 12:28:17 am by logarithm » Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #41 on: December 20, 2015, 01:09:49 am »

Alright. The communication-templating stuff is done.
--------------------
The initialization nightmare looks like this:
Code:
       [USER: run game]
        Starcon2Main
            BackgroundInitKernel
                getInitialFleetsDict
                LoadMasterShipList
                    x*load_ship - initialize all INITIAL states of fleets, loads some heavy resources
        
            cycle {
                StartGame
                    TryStartGame
                        RestartMenu
                            DoInput(DoRestart) -> loop main-menu, until "Start" or "Load" is chosen
                            [USER: enter "Load"]
            }
            
            InitGameStructures
                // init Fleets some more in their INITIAL states
                // set starting loc of Player Flagship
            
            ExploreSolarSys
                DoInput(InputFunc = DoIpFlight)
                    DoIpFlight(LastActivity == CHECK_LOAD)
                        SolarSysMenu(LastActivity == CHECK_LOAD --> MenuState.CurState = GAME_MENU)
                            DoInput(InputFunc = DoSolarSysMenu)
                                DoSolarSysMenu(MenuState.CurState = GAME_MENU, Save|Load = Load)
                                    GameOptions (LastActivity == CHECK_LOAD)
                                        PickGame
                                            DoInput(DoPickGame) -> loop in load-menu until save-entry is chosen
                                            [USER: choose save-entry to load]
                                            SaveLoadGame
                                                ConfirmSaveLoad
                                                    LoadGame
                                                        // update state of fleets
                                                        // set loc of Player Flagship
The structure is really bad, but no blaming devs - I can easily imagine how it emerged. That's what I call "Live Workaround Tree" (LWT). Almost all big-enough projects has similar degrading effect, when refactoring is considered to be too late and expensive... And I will not even try to fix the mess - it's just too complex. Thus workaround is the only possible choice - the only way to grow something on the LWT is to grow another workaround on it.

So, about the solution.
I'm aiming 2 modes for game start:
(A) init original starmap & fleets - considered to be fast
(B) init randomly relocated starmap & fleets - considered to be slow (especially due to fleets graph-layouting via springs)
These modes are already done.
Now to integrate them into LWT mess I need to introduce 2 more modes for game init, which will be orthogonal to (A)/(B):
(1) fake initialization - done before game is actually started or loaded (near BackgroundInitKernel and InitGameStructures)
(2) true initialization
The (1) should always be called in ORIGINAL MODE (A) before game is started/loaded. It will be used to load permanent resources into game. Later in procedure it is overwritten by (2).
The (2) may be in both ORIGINAL(A) and RELOCATIONAL(B) modes. It should be called only after player pressed "Start New Game". Game loading will need to be dealt additionally.

Cases:
(click to show/hide)

(click to show/hide)

(click to show/hide)


« Last Edit: December 20, 2015, 03:44:47 am by logarithm » Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #42 on: December 23, 2015, 03:13:56 pm »

I've decided to postpone dealing with the initialization hacking, until I have some real relocation algorithms working.
---------------------------------------
I integrated my graph layouting prototype for placing fleets and enforcing distance assumptions between them.
As expected, first prototype fails to solve the layouting.
For 24 participants and 132 assumptions I get 2-5 assumptions failing to resolve,
(click to show/hide)
The failure is not too bad, and algorithm has a lot of potential for refinement. And that's the plan. I also made a simple starmap drawer, to see how layouter behaves...
(click to show/hide)

This layouter algorithm is the hardest task in the whole endeavour, I should arm myself with patience...
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #43 on: December 24, 2015, 06:10:07 am »

After fixing few bugs in the layouting algorithm it started working quite nicely, resolving alpha config (132 assumptions) very fast.
I was quite afraid to get drown in endless-fruitless trying to refine algorithm, failing in the end after 1 month, and surrendering whole endeavour. So afraid, that when it finally started working fine (after few fixes), I was like
(click to show/hide)

I thoroughly analysed all relations between all fleets and important locations and made a matrix of assumptions with full specification here. I bet it's at least 95% complete, and of course it's content is subject of discussions.
This complete-assumptions-config contains 25 participants and 250 assumptions between them, which is quite heavy. On my 3Ghz CPU layouter consumes only 1 core, and solves it in 10-100 seconds, and it won't be easy to refine it further.
Btw, I tried to use graphical library to output some texts (like layouting iterations counter), and failed
Code:
void DrawTextInCorn(char* txt, Color c) {
    TEXT t;
        
    BatchGraphics();

    SetContextFont (TinyFont);

    t.baseline.x = 100;
    t.baseline.y = 100;
    t.align = ALIGN_CENTER;
    t.CharCount = strlen(txt);
    t.pStr = txt;
        
    SetContextForeGroundColor (c);
    font_DrawText (&t);  

    printf("Phase drawn %s\n", txt);

    UnbatchGraphics();
}
...
DrawTextInCorn("Text", PCMENU_SELECTION_TEXT_COLOR);
If anyone knows proper magics to make it work, please teach me. It would be good to show user some progress info, while layouter works...

I also decided to reuse the layouter in later steps to place on starmap important stars, some semi-important stars and some important constellations. And that's the plan.

-----------------------------
[Upd:]
Solved the text-drawing problem. Problem was in font, which was not loaded. In the not-yet-hacked initialization fleets get initialized before SC2 kernel (and fonts) is loaded.
« Last Edit: December 24, 2015, 11:01:54 pm by logarithm » Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #44 on: December 25, 2015, 07:26:58 pm »

Somehow, solving the font problem (I was trying to draw text without font being initialized) made layouter work much faster. I also moved forward reusing layouter for placement of other objects (not only fleets). Naturally refining it's algorithm. Now result is pretty cool - it averagely completes in <1 second, rarely giving maximum 4 seconds.
Code:
Last generation completed in  377 iterations,  0 seconds. Current average (for  100 generations): i  939, t  0. Overall max: i 5076, t  3

I also keep track of some issues, which were mentioned here, and which I noticed myself:
Code:
Issues in assumptions:
    #001 Shofixty epic return (from mission to Mycon -> back home through Vux and Yehat spaces): path may be non-straight line
    #002 Chenjesu expedition through Spathi to discover ZFP: path may be non-straight line.
    #003 Rainbow worlds will not form arrow
    #004 Supox   may be among other fleets, but noone talks about them
            Solved by #005.
    #005 Utwigs  may be among other fleets, but noone talks about them
            Solved by UTWIG_FAR_FROM_SOCIAL_RACES macro. Solves also #004.
    #006 Druuge  may be among other fleets, but noone talks about them
            Solved by DRUUGE_FAR_FROM_SOCIAL_RACES macro. Solves also #004.
    #007 Any race may neighbour other race, but pretend not knowing each other
            Solved by #004. Solved by #005. Solved by #006.
    #008 UrQuan not in center reduces need to encounter them (MUST BE SOLVED)
            Solved by URQUAN_SOICENTER_DISTANCE_FROM_EDGE = 4000 macro.
    #009 If "BugSquirt" sounds a bit like "Betelgeuse" (Deutch), then new Syreen location name will not sound like that anymore.
    #010 Beast hunted by Zex - it will not reside in constellation, which is like "snake ate elephant"
    #011 Constellation-stars should form pretty geometric forms.
    #012 Solving #007 and #008 makes generated galaxy quite deterministic.
 
(click to show/hide)
« Last Edit: December 25, 2015, 07:29:02 pm by logarithm » Logged
Pages: 1 2 [3] 4 Print 
« previous next »
Jump to:  


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!