JCivED - a toolbox for Civilization

Yeah alright. Is there a way to repack the exe? I have made several changes on the unpacked version...

Mmmh... No obvious way right off the bat, but can you detail the changes you made, in nature and quantity? So I can try to figure something out.

By the way, for those using other versions, I updated the patch above with info for all versions.
 
I tweeked the terrains a bit... Mountains, artic, and tundra can be irrigated, and ocean can be mined into grassland. I allowed the AI to do irrigating/mining under despotism. I changed the tech required for all of the spaceship parts to dummy tech. I think that's it, but I might have changed some other things. :)
 
Cool, it would be good to have support for that so when someone not quite as familiar with computers can still use your patches after they have unpacked their file.
 
Cool, it would be good to have support for that so when someone not quite as familiar with computers can still use your patches after they have unpacked their file.

I have written a small routine that automatically upgrades nearly all patches to support unpacked versions of CIV.EXE as well...

Here is a ZIP containing all the upgraded patches, so that you can test and confirm whether it works for you: View attachment patches_with_unpacked_support.zip

Let me know how they behave.
 
After some random testing, I found a fault in the experimental support for unpacked versions of CIV.EXE: only some patches work properly, some others have no impact at all...

The reason is simple: an unpacked CIV executable cannot work alone. As Gowron did explain somwhere, a long time ago, an unpacked version of CIV.EXE can only work when it is kept alongside an original (= packed) version of CIV.EXE. The unpacked version should, in addition, be renamed (for example to CIV_UNP.EXE), while the packed version should remain named CIV.EXE.

When executing the CIV_UNP.EXE, most of the code and hard-coded data will be loaded from it directly - but not all of it!
Actually, all overlays are loaded from the original packed CIV.EXE. (Note: overlays are pieces of code located at the end of CIV.EXE, and that are dynamically loaded by CIV during the game when calling functions located in them, a mechanism used to overcome the limited 640k memory available for a program in MS-DOS)
Since many patches operate on code located in overlays, applying those to an unpacked CIV_UNP.EXE will have no effect at all when running it.
However, if those patches are applied to the packed companion (CIV.EXE), then they will work properly, even when the game is started with CIV_UNP.EXE.

Hope this is clear for everyone - quiz next tuesday...
 
Ooh, I like quizzes. Anyways, I noticed that when I used the patch for default game options in my packed version, it didn't take effect in my new games when I used the unpacked version... so that makes me wonder what things have to be changed in the packed version vs the unpacked version.
 
O, darkpanda, know that your days on Earth have not been spent in vain! (Or, as someone else has said before me: wow, just wow!)

I haven't been following this forum - and therefore the development of JCivED - for some time now, as I've been sampling the delights of modding Civ 5. That's a damn fine game, and yet... I find myself irresistibly attracted back to the primitive delights of the original.

And (having meanwhile purchased a computer that, being capable of running Civ 5, can also manage JCivED) what do I find? This wonderful tool for modding the original! Many thanks :)

I'm absolutely delighted that it includes the ability to edit the colour palette. I did, however, discover that ability by accident - so I suggest you add a few words somewhere along the lines of "Click to edit". Anyway, I now have the visual pleasure of purple Romans, orange/bronze Greeks and light-grey (not dark-grey) Mongols.

However, I've discovered that I can only use colours with a low palette index, which is a great disappointment, since most of those colours must already be in use, and therefore can't be edited without side-effects. If I edit a colour with a high index, I get strange results: black, grey, magenta or flashing (reminding me of programming the ZX Spectrum!).

The lowest index I've tried that has this undesirable effect is 102, and the highest I've tried that doesn't is 53 (for those Greeks) - which suggests to me that perhaps only the first 64 colours are safely usable.

I haven't noticed anyone else reporting such behaviour, so I wonder why I'm getting it. Perhaps it's because I'm using version 474.03? And I'm editing SP256.PAL, not SP257.PAL (which doesn't seem to have any effect).

Any ideas?
 
O, darkpanda, know that your days on Earth have not been spent in vain! (Or, as someone else has said before me: wow, just wow!)

I haven't been following this forum - and therefore the development of JCivED - for some time now, as I've been sampling the delights of modding Civ 5. That's a damn fine game, and yet... I find myself irresistibly attracted back to the primitive delights of the original.

And (having meanwhile purchased a computer that, being capable of running Civ 5, can also manage JCivED) what do I find? This wonderful tool for modding the original! Many thanks :)

I'm absolutely delighted that it includes the ability to edit the colour palette. I did, however, discover that ability by accident - so I suggest you add a few words somewhere along the lines of "Click to edit". Anyway, I now have the visual pleasure of purple Romans, orange/bronze Greeks and light-grey (not dark-grey) Mongols.

However, I've discovered that I can only use colours with a low palette index, which is a great disappointment, since most of those colours must already be in use, and therefore can't be edited without side-effects. If I edit a colour with a high index, I get strange results: black, grey, magenta or flashing (reminding me of programming the ZX Spectrum!).

The lowest index I've tried that has this undesirable effect is 102, and the highest I've tried that doesn't is 53 (for those Greeks) - which suggests to me that perhaps only the first 64 colours are safely usable.

I haven't noticed anyone else reporting such behaviour, so I wonder why I'm getting it. Perhaps it's because I'm using version 474.03? And I'm editing SP256.PAL, not SP257.PAL (which doesn't seem to have any effect).

Any ideas?


Hi Nesretnik, and thanks for the praise - I am not immune to flattery ;)

From what I understand, you are changing the Civilizations' colors by editing the palette in SP256.PAL, right?

Are you also using the CIV.EXE patch for changing Civ colors? From your descriptions it is unclear whether you're doing it that way or just by editing the PAL.

Anyhow, I indeed noticed that not all colors can be freely edited without side effects. Some of the non-transparent (magenta) colors are also subject to color cycling, such as those for ocean tiles.

In the main game screen, I think one of the color range comes from Advisors graphics (GOVTxx.PIC/PAL) which are often rendered in the main screen when giving you messages in dialogs. Possibly the government background palette may be included too (BACKxx.PIC/PAL).

PIC/PAL is not my focus lately but your comment is nonetheless welcome. In fact i have been thinking that as more and more features are being added, usability starts to be a concern (although there aren't many declared that I know of, beyond kirkham7 and yourself...)

I am comtemplating spending some effort on user doc, typically by consolidating much of what is already around this forum, into an ordered structure on JCivED's sourceforge wiki.

Anyway, you can send screenshots of what you're doing, it might help.
 
From what I understand, you are changing the Civilizations' colors by editing the palette in SP256.PAL, right?

That's right. I began by using the JCivED patch for doing that, but I immediately ran into the kind of trouble I described earlier, resulting from using high-index colours. So since then, in order to simplify the situation and reduce the number of potential influencing factors, I've limited myself to editing the palette in JCivED directly (without using the patch) and then using a hex editor to change the colour indices in the packed CIV.EXE code (starting at 25845h):

Code:
00025840  FF 03 00 FD FF 0C 00 0D 00 0A 00 09 00 0E 00 0B  ÿ..ýÿ...........
00025850  00 34 00 14 00 04 00 04 00 02 00 01 00 36 00 03  .4...........6..
00025860  00 35 00 18 00 AC 00 B4 00 BE 00 C7 00 D1 00 DA  .5...¬.´.¾.Ç.Ñ.

After more research since my previous post, I've come to the conclusion that nothing above index 36h is worth touching, and any major change anywhere is asking for trouble. That's why I'm only using 00-0Fh and 34-36h, and only changing those colours slightly.

You can see some results in the attached screenshots. The greys (14/18h) are lighter, which I really like, and it's OK because the whites are gone. (I didn't like the cyan details in them.) So the whites are replaced by purples: the old magenta (0Dh) has been toned down and the dark red (04h) made bluer (giving the Barbarians, who share that colour, a crimson tone). The magenta civs are replaced by orange ones (34/35h, slightly edited for greater contrast and less saturation). The yellows have a slightly brighter 'light' colour, and I've changed the 'dark' colour to 36h: brownish rather than greenish. The greens, cyans and blues are unchanged.

One side-effect of fiddling with 04h can be seen in the 'Military losses' screenshot, where it appears as the background colour. But I very rarely look at that screen, which takes me on to my next post...
 

Attachments

  • CivScr01.jpg
    CivScr01.jpg
    167.7 KB · Views: 312
  • CivScr07.jpg
    CivScr07.jpg
    67.1 KB · Views: 289
  • CivScr09.jpg
    CivScr09.jpg
    171.6 KB · Views: 295
  • CivScr05.jpg
    CivScr05.jpg
    50.5 KB · Views: 249
  • CivScr06.jpg
    CivScr06.jpg
    194.7 KB · Views: 313
darkpanda, I've been trying out your patches for the CIV executable, and they're great. I do like being able to load a saved game, replacing the current game, instead of having to exit from the program.

However, I use F10 rather a lot, so I wondered whether there was a simple tweak to your patch that would transfer the 'load game' function to a different function key. I use F2 very rarely, partly because the info it gives is unreliable, so could that be given the 'load game' job?
 
darkpanda, I've been trying out your patches for the CIV executable, and they're great. I do like being able to load a saved game, replacing the current game, instead of having to exit from the program.



However, I use F10 rather a lot, so I wondered whether there was a simple tweak to your patch that would transfer the 'load game' function to a different function key. I use F2 very rarely, partly because the info it gives is unreliable, so could that be given the 'load game' job?

Shouldn't be a problem, just give me some time to look into it.

Nice take on the Civ colors by the way: although I've dreamt of changing them since the first days I played CIV, I've yet to play a game with new colors :)
 
darkpanda, I've been trying out your patches for the CIV executable, and they're great. I do like being able to load a saved game, replacing the current game, instead of having to exit from the program.

However, I use F10 rather a lot, so I wondered whether there was a simple tweak to your patch that would transfer the 'load game' function to a different function key. I use F2 very rarely, partly because the info it gives is unreliable, so could that be given the 'load game' job?

There you go:

Code:
For versions [b]EN47401[/b], [b]EN47501[/b], [b]EN47401UNP[/b] and [b]EN47501UNP[/b]:
        Original bytes: [color=red]FF 36 10 E7[/color] CD 3F [color=red]0E AD 03[/color] 
         Patched bytes: [color=blue][b]B8 FF FF 50[/b][/color] CD 3F [color=blue][b]0B 00 00[/b][/color] 
        Offsets:
            EN47401: [b]0x733E[/b]
            EN47501: [b]0x733E[/b]
            EN47401UNP: [b]0x9AD2[/b]
            EN47501UNP: [b]0x9AD2[/b]

For versions [b]EN47403[/b], [b]EN47404[/b], [b]EN47405[/b], [b]EN47403UNP[/b], [b]EN47404UNP[/b] and [b]EN47405UNP[/b]:
        Original bytes: [color=red]FF 36 EE D7[/color] CD 3F [color=red]0E AD 03[/color] 
         Patched bytes: [color=blue][b]B8 FF FF 50[/b][/color] CD 3F [color=blue][b]0B 00 00[/b][/color] 
        Offsets:
            EN47403: [b]0x6DC0[/b]
            EN47404: [b]0x6DC0[/b]
            EN47405: [b]0x73A8[/b]
            EN47403UNP: [b]0x9484[/b]
            EN47404UNP: [b]0x9484[/b]
            EN47405UNP: [b]0x9B5C[/b]

For versions [b]FR47405[/b] and [b]FR47405UNP[/b]:
        Original bytes: [color=red]FF 36 6E DB[/color] CD 3F [color=red]0E BD 03[/color] 
         Patched bytes: [color=blue][b]B8 FF FF 50[/b][/color] CD 3F [color=blue][b]0B 00 00[/b][/color] 
        Offsets:
            FR47405: [b]0x748C[/b]
            FR47405UNP: [b]0x9C00[/b]
 
There you go:

Code:
...For versions [b]EN47403[/b], [b]EN47404[/b], [b]EN47405[/b], [b]EN47403UNP[/b], [b]EN47404UNP[/b] and [b]EN47405UNP[/b]:
        Original bytes: [color=red]FF 36 EE D7[/color] CD 3F [color=red]0E AD 03[/color] 
         Patched bytes: [color=blue][b]B8 FF FF 50[/b][/color] CD 3F [color=blue][b]0B 00 00[/b][/color] 
        Offsets:
            EN47403: [b]0x6DC0[/b]...

Yup, that works :) Thanks very much!
 
Well, I was thinking something like giving every tech unique and static cost value. Didn't yet look at the procedure you described and I don't know if it's really possible to do.

But maybe one could try to insert custom code into subprogram again and use for example the tech ID for the cost value for each tech. And then edit the tech tree data. Would that do the job?

But at the moment I'm more interested about the CivOne project anyway.
 
Patch questions:
* patch032_skip_av_intro.xml - Skip A/V selection on startup. It seems like all you've done is replaced a JMP or CALL or something with a series of NOP. What state does this start the game in? Which sound driver, etc?

* patch007_bugfix_pathfind.xml - Fixes a bug in CIV generation of land pathfinding data. What exactly does this do? It only works for 474.01 and 475.01, and the reference link points to some unrelated post.

And one more for good measure:
* Can SP299x patch from here be included?
http://forums.civfanatics.com/showthread.php?t=518839
 
1. start new game, save asap
2. open up in the awesome JCivED
3. Make the entire map rivers
4. Game freezes on a between turn load after about a dozen turns

Is this a known freeze because my planet of rivers is just too silly?
 
1. start new game, save asap
2. open up in the awesome JCivED
3. Make the entire map rivers
4. Game freezes on a between turn load after about a dozen turns

Is this a known freeze because my planet of rivers is just too silly?

Can you post a copy of you savegame files just before the freeze ?

If the whole map is just rivers, could be related to continent/oceans IDs...
 
Top Bottom