Cross-Platform Civ3 Editor

Cross-Platform Editor for Conquests now available! 1.51

(see new version announcement in the previous post)

Thanks! Will try that later on and report back. Appreciate your help!!

EDIT:

java -version gives:

openjdk version "1.8.0_322"
OpenJDK Runtime Environment (build 1.8.0_322-b06)
OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)

java --version gives an error.

Is that the old version issue? Should it be 8. something rather than 1.8?

Just saw your update after posting the new version. 1.8 and 8 are the same in the Java world; the Java marketing department has dealt with numbers differently over the years. From Java 1.3 though 1.6, they used a 1.x scheme, for 1.7 and 1.8 they used 1.7/1.8 in developer materials and 7 and 8 in mass-market materials, and now they use 9+ everywhere. I'm not even going to try to cover the 1.1 and 1.2 versions...

So, in theory that should work. But I've never tried an OpenJDK version of Java 8 with such a high update number (the "322").

My hunch relates to the fact that the editor uses two UI frameworks. Most of it uses the old one "Swing", which was prominent when the editor was new. Some of it uses the new one "JavaFX", which debuted around the same time or shortly after the editor, and was supposed to be the successor. Long story short, HTML5 took off instead, "JavaFX" is still around but never gained massive market share, and it got discontinued. A lot of Java vendors have dropped support for it. I am wondering if OpenJDK has dropped it in their recent Java 8 updates. In theory it should still be around for Java 8, since it's part of the specs for Java 8 (it got dropped around 10, IIRC).

Update 201 is the latest I have installed right now, and it runs fine there. I'll see if I can set up a newer one and whether that works.

In the meantime, running the editor from the command line might also reveal something:

Code:
cd "wherever the editor is unzipped to"
java -jar "Conquests Editor.jar"

That will likely give some error that gives a better hint as to what's wrong. It might also appear in the log.txt file the editor creates, but it might not be getting far enough to put the error in the log file, depending on the cause of what's going on (if the log.txt file doesn't exist, it definitely isn't getting that far).

--------------

Edit: Installed OpenJDK Update 322, and sure enough, they removed JavaFX, which the editor depends on:

Code:
Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.civfanatics.civ3.xplatformeditor.MainLauncher.main(MainLauncher.java:17)
Caused by: java.lang.RuntimeException: Uncompilable source code - package javafx.application does not exist
    at com.civfanatics.civ3.xplatformeditor.Main.<clinit>(Main.java:141)
    ... 1 more

JavaFX is part of the Java 8 specifications, so they shouldn't have removed it, but such is life.

I recommend following the instructions in the first post to download the Liberica JDK at https://bell-sw.com/pages/downloads/#/java-8-lts (choose the Full JRE or Full JDK version), as it includes everything required to run the editor.

Due to the effort required to move away from JavaFX, or integrate it with newer versions of OpenJDK, I will not be supporting OpenJDK going forward unless someone is willing to sponsor the effort.
 
Last edited:
I hate to be the bringer of bad news, but the unit stats page doesn't seems to be working right. While the "All civilizations" section works as expected, if I change it to a civilization it returns empty (Total number of units: 0). Tested with AOI.
Further testing reveals the crux of the issue: the per civ section only count units added with this version of the editor, not preexisting ones.

In case it's relevant, I'm on OpenJDK 11.0.13. Nothing interesting in the log.

Out of curiosity, what is bmpDir used for? Mine is currently empty.
 
Thanks Quintillus! Really appreciate your help!

I'm confused though. I thought this is what I had already done:

I recommend following the instructions in the first post to download the Liberica JDK at https://bell-sw.com/pages/downloads/#/java-8-lts (choose the Full JRE or Full JDK version), as it includes everything required to run the editor.

Have a got a different version of Java running?
 
I hate to be the bringer of bad news, but the unit stats page doesn't seems to be working right. While the "All civilizations" section works as expected, if I change it to a civilization it returns empty (Total number of units: 0). Tested with AOI.
Further testing reveals the crux of the issue: the per civ section only count units added with this version of the editor, not preexisting ones.

In case it's relevant, I'm on OpenJDK 11.0.13. Nothing interesting in the log.

Out of curiosity, what is bmpDir used for? Mine is currently empty.

Ah... I see what the issue is. It's actually the age-old civ-type-owner versus player-type-owner dichotomy. I'd forgotten about the fact that units can be player-owned, as I was using civ-owned scenarios while testing. That will be fixed in version 1.44, which I'll be uploading in a few minutes.

bmpDir is used for the "Map -> Import Map from BMP" functionality. It stores the last directory from which you imported a map from a BMP file. I figured there was a good chance that wouldn't be the same as your Civ3 Scenarios directory, and while testing was finding it annoying to have to keep switching to the folder where my test BMP files were, so I added that setting to keep track of it so that if you use that feature more than once, it will remember where you keep your BMP files.

It makes sense that it is empty if you haven't used that functionality yet. I'm not sure that many people have used it yet; I posted a map-in-progress that I created with it here, but if others have been using it there hasn't been a lot of feedback on it. It might be my favorite under-utilized feature, though; I still have fond memories of the many maps that Railroad Tycoon II has, due in part to supporting a similar feature.

Thanks Quintillus! Really appreciate your help!

I'm confused though. I thought this is what I had already done:

I recommend following the instructions in the first post to download the Liberica JDK at https://bell-sw.com/pages/downloads/#/java-8-lts (choose the Full JRE or Full JDK version), as it includes everything required to run the editor.

Have a got a different version of Java running?

It's possible that the non-Liberica version is still your system default. I've seen that happen before, and it seems to happen more on Linux distros, which both have more variety than Windows, and sometimes really like to keep the default as the version they got from their package manager.

If you try the "java -jar ConquestsEditor.jar" suggestion, that will almost certainly print out an error of some sort. Or if it works that way, the problem is that some other program is associated with JAR files - I've seen them be associated archiver utilities, since the JAR format is, under the hood, a ZIP format for tying resources together. But if Liberica has been installed, it's highly likely that it isn't the default program for JAR files.

You could also try one of the "Legacy" versions on this page. They run with Java 1.5 or later, and only use the older graphics library, so as long as a 2005-or-later Java version is the default program for JAR files, they ought to work. The tradeoff is they lack some of the newer features, such as reorderable lists on some tabs, and the CFC Workshop feature that allows downloading units from CFC right into your scenario folder and scenario at the same time. But they still include the standard scenario editing and map editing features.
 
Version 1.44

Version 1.44 contains three bug fixes:
  • Units assigned to tiles that already have a "hard" owner (city, colony, or other unit on that tile) will now have that same owner.
  • The Unit Statistics window now works properly if player-owned units are present.
  • You will no longer get an "Open multiple files?" warning if the first file you tried to open did not exist.
Thanks to @Arcangelus for reporting all of these issues! You are the current leader for the Tester of the Year award!

The first issue flew under the radar for a surprisingly long time, and existed because the code used the state of the "owner" dropdown even in the case of adding units to a tile that already had that "hard" owner. Thus, suppose you were adding units to China in AoI. If you first added a unit to an empty tile, you would have already set the dropdowns to indicate Chinese ownership of a unit; subsequently adding a unit to a city would work as expected. But if you added a unit to a city or a tile with another unit first, you would run into this problem.

"Hard" ownership is opposed to the "soft" ownership indicated by civilization borders; the dropdowns are still used for ownership decisions if a tile only has "soft" ownership.
 
I apologise if I missed something, but the search function really didn't yield anything useful.

I have the following problem: When I open the editor and press either File > new or File > open, nothing happens. At all. No error message, no extra windows, nothing. If I select editor settings or anything from the "Help" group, those seem to work. Adjust safety level also gives no reaction.

This is the log I get from opening the program, pressing "Open" once, waiting a bit, and closing the editor:

Code:
2    [main] INFO  Main  - Starting program - version 1.44
2    [main] INFO  Main  - Looking for config file at civ3editor.ini
19   [main] WARN  Settings  - Missing value for key bmpDir in config file.
20   [main] WARN  Settings  - Missing value for key suppressedUpdateVersion in config file.
22   [main] INFO  Main  - Locale path: /C:/GOG Games/Civilization III/Conquests/ConquestsEditor1.44/Conquests Editor.jar
23   [main] INFO  Main  - i18n URL: C:\GOG Games\Civilization III\Conquests\ConquestsEditor1.44\langs
35   [AWT-EventQueue-0] INFO  Main  - Running Windows 10 10.0 on amd64
35   [AWT-EventQueue-0] INFO  Main  - Java vendor: Oracle Corporation
35   [AWT-EventQueue-0] INFO  Main  - Java runtime version: 1.8.0_322
36   [AWT-EventQueue-0] INFO  Main  - Java runtime name: OpenJDK Runtime Environment
132  [AWT-EventQueue-0] INFO  Main  - Is hardware enabled? true
219  [AWT-EventQueue-0] INFO  Main  - Took this many ms to get window visible
13363 [AWT-EventQueue-0] INFO  Main  - Successful exit
 
I apologise if I missed something, but the search function really didn't yield anything useful.

I have the following problem: When I open the editor and press either File > new or File > open, nothing happens. At all. No error message, no extra windows, nothing. If I select editor settings or anything from the "Help" group, those seem to work. Adjust safety level also gives no reaction.

This is the log I get from opening the program, pressing "Open" once, waiting a bit, and closing the editor:

Code:
2    [main] INFO  Main  - Starting program - version 1.44
2    [main] INFO  Main  - Looking for config file at civ3editor.ini
19   [main] WARN  Settings  - Missing value for key bmpDir in config file.
20   [main] WARN  Settings  - Missing value for key suppressedUpdateVersion in config file.
22   [main] INFO  Main  - Locale path: /C:/GOG Games/Civilization III/Conquests/ConquestsEditor1.44/Conquests Editor.jar
23   [main] INFO  Main  - i18n URL: C:\GOG Games\Civilization III\Conquests\ConquestsEditor1.44\langs
35   [AWT-EventQueue-0] INFO  Main  - Running Windows 10 10.0 on amd64
35   [AWT-EventQueue-0] INFO  Main  - Java vendor: Oracle Corporation
35   [AWT-EventQueue-0] INFO  Main  - Java runtime version: 1.8.0_322
36   [AWT-EventQueue-0] INFO  Main  - Java runtime name: OpenJDK Runtime Environment
132  [AWT-EventQueue-0] INFO  Main  - Is hardware enabled? true
219  [AWT-EventQueue-0] INFO  Main  - Took this many ms to get window visible
13363 [AWT-EventQueue-0] INFO  Main  - Successful exit

It looks like that is happening when using the OpenJDK system with recent versions of Java 8 - it doesn't include some of the editor's dependencies, which unfortunately includes the ability to use native file opening dialogs. After playing around with it, I see the error message for that is not being caught in the logs; I will add that to the tasks for 1.45.

My guess is you probably downloaded Java from either https://adoptopenjdk.net, or if more recently, from https://adoptium.net ? That would be consistent with the behavior observed.

The options for Java versions that still include the editor's dependencies are the Azul "Zulu" version at https://www.azul.com/downloads/?version=java-8-lts&os=windows&architecture=x86-64-bit&package=jre-fx , and the BellSoft "Liberica" version at https://bell-sw.com/pages/downloads/#/java-8-lts (make sure to select the "Full JRE" option from the "Package" drop-down). Both work equally well, although I've been testing "Liberica" for longer.

I see that my code that was supposed to give an alert about this assumes Java 8 will always work, which was a pretty safe assumption for quite a while, but isn't any more. So, I've written this up so I won't forget to make the process better for the next version. Thanks for letting me know!
 
I did download JDK 8 from the link you gave in the main post, but I also had JDK 16 from Adoptium installed for development purposes already. Do you know how I make your editor use the 8 one without removing the 16?
 
I did download JDK 8 from the link you gave in the main post, but I also had JDK 16 from Adoptium installed for development purposes already. Do you know how I make your editor use the 8 one without removing the 16?

Unfortunately it can be difficult and system dependent to set the default version of Java. The easiest solution in your case is probably to download the "Windows XP" version of the editor, which bundles a Java download, and copy-paste the files from the latest 1.44 version over the ones in "XP" 1.39. XP_launcher.vbs will launch the editor with the bundled Java 8.

If you want to change the default (which you might not, if you need JDK 16 for development purposes), a likely place to start is this SuperUser thread, where the first answer discusses how this can happen due to the order of the system path. I've seen some oddities over the years with setting the default Java version, so that isn't 100% guaranteed to fix it, but it's a good start.
 
I'm having an issue with the map tab. None of the tools that should be on the right side of the screen are visible. If I mouse over where they should be I'll briefly see them flicker onscreen, but I'm unable to click them. I've attached a picture of what it looks like. Any advice on how I can resolve it?
 

Attachments

  • CivMap.png
    CivMap.png
    174.3 KB · Views: 59
I'm having an issue with the map tab. None of the tools that should be on the right side of the screen are visible. If I mouse over where they should be I'll briefly see them flicker onscreen, but I'm unable to click them. I've attached a picture of what it looks like. Any advice on how I can resolve it?

That is a new one to me. Could you upload or send via PM your log.txt, or the section of it since the most recent "Starting program - version 1.44" line? It might also be useful to note the operating system/graphics card (the OS will be in the log, but not the graphics card). Visually it looks like the map is drawing over the right side instead of vice versa, but the question is what is causing that to happen.
 
I've attached the log.
OS is Windows 10, graphics card is NVidia GeForce RTX 2080 ti

Hmmm... no errors or warnings other than during the map benchmark on a previous run. Is this happening with all .biq files? And I see the Java version is the latest; is that Liberica or Zulu or something else? I also see you have the Steam version of Civ3, which shouldn't matter, but just trying to put together as many items as possible to allow more accurate reproduction of the issue.

My Windows 10 laptop has a GeForce GTX 1050, so I should be able to see if anything odd has started happening there.
 
I'm using the Liberica download from the original post

EDIT: And it's happening on all biq files I've tested

Unfortunately, I have not been able to reproduce this. Tested with both the 64-bit and 32-bit "Full" Liberica downloads, Update 322, on Windows 10 with a mobile GeForce 1050. No graphical issues were detected.

According to the nVIDIA Control Panel, I have version 398.35 of the drivers, which are the original ones for my laptop from 2018. I see there's an optional update for that; I'll see if that breaks it. Although if it does, I'm not sure I'll have any idea of how to fix it.

The only other thing I can think of is to try the Legacy version and see if the same problem occurs. It probably will, but if not then that is a variable at play.

Edit: It occurs to me that it's possible my laptop is running the editor with the Intel integrated GPU. The editor doesn't cause any GPU to show up in the "GPU engine" of task manager, which makes sense... I didn't add anything to cause it to be GPU-accelerated.

So alas, I probably won't be able to figure this out, since I don't have a way of reproducing it. If you figure out a setting that fixes it, or someone else notices it, that would be good to know of - perhaps with a few more data points we can figure out a pattern.
 
Last edited:
Trying to import a 290 x 400 (6416 x 9312 pixels) BMP to Civ map. The program can't seem to handle that kind of memory, which is only about 253 MB out of my 16 GB of RAM. Anything I'm doing wrong or how to increase its threshold?

I've got no clue how the civ maps work, but why do the bitmap files need to be so huge anyway? The terrain itself just seems like it could be a simple raster rotated 45 degrees, is there a reason that kind of conversion isn't possible?
 
Trying to import a 290 x 400 (6416 x 9312 pixels) BMP to Civ map. The program can't seem to handle that kind of memory, which is only about 253 MB out of my 16 GB of RAM. Anything I'm doing wrong or how to increase its threshold?

I've got no clue how the civ maps work, but why do the bitmap files need to be so huge anyway? The terrain itself just seems like it could be a simple raster rotated 45 degrees, is there a reason that kind of conversion isn't possible?

The amount of memory your system has doesn't matter. Civ 3 is a 32 Bit program and thus limited in the amount of RAM it can use.
 
Is there anyway to mod the functions of terraforms? What does "order" do?

I would like to trick the AI into building Airfields instead of Radar Towers. When I tested changing the "order" nothing happens.

Are worker functions hardcoded into the game in these slots and all that can be modded is cosmetics?
 
Trying to import a 290 x 400 (6416 x 9312 pixels) BMP to Civ map. The program can't seem to handle that kind of memory, which is only about 253 MB out of my 16 GB of RAM. Anything I'm doing wrong or how to increase its threshold?

I've got no clue how the civ maps work, but why do the bitmap files need to be so huge anyway? The terrain itself just seems like it could be a simple raster rotated 45 degrees, is there a reason that kind of conversion isn't possible?

While what B-29_Bomber said is true, the problem in this case is the editor only being able to use 256 MB of memory. The technical detail is that Java limits itself (I guess so it doesn't eat all your memory), and while 10 years ago it wasn't uncommon for it to self-limit to 128 MB, I thought it had been 1 GB by default for years by now. But checking locally (Help -> View Memory Usage Info), it seems that recent updates have taken that back down to 256 MB.

I've attached the old "launcher.jar" (within launcher.zip), which can be put in the same folder as the editor and used to launch it with a 1 GB limit, which should be enough for importing most BMPs as maps.

There are probably better algorithms for importing a map that would work with smaller source files; notable BMP2BIQ uses very small BMPs. The tradeoff is a loss of detail when the map is compressed to a very small size. The sweet spot is probably in between what this editor uses and what BMP2BIC uses; maybe 1/4 of the size in each direction of what this editor uses? I've also thought about adding support for compressed BMPs or PNGs over the years, and recently learned a bit about GIS height maps, through some Navy software, and had the thought that it would be cool to add support for those. That would potentially allow more accurate map imports with less work than the existing sateillite-image and color-matching system, although it would take more work to add support for it, which makes it questionable for a 20-year-old game. It also isn't as well-suited for Civ3's height model (flat/hills/mountains) as games with variable height models (it's used in Railroad Tycoon extensively, for example).

Is there anyway to mod the functions of terraforms? What does "order" do?

I would like to trick the AI into building Airfields instead of Radar Towers. When I tested changing the "order" nothing happens.

Are worker functions hardcoded into the game in these slots and all that can be modded is cosmetics?

Alas, those are hard-coded. Unless Flintlock has figured something out in "Sub Bug Fix and other Adventures in EXE Modding" thread. I believe "Order" is just the name for the order? The Firaxis help describes it as, "Determines the verbiage used to explain the orders of a worker job when told to perform this job", which seems to support that.
 

Attachments

Back
Top Bottom