JCivED - a toolbox for Civilization

And about point 2, which flag are you referring to?
Simply that Space Ship of this civilization is "LAUNCHED!" (or "LANDED", if year of arrival <= current year). 1 bit value per civilization, it's called bit flags. Not that important, but I want JCivED to be able edit everything. (Even to add "forbidden" terrain "colors" (0,4,5,8) to the map. To see what will happen.)

Ah, btw: game uses "space-enabled" flag of barbarians as "scoring completed"/end of history flag. So you cannot see barbarian Space Ship from the main menu. You can see their space ship screen only when they somehow finished production of some SS part in their city. So even if you created SS for them in editor, the only way to launch it is to edit production in a some of your barb cities to some SS part and then complete it.
 
OK, that's a computer term, I was already looking for a literal flag, I even looked at the images of space colonization in case I saw a flag. XD
When I was little and played I had the illusion that barbarians with enough cities could become a new civilization.
 
I'm willing to spend some time to add the "edit city specialist" asked by tupi, first... But if this becomes too difficult, I'll release the new version directly before spending time on specialists.

Sharing some of my thoughts around JCivEd dev at the moment : the challenge I face in adding that piece of code comes from the unorthodox data format used to store city specialists.

For each city, the MPS guys dedicate 6 bytes (48 bits), to store 3 types of information:
- 20 bits for yes/no flags indicating whether a city square is being exploited or not
- 6 bits to count the number of specialists (2^6 = 64 max specialists, a size almost no city can ever reach in the first place unless in a "full oasis"-hacked area... Dack did it, look it up in the forums...)
- 8 pairs of 2 bits (= 16 bits = 2 bytes) to specify the type of the first 8 specialists (this explains why specialists beyond 8 cannot be customized)

Almost all SVE data is stored as straightforward standard values (byte, shorts, strings, etc.) so I built JCivEd around such simple types, both on the data side and UI side. Reviewing my old code, of course I find it kind of bloated and somehow too complex and abstract, probably due to the classic youth error of wanting my code to "be able to do everything"... So many different generic hierarchies of classes, etc.

Anyway, it is still setup in a good enough way that I could create more specific UI components that can handle more complex structured data beyond the basic byte/short/string.

Especially for City data modification, it makes me want to implement a UI that mimics in-game City Screen with similar UI interaction: mouse clicks on city map to move workers around, and then also to modify specialists.

But ideally, to keep user experience seamless as I tried to do in MAP editor, that would entail also showing the correct square yield for each exploited square, and also showing the city population with its clickable specialists.

But then why stop there and not design the entire City modification screen as a copycat of ingame City screen ? Of course that would require tremendously more work...

So right now my thoughts are going back and forth between a quick and dirty unsatisfying hack, and a full-featured city modification screen, trying to find a intermediate acceptable solution.

The side challenge to this is also to keep ability for users to "hack" savegames with potentially corrupt values and wrong data (for advance hacking or testing the technical limits of CIV.EXE), allthewhile implementing *correct* game logic in UI components that can handle both correct and incorrect bits and bytes when displaying game data. For instance, what would the UI show if an invalid city specialist type is set ?

Will keep you posted.
 
Last edited:
@darkpanda one way to go about it would be an 'expert mode' (just a toggleable menu option or similar) where the in game safe limits are disabled and you keep the pieces if it blows up? For example @Quintillus 's Civ III editor has a number of 'safety levels' which achieves roughly the same thing. When you enable it, you could have a big old warning text box pop up saying something along the lines of 'only use this if you really know what you're doing!'.

As for the layout, a compromise could be a city editing screen that mimics the layout / position of the in game version but reuses the existing widgets and edit boxes that jcived already uses for everything else, rather than attempting to be a perfect clone, graphics and all. I'm sure us users would get the idea! :)
 
@darkpanda one way to go about it would be an 'expert mode' (just a toggleable menu option or similar) where the in game safe limits are disabled and you keep the pieces if it blows up? For example @Quintillus 's Civ III editor has a number of 'safety levels' which achieves roughly the same thing. When you enable it, you could have a big old warning text box pop up saying something along the lines of 'only use this if you really know what you're doing!'

Yes, from the beginning I have been thinking about this, splitting my efforts between "Advanced SVE hacking" and "high-level CIV game logic", but it's still a huge effort to produce, and my free time is still scarce.

Anyway, I will go about it step by step.
 
Just wanted to say that JCivEd's CivWin support has made my latest round of updates to the graphics mods so much easier to do than before. Now I can load up a map in JCivEd and make tweaks, do a DOS save, do a windows save then quickly load up both games (also using the skip to title screen EXE patches to speed up DOS start time) and compare. Much faster than before when I was using CivCracker for the windows stuff and trying to stay in sync with DOS.
 
I think my post are unnoticed so I repeat:

This "identity flag" determines which of the 2 Civs is active for each Color.
So if in "Active civ" I have Aztecs and I select this position in "civ identity flag" game has changed nation to Egyptian?
And if i don change "leader pic" Montezuma will stay?
Can it be changed even in the middle of the game?
And how can you be sure this is changed? Can it be somehow checked?

Data>civilizations>(nation)>Geopolitics>AI Strategy
Is it possible here or elsewhere to force civilization to greater expansionism to a given continent? Unfortunately, when I am doing a scenario with islands, civilizations do not want to settle on new continents, they only stay on their own
 
Data>civilizations>(nation)>Geopolitics>AI Strategy
Is it possible here or elsewhere to force civilization to greater expansionism to a given continent? Unfortunately, when I am doing a scenario with islands, civilizations do not want to settle on new continents, they only stay on their own
Geopolitics per continent definitely will not work because every AI civ updates this data every turn. And for strategic locations, AI sets some strategic locations every turn, but I think it does not wipe them altogether. But anyway strategic locations will not help you with your problem, I think.

Do AI civs build any trireme/sail etc. ships in your scenario? Are they alone on their starting continents? Do they have enough space to build at least 1 city on a seaboard? Maybe it's a good idea to give every AI civ MapMaking at the start?

Probably the only good way to made "seafaring" civs is to change conditions for production of transport ships in .EXE (or to change conditions for "transport" continent "geopolicy"). We have problem even on default Earth map with English. If continent policy is not transport -> no any transport ships. If defense force on the continent is less than 8 -> no any transport ships.
 
Idea:
For AI to change its policy on a continent from "settle" to "transport", there's should be enough unit power (usually happens only later in the game, with more powerful units) or number of cities * 6 +2 should be more than number of "buildable" squares on the continent. So its a good idea to change number of "build squares" in "Geography" tab (decrease it). I have no idea if it will causes some other changes in AI behavior (i.e. does this data is actually used anywhere else). If you want it to be fully correct, you can change corresponding amount of "build-able" squares on a continent to "non-buildable" (for example, to forests and hills). You also should "Refresh land values" after that for correct AI behavior.

darkpanda, what does "Recompute continents and oceans" option in "Map" tab actually do? I thought that it re-calculates sizes of oceans and continents, but nope. Its description is "adjust minimap to current player visibility", but it seems it does not do anything like this either.
 
Last edited:
darkpanda, what does "Recompute continents and oceans" option in "Map" tab actually do? I thought that it re-calculates sizes of oceans and continents, but nope. Its description is "adjust minimap to current player visibility", but it seems it does not do anything like this either.

Thanks for noticing the wrong tooltip. This action actually updates "Layer 2", which contains the continent and ocean IDs for each squares. To do this, it recomputes the sizes of all continents and oceans, then order them by size and assign a number form biggest to smallest.

Unfortunately it does NOT update the values stored in SVE (tab Geography) but only the MAP data (layer 2).

I might consider fixing this.
 
  • Like
Reactions: GPR
Thanks for noticing the wrong tooltip. This action actually updates "Layer 2", which contains the continent and ocean IDs for each squares.
I also have problem with layer 2.
Sometimes counts 2 continents under one number.
I understand that give number from the largest to the smallest continent but I have now problem because continent who should have number 4 have this same number as second largest continent - 2
Should I manually change the numbers of the continents?
Also has a problem with the calculation of the bottom of the map - it is divided between continents (bottom it does not touch any of them). Meybe game have a problem with size od 1 continent?

got.jpg


Do AI civs build any trireme/sail etc. ships in your scenario? Are they alone on their starting continents? Do they have enough space to build at least 1 city on a seaboard? Maybe it's a good idea to give every AI civ MapMaking at the start?
Civ have map making, have tireme, and even settlers on tireme nad not unpacking settlers but floats around the map.
Civ is alone on little island, city is on shore and dont have space to build new city.
Civ sits on an island and builds army and irrigates. This civ is England or Greek - both are expansionist.
 
I also have problem with layer 2.
Sometimes counts 2 continents under one number.
I understand that give number from the largest to the smallest continent but I have now problem because continent who should have number 4 have this same number as second largest continent - 2
Should I manually change the numbers of the continents?
Also has a problem with the calculation of the bottom of the map - it is divided between continents (bottom it does not touch any of them). Meybe game have a problem with size od 1 continent?

View attachment 655622
Can you share the MAP/SVE for investigation ? (mp if you prefer)
 
I think it should be here so I'm quoting:
Indeed I can reproduce your bug, and after testing a little bit, I think the problem is related to map boundaries: you should avoid continents in the FIRST and LAST TWO ROWS and COLUMNS.
In your map the little island marked 2 in the middle left of the map has square in the second column. If you mark those squares as sea, the map and continents numbering will no longer be wrong.
Same for north pole on the top-left, which is having squares on rows 3 and 4, you sould limit poles to rows 1 and 2 (or 49 and 50 for south pole).
I found that when removing those sqaures set them to sea) the numbering will be correct.
I didn't investigate the "sea and continent" algorithm in details, but I know CIV doesn't handle those rows and columns the same as the others.
 
Beware: I did this with a hardcoded hack that checks whether the PIC palette "firstIndex" value is either 0 (CIV) or 16 (DarkLands). If other games make a more sophisticated use of this value, it will not work.
I'm also a Darklands enjoyer, so I checked the darklands art out with jcived. Yeah if you accommodate that palette offset, that would be exciting.
 
I have a little request.

There are "Civs identity flags" in "Game data" tab. It's a single byte at 0xdf1e,1 bit per civ.

But game also uses array of 8 elements (2 bytes for each civ, 16 bytes total), this array starts at 0xd7f4, and contains either civ_number (for 1st civ from pair) or civ_number+8 (for second civ from pair). So, if we want to correctly change, for example, Greeks to English, we should change this field from 6 to 14. For now, it's impossible to change civ to its counterpart of the same color in JCivED. To detect what civ from the pair is in use, game always check value from this array and not "civs identity flags".

So maybe it's a good idea to add this field to Civilizations/Misc tab. Or to add them as flags to "Game data" tab: with flag: value is civ+8, without flag: value is civ+0.

"Civs identity flags" actually are used only to check that civ of this color already was spawned: if "civs identity flags" is 1 and array element is >= 8 or "civs identity flags" is 0 and array element < 8 ==> then game will not spawn civ again (it will be 3rd civ of this color in this case).

I'm testing civil war routine and so I noticed that "civs identity flags" do not change one civ from pair to another. You see, in civil war dead Egyptians always become Aztecs, dead Babylonians always become Zulu and dead Greeks always become English, but for all other civs (or for any civ added beyond "level of competition") pair is selected randomly. In my tests it did not work correctly after I manually changed civ pair in JCivED, and now I understand why. Actually, I was wrong: all civs with even ID (green, yellow, pink) will change their civ to another from pair. And also gray civ.
 
Last edited:
I have a little request.

There are "Civs identity flags" in "Game data" tab. It's a single byte at 0xdf1e,1 bit per civ.

But game also uses array of 8 elements (2 bytes for each civ, 16 bytes total), this array starts at 0xd7f4, and contains either civ_number (for 1st civ from pair) or civ_number+8 (for second civ from pair). So, if we want to correctly change, for example, Greeks to English, we should change this field from 0x06 to 0x16. For now, it's impossible to change civ to its counterpart of the same color in JCivED. To detect what civ from the pair is in use, game always check value from this array and not "civs identity flags".

So maybe it's a good idea to add this field to Civilizations/Misc tab. Or to add them as flags to "Game data" tab: with flag: value is civ+8, without flag: value is civ+0.

"Civs identity flags" actually are used only to check that civ of this color already was spawned: if "civs identity flags" is 1 and array element is >= 8 or "civs identity flags" is 0 and array element < 8 ==> then game will not spawn civ again (it will be 3rd civ of this color in this case).

I'm testing civil war routine and so I noticed that "civs identity flags" do not change one civ from pair to another. You see, in civil war dead Egyptians always become Aztecs, dead Babylonians always become Zulu and dead Greeks always become English, but for all other civs (or for any civ added beyond "level of competition") pair is selected randomly. In my tests it did not work correctly after I manually changed civ pair in JCivED, and now I understand why.

By any chance, isn't it the data element named "Leader ID (PIC)" in the "Civilization" panel ? It seems to correspond to your logic, "id" or "id+8":

leader_id_pic.png
 
Top Bottom