Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: StarSystemGenerator.addOrbitingEntities() "withSpecialNames" not working?  (Read 2212 times)

WadeStar

  • Ensign
  • *
  • Posts: 30
    • View Profile

This isn't an in-game bug so much as something that doesn't seem to be working in the modding scripts.

The method signature is: addOrbitingEntities(StarSystemAPI system, SectorEntityToken parentStar, StarAge age, int min, int max, float startingRadius, int nameOffset, boolean withSpecialNames)

And I believe if "withSpecialNames" is false, then planets are named using the Star's name and a numeric based off of "nameOffset".

Thing is, whether I set that value to true or false, planets are always generated with custom names. I don't know why. I can provide sample source code if needed. But I think this method isn't working as intended.

Hope this is the right forum for this. I wasn't sure if I should post in modding, but I didn't see any other threads there related to bugs...
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile

Hmm - tried changing the call in Corvus to pass in false for the special names parameter. Results are as expected, with Corvus IV/V names:

https://imgur.com/a/2pLj0AO

Nothing immediately jumps out as being wrong in that method's code, either. So either 1) I'd fixed something here since the release (which is possible) or 2) we're doing something different.

For a quick test, could you change your Corvus.java to pass in false in the addOrbitingEntities() call? If that still assigns special names for you, we'll know it's been fixed.
Logged

WadeStar

  • Ensign
  • *
  • Posts: 30
    • View Profile

Thanks, yes I'll take another look this weekend. I can always send my code for the mod I'm working on too.

Also thanks for moving the topic. I couldn't find the modding bug report forum for some reason.
Logged

WadeStar

  • Ensign
  • *
  • Posts: 30
    • View Profile
StarSystemGenerator.addOrbitingEntities() still not working as expected...
« Reply #3 on: October 06, 2018, 08:58:24 AM »

Ok, I'm still getting odd behavior from using it.

Here's a link to my source code:
https://github.com/WadeStar/StarSector-Modding-Tutorials/blob/master/MakeAStar/data/scripts/MaSModPlugin.java

In addition to always getting custom names, another thing I've noticed is that it seems the StarSystemGenerator min count is also including entities I've added explicitly. So even though I specify a minimum of 2 new entities, I often see only one added. And sometimes it's an accretion disk, which also seems odd for StarAge.AVERAGE...

Am I missing something fundamental here? Maybe I have the wrong version of StarSector installed???

The entire mod can be downloaded off github. I'm working on a series.
https://github.com/WadeStar/StarSector-Modding-Tutorials
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile

Did you do the Corvus test?

For a quick test, could you change your Corvus.java to pass in false in the addOrbitingEntities() call? If that still assigns special names for you, we'll know it's been fixed.

So even though I specify a minimum of 2 new entities, I often see only one added. And sometimes it's an accretion disk, which also seems odd for StarAge.AVERAGE...

Min/max are the number of attempts to add an entity, so you may end up with nothing, depending on RNG. An accretion disk is a possible entity in any system age, but only on the first (closest-to-star) orbit.

For more details on all that (though it's also liable to be a bit confusing, since there's a lot of stuff there), check out:

data/campaign/procgen/planet_gen_data.csv
Logged

WadeStar

  • Ensign
  • *
  • Posts: 30
    • View Profile

Line 211 of my Corvus.java is set to false:

Code
float radiusAfter = StarSystemGenerator.addOrbitingEntities(system, star, StarAge.AVERAGE,
  2, 4, // min/max entities to add
  12500, // radius to start adding at
  3, // name offset - next planet will be <system name> <roman numeral of this parameter + 1>
  false); // whether to use custom or system-name based names

I still get the custom names, though. The first planet always seems to be called "Somnus" as well.
If it's working on your end it must be my version of the game. I checked and I'm running 0.8.1a-RC8.

Thanks for clarifying the details on the entity generation! I'll make a note of that.
And thanks for following-up with me.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23987
    • View Profile

Alright, cool - so we're good, then, must've been something I'd since fixed on my end.

Kind of funny about Somnus - the name should be random, but there used to be a hardcoded planet in Corvus named Somnus, many versions ago.

Although, actually, the naming is not entirely random - certain names for parents (i.e. star -> planet, planet -> moon) mean that the children pull from a specific name set that's related. And, right, for Corvus, Somnus is part of that set, along with a couple other names.

Check out name_gen_data.csv if you're interested - that one is actually fairly simple :)
Logged

WadeStar

  • Ensign
  • *
  • Posts: 30
    • View Profile

Yeah, I figured it was a sort of pseudo-random procedure. With more testing I found that it's not guaranteed to be Somnus but Somnus is very popular on the naming list! I have a hunch that any other additional entities created in the mods will throw it off entirely. Like right now in my test mod I get accretion disks very frequently. It's interesting to see how it works.

If I have any other issues, I'll let you know, but I think I have what I need to finish the tutorial!
Logged