Cross-Platform Civ3 Editor

Cross-Platform Editor for Conquests now available! 1.48

Problem with opening a biq: I have a map which I had previously worked on without changing any rules. The current version of the editor will not allow me to open it. Since I know longer have access to the windows version of the editor what's a poor boy to do?
 
Problem with opening a biq: I have a map which I had previously worked on without changing any rules. The current version of the editor will not allow me to open it. Since I know longer have access to the windows version of the editor what's a poor boy to do?

Can you upload it? Then I can try to load it and see what's tripping it up. Alternately, I can PM you my e-mail if it's double-plus-top-secret and you don't want to upload it on CFC yet.
 
I'll PM you - hopefully with the biq attached.

I'm opening the editor through the launcher. Then using the Open tab to bring up the dialogue box. The editor is making an archival biq, but doesn't open the biq itself for editing. Here's the error message I'm getting:

thumbnail
 
I've replied via PM. I used the Firaxis editor to enable custom rules, since that gets it working tonight, and custom rule support would take longer, even in the best case.

This is probably also as good of time as any to link to the new progress-tracker I'm trying. It's here, and publicly visible with no sign-up this time. Hopefully, it yields to fewer ideas lost forever on page 11 of this thread. It also lets you see what I've been working on before the next release. Right now, that primarily means fog of war support and work on PTW support, as well as boring back-end work that ought to make the code easier to work with.
 
Hi Quintillus,

I sent you a PM about this, as you were aware of the issue I had...

Here are the details about the issue with my desktop and your editor:

I included everything mostly in picture form for you to see, which includes the info about my computer and WinRAR.

Here is my desktop's info:



So, after downloading and unzipping the zip folder that contains your editor, from CFC, I got presented with the following:



That's how zipped folders always appear on my desktop after I installed WinRAR. Right clicking the launcher.jar file brings up this submenu:



If I extract, I get the "launcher.class" file. If I "open" or if I just double click the launcher.jar file, then WinRAR opens like this... (I included the info on the version I had)



And finally, opening the launcher.jar in WinRAR, or extracting it, results in this:



As mentioned though, my laptop that has WinRAR doesn't do that, and I can open and launch the launcher.jar file normally.

Hope this helps.
 

Attachments

  • Quint1.jpg
    Quint1.jpg
    55.9 KB · Views: 422
  • Quint2a.jpg
    Quint2a.jpg
    73.2 KB · Views: 425
  • Quint2b.jpg
    Quint2b.jpg
    108.4 KB · Views: 434
  • Quint3.jpg
    Quint3.jpg
    171.5 KB · Views: 457
  • Quint3b.jpg
    Quint3b.jpg
    118.5 KB · Views: 422
@Grandraem - Are you sure that the desktop has Java installed? If both Java and WinRAR are installed, the Open With menu should look similar to the following?



(note: Clicking on the Java link from Open With is not how to get it to start; double-clicking is)

If both Java and WinRAR are installed, I'm not sure why WinRAR would be the only option. I installed WinRAR after Java, but it still left Java as the default for .jar files (which it should, since jar files are only really useful if they are run with Java).

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

In other news, I now have a PowerBook to test the editor on OS X on. So far that's meant fixing the task bar/dock name. Most of the rest of my editor-improvement time since it arrived has been focused on the in-progress BIX-to-BIQ support. But if there's something that seems to be working less well on OS X than Windows (horizontal scrolling is one thing that I remember this being the case for), I now have a feasible way to test there once more.

I've also been smoothing out the rough edges with teleportation. Always inconvenient when you expect to teleport to one location and wind up somewhere else instead.
 
Hi Quintillus,

it seems that I found a minor bug in the upgrade function for units.

After adding a new unit in the game it will not appear in the list of possible upgrades.

Only after closing the editor and then reopen it they appear in the list.



In the pictured editor session I have added the Latina Caravel and the Mediterran Galleon, but none of them appear as possible upgrade in the session.
 
You're right. It also doesn't get added to Enslave Results In (though it does to stealth attack and teleportation targets). I've added this to the to-be-fixed-by-the-next-version list. That version is currently making slow progress.
 
Hi Quintillus,

sorry to bother you again. :blush:

I am currently using your editor for adding units (previously I used only the Firaxis editor for this and use yours only for fine tuning).

I am using reduced hitpoints for the first generation of ships. It works flawless with the Firaxis editor, but I received this message from yours.



The only option under "Settings" I found and tried ("Debug Level" all possible selections) did not solve the problem. I am unable to save the scenario with reduced hitpoints.

What did I do wrong and how can I solve this problem.

Annother Point: In the game the previously added units lack the "Go to" Button, despite all standard orders been selected. After checking the unit in the Firaxis editor and saving the scenario, it reappears for these units in the game. :confused:

Thanks for your help!
 
The error message is related to the "Safety Level" concept, although the fact that it's appearing in that situation is actually a mistake. By default, the editor doesn't allow editors that the Firaxis editor doesn't, so that it should be no easier to make a corrupt scenario than it is with the Firaxis editor. However, by changing the "Safety Level", you can allow values that Firaxis doesn't, expanding the editing possibilities.

In this case, back in 2010 or so I'd thought the valid hitpoint bonuses in the Firaxis editor were 0 to 20, but they are actually -20 to 20. So, currently, the editor by default limits the hitpoint bonus to 0 to 20. You can change this by clicking on the "Overall Safety Limit:" button at the top, to the left of the green "Firaxis" text box. It brings up a window like this:



By changing the "Unit" selection to "Exploratory" as indicated, the (incorrect) limit will be bypassed, re-allowing negative hitpoint bonuses. Unfortunately, this isn't currently saved across launches of the editor.

I've corrected the incorrect hit point bonus limitation so it will be correct in the next version, and hopefully will also have saving of the safety levels across editor launches.

I'm not sure about the lack of a Go To button. That seems to be working when I test it. It might be necessary to upload a BIQ to compare with.

And no worries about bothering me! It's good to get feedback on the editor, even when something isn't working quite as intended. That means it's being used to make new scenarios, which is after all its main purpose.
 
Thanks Quintillus,

that was the solution. I must admit, that I totally missed that menu. :blush:

I will see if I can replicate the "Go To"-Error with a fresh BIQ. My current mess will probably not work on your civ. ;)
 
Last night, after doing a bit of work on the editor, some of which was more complicated than it really should have been due to questionable programming practices made years ago and simply not remembering that area well after a year or two of dust, I found myself pondering the course of the editor's development. In particular, the fact that at the time it started - and thus also when the foundations were made, and most of the coding was done - it was really an amateur project. A second-year CS student, I'd never worked on a project for more than a year at that point, nor any as large or complex as the editor would soon become. For some reason, likely not knowing how complex it would be or how inexperienced I was, I decided I had a decent chance of being able to make a Civ3 editor, and started coding.

Figuring that perhaps some might find the story of interest, I decided why not post it while I still remember many of the early details?

The Beginnings

Spoiler :
As it was, I was a second-year student when I started the project. Armed with the boundless optimism of someone who doesn't know how little they actually know, as well as fairly comprehensive documentation of the scenario format at Apolyton, I jumped in on Saturday, April 4, 2009. In those heady days, Steph's Editor was still receiving regular updates, 0.53 being the latest at that time. Why another one was needed, I'm not sure I knew even then. What I did know was that I felt like maybe I could also make a Civilization editor, and that I didn't know anything about C#, which Steph was using. In retrospect, now knowing how similar Java and C# are, it likely would have made sense to learn some C# and offer to help on that project, or perhaps use some of my newly-acquired C knowledge to help with another utility. But Gramphos's documentation was beckoning, I knew some Java, and starting from scratch was exciting. So the editor began!

After a few weeks, I realized that there was a lot to the BIQ format (more on this later). I could read a few sections, such as the building section, but was still a ways off from reading an entire scenario file. I was starting to wonder what I could really do with the proposed project, and whether it made sense to continue when Steph had already cranked out three updates in April alone and was still adding functionality at a rapid rate. That's what I read Lee_Dailey's post requesting a utility to compare BIQ files. Bingo! Something that Steph's editor didn't do, was probably too niche for it to do anytime soon, and I could do without having to add the ability to modify everything in the BIQ. After a week or so of hasty coding, Civ3 BIQ Compare went live in May, 2009, with support for standard rules only. A couple days later, world maps would be supported, and regular updates would follow into June.

While by no means a full editor, this intermediary goal likely saved the project from languishing forever in an abandoned folder on my hard drive.


Quick Development + Inexperience = High Quality? Not So Fast...

Spoiler :
It was around June, 2009 when Civ3 BIQ Compare more or less reached its baseline functionality, and my focus switched to building out tabs to be able to edit the scenarios. Buildings came first, naturally. As I was not experienced with coding user interfaces in Java at that time, I was using a GUI-builder. It had some idiosyncracies, and sometimes moving a button or label a tiny amount would throw everything in the tab off. That became pretty old pretty fast, and more than once while walking around campus I found myself thinking that I'd have to learn how to write GUIs so I could be rid of the insane GUI-builder. But in the summer of 2009, the focus was on the finish line. So I stuck with my current modus operandi.

Eventually, though, limitations were becoming apparent. I'd put each of the BIQ sections - resources, units, buildings, and so forth - in their own file from the beginning. But all of the front end - the user interface - was in one big file. And "big" was becoming "gigantic". Over 10,000-lines. It was not only becoming unwieldy to navigate, but unresponsive, particularly as I added more tabs. I realized I'd have to rewrite the GUI or the editor would become too slow to develop before it was even released.

But before that happened, I received an error that my code could no longer be compiled. All that GUI code I'd put in one class? Well, most of it was in a single method. One giant set of tabs within one window, containing a whole editor's functionality, specified in one place. It turns out that giant method had exceeded 64 KB in size, which is the upper limit for compilation in Java. At that point, I had no choice but to split up my GUI code if I wanted to add more functionality. And so, it was to the chopping block. Each tab now received its own file, to which I copied the file that the GUI-builder had automatically generated. I then spliced them all together, and not only was I below the compilation limit, but responsiveness in development was much improved. The GUI-builder no longer worked with the split-off tabs, but in some ways that was a good thing. It made them difficult to modify, as the GUI-builder's code was not particularly human-readable, but it made me learn about GUI coding in Java.

Incidentally, this was around the fall of 2009, about the same time that Steph reorganized his editor from one window with a bunch of tabs to a window that created separate windows for each tab. Based on that and some of his posts at the time, I suspect he may have been running into similar slow-development-environments difficulties, but chose a different solution.

At any rate, it was at this time that many of the foundations of the project were build. These included:

- Lots of auto-generated GUI code that's difficult to modify. This is both directly and indirectly responsible for some of the UI errors in the current editor, as well as the fact that the GUI has not changed a whole lot over the years.
- The file input/output routines being coded in a C style with essentially no data protection. The editor tabs directly accessed the variables stored in the I/O files (such as TECH and PRTO). This was quick and convenient, but also meant that particularly for binary fields, of which the BIQ format has more than a few, the code modifying the binary data was all over the place. This was displayed perhaps best when I realized that the base and real terrain documentation at Apolyton was swapped. Already having code dealing with that everywhere, I simply swapped the labels and left them reversed in the code, it being too big a mess to fix at the time.

But despite some questionable coding practices, progress continued.


The Road to Release

Spoiler :
Whereas Steph's editor had taken the (probably sensible) route of starting out with just a few tabs editable, I decided I wanted to have all non-map tabs available at release. As a result, it took over a year after the glory days of BIQ Compare to complete version 0.50 of the editor, the first release.

At release, there wasn't really anything the editor could do that Firaxis's or Steph's couldn't do. The one exception was run on non-Windows operating systems. This was largely the reason the editor was billed as the Cross-Platform editor. It was part of the reason for its development, too, as that was the obvious niche to fill. But I didn't actually own any Apple products at the time. So it was really more a case of the project looking for a need to fill and finding one, than starting the project because I needed it to solve a problem.

The initial release of the editor came on August 30, 2010, and a number of updates followed in fall 2010. These focused on improving compatibility with various scenarios, but also included multi-threading of BIQ input. This was perhaps the first feature that was fairly well-designed, at least if more sophisticated ways to do it that had been introduced in 2004 (and I discovered around 2012) are ignored. But with lock-free, thread-safe multithreading, it was an improvement that worked as intended, and has so far escaped serious thought of a redesign.


Map Editing Becomes Available

Spoiler :
The winter of 2010-2011 saw some new features added, such as CSV export (a user request), and Autosave. But it was version 0.70 in April, 2011 that was the big one - adding the first support for map editing. Map editing was not very sophisticated early on. It was functional (with a few bugs), but that's about it.

It perhaps make sense now to talk about how the map editing works. Having zero experience with actual graphics coding (as opposed to building user interfaces) before, I did some research ahead of time, perhaps not enough. Already using Java and definitely not wanting to re-write all the BIQ input/output code in another language (knowing how long that took), the options were somewhat limited. I found three main options. Java 2D likely would have made sense, but required Java 1.6, and I'd gone to Java 1.5 since some current users of the editor couldn't upgrade beyond that without upgrading their operating system, and every user counted. Then there was Java 3D, which may have worked, but hadn't been updated since 2008. Learning it in late 2010-early 2011, when it looked pretty much abandoned, didn't seem to make much sense. And indeed, it still hasn't had a stable release since 2008, so that may have been a good choice.

Instead, I went with using Swing, Java's general-purpose GUI toolkit, for the map editing. I figured out that it could be used to draw graphics on a canvas, and though it required a fair amount of manual overhead, it could be used to do the type of image manipulation I'd need for a map tab. What it boils down to is purely-CPU powered graphics, with no graphics card involved. It's relatively slow, and not very elegant, but does work. And on the plus side, it's meant zero complaints about graphics cards not being compatible.

It also means that nearly every aspect of scrolling across the map, interacting with it, and so forth had to be added separately. It's why zoom support took such a long time. If I'd been using a 3D framework, it likely would have simply been a matter of zooming out the camera. Instead, it involved scaling the graphics to whatever scale was requested, and making sure that the scrollbars still worked properly at any zoom level. And just as much of a killer - making sure that clicking on a tile at any zoom still registered as clicking on the correct tile, even if you clicked near a tile boundary or were at some odd zoom like 43.221%. It took multiple tries to get zoom right, as well as many months of time. Ever wonder why most 2D games like Civ3 and Age of Empires II only support a couple zoom levels? It makes a lot of sense to me now.

But there was one other key aspect of showing Civ3 maps that needed to be solved. That was displaying PCX files. Java doesn't support PCX natively, likely because PCX was rather old even by the time Civ3 came out. Looking around for a good Java PCX library, I didn't find any promising candidates. Fortunately, the specifications for PCX is readily available, and not overly complicated, so I wrote a PCX import class so I could import PCXs. Again being purely-CPU-powered (as well as purely in Java), it's not the fastest PCX-importing utility ever, but it does the job. And unlike most, it does have native support for the Civ3-specific extension of the last two colors controlling transparency.

Frequent updates would continue through version 0.75 of the editor, in July 2011, with 24 releases in the first year. Likely not coincidentally, July 2011 was also just before I started my first professional programming job.

Speaking of professional programming jobs, it's getting late, and I have one tomorrow. So this history will have to be added to later...


To be continued. Eventually, this will tie in with what I've been doing for the next version, but that'll have to be at a later time. Oh, and the upgrades to/enslave results in bug is now fixed.
 
Quintillus,

Thanks for sharing your story about the editor. It's fantastic what you were able to accomplish.

And some of it had to be very difficult to figure out ...
 
Quintillus,

Thanks for sharing your story about the editor. It's fantastic what you were able to accomplish.

And some of it had to be very difficult to figure out ...

You're welcome. I need to actually go ahead and continue it at some point. I was too tired to write well the following night, and also am tonight, and spent a lot of time outdoors and got re-addicted to Europa Universalis in the interim. There definitely were parts that were tough to figure out. Most of the toughest ones dealt with drawing the map, since that was both new to me and not as well documented as the BIQ format. Pen and paper proved to be a help in working out how to get some of those issues working.
 
Hello Quintillus
Thank you very much for this great editor.

To facilitate the creation of maps, I think it could be great if the editor can load a bitmap (jpg or other format) as a layer. Then by transparency effect (with an on / off button for example to show or hide the jpg), it would be easy to draw the civ3 map over.
I'm not programmer and I do not know if this feature is 'easy' to implement. I will submit the idea just in case...
 
Hello Quintillus
Thank you very much for this great editor.

To facilitate the creation of maps, I think it could be great if the editor can load a bitmap (jpg or other format) as a layer. Then by transparency effect (with an on / off button for example to show or hide the jpg), it would be easy to draw the civ3 map over.
I'm not programmer and I do not know if this feature is 'easy' to implement. I will submit the idea just in case...

You're welcome!

That's an interesting idea with a transparency layer. After thinking about it a bit, I think it would be possible. How easy, I'm not sure, and I'm not a graphics person (the existing map support in the editor is the most complex graphics-related programming I've done). But I don't think it would be ridiculously difficult. And being able to use a convenient format shouldn't be too much of an issue for that - the main reason the existing bitmap-to-Civ-map functionality require a bitmap format is the need for a limited and easily identifiable number of colors.
 
Although the grandiose plans for 0.90 have not been achieved, I've decided to go ahead and release what's currently available as version 0.90. Changes include:

  • You can now add and remove fog of war.
  • Fixed a bug where the add-buildings-in-many-cities option sometimes didn't work properly if you opted to leave existing buildings.
  • Fixed new units not being available in the Upgrade To and Enslave Results In lists until you restarted the editor and reloaded the scenario.
  • Set the program name in the Dock properly on OS X.
  • Fix the program failing to start properly with a fresh download on Windows 98 (and likely ME), due to not being able to look up where Civ3 was installed.
  • Various behind-the-scenes changes, primarily related to cleaning up the BIQ import-and-export code.

As always, the download link is here.

Additionally, the BIQ-loading code is now available in an open source fashion, over here at Bitbucket. Feel free to make use of it for your own projects, for reference, or however else you wish to.
 
Merry Christmas! To celebrate Christmas, an update to the editor is now available! It wouldn't be Christmas without presents, after all. :xmastree:

You can download it here.

Changes in this version include:

  • BIQs without custom rules are now supported. You can continue to edit them with the default rules, or you can enable custom rules from the editor.
  • A new menu-based interface has been added. As more features added, the buttons across the top was becoming increasingly insufficient. The menus will scale better with the features and use less space.
  • A most-recently-used files list has been added in conjunction with the menus.
  • Initial internationalization has been added. While still very incomplete, the technical base is now present.
  • Fix bug where the polar ice and x/y wrapping was not being read in for existing maps.

The menus are a work in progress. They should be fully functional now, but they currently largely mirror the old interface. In particular, the Special Actions Region (SAR) has not been broken up into the menus yet. The menus won't prevent you from trying to do illegal things yet, either.

The following screenshot illustrates the new interface, as well as a bit of French translation (apologies for any mistakes in translations):



Fear not if you prefer the old interface; you can switch back in the Settings menu (changes apply after a restart). I use the Windows-2000-like theme on Windows 7; I couldn't just replace the theme immediately with no recourse. Going forward, however, new features are likely to only show up in the menu interface, the Most-Recent-Files list being the first and so far only example.

There are 5 most recently used files. This was chosen because it's a nice round number and it's one more than Firaxis's editor allows. I don't know why Firaxis chose 4.

So far, it's only the majority of the menus that are internationalized. You can change language via the Settings. You may notice a new "langs" folder with the download. This is where translations are stored. You can modify them, and the changes will appear after the editor is restarted. So far, only English, French, and sometimes Russian translations of what is translatable so far are available, but you could re-use one of those files for your preferred language if you'd like to experiment.

If there's interest, an increasing amount of the editor will become available for translation. It's not difficult to make more of it translatable, just somewhat tedious, which is largely why I've started small. I'm also not sufficiently fluent in any one non-English language to do a full translation myself. But the goal is that eventually the editor will be accessible to those who aren't fluent in English as well. If you're interested in helping with translation, speak up!

Merry Christmas! :rudolf:
 
Top Bottom