The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
October 03, 2022, 06:10:30 am
Home Help Search Login Register
News: Paul & Fred have reached a settlement with Stardock!

+  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 16642 times)
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #15 on: November 08, 2015, 10:43:55 pm »

Quote
If anyone willing to start defining this specification - welcome!
Here is a doodle to try some ideas. It reads fleets and constraints information from a file, arranges the fleets randomly on the map and runs a simulation (at 30 fps for illustration purposes) that pushes and pulls them according their constraints. Space key shakes up the map, any other key randomizes fleet locations. Sometimes the results make no sense, but sometimes they are quite playable. dotNET 4.0 required.

https://drive.google.com/file/d/0B-x8G2X1znSaMThHYnZWbWI5UW8/view?usp=sharing
Great stuff! Grin
Which algorithm/library did you use?
Would you join mod development?  Roll Eyes

I was thinking about using the Spring Embedder algorithm, but kinda got lost among it's versions for now.
The steps I was thinking about:
(1) Randomize all impotant stars/fleets locations.
(2) Let springs do the job.
(3) After timeout check if all constraints are respected. If not, goto (1).
Logged
kfdf
Zebranky food
*
Offline Offline

Posts: 8



View Profile
Re: UQM stars/races relocation mod?
« Reply #16 on: November 09, 2015, 03:24:40 am »

Quote
Great stuff! Grin
Which algorithm/library did you use?
Would you join mod development?
Coding is my hobby, hobbies are supposed to be fun, and there is no fun for me in plain C, only misery and pain. Looking at the codebase only confirmed and reinforced my worst fears.
And there is no algorithm per se, things are just arranged randomly, and then "forces" are applied to them until they fall into their proper places. I played with it a bit, mainly trying to introduce some structure into the map it by using dummy fleets that represent empty space (or as they say in Art, "negative space") by being arranged into chains, attached to edges or the center of the map, or even real fleets... I had mixed success, so I ended up using two dummies with fixed positions to force ur-quans away from the edges and one dummy around the Sol to push other fleets away from it without explicitly defining all those constraints. But I still believe that judicial use of dummies and constraints can make maps look more realistic.
(click to show/hide)
Quote
(3) After timeout check if all constraints are respected. If not, goto (1).
Yes, that's what the spacebar does.  Grin And it would help to run some heuristics to detect cases where results are technically acceptable but aren't very playable or visually pleasing, like when all or most fleets are lumped together on one side of the map leaving large empty spaces elsewhere, or pushed against the edges of the map etc.
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #17 on: November 09, 2015, 07:11:33 am »

kfdf
Thanks for the code - will make use of that. It's good for at least first versions, later we can refine it (althought for me all maps it generated looked quite alright already).

Quote
there is no fun for me in plain C, only misery and pain
Yeah, that language isn't a gift, especially when got practice with some really advanced languages, like Scala or Haskell. But at least C got macroses loool.

----------------------------------
I'll also need to think of the way of making stars into constellations. Not sure how will be done yet.
Probably
(1) random-evenly generate only constellation stars first
(2) random-evenly put attractors to map, and let them attract nearby stars, grouping them into constellation
(3) scan map to get emptiest spaces, and fill them with non-constellation stars

From 502 stars total I've counted 102 constellations stars, and 30 non-constellation stars.
« Last Edit: November 09, 2015, 07:14:09 am by logarithm » Logged
kfdf
Zebranky food
*
Offline Offline

Posts: 8



View Profile
Re: UQM stars/races relocation mod?
« Reply #18 on: November 10, 2015, 12:29:09 pm »

Quote
I'll also need to think of the way of making stars into constellations. Not sure how will be done yet.
I wrote a star randomizer that grouped them in constellations as a part of a tool (admittedly, mostly redundant given the generated nature of the map) that can be found in this thread http://forum.uqm.stack.nl/index.php?topic=6078.0, and while simple, the end result needed some postprocessing and more importantly, is kind of hard to integrate with the fleets map. So here's a better, yet even more simple randomizer. It's very much like you described it, and there is even no need to run a simulation on it. Stars are randomly generated and then every star selects one attractor and is pulled towards it. Which attractor is selected is based on the distance to it and its strength, and pull strength is dependent on two factors, one comes from the attractor (to give every constellation some individuality), and another is defined by the star itself. Playing with strength and factors formulas can give some interesting looking results, the ones I used seem to give sufficiently adequate results.
(click to show/hide)
https://drive.google.com/file/d/0B-x8G2X1znSaMHhaRHlRMFlSWlk/view?usp=sharing

Quote
From 502 stars total I've counted 102 constellations stars, and 30 non-constellation stars
Is this really important, which stars are parts of constellations and which aren't, they are just names, right? So you can have Alpha Groombridge, Beta Groombridge etc... I mean, the game even has a couple of stars missing from constellations and nobody cares...
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #19 on: November 10, 2015, 09:38:19 pm »

On first iterations we can make this simple. Later, after whole mod is done, we can refine this.

I think better stick to those requirements
(1) Each "constellation attractor" should attract no more than ~2-10 stars (fixed random for each attractor).
(2) Attractor shouldn't make stars come too close to each other.
(3) (doubtful) While attractor attracts - it may move too. This way we may get something more complex, than only spheric constellations.
(4) Attractor better stop, if stars densities gets too high nearby. May somehow incorporate with (3).
Maybe too complex for first iteration, though.

The refinement for after-release may be making a file containing constellation patterns (for constellations like Horologii, Vulpeculae, Chamaeleonis, etc). And for some constellations instead of using dynamic attractors - just place stars in predefined patterns. Can even make more patterns, than generator would actually use - this would give even random set of constellations for each generation...

I'm getting more and more confident, that I'll need to remix names of all stars (except for Sol). Remixing names will fit well into constellation generation procedure (for proper naming of constellations).
I'm now somewhere 70% done extracting all hardcoded coordinates to a single manageable module. Next will be extraction of star-names.

Btw, if you feel more on playing with interesting tasks, you may also tackle the problem of identifying big empty spaces. There are few interesting approaches for doing that (like using fields, or making use of sectoring, or other approaches). Knowing, where attractors acted might be handy..  Wink
« Last Edit: November 10, 2015, 10:10:31 pm by logarithm » Logged
CelticMinstrel
Enlightened
*****
Offline Offline

Posts: 522



View Profile
Re: UQM stars/races relocation mod?
« Reply #20 on: November 12, 2015, 02:26:39 am »

Althought assumptions for Druuges not clear. I don't remember many things from gameplay.
Basically, the Druuge have confirmed relationships with two races in the story - the Utwig, to whom they tried to sell the Ultron (but got ripped off), and the Burvixese of Arcturus. That means that Arcturus needs to be near the Druuge sphere of influence, and it should probably be near that edge of the map as well, since the Druuge saved themselves from the Kohr-Ah by sacrificing the Burvixese.

And according to map, Yehat is quite far from Pkunk. Not sure if this is starting location or late location, - if i remember correctly, at some point their fleets got intersecting. According to code their (Yehat) fleet starting loc is 497.0, 4.0.
(click to show/hide)
That map has the Pkunk's original location. Eventually, they move to rejoin the Yehat.

By the way, one SoI on there was different before the war - the Ilwrath sphere of influence used to be a lot smaller and centred near the Tauri constellation (where their homeworld is). This probably isn't very relevant to your randomization project though.

Quote
The "out of the way" part is based on the assumption that a Dreadnought crashing within another race's sphere of influence is unlikely to go unnoticed.
That sounds like a far fetched assumption. There is an entire race that stays almost unnoticed inside two other races' spheres of influence. I actually remember being surprised, like, what the hell the ur-quans were doing out there so far from their battlefield? And btw, the original game didn't really push you into the fight with the ur-quan until the very end. They are the main antagonists of the game, but you rarely had any reasons to fight them. And the search for the crashed ur-quan dreadnought deep into their territory sound like the good opportunity to fix this. It would be even better if you didn't know the exact location of the crash site. Same thing with the Syreen ships. The intelligence ZFP give you on them could be a little more vague...
Well, you may have a point on the "out of the way" argument. I don't think I'm entirely wrong on that point, but this is a setting where there's no reason to expect you to know what's happening in the nearest star system, let alone some system on the edge of your sphere of influence. There would probably be patrols within the sphere of influence, but even patrols can't watch over every single system 100% of the time.

There's a simple answer for why the crashed dreadnought is so far from the Ur-Quan's battlefield. The Ur-Quan are not from this part of the galaxy. They arrived from the top left of the map, conquered the Thraddash, and then moved on into the war with the Alliance of Free Stars. After bringing the Sa-Matra in to quickly end that war, they met in combat with the Kohr-Ah at the centre of the starmap. So, in fact, that crashed dreadnought is actually pretty close to the area that the Ur-Quan came through.

I think it wouldn't make any sense for the crashed dreadnought to be in their current sphere of influence. I could maybe understand it being in the Thraddash, Umgah, or Spathi SoI, or maybe even in the Ilwrath or VUX SoI, but if it was in their current SoI I would really be wondering why they didn't find and destroy it already. Don't forget that their ships are designed to self-destruct when defeated, so as to keep their technology out of enemy hands. I wouldn't be surprised if they have the ability to detect emissions or something from ships whose self-destruct failed.
Logged
CelticMinstrel
Enlightened
*****
Offline Offline

Posts: 522



View Profile
Re: UQM stars/races relocation mod?
« Reply #21 on: November 12, 2015, 02:35:06 am »

I'm getting more and more confident, that I'll need to remix names of all stars (except for Sol). Remixing names will fit well into constellation generation procedure (for proper naming of constellations).
There might be a few others that it's simpler to not rename. Arcturus and Vela in particular, but possibly also Betelgeuse, Procyon, and Groombridge.

...speaking of Groombridge, will your randomization retain the arrow formation of the rainbow worlds?


...oh, also, the placement of the Slylandro should probably be kept in the upper-left quadrant. This could be difficult, because there's several vague references indicating their location - I believe the Spathi, Thraddash, and Zoq-Fot-Pik all give information that points in the right general direction. Maybe the Umgah do as well? I kinda suspect not, though. (The Melnorme give the exact location, I believe, so that's easy.)
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #22 on: November 12, 2015, 09:13:14 pm »

CelticMinstrel
 Smiley Thans for hints. I already took care of Slylandro.

Yeah, there are some stars weaved into story. Apart from mentioned ones, also Antares and Horologii constellation (for Supox and Utwig). Apparently, I'll have to respect those assumptions while relocating stars, races, and giving names to stars and constellations. Quite a knot. But not too difficult.

As for Rainbow worlds - probably not. Maybe in some future release after v1.0. But I'll keep that in mind.
« Last Edit: November 12, 2015, 09:15:02 pm by logarithm » Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #23 on: November 15, 2015, 12:54:33 pm »

Finally finished extractind all coordinates.
Had to generalize some coordinates evaluation. F.e., when fleet decides to approach another fleet for attack.
Also extracted few more distance assumptions.

Tested most coordinates, except for event, when Ilwrath decides to approach Thadds. Also didn't make sure events flow normally (like fleets die in war). And didn't test most of communications - only tested Spathi on Pluto for proof of concept, and then cloned the solution to other communications.
If anyone would wish to test, notify me. The risk is low, but it's still worth to test if global events (involving moving and fighting fleets) are not damaged.

Dialogues duplicate in
Code:
sc2/content/base/comm/
and
Code:
sc2/content/addons/3dovoice/
Not completely sure, but I think latter ones are not used. I modified only first location.

------------------------------------
Next - extraction of all star and cluster names.  

After that - randomization of fleets locations. Will make use of experiments made by kfdf.

Have also some thoughts for other future mods, but can't allow them to spring yet. )) I'll just leave them here, so they don't bother me:
** One of ideas involve making alien fleets in Hyperspace more random. F.e. some Slylandros faster, some slower, some attacking with not full crew. Also not all fleets will attack. Some will pass by, and some will run away. Make racial fleets appear rarely randomly away from their Sphere of Influence. Make mixed fleets of mercineries, traders, pirates, cargo. Loot (not only credits), trade and bribery...
** Another mod idea is about better balance. Probably will make cost of thrusters and turning-jets depend on how much installed already. Like, 1st - 500 RU, 2nd - 750, 3rd - 1000, 4th - 1500, 5th - 2000...
** Make "Kohr-Ah Death" mod a bit more configurable.

« Last Edit: November 15, 2015, 01:12:51 pm by logarithm » Logged
CelticMinstrel
Enlightened
*****
Offline Offline

Posts: 522



View Profile
Re: UQM stars/races relocation mod?
« Reply #24 on: November 15, 2015, 10:26:06 pm »

For races whose homeworlds or home constellations are given by name, you can probably just assign names after generating all the stars and assigning homeworld locations, so that the name constraints are satisfied. For example, when naming stars, the constellations containing Supox and Utwig should be called Antares and Horologii because the homeworlds of those two races have already been assigned to a star in that constellation.

Dialogues duplicate in
Code:
sc2/content/base/comm/
and
Code:
sc2/content/addons/3dovoice/
Not completely sure, but I think latter ones are not used. I modified only first location.
Both should be used. The first would be used when voices are disabled, the second when voices are enabled. Or, at least, I think that's the intention. If voices are installed, it might use the second one even if they're disabled.
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #25 on: November 15, 2015, 10:53:12 pm »

CelticMinstrel

Actually, with voices on - it used sc2/content/base/comm/ (at least for Spathi on Pluto).
I guess I'll have to double-check that...

As for naming - yeah, I'll have to choose proper order of stars relocation, renaming, constellations formation, fleets relocation. I'm not planning to keep original names for homeworlds and important stars. That's why I'm extracting star/contsell names.
For Antares and Horologii it's even harder. These are not homeworlds, - these are territories in UrQuan SoI, where allied Utwigs and Supox may come to attack evil asses. I spent few hours for writing/testing algorithm of calculating coordinates of these regions for cases, when Utwigs and Supox reside elsewhere. So I'll have to pick nearby constellation and a lone star and place there, - specially for Supox and Utwigs...  Roll Eyes
Logged
CelticMinstrel
Enlightened
*****
Offline Offline

Posts: 522



View Profile
Re: UQM stars/races relocation mod?
« Reply #26 on: November 16, 2015, 02:40:01 pm »

Actually, with voices on - it used sc2/content/base/comm/ (at least for Spathi on Pluto).
I guess I'll have to double-check that...
Hmm. It could be that the second location doesn't have the full dialogue? It might just have some files overriding the defaults. I'm not really sure, but I do know that there are supposed to be some differences in dialogue when the voices are enabled.

For Antares and Horologii it's even harder. These are not homeworlds, - these are territories in UrQuan SoI, where allied Utwigs and Supox may come to attack evil asses. I spent few hours for writing/testing algorithm of calculating coordinates of these regions for cases, when Utwigs and Supox reside elsewhere. So I'll have to pick nearby constellation and a lone star and place there, - specially for Supox and Utwigs...  Roll Eyes
Oh, it was that, whoops. In that case I think you could just do something like picking the Ur-Quan constellations nearest to wherever Utwig and Supox end up. Something like that.
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #27 on: November 16, 2015, 08:57:01 pm »

Quote
some files overriding the defaults
Yeah, most probably. Some dialogue files duplicate (with minor differences), others have texts only in sc2/content/base/comm/.
Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #28 on: November 20, 2015, 07:20:41 pm »

I need to learn and practice Go language for my next project, so I used that to write a script for smart-search through the project for star-names.
I got 242 hits - all of them in communication files
(click to show/hide)
I also thoroughly analyzed code for other ways to hardcodedly stick to star-name. Found none. Good style.

Now 242 is too much to handle it manually. It's also risky (to make mistakes).
So, I decided to make another Go script to make smart-replaces in those *.txt files, and to make a cunning solution in related *.c files...
For example, I'll turn Utwig's words
Code:
Indeed, it seems that you should proceed to the second moon of the sixth planet of Zeta Hyades
into
Code:
Indeed, it seems that you should proceed to the second moon of the sixth planet of $${StarName:ImortantStarIdx=22}

It will be much harder with non-important stars being mentiond. Like
Code:
Starbase Commander: The Ur-Quan came roaring through VUX space, and tried to push past the Indi and Mira star systems.
or
Code:
Syreen: They all appear to be originating from the direction of the Horologii constellation.
Will have to deal with them manually...
« Last Edit: November 20, 2015, 07:24:09 pm by logarithm » Logged
logarithm
Zebranky food
*
Offline Offline

Gender: Male
Posts: 32



View Profile
Re: UQM stars/races relocation mod?
« Reply #29 on: November 21, 2015, 01:44:56 pm »

Published Git repo https://sourceforge.net/u/uqm-logarithm/sc2/ci/master/tree/ .
Work being done under MS VC2010. (with all my great respect to Linux community, sorry)
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!