Pages: 1 2 3 [4]
|
|
|
Author
|
Topic: UQM stars/races relocation mod? (Read 17910 times)
|
logarithm
Zebranky food
Offline
Gender:
Posts: 32
|
Integrated tools for solving collisions of stars/constellations (while making layout). Finished layouting for 4 steps: fleets, important stars, important constellations, semi-important stars. As layouting may fail in some very rare random cases, introduced fail-tolerance and reset-retry logics. Added some more benchmarking tools. Although I tried to be careful with memory allocation (malloc/free), benchmark showed a memory leak, and on Windows I can't localize it. The tools below conflicts with src/libs/compiler.h and other libs.
#include <windows.h> #include <psapi.h>
size_t getPeakRSS() { PROCESS_MEMORY_COUNTERS info; GetProcessMemoryInfo( GetCurrentProcess( ), &info, sizeof(info) ); size_t peak = (size_t)info.PeakWorkingSetSize; } size_t getCurrentRSS(){ PROCESS_MEMORY_COUNTERS info; GetProcessMemoryInfo( GetCurrentProcess( ), &info, sizeof(info) ); return (size_t)info.WorkingSetSize; } The failed benchmark consists of 1000 attempts to layout 4 steps: fleets, important stars, important constellations, semi-important stars. It fails on 350th-400th step with out-of-memory. Otherwise works pretty fine - reset-retry frequency is near 0.1%, average generation time is below 1 second. I'll leave it like that for now, as I don't think it will ever cause any problem to gamer - the starmap generation is a very rare thing gamer will do.
Next tasks are (A) generation of non-important constellations (B) generation of non-important solo-stars and constellation-stars (C) random distribution of names to constellations/stars
For (A) and (B) the main challenge will be to make distribution even. Probably gonna reuse layouting-via-springs, but under different sauce now. Another idea was to separate starmap into big amount of overlapping windows, and to solve distribution-evenness problem in scope of each window. It's like an indexing strategy (one of), used in some DBs. As for pretty constellation patterns... well, I would do that if someone cooperated, and made a simple txt file containing all constellations profiles. Each profile should contain a bunch of coordinates for each star in it, centered on constellation centre as (0,0). Quite easy to do programmatically btw, - even Excel would be enough to do it... Otherwise, I don't think I'll bother with that, until first complete version of fully working relocation mod is released.
|
|
« Last Edit: December 27, 2015, 10:47:41 pm by logarithm »
|
Logged
|
|
|
|
Death 999
Global Moderator
Enlightened
Offline
Gender:
Posts: 3873
We did. You did. Yes we can. No.
|
One put the Syreen homeworld on top of the Burvix, which seems a little odd. I guess that's just a matter of adding a new but very loose constraint.
|
|
|
Logged
|
|
|
|
CelticMinstrel
Enlightened
Offline
Posts: 522
|
For #9, just force the Syreen location to be named Betelgeuse regardless of where it ends up being placed.
For #10, in theory you can probably just force the constellation containing the beast to have the same name as in the original game. I don't recall if the constellation actually formed a snake-beast-like shape though.
|
|
|
Logged
|
|
|
|
logarithm
Zebranky food
Offline
Gender:
Posts: 32
|
One put the Syreen homeworld on top of the Burvix, which seems a little odd. I guess that's just a matter of adding a new but very loose constraint.
Chronology: (1) Burvix lives in Arcturus, communicates with Druuge and Utwig. (2) Syreen lives in Beta Copernicus I. (3) Syreen homeworld got destroyed by Mycon. (4) Burvix got destroyed by Kohrah. (5) Syreen submits to Ur-Quan, in exchange they find a world where Syreen can live - Betelgeuse.
Thus there's almost no assumptions about where Syreens should be, and who they should neighbour (except, that they should neighbou Ur-Quans), - because they got new home just very recently. Spathi may know about it from insider info channels, because they became part of hierarchy. And this home don't even need to be near human space (according to dialogues)... Although, I don't think Syreen's battle/intelligence value is high for player. Thus placing them too far from Sol might make them just worthless - so probably need the Sol <-> Syreen assumption anyway... Not sure. And please, correct me if I'm wrong.
For #9, just force the Syreen location to be named Betelgeuse regardless of where it ends up being placed.
For #10, in theory you can probably just force the constellation containing the beast to have the same name as in the original game. I don't recall if the constellation actually formed a snake-beast-like shape though.
For #9 - I could do either that, or just remove Bugsquirt stuff and let Spathies name real location. Another solution (really funny) would be to give a funny second name to every star/constellation, and depending what new name for Syreen home is randomly chosen - put fun into Spathi mouth. If I was a school teacher, it would be quite easy - I would give a task to each student to invent funny names for 2-3 stars...
For #10 - not sure I remember correctly, - it wasn't anything about name. The Lyncis constellation actually looks like a snake which ate something big. One way to solve this would be changing dialogue (excluding hint about snake and elephant).
If I keep Syreen in Betelgeuse and Vux Beast in snake-like constell - it just would kill the idea of relocation and randomization.
|
|
« Last Edit: December 29, 2015, 11:06:53 pm by logarithm »
|
Logged
|
|
|
|
|
logarithm
Zebranky food
Offline
Gender:
Posts: 32
|
CelticMinstrel
Actually, making fun names from at least 5-10 of solo stars might be enough. All solo stars are below. If anyone wishes to contribute - welcome - think of 5-10 funny star-names.))
Deneb(0,126) Capella(0,125) Pollux(0,124) Alcor(0,112) Organon(0,123) Regulus(0,122) Hyperion(0,121) Mizar(0,120) Canopus(0,127) Bellatrix(0,119) Vela(0,98) Zeeman(0,97) Rigel(0,118) Procyon(0,117) Almagest(0,111) Achernar(0,116) Algol(0,113) Aldebaran(0,115) Betelgeuse(0,114) Metis(0,104) Arcturus(0,130) Altair(0,37) Antares(0,38) Fomalhaut(0,50) Groombridge(0,42) Menkar(0,51) Vega(0,0) Microscopii(0,52) And if I ever get to constellation templates, we can similarly think of 5-10 constellation hints.
|
|
« Last Edit: December 31, 2015, 12:01:03 pm by logarithm »
|
Logged
|
|
|
|
logarithm
Zebranky food
Offline
Gender:
Posts: 32
|
Solved non-important constellations placement. Made an XY-overlapping-windowing indexer, which solves tasks of empty spaces detection and even distribution of constellations. Also applied collision resolver (which is also used near graph-springs-layouter) to make sure constellations don't get too close to each other.
Non-important solo stars will most probably be treated like single-star-constellations, which means that placement of non-important solo stars is 95% done.
Also completed naming for constellations. And for solo-stars will use same solution, which makes it ~80% done.
Overall progress: V (1) Initialization of initial fleets V (2) Initialization of important stars V (3) Initialization of important constellations V (4) Initialization of semi-important stars V (5) Initialization of non-important constellations TODO (6) Initialization of non-important constellation-stars 90% (7) Initialization of non-important solo-stars TODO (8 ) Initialization of quasi-space locations 90% (9) Initialization of important coordinates V (10) Compilation of all previous steps results into a starmap
Resolved 1 memory leak, but it's still not healthy. Benchmark still dies on 300th-400th iteration. Quasi space locations placement will be solved using logics similar to constellations placement - using combination of XY-overlapping-windowing indexer and collisions solver. All hardest tasks are solved, and now just need to apply the tools made, and integrate this whole stuff into game initialization logics. As for the latter, I was also thinking about making a sub-menu for "New Game" -> "Start with original locations" or "Start with randomized locations".
Quite tired by now, as I spent sick leave (from work) and holidays to implement hardest stuff. I have 1 week of vacation left now, and hope to release first good version by end of it - starting from next week things will go very slow again.
|
|
« Last Edit: January 03, 2016, 09:38:34 pm by logarithm »
|
Logged
|
|
|
|
|
Krulle
Enlightened
Offline
Gender:
Posts: 1115
*Hurghi*! Krulle is *spitting* again!
|
Depending on what you want to do, you could also randomly select a topic, and rename the moved solo stars for this topic. Thus naming the reallocated solo stars all like Oregano, Tomato, Pepperoni, Pollo, Salami, ... or Reggae, Ska, Folk, Ondo, Orchestra,....
Pollux(0,124) -> Chicken Organon(0,123) -> Oregano (thus allowing for a whole range of stars with names of pizza/pasta/Italian kitchen ingredients) Regulus(0,122) -> Reggae (and other music styles for other stars) Hyperion(0,121) -> HyperHyper (and other pregnant elements from single top20 music titles) Bellatrix(0,119) -> Bella Trixie (and other female pet names) Groombridge(0,42) -> God's Bridge Vega(0,0) -> Las Vegas (and other names of well-known Earth cities) --end spoiler-- Just an idea, and please kill me for suggesting more work.
BTW: Thanks, I love to see a project which does something and thus keeps this community alive.
I also agree that Groombridge is special, and I still hope to see an implementation of the chat FF and PR3 wanted to implement.
|
|
|
Logged
|
|
|
|
|
logarithm
Zebranky food
Offline
Gender:
Posts: 32
|
Well, all stars having importance index will remain having original content. Including Rainbow-containing and Melnorme-containing stars. Do you want to keep the "Groombridge" name for that Rainbow-containing star? What's so special about this name? Oh, btw, I've decided to make Sirius always be near Sol. I guess everybody knows, that Sirius is the closest neighbour star.
Thanks for supporting words and those contributions. Sometimes it's really important to see, that I'm not alone in my endeavour.
I was hoping to do the final sprint this week, but failed bumping (like silly) on the underestimated complexity of gluing stars with constellations, while avoiding collisions, and making all this random and look nicely. I'll have to backup to the slow pace, where I have much more time to think things over-and-over again, before implementing them at weekends. Besides I spent vacation for rest, and hanged on the new UnderRail game, which is quite nice.
I'm currently thinking about 2 alternative paths of doing things.
(1) I'll start implementing constellation patterns. I'll take those patterns, which are already in original starmap (it will be possible to add more patterns right away, but that's out of priority right now), because generating constellation structures random-and-pretty is harder.
(2) I will assume, that [constellation layouting may to some extent override the graph-layouter resolution]. E.g., let's assume graph-layouter resolved Supox homeworld to be in coordinates 2000:2000, but constellation placed nearby is centered at 2051:2017, and according to constellation pattern there's no star at 2000:2000, but Supox may stick their HW to constellation star located at 1960:2001. One serious problem I'll need to solve here, is avoiding having Supox HW to accidently appear out of Supox SoI. Thus I'll need to pick proper constellation star wisely, still respecting some location-specific distance assumptions. Or, if such pick is impossible (which should be rare), dedicate a solo star here. With all this, I also have some important stars already bound to important constellations (like Pkunk HW); and some other important stars, for which I'll need to generate constellations or solo-star (like Spathi HW).
(3) Avoiding collision of 2 constellations can't be solved by simply putting 2 points (for constellation centres) and circles around them, and checking, that circles don't intersect, or bumping them away, if they intersect. I guess I'll have to do the following: for each constellation pick all nearby constellation, and make sure all it's stars are far enough away from stars of all nearby constellations. Bumping away might include constellation rotation, but I don't see a proper mathematical solution for this yet - how to determine if constellation rotation is better than moving it away. Probably, should use a specific version of springs-based layouter here again... Making it respect problems of (2) makes it more complex.
(4) Maybe I'll have to drop idea of allowing constellations-combinations, like Apodis-Draconis, if (3) won't solve this.
Just make a fast release - the simplest (and ugliest) solution. Without bothering much about constellation prettiness and allow constellations to intersect... After release is done get back to Path#1. Maybe there is an easier way to make things look nice?, but I can't see it.
|
|
« Last Edit: January 08, 2016, 09:00:05 am by logarithm »
|
Logged
|
|
|
|
CelticMinstrel
Enlightened
Offline
Posts: 522
|
Well, all stars having importance index will remain having original content. Including Rainbow-containing and Melnorme-containing stars. Do you want to keep the "Groombridge" name for that Rainbow-containing star? What's so special about this name? I have no idea if there's any special significance to the name "Groombridge".
Oh, btw, I've decided to make Sirius always be near Sol. I guess everybody knows, that Sirius is the closest neighbour star.
If you mean in real life, Alpha Centauri is actually a bit closer than Sirius. However, real life doesn't matter since it's explicitly established that the constellations don't correspond to real-life ones. If you mean because everyone already knows it's the closest star in the SC2 universe, then sure, that seems fine to me.
One serious problem I'll need to solve here, is avoiding having Supox HW to accidently appear out of Supox SoI.
One solution to this would be altering the position of the SoI to ensure the homeworld is within it. That could even be applied to all races, except the Ilwrath whose homeworld can (should?) be outside their SoI.
Also, while we're talking about constellations, one of the ones in/near Orz space (Pavonis, I think?) is missing an Alpha, as I recall. Are you going to retain that oddity? (There are two ways to do it - either pick a random constellation near Orz SoI and delete the Alpha, or don't place an Alpha Pavonis) Mind you, I don't think it's terribly important, and I don't recall it ever being referenced in-game, either.
(3) Avoiding collision of 2 constellations can't be solved by simply putting 2 points (for constellation centres) and circles around them, and checking, that circles don't intersect, or bumping them away, if they intersect. I guess I'll have to do the following: for each constellation pick all nearby constellation, and make sure all it's stars are far enough away from stars of all nearby constellations. Bumping away might include constellation rotation, but I don't see a proper mathematical solution for this yet - how to determine if constellation rotation is better than moving it away. Probably, should use a specific version of springs-based layouter here again... Making it respect problems of (2) makes it more complex. Rather than a bounding circle, you could maybe use a bounding polygon, or simply ensure that no lines between the stars of one constellation cross any of the lines between the stars of the other constellation. In the latter case I think the lines to use would be specified by the constellation's shape - you wouldn't need to check every possible line between the stars of each constellation.
Even though I say "simply", it's probably harder than it sounds.
|
|
|
Logged
|
|
|
|
Krulle
Enlightened
Offline
Gender:
Posts: 1115
*Hurghi*! Krulle is *spitting* again!
|
Also, while we're talking about constellations, one of the ones in/near Orz space (Pavonis, I think?) is missing an Alpha, as I recall. Are you going to retain that oddity? (There are two ways to do it - either pick a random constellation near Orz SoI and delete the Alpha, or don't place an Alpha Pavonis) Mind you, I don't think it's terribly important, and I don't recall it ever being referenced in-game, either. Pavonis is the star constelletaion where you can find an engine.
In Orz/Androsynth space there's the circular Vulpeculae constellation around a Giant, Alpha Vulpeculae, so that's not the one you're searching.
I haven't found a constellation without an "Alpha-Star".... ( http://mooses.nl/uqm/wip/js-starmap/ )
edit: http://www.resonant.org/games/sc2/0/resource.pdf , page 9 following shows all systems, sorted by constellation name. No "Alpha" seems to be missing, but I may have missed it myself when scrolling through the document.
|
|
« Last Edit: January 12, 2016, 02:28:17 pm by Krulle »
|
Logged
|
|
|
|
CelticMinstrel
Enlightened
Offline
Posts: 522
|
I looked over the wiki. It's Corvi I was thinking of, not Pavonis.
|
|
|
Logged
|
|
|
|
Krulle
Enlightened
Offline
Gender:
Posts: 1115
*Hurghi*! Krulle is *spitting* again!
|
Stupid me.
The list I linked does include Corvi Alpha, but without a list of ressources. Instead it reads: "(Victim of interdimensional fatigue)". Somehow I always missed that one constellation is without an "alpha".
So, near Slylandro, and not near Orz...
It may well be that I attributed it to the border of the map. Or never actually paid attention to this.
|
|
|
Logged
|
|
|
|
Pages: 1 2 3 [4]
|
|
|
|
|