Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Commit

Permalink
1.6.2 Minor governor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
coder111111 committed Apr 22, 2020
1 parent a46ea09 commit 4c254fc
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 11 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,33 @@ amount of micromanagement needed drastically.

To run the mod:

* Download my distribution of ROTP-1.6.1.jar (large file) and run that instead of
* Download my distribution of ROTP-1.6.2.jar (large file) and run that instead of
original game.

or

* Download only the ROTP-1.6.1-governor.jar
* Download only the ROTP-1.6.2-governor.jar
* Place it in same directory that contains original Remnants.jar version Beta 1.4
* Run ROTP-1.6.1-governor.jar
* Run ROTP-1.6.2-governor.jar

To enable governor, use 'q' key on keyboard, or else click "Allocate Spending"
text in the planetary spending screen. Since version 1.6.1 Governor is on by default.
text in the planetary spending screen. Since version 1.6.2 Governor is on by default.

---

Additional features.

* ROTP-1.6.1-mini.jar is now provided. It uses WebP images and Ooo Vorbis sounds.
* Changed in 1.6.2. Governed colonies are now shown in green in colonies list.
If autotransport is on, maximum population reached message should not be shown
for governed planets and governor won't spend production on population growth if
only 1-3 population remains until limit. Also, my email is shown in case of error.

Some problems with ROTP-mini have been fixed. I also found out that to run on
Windows, ROTP-mini needs "vcruntime140d.dll" & "ucrtbased.dll" to run. Please get
them and place them in the same directory. This issue has been raised with WebP
library authors already: https://github.com/sejda-pdf/webp-imageio/issues/1

* ROTP-1.6.2-mini.jar is now provided. It uses WebP images and Ooo Vorbis sounds.
It should have all the same features as ROTP but take up less space (~193 MB). Since
WebP library uses native parts, this will only work on Windows (32 and 64 bit),
Mac OSX 64 bit, Linux 64 bit. If you have a different system, use full-size ROTP.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.rayfowler</groupId>
<artifactId>ROTP</artifactId>
<version>1.6.1</version>
<version>1.6.2</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
3 changes: 3 additions & 0 deletions src/assembly/governor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<include>**/GovernorOptions*.class</include>
<include>**/GovernorOptionsPanel*.class</include>
<include>**/Galaxy*.class</include>
<include>**/AIGovernor*.class</include>
<include>**/SystemListingUI*.class</include>
<include>**/ErrorUI*.class</include>
<include>**/en/labels.txt</include>
</includes>
<outputDirectory>/</outputDirectory>
Expand Down
2 changes: 1 addition & 1 deletion src/rotp/RotpGovernor.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* to get more memory it uses the right jar file name.
*/
public class RotpGovernor {
static String governorVersion = "1.6.1";
static String governorVersion = "1.6.2";
static String expectedROTPVersion = "Beta 1.6a";

public static void main(String[] args) {
Expand Down
9 changes: 7 additions & 2 deletions src/rotp/model/ai/base/AIGovernor.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import rotp.model.colony.ColonySpendingCategory;
import rotp.model.empires.Empire;
import rotp.model.galaxy.StarSystem;
import rotp.model.game.GameSession;
import rotp.util.Base;

public class AIGovernor implements Base, Governor {
Expand Down Expand Up @@ -79,8 +80,12 @@ public void setColonyAllocations(Colony col) {
session().addSystemToAllocate(sys, text("MAIN_ALLOCATE_BASES_COMPLETE", name, col.defense().maxBases()));
if (col.industry().isCompletedThisTurn())
session().addSystemToAllocate(sys, text("MAIN_ALLOCATE_MAX_FACTORIES", name, (int)col.industry().maxFactories()));
if (col.ecology().populationGrowthCompleted())
session().addSystemToAllocate(sys, text("MAIN_ALLOCATE_MAX_POPULATION", name, (int)col.maxSize()));
if (col.ecology().populationGrowthCompleted()) {
// disable colony at max pop message if governor is on and we are using auto transport
if (!col.isGovernor() || !GameSession.instance().getGovernorOptions().isAutotransport()) {
session().addSystemToAllocate(sys, text("MAIN_ALLOCATE_MAX_POPULATION", name, (int) col.maxSize()));
}
}
if (col.ecology().atmosphereCompleted())
session().addSystemToAllocate(sys, text("MAIN_ALLOCATE_ATMOSPHERE_COMPLETE", name));
if (col.ecology().soilEnrichCompleted()) {
Expand Down
12 changes: 11 additions & 1 deletion src/rotp/model/colony/Colony.java
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,17 @@ public void govern() {
// Add maximum ecology
if (!ecology().isCompleted() || ecology().enrichSoilCost() > 0.0 || planet().canTerraformAtmosphere(this.empire())) {
locked(Colony.ECOLOGY, false);
moveSlider(Colony.ECOLOGY, null, "Reserve");
// Provision for autotransport. Don't spend on pop growth if only pop growth remains and we have close to max pop
float expectedGrowth = Math.max(2, normalPopGrowth());
if (session().getGovernorOptions().isAutotransport()
&& ecology().enrichSoilCost() <= 0.0
&& ecology().terraformCost() <= 0.0
&& (ecology().waste() <= 0 || empire().race().ignoresPlanetEnvironment)
&& (population() + expectedGrowth >= planet().currentSize()) ) {
// do nothing
} else {
moveSlider(Colony.ECOLOGY, null, "Reserve");
}
locked(Colony.ECOLOGY, true);
}
// add maximum defence
Expand Down
2 changes: 1 addition & 1 deletion src/rotp/ui/ErrorUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void paint(Graphics g) {

g.setFont(narrowFont(24));
y0 += BasePanel.s60;
g.drawString("Email: rayfowler@fastmail.com", x0, y0);
g.drawString("Email: coder111@protonmail.com", x0, y0);
y0 += BasePanel.s30;
g.drawString("Reddit: www.Reddit.com/r/rotp", x0, y0);

Expand Down
12 changes: 12 additions & 0 deletions src/rotp/ui/fleets/SystemListingUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ public void draw(Graphics g, RowSprite row, StarSystem sys, int x, int y, int w)
return;
}
if (nameField.isVisible()) {
nameField.setForeground(color(sys));
if (nameField.getY() != (y-s30)) {
nameField.setBounds(x, y-s30, w, s30);
nameField.repaint();
Expand All @@ -786,9 +787,20 @@ public void draw(Graphics g, RowSprite row, StarSystem sys, int x, int y, int w)
nameField.setBackground(selectedC());
nameField.setBounds(x, y-s30, w, s30);
nameField.setVisible(true);
nameField.setForeground(color(sys));
nameField.repaint();
}
}

@Override
protected Color color(StarSystem sys) {
if (sys.colony().isGovernor()) {
return Color.green;
} else {
return super.color(sys);
}
}

public boolean showField(int y) {
return (y >= minDisplayY) && (y <= maxDisplayY);
}
Expand Down

0 comments on commit 4c254fc

Please sign in to comment.