JCivED - a toolbox for Civilization

Just a quick word to mention that I have added a basic CIV.EXE patcher function to the work-in-progress version of JCivED.

It supports custom-made patches in the form of on-the-side XML files containing the patches offsets and code, by version, etc...

I am currently writing the XML patches corresponding to many threads posted on civfanatics, so they become available and easy to use for everyone.

As well, this will make it possible for anyone to publish CIV patches as convenient XML files for everyone to drop to their JCivED folder and apply, without the need for finding a Hex editor and so.

All this will be released within the coming week or so.

Cheers
 
What would really help are the first few lines in the 'cmd.exe' windows :)

Here are the first six lines:

Code:
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Consructor.newInstance(Unknown Source)
   at dd.commn.ui.MDIEditor.openSupportedObject(MDIEditor.java:91)

I hope this helps. Good luck!
 
Here are the first six lines:

Code:
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Consructor.newInstance(Unknown Source)
   at dd.commn.ui.MDIEditor.openSupportedObject(MDIEditor.java:91)

I hope this helps. Good luck!

Arg! This error is really not what I expected, I might actually need more than 6 lines, maybe 12 ! :p

Besides this, it could be related to the directory/file structure where you put JCivED on your disk... Would you mind giving me some details about it ?

You could also give me the output of a dir /s from the JCivED directory.

I am still really surprised it happens in WinXP but no in Win 7...
 
Arg! This error is really not what I expected, I might actually need more than 6 lines, maybe 12 ! :p

Here are 15-and-a-bit for the price of 12:

Code:
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
   at java.lang.reflect.Consructor.newInstance(Unknown Source)
   at dd.commn.ui.MDIEditor.openSupportedObject(MDIEditor.java:91)
   at dd.jcived.jciveditor.ui.actionsOpenGameSaveAction.openFile(OpenGameSaveAction.java:53)
   at dd.common.ui.actions.OpenFileAction.actionPerformed(OpenFileAction.java:32)
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.AbstractButton.doClick(Unknown Source)
   at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
   at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
   at java.awt...

Besides this, it could be related to the directory/file structure where you put JCivED on your disk... Would you mind giving me some details about it ?

JCivED is in c:\games\civ\jcived. Its parent directory is where CIV.EXE and all its companions reside. I've tried relocating JCivED (into the Civ directory, and into a sibling directory of Civ) and the saved games (into the Civ directory and the JCivED directory itself), but it hasn't made any difference.

You could also give me the output of a dir /s from the JCivED directory

Here it is:
Code:
 Volume in drive C is Primary
 Volume Serial Number is 44A0-0281

 Directory of C:\GAMES\CIV\JCIVED

13-08-14  17:07    <DIR>          .
13-08-14  17:07    <DIR>          ..
13-08-08  19:03           363,160 dd-common.jar
13-08-14  17:07                 0 jcivdir.txt
13-08-12  14:08           627,984 JCivED-0.0.11.2a.zip
13-04-26  06:16                33 jcived.bat
13-06-25  08:04           376,004 jcived.jar
13-04-26  06:17                60 piced_cmd.bat
13-08-12  14:11                57 settings.ini
               7 File(s)      1,367,298 bytes

     Total Files Listed:
               7 File(s)      1,367,298 bytes
               2 Dir(s)  40,079,859,712 bytes free

I hope this looks more enlightening to you than it does to me!
 
I hope this looks more enlightening to you than it does to me!

Can't see any obvious problem right now...

Here are 15-and-a-bit for the price of 12

As a matter of fact, there should be a "nested exception", meaning that scrolling further down the cmd.exe window, you should another 'stacktrace' starting with java.xxx.yyy.SomethingException, which will be the *real* cause of the error, which in turn provoked the InvocationTargetException...

As a last resort, can you copy-paste it here ?
 
As a matter of fact, there should be a "nested exception", meaning that scrolling further down the cmd.exe window, you should another 'stacktrace' starting with java.xxx.yyy.SomethingException, which will be the *real* cause of the error, which in turn provoked the InvocationTargetException...

Aha! Scrolling down, I see the following:

Code:
   ...
   at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.OutOfMemoryError: Java heap space
   at java.awt.image.DataBufferInt.<init>(Unknown Source)
   ...

If you need more lines than this, could you teach me how to turn this output into something that's copy-pasteable?
 
I think it says it all:

Code:
   ...
   at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.[B]OutOfMemoryError[/B]: Java heap space
   at java.awt.image.DataBufferInt.<init>(Unknown Source)
   ...

What's the amount of RAM on your WinXP system?

I never really cared for this, but it's true that JCivED quickly gets over ~400 MB of used RAM when opening a single gamesave, plus 200 or 300 MB per additional gamesave...

Another possibility is that your Java installation has memory limitations configured by default, but usually this is based on the system memory.
 
I think it says it all:

What's the amount of RAM on your WinXP system?

384 MB (although the label says 'half a gigabyte'). 'Nuff said... Thanks for your help in identifying this issue. Eh, the laptop I had before this one (and which I bought specifically to play CIV as I commuted by train) had just 8 MB!
 
Just tried out JCivED for the first time since the land value generation was added. Good work Darkpanda. The only little issue that I noticed was that when generating the land value, you need to account for the fact that all squares directly surrounding the city's productive land are normally valued at '8' (in order to keep the cities 3-spaced apart). This is not maintained when you refresh the land values in JCivED.
 
Just tried out JCivED for the first time since the land value generation was added. Good work Darkpanda. The only little issue that I noticed was that when generating the land value, you need to account for the fact that all squares directly surrounding the city's productive land are normally valued at '8' (in order to keep the cities 3-spaced apart). This is not maintained when you refresh the land values in JCivED.

Actually, the MAP contains 2 areas to store land values:
  • Initial land values
  • Land values with cities area/influence

The second area is (presumably) used by the AI to avoid building cities too close to each other, even if there is high-value land around. To do that, CIV basically overwrites the original land value (ranges from 8 to 15, when not 0) with the neighbour city's Civ ID (ranges from 1 to 7). I didn't check the CIV code for that, but I guess this makes Civs believe that the land has too low a value to build a city.

Now, what JCivED does when rebuilding land values is to completely rewrite the first layer (called 'Land values' in JCivED) and then rewrite the second layer (called 'Current Land values' in JCivED) by skipping city squares.

I just re-tested it in 0.0.12a, and didn't see the behaviour you mentioned.

If you still think there's something wrong, can you elaborate?
 
Hmm, that's odd. I tried it a few times. The 8 value 'shroud' dissapeared each time, on all cities. Let me give it a few goes on a more predictable Earth map.
 
Hmm, that's odd. I tried it a few times. The 8 value 'shroud' dissapeared each time, on all cities. Let me give it a few goes on a more predictable Earth map.

Ok, I checked it again and now I know what you mean... I had not noticed this "8-value" shroud, that is created beyond the city radius, actually.

I think I need to check the logic that's behind it to make it right.

Thanks for noticing!
 
Yes, I didn't think anybody had noticed. But as you mentioned before, it seems to be what the game does in order to keep the cities well-spaced; I always had to do this manually before you introduced the automated value-generator, or cities would be built too closely together.
 
A quick word to notify that some fresh CIV.EXE patches are available from the JCivED source code repository at sourceforge.net: http://sourceforge.net/p/jcived/code/HEAD/tree/branches/dev/patches/

You can manually download them and put them to your "JCivED/patches" sub-directory for JCivED to recognize them.

Hereunder is the full list of patches available:

patch001.xml - CIV1_CUSTOM_TRIBE_NAME+COLOR - Choose the Civ color AND a custom tribe name ! - source: http://forums.civfanatics.com/showthread.php?p=12686797#post12686797
  • After applying this patch, the player will be prompted to enter their own Tribe name even after selecting the Civ color they desire, with no need to press the ESC key
patch002.xml - CIV1_PLAY_1TO1 - Play against just 1 computer Civ... Or even 0! - source: http://forums.civfanatics.com/showthread.php?t=499613
  • This patch adds the possibility to select "2 Civilizations" or "1 Civilizations" to the number of Civ selection screen, and then starts the Civ game with the corresponding number of Civs: if 2 is selected, the player is playing against a single computer opponent; if 1 is selected, the player is playing alone!
patch003.xml - CIV1_PLAY_FOREVER - Play never-ending games! - source: http://forums.civfanatics.com/showthread.php?t=499911
  • This patch removes the "retirement" limitation that ends games on year 2100 (Chieftain) to 2020 (Emperor). It does NOT remove other endgame conditions such as conquest (all opponents destroyed) or space conquest (spaceship reaches Alpha Centauri)
patch004.xml - CIV1_EARTH_RAND_START - Play on earth with random starting positions - source: http://forums.civfanatics.com/showthread.php?t=499611
  • This patch bypasses the hard-coded starting positions when playing on Earth, and makes Civ choose random positions instead. This can be especially useful when playing with a custom-designed MAP.PIC
patch005.xml - CIV1_STARVE_INC_POP - Food-starving cities have their population... increase! - source: http://forums.civfanatics.com/showthread.php?t=497438
  • This pointless -yet fun- patch makes the population of cities that endure food shortage *increase* by 1 instead of decreasing by 1 in the original game rules... My very first CIV.EXE hack ;)
patch006.xml - CIV1_NO_POLES - Remove North and South poles - source: http://forums.civfanatics.com/showthread.php?t=495521
  • This patch makes CIV bypass the generation of landmass at North and South poles, for both Earth and random maps
patch007.xml - CIV1_BUGFIX_LAND_PATHFIND - Fixes a bug in CIV generation of land pathfinding data - source: http://forums.civfanatics.com/showthread.php?p=12686797#post12686797
  • After applying this patch, the high-level path-finding data for land movement (also present in SVE files) will be generated properly by CIV; the actual impact on CIV games is unknown
patch008.xml - CIV1_F10_LOAD_GAME - Rewires F10 shortcut key to load saved game from within CIV - source: http://forums.civfanatics.com/showthread.php?p=12766006#post12766006
  • After applying this patch, pressing F10 key will open the "Load Saved Game" screen and allow the player to directly load a previously saved game; the World Map can still be shown by using the menu item from the WORLD menu; note: some side effects have been noticed, this functionality is not guaranteed
patch009.xml - CIV1_BUGFIX_MAP_LAYOUT - Fixes terrain layout glitch - source: http://forums.civfanatics.com/showthread.php?p=12851553#post12851553
  • For some terrain types (jungle, swamp, tundra and arctic), contiguous map squares are rendered using single-square graphics; applying this patch fixes this glitch and makes all terrain types display using their contiguous square graphics
patch010.xml - CIV1_BUGFIX_LAND_VALUE - Fixes land value calculation - source: http://forums.civfanatics.com/showthread.php?p=12851553#post12851553
  • Parts of the original CIV algorithm to compute land calculation is deemed incorrect; this patch fixes this bug
patch011.xml - CIV1_RERESPAWN - Opponent Civs can now respawn more than once - source: http://forums.civfanatics.com/showthread.php?t=514562
  • The original CIV code only allows a Civ to be respawned once after it is destroyed (not including the special case of SCHISM); this patch removes this limit by skipping the verification that the Civ is being re-spawned for the 2nd time; Note: discrepancies in the Replay are to be expected
patch012.xml - CIV1_1TURN_LAND_IMPROVEMENT - Improving land takes 1 turn only (not railroad) - source: http://forums.civfanatics.com/showthread.php?t=514255
  • This patch changes all terrain characteristics so that improving them (irrigation or mining) takes only 1 turn


In the meantime, JCivED development is ongoing, by phases, and I don't plan to release a new version until something serious is done for user-friendly edition of cities and units... Sorry for keeping you waiting!
 
Question, is there a way to bring in a picture and turn it into a map? Just thinking it would be quite handy to be able to bring in pictures and not have to draw them out by hand to use them in civ. For example, I would like to play civ on the Lord of the Rings world, it would be great if I didn't have try to draw it.
 
Question, is there a way to bring in a picture and turn it into a map? Just thinking it would be quite handy to be able to bring in pictures and not have to draw them out by hand to use them in civ. For example, I would like to play civ on the Lord of the Rings world, it would be great if I didn't have try to draw it.

As a matter of fact, I've been thinking of such a feature for some time already, to be able to transform arbitrary geographical pictures and turn them into Civ MAPs...

One issue is that you still need some kind of constraints on the input picture, the minimum being to tell JCivED which terrain type to generate...

There could be different levels of details, for example: 2 colors (1 for land/plains, 1 for sea), 3-4-5 colors (sea, plains, forest/mountains/hills), or up to 12-colors (1 for each terrain type).

You'de still need to prepare the input picture, although painting it in a photoshop-like tool would be probably much easier than in JCivED. Also, probably some "finitions", final adjustments, would need to be done inside JCivED to polish the thing.

It's not really on the top of my list, but if you're interested, I can push it up a little...
 
Top Bottom