Logo Platform
logo amplifiers simplified

MoneyToConvert and Strategic Resource Probabilities for Planet Modding

Reply
Copied to clipboard!
11 years ago
Dec 5, 2013, 6:07:08 PM
Hi,



I'm working on a mod for Endless Space and I've run into a couple of things that I'm not sure about that I don't see answers for on the forum (hopefully I didn't just miss them -_-), so hopefully somebody can help me with these.



1) What exactly does MoneyToConvert do? I see it in a lot of places that mention Money (though not in some of the Planet Anomalies for some reason), but it's not really clear what it's for.



2) When you list the strategic resource probabilities for each planet type, is that the probability of the resource being placed on that planet type overall, or just the probability within that planet type? For example:

PlanetTypeA:

StrategicResource1 Probability="1"

StrategicResource2 Probability="2"

StrategicResource3 Probability="3"



PlanetTypeB:

StrategicResource1 Probability="2"

StrategicResource2 Probability="4"

StrategicResource3 Probability="6"



Do both A and B have the same probability of having each strategic resource (basically I could've put 1, 2, and 3 for B and it would've been the same), or does B have twice as much of a chance of getting each resource? It seems like it should be the latter because there are a set number of strategic resource deposits, but I figure I should make sure.



Thanks for your help.
0Send private message
11 years ago
Dec 6, 2013, 7:28:43 PM
Actually, I know no one's answered the first post yet but I have a couple of other questions if anyone can field them, though this might be up to the devs:



1) I noticed in the tutorial for modding that there are no prefabs for Tundra and Asteroids. Tundra's not too big of a deal, but does this mean that if I want to have asteroids in my game that I need to specifically use the original PlanetTypeAsteroid only? I can make it work if I need to since I can presumably just overwrite the stats and Localization text for them to be what I need, but it means I presumably won't be able to make a custom skin for them (which admittedly makes sense since the texture map would be markedly different, heh).



2) So I tried adding a Unique Planet and I was successfully able to have one show up with the Tundra type. Checking the Galaxy.xml that was generated, it looks like it overrides a random planet in the galaxy with the type specified. Now, I wanted to have a special planet type that was just used for unique planets, but it seems like when I try to assign it that type, it doesn't show up, it just uses whatever type the planet was that it overrode. I'll still be playing around with this one later, but everything seems to be good in terms of planet type definitions so I'm wondering: do you have to make it so that there's at least a chance of the planet showing up during galaxy generation for the game to be able to override it with a unique? I was hoping to not have just random non-unique "special" planet types show up, but I might try putting them with an extremely low chance of appearing and maybe that'll work. Anywho, if I figure it out I'll post my findings here (along with a little tutorial for adding unique planets since there doesn't seem to be one), but if somebody already knows the answer I'd be happy to hear it. Thanks!
0Send private message
11 years ago
Dec 6, 2013, 11:26:21 PM
MrGraves wrote:
Hi,



I'm working on a mod for Endless Space and I've run into a couple of things that I'm not sure about that I don't see answers for on the forum (hopefully I didn't just miss them -_-), so hopefully somebody can help me with these.



1) What exactly does MoneyToConvert do? I see it in a lot of places that mention Money (though not in some of the Planet Anomalies for some reason), but it's not really clear what it's for.



2) When you list the strategic resource probabilities for each planet type, is that the probability of the resource being placed on that planet type overall, or just the probability within that planet type? For example:

PlanetTypeA:

StrategicResource1 Probability="1"

StrategicResource2 Probability="2"

StrategicResource3 Probability="3"



PlanetTypeB:

StrategicResource1 Probability="2"

StrategicResource2 Probability="4"

StrategicResource3 Probability="6"



Do both A and B have the same probability of having each strategic resource (basically I could've put 1, 2, and 3 for B and it would've been the same), or does B have twice as much of a chance of getting each resource? It seems like it should be the latter because there are a set number of strategic resource deposits, but I figure I should make sure.



Thanks for your help.




1. This has to do with the Harmony faction, it is needed for them to purify the system.

2. I don't quite understand what you're asking, but the probability is per planet type, with math saying both of your examples have equal placement odds.
0Send private message
11 years ago
Dec 6, 2013, 11:30:00 PM
MrGraves wrote:
Actually, I know no one's answered the first post yet but I have a couple of other questions if anyone can field them, though this might be up to the devs:



1) I noticed in the tutorial for modding that there are no prefabs for Tundra and Asteroids. Tundra's not too big of a deal, but does this mean that if I want to have asteroids in my game that I need to specifically use the original PlanetTypeAsteroid only? I can make it work if I need to since I can presumably just overwrite the stats and Localization text for them to be what I need, but it means I presumably won't be able to make a custom skin for them (which admittedly makes sense since the texture map would be markedly different, heh).



2) So I tried adding a Unique Planet and I was successfully able to have one show up with the Tundra type. Checking the Galaxy.xml that was generated, it looks like it overrides a random planet in the galaxy with the type specified. Now, I wanted to have a special planet type that was just used for unique planets, but it seems like when I try to assign it that type, it doesn't show up, it just uses whatever type the planet was that it overrode. I'll still be playing around with this one later, but everything seems to be good in terms of planet type definitions so I'm wondering: do you have to make it so that there's at least a chance of the planet showing up during galaxy generation for the game to be able to override it with a unique? I was hoping to not have just random non-unique "special" planet types show up, but I might try putting them with an extremely low chance of appearing and maybe that'll work. Anywho, if I figure it out I'll post my findings here (along with a little tutorial for adding unique planets since there doesn't seem to be one), but if somebody already knows the answer I'd be happy to hear it. Thanks!




1. There is a tundra prefab, it's just not listed. I assume the same for asteroids, though i've never tried. I don't see why you wouldn't be able to use custom textures. The only prefab i know if that's broken is the lava prefab.

2. You do not have to add that new type to galaxy settings. I've added several unique planet types for the upcoming version of my mod (A Galaxy of Endless Diversity) just fine. It sounds like you are just not adding the new planet type correctly.
0Send private message
11 years ago
Dec 7, 2013, 6:00:17 AM
Awesome, thanks for your help.



LogicSequence wrote:
2. I don't quite understand what you're asking, but the probability is per planet type, with math saying both of your examples have equal placement odds.




Okay, so is there a way to make it so that certain planet types are more likely to be selected overall to have strategic resources added to them? It sounds like the galaxy generation chooses a planet at random and then figures out what resource to assign it based on PlanetStrategicResourcePerPlanetType probabilities; in theory you could make it slightly more likely for a planet type to be selected by giving probabilities for all resources > 0 (i.e., if all of the resource deposits except say, Hexaferrum, have been assigned near the end of the process, then planets that have PlanetStrategicResourceHexaferrum > 0 will be getting the last few resource deposits, so planet types with lots of them are more likely to pick up some extras at the end), but I'd imagine the %s won't be too noticeable. What I'd like to see is, have a planet type that's significantly more likely to get strategic resources (and also one for luxury resources), which would make them a priority for militant factions even if they don't have Mineral Memory and haven't unlocked all the resources yet.



LogicSequence wrote:
1. There is a tundra prefab, it's just not listed. I assume the same for asteroids, though i've never tried. I don't see why you wouldn't be able to use custom textures. The only prefab i know if that's broken is the lava prefab.

2. You do not have to add that new type to galaxy settings. I've added several unique planet types for the upcoming version of my mod (A Galaxy of Endless Diversity) just fine. It sounds like you are just not adding the new planet type correctly.




RE: Asteroids: I played around with it a bit, and Graph/CelestialBodies/Planets/PL_Asteroids_A seems to be the thing to do, but when I try to use that I get this when the game starts:



NullReferenceException: Object reference not set to an instance of an object

at ViewMapper+c__IteratorC6.MoveNext () [0x00000] in :0

UnityEngine.MonoBehaviour:StartCoroutine(String, Object)

c__IteratorC5:MoveNext()



I can continue playing but if I load up a game, the "asteroid planet" is a dull blank gray sphere instead of the shiny white blank sphere I usually get if there's a typo. That tells me that that's probably the right name but I'm not sure what this error is all about. I tried verifying integrity of game cache and also supplying a model folder with some valid textures that work fine on other planets, but it doesn't seem to actually change anything. I'll keep playing around with it though, it could just be something wonky with my computer.



As far as the unique planets go, yeah, I'd imagine there's some mistake in my code somewhere (this undertaking is a lot bigger than I thought, heh), but I'm glad to hear that somebody was able to successfully implement unique planet types so I know it can be done! Also looking forward to seeing what you've got planned for AGED, that's a great mod. Thanks again!
0Send private message
?

Click here to login

Reply
Comment