Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Pages: 1 2 3 [4] 5 6 ... 11

Author Topic: Random Code Mistakes Thread  (Read 36285 times)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Random Code Mistakes Thread
« Reply #45 on: February 09, 2016, 09:01:09 AM »

Thanks - but this is actually correct!

The methods are supposed to scale the number of of ships/weapons down by the provided multiplier, hence the parameter name. Can't possibly expect anyone to tell that's what's intended just from the name or usage, though :)
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Random Code Mistakes Thread
« Reply #46 on: February 09, 2016, 09:24:41 AM »

You misunderstand; as implemented, using an argument of 1 will remove all stacks of weapons except stacks of 1.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Random Code Mistakes Thread
« Reply #47 on: February 09, 2016, 09:30:31 AM »

Ahh, gotcha. Was just looking at the random-check related lines, not the other stuff.

Changed it to:

cargo.removeItems(stack.getType(), stack.getData(), Math.round(qty * (1f - mult)));
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Random Code Mistakes Thread
« Reply #48 on: March 04, 2016, 12:00:24 PM »

MarketProcurementMissionCreator.java:381

Code
	protected boolean doNearbyMarketsHave(MarketAPI from, String commodityId, float minQty) {
if (from.getContainingLocation() == null || from.getContainingLocation().isHyperspace()) return false;

It excludes hyperspace, which causes imbalanced behavior such as hyperspace stations offering procurement missions that you can fulfill with goods already present at that station.  It's basically like printing money.  Removing the hyperspace check shouldn't cause instability.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Random Code Mistakes Thread
« Reply #49 on: March 05, 2016, 02:19:10 PM »

Thanks, fixed. That was a holdover from when all markets in the same location were considered "nearby" (which still would've mucked up hyperspace stations, but made some sense otherwise.)
Logged

Embolism

  • Admiral
  • *****
  • Posts: 511
    • View Profile
Re: Random Code Mistakes Thread
« Reply #50 on: March 07, 2016, 05:57:17 AM »

The variant file "Kite_pirates_Raider" has a variantID of "Kite_Raider". This isn't normally a problem but apparently it makes it impossible to replace with a mod: usually having a mod variant file with the same name and variantID replaces it.


EDIT:

So what's actually the problem is that there is a "Kite_Raider" file outside the kite folder that also has the variantID "Kite_Raider" (same as the file "Kite_pirates_Raider" in the kite folder). The two files are actually different loadouts so it appears this does have an effect in vanilla.
« Last Edit: March 07, 2016, 06:04:07 AM by Embolism »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Random Code Mistakes Thread
« Reply #51 on: March 07, 2016, 09:04:12 AM »

Thanks! Fixed.
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Random Code Mistakes Thread
« Reply #52 on: March 26, 2016, 01:14:10 PM »

RepairEnoughSupplies.java:23-33
Code
		if (entity.getFaction().getRelationship(playerFleet.getFaction().getId()) >= 0) {
float needed = playerFleet.getLogistics().getTotalRepairAndRecoverySupplyCost();
if (needed > 0) needed = Math.max(1, Math.round(needed));
float supplies = playerFleet.getCargo().getSupplies();

if (supplies < needed) {
return false;
}
}

return true;

Full Repairs ignores the player's available supplies if their reputation is below 0 but above Inhospitable.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Random Code Mistakes Thread
« Reply #53 on: March 26, 2016, 02:11:28 PM »

Thank you, fixed.
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4688
    • View Profile
    • GitHub profile
Re: Random Code Mistakes Thread
« Reply #54 on: April 09, 2016, 02:20:19 AM »

IsSeenByPatrols/IsSoughtByPatrols doesn't check if the patrol fleet is busy with something else. This can cause edge case annoyances like the market locking the player out for longer than necessary because a patrol wants to scan the player while in a battle with someone else.
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Random Code Mistakes Thread
« Reply #55 on: April 09, 2016, 03:38:23 AM »

MarketProcurementMissionCreator.java:329-339

Code
		if (market.getSize() == 4) {
quantity = Math.min(quantity, 200);
} else if (market.getSize() == 5) {
quantity = Math.min(quantity, 500);
} else if (market.getSize() == 6) {
quantity = Math.min(quantity, 1000);
} else if (market.getSize() == 7) {
quantity = Math.min(quantity, 2000);
} else if (market.getSize() >= 8) {
quantity = Math.min(quantity, 10000);
}

Missing cases for markets smaller than size 4; effect is an abundance of huge procurement missions, such as 4500 harvested organs to a size-3 pirate backwater.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Random Code Mistakes Thread
« Reply #56 on: April 09, 2016, 08:24:04 AM »

Thanks - fixed.
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Random Code Mistakes Thread
« Reply #57 on: April 17, 2016, 09:42:11 PM »

TachyonLanceEffect.java
Code
fireInterval.advance(beam.getDamage().getDpsDuration());
Results in a massive power-up when the player is under the effects of time dilation because getDpsDuration is much larger under a time-scale divider.  Not sure if it's the script's fault or the getDpsDuration() function's fault, but in any case the current behavior is wrong.

Ion Beam has a similar issue.  Unfortunately, neither of these weapons can be mounted on the Scarab, so it's not possible to reproduce in vanilla.
« Last Edit: April 17, 2016, 09:44:26 PM by Dark.Revenant »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24128
    • View Profile
Re: Random Code Mistakes Thread
« Reply #58 on: April 22, 2016, 01:58:41 PM »

Just gave it a quick try on a Scarab with a large slot - a full Tachyon Lance burst against an Onslaught does right around the same amount of damage (high 600s) while the system is off and while the system is at full strength. What am I missing?
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia
Re: Random Code Mistakes Thread
« Reply #59 on: April 22, 2016, 06:07:27 PM »

It creates approximately three times more EMPs.  If you've changed the way that time dilation works under the hood, it may be different on your build.
Logged
Pages: 1 2 3 [4] 5 6 ... 11