• Civilization 7 has been announced. For more info please check the forum here .

JCivED - a toolbox for Civilization

It's ok, my CivWin graphics modding was just as obtuse, once I've got something that works it's fine. Having a go at getting the SNES graphics over to the DOS version. Turns out, I should have prepped my palette before doing a bulk paste, much detail has been lost :) but in principle it should work.
1705344832856.png
 
Hello again @darkpanda , does the 'import pal' option only support Civ format pal files, or is it meant to be able to handle a custom palette from another source?

I've been researching DOS 13h 6-bit VGA palettes VS full 8 bit 256 colour palettes to try to get an understanding of what's going on here.

My graphics editor is saving my edited palette as an 8 bit palette (in the 'microsoft format' apparently), and the import into jcived always heavily alters the shade of the colours. I'm wondering if the 6bit vs 8bit thing is at fault here. Do I need to pre-convert to a civ pal before importing it in, or is there already logic in jcived to handle that conversion?

EDIT - just to clarify, when I say custom palette, I mean altering some of the palette values of the extracted gif in paint shop pro then saving out the new pal, not creating a new one from scratch!

EDIT 2 - once again I've missed something obvious, you can edit the palette in jcived by double clicking on it!
 
Last edited:
Even altering the palette in jcived, the game is still not respecting it and seemingly defaulting to the standard palette. I must be missing something obvious here.
1705494875554.png


EDIT - attached my modded TER257.PIC. I note that it's considerably larger than the original (which had better compression I suppose)
 

Attachments

  • TER257mod.zip
    18.5 KB · Views: 5
Last edited:
Yeah, graphics in CivDOS are quite hacky...

Even though some PIC files contain their own palette (same data as in PAL files), Civ will *still* sometimes load palette from a PAL file, then load PIC data from the PIC file, disregarding palette data...

It's also possible that JCivEd doesn't save Palette data correctly after you edited it, I should check that too :p

Also, different PAL files (and PAL data inside PIC files) will only span some color ranges, usually that complement each other, but that can also overlap..... Adding to the complexity of knowing from which palette data the actual shown color will be taken.

And let us not forget: some colour routines are simply hard-coding colours during the rendering process.....

The 6-bit vs 8-bit certainly has something to do with the down-shading of colors, as I am pretty sure CivDOS will pad 6-bit color values to 8-bit by left-shifting and pre-pend 2 additional bits (to the right) same as the 2 left-most bits. I'm just stating this from memory, but pretty sure that's what happens.

Also: JCivEd does NOT support any standard palette formats, sorry about that. If I can find some time, I will try to see in more details what's going on with your problem, and hopefully find a solution.

Keep up the good work !

Cheers
 
DOS graphics mods are meant to be challenging, so I'm happy to keep messing with the various pics and pals to see what works and what doesn't. Thanks for the detailed reply. It might even be that a full makeover like this just isn't feasible, but we'll see!
 
Ok, went back at it and I think I got something: the palette file used for rendering the map squares is actually SP256.PAL.

I modified the palette in TER257.PIC, just like you did, but it didn't give anything in game:
1.png
2.png


Then I saved the TER257.PIC palette as a standalone PAL palette file, as shown below:
3.png



First I saved it as SP257.PAL, but it didn't work.

Then I went on to open SP256.PAL in JCivED (just open it through regular "Open PIC image", it will work fine), and modified the same colours I had modified in TER257.PIC, then saved it back as SP256.PAL (using Export palette as PAL again), and voilà ! (yes it's just a couple of colours in hills)

4.png


Does this help you ?

Note: I re-did the modification in SP256.PAL, instead of ust exporting TER257.PIC palette to overwrite SP256.PAL, because original SP256.PAL contains additional color ranges at the final indexes, that would be lost if overwritten from TER257.PIC palette
 
That's awesome, thank you. I tried sp257.pic and .pal but didn't think to check sp256. I think i need to make sure all the palettes match because of the overlap. I will experiment.

EDIT: got it at last. The mistake I was repeatedly making was to save the pal by just hitting save, when I should have been exporting the palette and overwriting it. Tomorrow I will fill in all the other colours and see how far I get.
1705527043836.png
 
Last edited:
Did the resources and rivers, some of them did not auto convert well and will have to be touched up, but we're getting there.

EDIT - replaced image with corrected resources
1705574957758.png
 

Attachments

  • 1705573589716.png
    1705573589716.png
    78.5 KB · Views: 10
Last edited:
Last one for today, I sorted out the water. Looking pretty good now! Some stray pixels on the mountains and shorelines which need a tidy, but nearly there (at least for the tiles). Not sure about units yet, the SNES units are slightly larger than the DOS ones so it might look a bit rubbish.
1705579261699.png
 
For the record, this is the process that ended up working for me (I'll do a nice tutorial post once I'm completely done)
1) Open TER257.PIC, SP257.PIC and SP299.PIC in JCivEd and convert to gif
2) Open gifs in Paint Shop Pro 7 (or another graphics editor which will leave the palette alone when you save)
3) Edit the palette in PSP7 to your liking (leave the top row, the greyscale and the blue well alone, just muck around with the bit in the middle), but remember which colours you changed!
4) Do your changes (in my case, this was pasting in a bunch of stuff from my CivWin SNES mod then tidying up stray pixels by hand) and save the gif.

This is where it gets confusing, now you have to prepare your palettes in JCivEd
1) edit the palettes of TER257.PIC, SP257.PIC and SP299.PIC in JCivEd. For each colour you changed in PSP7, you need to change the equivalent in each of these files, they all need to match. Easiest way is to just copy and paste the hex code over for each colour. Save when done.
Don't try and save time by importing from one file to another, they are not quite identical and this causes problems.
2) open SP256.PAL and do the same thing but instead of saving as normal, export the PAL and overwrite the file.

Now finally the conversion
1) open all the gifs you changed by using 'load image'
2) convert them all to pic (the colours will be all wrong)
3) import the palette from the original version of the pic (which you altered to match PSP7 above) and choose 'substitute palette colours'
4) save the newly created PICs over the originals.
 
I have noticed a bit of a pain point here. The tiles in CivDOS all have a generic green back layer, then a pattern that's layered over the top.

The irrigation graphics actually is drawn in between the green back layer and the top layer, so it's 'underneath' the mostly transparent top layer.

CivWin & CivSNES do not do this, irrigation acts like roads, rails, mines etc and are drawn over the top which allows more variety in the tile graphics. At the moment, the irrigation is hidden underneath my colourful tiles.

A suggestion for a future jcived patch :) can we force the irrigation graphics to be the top layer like other improvements?
 
Just WOW, this is crazy work !!! I really like how the SNES style pops out visually :)

I'm thinking there could be a way to work out your modification more easily, but I have to investigate...

Regarding rendering order of irrigation: I think something is feasible, but I remember it's quite complex code, and in my understanding the purpose was to visually be able to tell desert from plains from grassland apart...

I'll keep you posted.

Cheers !
 
Thanks! Once I cracked the method it was pretty easy to rejig my CivWin stuff to work. I'd done all the hard work to transform the tiles into civ style for that version. Here's the latest wip for you to play with, It's a bit cleaner and I also experimented with plain grey status bar and city screen.
 

Attachments

  • CivDOS_SNES_Wip.zip
    49 KB · Views: 9
Regarding rendering order of irrigation: I think something is feasible, but I remember it's quite complex code, and in my understanding the purpose was to visually be able to tell desert from plains from grassland apart...
Would be useful for tomekum’s terrain set too (I’m still around, I promise!)
 
...
2) open SP256.PAL and do the same thing but instead of saving as normal, export the PAL and overwrite the file.
...
It could also work by just using "Save as PIC image" (=save as normal), but just make sure to keep the name "SP256.PAL"... I just changed some colors in SP256.PAL, saved it with PIC save, then re-opened in JCivEd and it had properly saved the changed colors...
 
It could also work by just using "Save as PIC image" (=save as normal)
Weird, I found when I actually played civ after saving it like that, it would crash when I tried to load a save. Maybe it was something else and I just got mixed up.

For the record, I have now created a landing page for releases of this mod. There's a slightly newer WIP there as well
 
Weird, I found when I actually played civ after saving it like that, it would crash when I tried to load a save. Maybe it was something else and I just got mixed up.
Well in fact that was the risk I think that could happen... Just saving as "PIC" could write the file in a different way than a PAL file is structured (although PIC files also contain PAL-structured palettes...), hence the crash... So, better to "export as PAL" then :)
 
Top Bottom