Pages: [1]
|
|
|
Author
|
Topic: Starmap Editing - plandata.c (Read 5761 times)
|
MasterNinja
Frungy champion
Offline
Posts: 80
|
For 2 days I've been tinkering with the Source Code and will *perhaps* make a single-player mod, something like the one Nicholai does (if he still works on it).
For now I'm playing around with the starmap and began to write a small tool to help me with editing the starmap. A search in this forums has revealed that it's "dangerous" to move "special stars", those which have items, homeworlds, aliens or something like that in them, because changing the coordinate also change the seed and therefore may result in a system which does not fit to the assumptions made by the code generating e.g. a homeworld or an item.
But now let's see... I think there are some special locations which are completely safe to move... I have not yet tried that because I first wanted opinion of people who know the code better. So, I think safe are:
Melnorme traders -- because they are not dependent on any planet but just hang around in their ship, this would not be a problem, I think.
Rainbow worlds -- these are always the first planet in a system and because the game never generates systems WITHOUT planets, they could be moved anywhere and would always find a first planet to turn into a Rainbow World.
Sol -- since this system is completely hardcoded and does not depend on coordinates as seeds (even has it's own seed in it, changing this does slightly changes the system (only minerals on planets and the position of some planets in their orbit), but causes no problems - I've tested that). But of course you will have to change the other two appearances of Sol's coordinated in the Source Code! (just search for "1752")
Can you think of other Stars which would be safe to move? Or do you think I am wrong with one of my ideas?
The idea I have for "unsafe" star systems to move: First I let them at their old place, but want to move them later... Then in the game I will look for another system which meets the preferences for the special world that I want to move... and then I move the special world to this world's coordinates while I put this world to some other place... Do you think this would work?
I've also problems understanding the QuasiSpace portals in plandata.c, could somebody help me?
// QuasiSpace locations #define VORTEX_SCALE 20 {{(-12* VORTEX_SCALE) + 5000, (-21 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{( 1 * VORTEX_SCALE) + 5000, (-20 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(-16 * VORTEX_SCALE) + 5000, (-18 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{( 8 * VORTEX_SCALE) + 5000, (-17 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{( 3 * VORTEX_SCALE) + 5000, (-13 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(-21 * VORTEX_SCALE) + 5000, (-4 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(-4 * VORTEX_SCALE) + 5000, (-4 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(-12 * VORTEX_SCALE) + 5000, (-2 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(-26 * VORTEX_SCALE) + 5000, (2 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(-17 * VORTEX_SCALE) + 5000, (7 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(10 * VORTEX_SCALE) + 5000, (7 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(15 * VORTEX_SCALE) + 5000, (14 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(22 * VORTEX_SCALE) + 5000, (16 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(-6 * VORTEX_SCALE) + 5000, (19 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, {{(10 * VORTEX_SCALE) + 5000, (20 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132},
{{6134, 5900}, MAKE_STAR (DWARF_STAR, YELLOW_BODY, -1), 0, 0, 132},
|
|
|
Logged
|
|
|
|
|
meep-eep
Forum Admin
Enlightened
Offline
Posts: 2847
|
Each specially generated solar system has its own file sc2code/plantets/gen*.c. They can there override the default behavior for solar system, world, ships, minerals, bio and energy generation. Often they first call the general generation routine by calling GenerateRandomIP() and then make changes to the result.
I think that your conclusion about the stars which would be safe to move anywhere is correct. Note that you could still move others if you make sure that the new location has certain properties, or if you change the code which depends on these properties.
It looks like quite a lot of the special locations wil be safe to move. Often they just change the first planet. And if they use moons, but set 'NumPlanets' on individual planets in GENERAL_PLANETS, then the moon generation should be ok too. The Spathi homeworld for instance looks ok to move.
As for the QuasiSpace question, let's look at one of the entries: {{(-12* VORTEX_SCALE) + 5000, (-21 * VORTEX_SCALE) + 5000}, MAKE_STAR (DWARF_STAR, WHITE_BODY, -1), 0, 0, 132}, These are fields just like in starmap_array in plandata.c. The "{(-12* VORTEX_SCALE) + 5000, (-21 * VORTEX_SCALE) + 5000}" part specifies the location of the portal in QuasiSpace. "{5000, 5000}" would be the centre of the map, and "{0, 0}" would be the bottom left. Here the portal is placed "12 * VORTEX_SCALE" units to the left, and "21 * VORTEXT_SCALE" units to the bottom, from the centre of the map. The reason for this VORTEX_SCALE constant seems to be to be able to move all the portals apart just by modifying this one constant. The "MAKE_STAR (DWARF_STAR, WHITE_BODY, -1)" determines what kind of "star" this would be, but for portals the only thing that this determines is the picture that is used for the portal. It seems that these are taken from a different list of pictures than for normal stars, as the normal portals don't look like white dwarf stars, nor does the Arilou homeworld look like a yellow dwarf star. The first "0" specifies if special solar system generation code is used; as these "solar systems" are never really entered, these values should just be left to 0. The last two values specify the prefix and postfix names. Things like "Beta" and "Corvi". These are indices in string tables in starcon.txt from the content. The 0 specifies an empty prefix, and 132 stands for "UNKNOWN".
|
|
|
Logged
|
“When Juffo-Wup is complete when at last there is no Void, no Non when the Creators return then we can finally rest.”
|
|
|
MasterNinja
Frungy champion
Offline
Posts: 80
|
Thank you for the posts, ok, I undestood the QuasiSpace Portals...
but where do I find the specifications, where you come out in HyperSpace if you enter a QuasiSpace portal? is this also generated per "seed" from the location of the portal in QuasiSpace?
|
|
|
Logged
|
|
|
|
|
Nicholai
Zebranky food
Offline
Gender:
Posts: 32
|
Hey,
I'm excited to see more people messing with this stuff!
I don't know much about the true nature of the code, but I know a great deal (at this point) about how to get a desired effect with a given star system. Like Meep-Eep was saying; the sc2code/plantets/gen*.c files contain relevant data for overriding the randomly generated star systems.
Some of them, such as gensol.c, actually dictate the NUMBER of planets in the system, in addtion to their characteristics.... While MOST of the gen* files simply modify the existing characteristics of, say, the second planet in the solar system (whatever that planet may have been randomly generated as).
I've found that the easiest thing to do is just set the new star coordinate, build the game, play it, and if the modified planet (say it's the fifth planet) does not exist (say that the randomly generated system only has three planets) -- then you can just move the star by one coordinate (X or Y) and try again, until the seed presents you with a satisfactory star system.
You can also cheat by using the relevant code in gensol.c to specifically generate a set number of planets IN your star system if you really have your heart set on a SPECIFIC coordinate and star color / size, and need your item/event to be on the fourth moon of the ninth planet (which unlikely to be randomly created at a given spot)
At this point, I've moved every single race, homeworld, item, etc. and created a whole bunch of new ones in addition....... Anything is possible!
|
|
|
Logged
|
~ Nicholai
|
|
|
Angelfish
Enlightened
Offline
Posts: 568
|
Don't mind me, just kicking this topic now
If anyone wants to create a mod/clone that is mostly canon, and doesn't want to have to play through SC2/UQM to get the correct data for the planets and star systems, what would be the best way to go about it?
For the hyperspace coordinates it's quite easy as those values are available from the coding, but for the actual number of planets for each starsystem and their types etc it's quite complicated..
I was personally thinking of 2 options: 1) Using the original UQM code and algorhytms that generated those star systems and using/emulating them in the mod/clone to generate these systems again in the new game. Possible problems could involve not being able to emulate the random number generator correctly. 2) Changing the UQM code to write the star system and planet data to one or multiple easily importable files (for example XML), which can then be used in other mods/clones.
What do you guys think about this? Or are there better options?
|
|
« Last Edit: July 23, 2009, 07:45:44 pm by Angelfish »
|
Logged
|
|
|
|
|
Angelfish
Enlightened
Offline
Posts: 568
|
Thanks for your quick response Meep-eep! I'll check out option 2, because it seems to be the easiest one .
|
|
|
Logged
|
|
|
|
|
logarithm
Zebranky food
Offline
Gender:
Posts: 32
|
Hi, anyone tried to import this data back into the game? I'm interested in having a code which would do the import (in context new effort). Probably, gonna have to write it myself anyway... ))
|
|
|
Logged
|
|
|
|
CelticMinstrel
Enlightened
Offline
Posts: 522
|
It wouldn't be possible to import the data back into the game without major changes to the code. The game normally generates this data on the fly when starting.
|
|
|
Logged
|
|
|
|
Pages: [1]
|
|
|
|
|