Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 237 238 [239] 240 241 ... 710

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 1727369 times)

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3570 on: September 09, 2017, 11:48:30 PM »

1) Anyone using intellij know why recompiling would add 100mb each compile despite no script changes?? My jar is now at 1.2 gb from relatively minor scrip cleanup and other small changes. At this point netbeans is looking way more attractive... >:(

Think I'm on to something with this. Its definitely something I'm not understanding with how the IDE is building its modules. Its compiling the whole mod into the jar.. including the prior jar containing, you guessed it, the whole mod, again, each compile. So that's why its exponentially growing.

I just don't quite understand what to do to stop it without breaking everything  :-\
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3571 on: September 10, 2017, 08:13:09 AM »

I'm not familiar with intellij, but: my guess would be the output directory for the jar is inside the directory that's configured as the "source" directory for the project. It might be possible to exclude a specific file, or you might have to move it somewhere else. Again, though, not familiar w/ it so this is just a guess.
Logged

Morrokain

  • Admiral
  • *****
  • Posts: 2143
  • Megalith Dreadnought - Archean Order
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3572 on: September 10, 2017, 10:32:03 AM »

I'm not familiar with intellij, but: my guess would be the output directory for the jar is inside the directory that's configured as the "source" directory for the project. It might be possible to exclude a specific file, or you might have to move it somewhere else. Again, though, not familiar w/ it so this is just a guess.

It was a good guess (also what I was thinking) but, no, moving the output directory outside of the source directory doesn't solve the problem. At 1.5gigs for the jar now when the scripts equal 50kb respectively.

Edit: Interesting. I didn't expect it to actually remove the prior jar from the source directory. So I'm about 90% sure now changing the directory just makes the IDE move the jar and still attempt to overwrite, adding to it. I think I'm going to start a fresh project and just move the source scripts. See if that helps.

EDIT: Solved!

Needed to further reduce the scope of the source directory. It was one level higher than it should have been and so it was still wrapping in the jar and way more than it should have been  ::) I also realized I could just exclude everything but the source directory for the scripts themselves with tags under project structure - artifacts.

Then I just needed to rebuild the jar to a completely separate directory I isolated on my desktop- for certainty. Then move the new complied (17kb!) jar back to the main mod directory (where the mod plug-in references it)

Mod also loads and runs ~3 times faster  ;D
« Last Edit: September 10, 2017, 11:38:53 AM by Morrokain »
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3573 on: September 11, 2017, 09:34:57 AM »

I ran into a bizarre issue with EZ Faction last night that blocked a release. 

In the System Overview UI panel, where we can see the planets, their Conditions etc., and in the Intel Menu's Planet list... the planets I've been building procedurally are showing up twice.   Same names, same everything, but there are two of them.

You can click on either without any errors, but when you go to the Map View, there's only one planet, and there's only one Planet if you visit the System (and it's interacting with things just fine, with no crashes or odd behavior).

It's really weird and it's a new issue; I'll probably pull a diff with the older versions and see what's up but I was wondering what the heck I should go hunting for; most of the changes made this time for the original EZ Faction colony planets were, I thought, superficial; I mainly just changed how the planets' orbits got assigned. 

I also tried to write some code to check and see if they were duplicate Markets or something odd like that, but no luck thus far.  I haven't tried to see if I actually have two PlanetAPI's that are identical in place and name; this seems rather unlikely, given how my code works, but I haven't tried that yet.

So... how does that code pull up the Planet list for the System?  Any hints as to what it's evaluating would be appreciated.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3574 on: September 11, 2017, 10:02:16 AM »

My guess is you've got two copies of the same star system - that'd be tough to spot (the jump-points may look a bit brighter) - but aside from that it would appear normal. I don't see how it could get multiple copies of the same planet in that list otherwise, it just goes through all the star systems and all their planets to create the list.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3575 on: September 11, 2017, 01:50:11 PM »

Whoa, that'd be weird... because I don't think I'm creating any star systems; that's kind of the point of how EZ Faction works.  

Perhaps an odd copy happens somewhere.  I'll look into this a little further; there's one weird theory I haven't tested just yet.

Well, that didn't pan out.  I suppose now I need to write something that looks for Systems that got copied somehow.
« Last Edit: September 11, 2017, 02:40:06 PM by xenoargh »
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Nicke535

  • Commander
  • ***
  • Posts: 240
  • Degenerate Core
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3576 on: September 12, 2017, 04:38:44 AM »

Whoa, that'd be weird... because I don't think I'm creating any star systems; that's kind of the point of how EZ Faction works.  

Perhaps an odd copy happens somewhere.  I'll look into this a little further; there's one weird theory I haven't tested just yet.

Well, that didn't pan out.  I suppose now I need to write something that looks for Systems that got copied somehow.

If it helps, your error isn't all that new: running the old 0.3 version of EzFaction triggers the same error on the Crystanite (have yet to test other factions with the old one)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3577 on: September 12, 2017, 08:30:15 AM »

Yeah, it's really weird, and I didn't notice, unfortunately.  I'm looking at Alex's code for ProcGen to see if I can puzzle out what's happening there.  I'm definitely not making any new Systems; I've ruled out copies of the PlanetAPI or MarketAPI as best as I can. 

I spent some time being stumped by this last night; since I can't see the UI code, I simply don't know what it's looking for there that causes it to find a "duplicate".
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3578 on: September 12, 2017, 11:24:56 AM »

Possible that you're adding the market to the economy several times? Not sure that'd do it, but it just might.
Logged

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3579 on: September 12, 2017, 11:56:09 AM »

Project Properties (right-click on the project in Projects window, or use the File menu) -> Sources -> Set Source/Binary Format to JDK 7

Just FYI - I did get a IDE, followed all the advice here and the .jar still won't compile properly or something.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3580 on: September 13, 2017, 08:34:41 AM »

I'm still trying to find MarketAPI copies and kill them; that's the best theory I've got.  I'll take another look at this issue tonight.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

TrashMan

  • Admiral
  • *****
  • Posts: 1325
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3581 on: September 13, 2017, 08:38:49 AM »

I'm still trying to find MarketAPI copies and kill them; that's the best theory I've got.  I'll take another look at this issue tonight.

Are you sure it's just not some faction that causing this? I know some add their own systems. Or did you only test it with Explorers Society?
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3582 on: September 13, 2017, 08:57:09 AM »

I have four Factions that all are using EZ Faction doing stuff in my tests here; one's Explorer Society, one's Pirates (the Pirate-station feature request) and a couple of others that aren't public yet.  I'm fairly certain that the issue's related to how the Markets are getting set up, but I'm still not entirely certain how copies could be present, nor am I totally certain I've found any copies; I just built some code to attempt to kill copies but it was late and I was tired when I did; I'm sure it wasn't adequate and when I figure this out, it'll be "really obvious", lol.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3583 on: September 13, 2017, 11:19:50 AM »

Hmm.  Still seeing things here that lead me to believe there's some weird issues with this.  It's almost like the MarketAPI's getting "attached" to the PlanetAPI twice, which doesn't look possible; SectorEntityToken getMarket() doesn't return multiple MarketAPIs.

What's really strange is... this bug doesn't happen with the Stations.  Just the PlanetAPIs.

I've ruled out multiple copies of the PlanetAPI; I'm not building new Systems.  

Alex, what we're seeing here looks like this, btw:




So... here's the code that builds the planets right now:

Spoiler
Code: java
private static SectorEntityToken buildEntity(StarSystemAPI pickedSystem, FactionAPI faction, int minMarketSize, int maxMarketSize, boolean isCapital){
int marketSize = MathUtils.getRandomNumberInRange(minMarketSize, maxMarketSize);
if(isCapital) marketSize = maxMarketSize;
if(pickedSystem == null) return null;

if(faction == null) return null;
if(pickedSystem.getStar() == null) return null;
if(pickedSystem.getStar().getName() == null) return null;
if(faction.getId() == null) return null;
if(pickedSystem.isHyperspace() || pickedSystem.isNebula()) return null;
SectorEntityToken ezColony;
try{
String starName = pickedSystem.getStar().getName();
String factionID = faction.getId();
String denomination = pickDenomination(pickedSystem,faction,false,true);
ezColony = pickedSystem.addPlanet(starName + factionID + "planet" + denomination,//Attempts to build a random numbered location id; needs improving
pickedSystem.getStar(), starName+" "+ denomination,//Probably needs improving
planetType(faction),//Pulls a string at random
MathUtils.getRandomNumberInRange(30f,60f),//Angle
MathUtils.getRandomNumberInRange(50f,300f),//Radius
MathUtils.getRandomNumberInRange(4000f,8000f),//Orbital radius
MathUtils.getRandomNumberInRange(100f,300f));//Orbital period
ezColony.addTag("customColony");
}catch (Throwable ex) {
return null;
}


ezColony.setFaction(faction.getId());
ezColony.setInteractionImage("illustrations", ILLUSTRATIONS.get((int)MathUtils.getRandomNumberInRange(0, ILLUSTRATIONS.size()-1)));
ezColony.addTag(Tags.STATION);
MarketAPI market = Global.getFactory().createMarket(faction.getId() + ezColony.getId() +"_market"+MathUtils.getRandom(), ezColony.getName(), 0);
ezColony.setMarket(market);
market.setPlanetConditionMarketOnly(false);
market.addCondition(Conditions.SPACEPORT);
market.addCondition(Conditions.OUTPOST);

market.setFactionId(faction.getId());

market.setSurveyLevel(SurveyLevel.FULL);
market.setPrimaryEntity(ezColony);

//Set up all of the Market Conditions here
if(isCapital == true || MathUtils.getRandomNumberInRange(0f, 100f) > 66f) market.addCondition(Conditions.MILITARY_BASE);
setMarketConditions(market, marketSize, ezColony, false);

//Set the market's size and population here
market.setSize(marketSize);
assignPopulation(market,marketSize);

market.addSubmarket(Submarkets.SUBMARKET_OPEN);
if(market.hasCondition(Conditions.MILITARY_BASE)){
market.addSubmarket(Submarkets.GENERIC_MILITARY);
}
market.addSubmarket(Submarkets.SUBMARKET_BLACK);
market.addSubmarket(Submarkets.SUBMARKET_STORAGE);

market.getSubmarket(Submarkets.SUBMARKET_OPEN).getCargo().addCommodity(Commodities.FOOD, 1000);
market.getSubmarket(Submarkets.SUBMARKET_OPEN).getCargo().addCommodity(Commodities.LUXURY_GOODS, 100);
market.getSubmarket(Submarkets.SUBMARKET_OPEN).getCargo().addCommodity(Commodities.ORGANICS, 3000);
market.getSubmarket(Submarkets.SUBMARKET_OPEN).getCargo().addCommodity(Commodities.VOLATILES, 3000);
market.getSubmarket(Submarkets.SUBMARKET_OPEN).getCargo().addCommodity(Commodities.HEAVY_MACHINERY, 1000);
market.getSubmarket(Submarkets.SUBMARKET_OPEN).getCargo().addCommodity(Commodities.METALS, 1000);
market.getSubmarket(Submarkets.SUBMARKET_OPEN).getCargo().addCommodity(Commodities.RARE_METALS, 1000);
market.getSubmarket(Submarkets.SUBMARKET_OPEN).getCargo().addCrew(300);
market.getSubmarket(Submarkets.SUBMARKET_OPEN).getCargo().addFuel(5000);

Global.getSector().getEconomy().addMarket(market);

buildCommRelayIfNeeded(pickedSystem,faction);

Logger log = Global.getLogger(CoreScript.class);
log.info("Created EZ Faction Colony " + ezColony.getName() + " for Faction " + faction.getDisplayName() + " at System " +pickedSystem.getBaseName());

return ezColony;
}
[close]

IDK what's doing this; all I know thus far is that Global.GetSector().GetEconomy().addMarket() is really sensitive to the order of operations; all Conditions and SubMarkets appear to need to be defined first.  I really am pretty stumped by this one; nothing's technically "broken" in an obvious way; the NPE issue reported in the last build of EZ Faction was unrelated.  

It's just presented incorrectly in the game UI.
« Last Edit: September 13, 2017, 12:47:28 PM by Alex »
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #3584 on: September 13, 2017, 12:58:23 PM »

Weird. Nothing jumps out right off, but that's not *all* of the code, so it's hard to say.

Code: java
for (PlanetAPI planet : system.getPlanets()) {
MarketAPI market = planet.getMarket();
if (market == null || market.getSurveyLevel() != SurveyLevel.NONE) {
planets.add(planet);
}
}
planets.addAll(getStandaloneStations(system));

This is how it picks what entities to display on that screen, btw. One case I can see is if a market has a station and it's the "primary" entity for the market instead of the planet being the primary entity - then it would show up twice, but I'd expect both planet and station to show up then rather than two planets, so never mind.

Edit: I would suggest the time-honored practice of commenting stuff out gradually until the problem goes away.
Logged
Pages: 1 ... 237 238 [239] 240 241 ... 710