JCivED - a toolbox for Civilization

Got it, it's because I was actually using 475.01. It's looking for the resource DM_EXE_EN47501.txt. Which checking the source code on source forge, only exists for 474.01.

So user error after all!
I am pretty sure the only difference in CIV.EXE between 474.01 and 475.01 is the "4" digit replaced by a "5" digit... The file "DM_EXE_EN47401.txt" could be just copied and renamed "DM_EXE_EN47501.txt", and it would work...

Unfortunately I cannot test this, since it seems I don't have every version of every CIV.EXE at hand to make the comparison...

Also you encounter this problem because I optimistically marke the patch023 as compatible with both versions 474.01 and 475.01, so JCivED wrongfully allowed you to configure this patch... This can be prevented by restricting the patch compatibility directly at line 11 of file "patches/patch023_game_cfg.xml":
- Before
Code:
    <data versions="EN47401,EN47501"> <parts><part>    <offset> 0x23859 </offset>
- After
Code:
    <data versions="EN47401"> <parts><part>    <offset> 0x23859 </offset>
 
Ok so I took the opportunity to make another JCivED release, now 0.0.25a, focused on fixing bugs in patches (download here: https://sourceforge.net/projects/jcived/files/JCivED-0.0.25a.zip/download )
  • Added 2 patches by YurArm, 53 fixes pollution bug, while 54 fixes negative scores
  • bug fix: fixed incorrect support of patch 23 (experimental) for CIV 475.01
  • bug fix: tupi's F10 PowerGraph patch (204) had a wrong offset for v01, now fixed
  • bug fix: patches 38 and 39 had typo which made them unusable for v03 and v05, now fixed

I am considering spending a little time improving the patch 23, considering more data is already mapped out from the EXE file (such as: building costs, unit cost/attack/defense/move, tech prerequisite/obsolete, wonder prerquisite, etc.), so in theory only the UI is missing to be able to modify those values hard-coded in the CIV.EXE
 
I am running into the "java.lang.Long cannot be cast to java.lang.Short" error when trying to change some variables in a save game, e.g. the position of a unit. It throws the error in the console and when I click away and click back the value has reverted. I'm running Java 1.8.0_311 and JCIVED version 0.0.25 (alpha). I tried JCIVED 0.0.24 and got the same error.

I'd appreciate any assistance, thanks!
 
Last edited:
I am running into the "java.lang.Long cannot be cast to java.lang.Short" error when trying to change some variables in a save game, e.g. the position of a unit. It throws the error in the console and when I click away and click back the value has reverted. I'm running Java 1.8.0_311 and JCIVED version 0.0.25 (alpha). I tried JCIVED 0.0.24 and got the same error.

I'd appreciate any assistance, thanks!
Hi,

Always keen on helping when I can : would you mind sharing the complete error message ? ( full stack trace if you can)
And the savegame you are trying to alter , as well ?

Cheers
 
Hello, Is possibility how to run Jcived in Windows from 2025? I tried to install XP simulátor And win7 simulátor, but IT still does not work. How do you run this program? Thank you Martin
 
I use Cived on WIn7

civ.jpg


Modyfication "Civs Identify flag" changes anything?
After modyfication I gets the same civilization and this same leader and I have problem again because map is done and i have not adapted charecteristic of leader.

I dont find it in this thead but what changes in this three options, more precisely when I imported map from save?

map.png


1. Discard = Dont change position of any animals on map, Dont change civs, his position on map and discoveries.
2. Keep all other map media = Also dont changes position of any animals on map or Civs data
3. Standalone = Loads the map without anything deleting nations and animals. Can't edit anything.

So..what is the difference between option 1 and 2 and is there way to change animals position or load a map with the animals position?
 
Last edited:
Hello, thank you Very much. I opened IT on my old computer without problems. So I Will use IT on my old jursic PC from age of T-Rex.
 
On mY PC with win 11 does not work IT. I tried IT many Times. Than I tried IT on my old PC with XP And IT works without problems.
 
Can me please anybody say how to change nation for human player? I did IT only that I marked IT on one position So I changed IT from Romans to English, but IT did not work And I play Always fór Romans. Many thanks
 
Yes, thank you. And Is IT possible to rename all nations? I see only 8 which Are in the game...
 
Could you please tell me if it's possible to use JCivED to add text to the second science screen (where the game information is, not the artistic description) via *.txt files, like it does with units and buildings?

That is, so that it would be possible to add a text here:

Writing.jpg
 
Last edited:
java.lang.ClassCastException
Started toying with the JCivEd tool and encountered an error when trying to change the numerical value of an unit's X position. I found it discussed earlier in this thread but it seemed to have been reportedly addressed in the previous release of the editor, i.e., version 0.0.24. Changing the Unit's Type worked as expected and was accepted when reloading the saved game. There was no issue which is interesting because the pulldown menu for selecting the unit type (I assume) is an interface for the actual numerical value shown alongside the pulldown and that is used within the program. So, this seems to indicate (again, my assumption) a difference between how the two variables may be coded. Hope this info helps to find the root cause. Save & Map files attached. 100% repeatable using different Save files and system reboots.
OSWin 11 25H2
MoBoX870E
CPU9950X3D
Java
VERSION25.0.1
RUNTIME_VERSION25.0.1+8-LTS-27
MODULESjava.base java.compiler java.datatransfer java.xml java.prefs java.desktop java.instrument java.logging java.management java.security.sasl java.naming java.rmi java.management.rmi java.net.http java.scripting java.security.jgss java.transaction.xa java.sql java.sql.rowset java.xml.crypto java.se java.smartcardio jdk.accessibility jdk.internal.jvmstat jdk.attach jdk.charsets jdk.internal.opt jdk.zipfs jdk.compiler jdk.crypto.cryptoki jdk.crypto.ec jdk.crypto.mscapi jdk.dynalink jdk.internal.ed jdk.editpad jdk.internal.vm.ci jdk.graal.compiler jdk.graal.compiler.management jdk.hotspot.agent jdk.httpserver jdk.incubator.vector jdk.internal.le jdk.internal.md jdk.jartool jdk.javadoc jdk.jcmd jdk.management jdk.management.agent jdk.jconsole jdk.jdeps jdk.jdwp.agent jdk.jdi jdk.jfr jdk.jlink jdk.jpackage jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.management.jfr jdk.naming.dns jdk.naming.rmi jdk.net jdk.nio.mapmode jdk.sctp jdk.security.auth jdk.security.jgss jdk.unsupported jdk.unsupported.desktop jdk.xml.dom
DosBox2025.12.01
JCivEd0.0.25a
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Short (java.lang.Long and java.lang.Short are in module java.base of loader 'bootstrap')
at dd.commons.binary.bytemap.UnsignedByteMapping.valueToBytes(UnsignedByteMapping.java:26)
at dd.commons.binary.bytemap.AbstractMapping.setValue(AbstractMapping.java:102)
at dd.commons.binary.bytemap.ByteMapModel.setValueForId(ByteMapModel.java:89)
at dd.civ.data.game.model.sve.impl.ByteArraySVE.setValue(ByteArraySVE.java:169)
at dd.civ.data.game.model.sve.impl.CivDosGameState.setPropertyValue(CivDosGameState.java:298)
at dd.civ.data.game.model.generic.Entity.setPropertyValue(Entity.java:81)
at dd.civ.data.game.model.generic.Entity.setPropertyValue(Entity.java:81)
at dd.jcived.ui.components.generic.Field.propertyChange(Field.java:127)
at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:336)
at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:268)
at java.desktop/java.awt.Component.firePropertyChange(Component.java:8670)
at java.desktop/javax.swing.JFormattedTextField.setValue(JFormattedTextField.java:828)
at java.desktop/javax.swing.JFormattedTextField.commitEdit(JFormattedTextField.java:559)
at java.desktop/javax.swing.JFormattedTextField$FocusLostHandler.run(JFormattedTextField.java:677)
at java.desktop/javax.swing.JFormattedTextField.processFocusEvent(JFormattedTextField.java:659)
at java.desktop/java.awt.Component.processEvent(Component.java:6332)
at java.desktop/java.awt.Container.processEvent(Container.java:2260)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4958)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2318)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4790)
at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1829)
at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1061)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:729)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4839)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2318)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4790)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:725)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:702)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
 

Attachments

Last edited:
Was perusing the JCivEd java repository on SourceForge to see if I could trace the above error. While there I noticed a little nit/typo in the UnitTypeCode.java file.

Line 18 of the file contains:
MECH_ING(12, "mechinf"),
Don't know if it's important but should that G be an F? Color added for clarity.
 
I use Cived on WIn7

View attachment 730224

Modyfication "Civs Identify flag" changes anything?
After modyfication I gets the same civilization and this same leader and I have problem again because map is done and i have not adapted charecteristic of leader.

I dont find it in this thead but what changes in this three options, more precisely when I imported map from save?

View attachment 730226

1. Discard = Dont change position of any animals on map, Dont change civs, his position on map and discoveries.
2. Keep all other map media = Also dont changes position of any animals on map or Civs data
3. Standalone = Loads the map without anything deleting nations and animals. Can't edit anything.

So..what is the difference between option 1 and 2 and is there way to change animals position or load a map with the animals position?

Hi GPR,

In CIV1, MAP data contains more than just terrain/geography : in addition there are 9 other layers of data such as : land value, land ownership, improvements on each square (like irrigation, mining,road , railroad ...), etc.
You can find more details in this post: https://forums.civfanatics.com/thre...rmats-figured-out-almost.478234/post-11964685

So here is what happens with each option:
- 1. in the current savegame, overwrite all terrain geography, and reset all other map data
- 2. in the current savegame, overwrite all terrain geography, but keep terrain improvements, land value, land ownership, etc....
- 3. open the map in "terrain edition mode" only, so there is no other game data to modify ; useful for prerparing EARTH replacement maps (MAP.PIC file)

I you are keen on it, you can look at the source code in these files:
- Dialog box and associated code: https://sourceforge.net/p/jcived/co...ed/jciveditor/ui/helpers/ImportMapHelper.java
- What "ConvertToMAP" does when using option 2: line 236 of file https://sourceforge.net/p/jcived/co.../game/model/sve/impl/StandaloneCivDosMAP.java

Final note: you CANNOT change animal positions with map edition, because animal position is dicated by an algorithm (see here: https://forums.civfanatics.com/thre...tterns-for-huts-and-special-resources.339049/), and this algorithm itself is controlled by a game data value in the SVE file, not map data.
 
java.lang.ClassCastException
Started toying with the JCivEd tool and encountered an error when trying to change the numerical value of an unit's X position. I found it discussed earlier in this thread but it seemed to have been reportedly addressed in the previous release of the editor, i.e., version 0.0.24. Changing the Unit's Type worked as expected and was accepted when reloading the saved game. There was no issue which is interesting because the pulldown menu for selecting the unit type (I assume) is an interface for the actual numerical value shown alongside the pulldown and that is used within the program. So, this seems to indicate (again, my assumption) a difference between how the two variables may be coded. Hope this info helps to find the root cause. Save & Map files attached. 100% repeatable using different Save files and system reboots.
OSWin 11 25H2
MoBoX870E
CPU9950X3D
Java
VERSION25.0.1
RUNTIME_VERSION25.0.1+8-LTS-27
MODULESjava.base java.compiler java.datatransfer java.xml java.prefs java.desktop java.instrument java.logging java.management java.security.sasl java.naming java.rmi java.management.rmi java.net.http java.scripting java.security.jgss java.transaction.xa java.sql java.sql.rowset java.xml.crypto java.se java.smartcardio jdk.accessibility jdk.internal.jvmstat jdk.attach jdk.charsets jdk.internal.opt jdk.zipfs jdk.compiler jdk.crypto.cryptoki jdk.crypto.ec jdk.crypto.mscapi jdk.dynalink jdk.internal.ed jdk.editpad jdk.internal.vm.ci jdk.graal.compiler jdk.graal.compiler.management jdk.hotspot.agent jdk.httpserver jdk.incubator.vector jdk.internal.le jdk.internal.md jdk.jartool jdk.javadoc jdk.jcmd jdk.management jdk.management.agent jdk.jconsole jdk.jdeps jdk.jdwp.agent jdk.jdi jdk.jfr jdk.jlink jdk.jpackage jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.management.jfr jdk.naming.dns jdk.naming.rmi jdk.net jdk.nio.mapmode jdk.sctp jdk.security.auth jdk.security.jgss jdk.unsupported jdk.unsupported.desktop jdk.xml.dom
DosBox2025.12.01
JCivEd0.0.25a
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Short (java.lang.Long and java.lang.Short are in module java.base of loader 'bootstrap')
at dd.commons.binary.bytemap.UnsignedByteMapping.valueToBytes(UnsignedByteMapping.java:26)
at dd.commons.binary.bytemap.AbstractMapping.setValue(AbstractMapping.java:102)
at dd.commons.binary.bytemap.ByteMapModel.setValueForId(ByteMapModel.java:89)
at dd.civ.data.game.model.sve.impl.ByteArraySVE.setValue(ByteArraySVE.java:169)
at dd.civ.data.game.model.sve.impl.CivDosGameState.setPropertyValue(CivDosGameState.java:298)
at dd.civ.data.game.model.generic.Entity.setPropertyValue(Entity.java:81)
at dd.civ.data.game.model.generic.Entity.setPropertyValue(Entity.java:81)
at dd.jcived.ui.components.generic.Field.propertyChange(Field.java:127)
at java.desktop/java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:343)
at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:336)
at java.desktop/java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:268)
at java.desktop/java.awt.Component.firePropertyChange(Component.java:8670)
at java.desktop/javax.swing.JFormattedTextField.setValue(JFormattedTextField.java:828)
at java.desktop/javax.swing.JFormattedTextField.commitEdit(JFormattedTextField.java:559)
at java.desktop/javax.swing.JFormattedTextField$FocusLostHandler.run(JFormattedTextField.java:677)
at java.desktop/javax.swing.JFormattedTextField.processFocusEvent(JFormattedTextField.java:659)
at java.desktop/java.awt.Component.processEvent(Component.java:6332)
at java.desktop/java.awt.Container.processEvent(Container.java:2260)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4958)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2318)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4790)
at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1829)
at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1061)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:729)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4839)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2318)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4790)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:725)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:702)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Hi tocguy,

The root cause of this error is indeed a bug in the code : I partially fixed it for "Byte" type mappings, but forgot to do it for "UnsignedByte" type mappings, as you can see in the code screenshot side by side below:

root_cause.png


Those classes are in the companion JAR package "dd-commons.jar".

If you master Java, you may be able to recompile this JAR by yourself from SourceForge (code is in branches/dev-commons), otherwise you'll have to wait for a patch - uncertain at this point when this could come your way...

Thanks for reporting anyhow, and cheers
 
Back
Top Bottom