One Turn Deserves Another III

Puppeteer, this all sounds very interesting :) (so I don´t understand all of it). Many years ago, I converted some Civ 3 units to animated Civ 2 ToT sprites using Flicster and a tool done by Mercator called CivSprite, that can be found here: http://civ2.mercator.fastmail.fm//mapedit/downloads.html

The converted units can be found here: https://forums.civfanatics.com/threads/animated-units-for-civ-2-tot.411816/#post-10217483

I don´t know, if these Civ 3 unit sprites or the single images inside these sprites can be useful for your project, but better to post the links here, even if they are not useful, than not posting them, and they could be of a little help.
 
Thanks! I'm not sure I understand it myself. I mean this is kind of exploratory programming. The path I'm on now has me thinking of using the Godot engine to display Civ3 graphics--eventually in a more by-tile/unit fashion--including unit animations. It did occur to me that at the very least having Godot read and animate graphics could become a(-nother) utility to preview unit animations, and tying back to my OP idea, Godot could be a view/UI client for my putative game logic engine.

I appreciate the links.

Some morning thoughts about next/future steps:

  • Need to divide images/textures into regions (discrete tiles/popheads/etc); Godot has settings for this already
  • Assuming my logic engine will only provide item IDs meaning "grassland", "warrior", "pop points", need some selection logic in the Godot portion to choose which discrete image(s) to display
  • Adding to the last point, I'll need to figure out how to select terrain tiles appropriately because my game logic map will just provide e.g. "grassland", "plain", "mountain" whereas the Civ3 game proper has the exact tile image reference coded in the game map.
    • This might even be doable with a shader, but I don't yet know enough to determine if that makes more sense than other logic
  • Probably will decode each flc into a single texture, although I might see if it makes sense to put a whole unit into a single texture
  • Godot will need to understand how to animate each action for the appropriate direction; my game logic will only say "unit moves from this tile to this adjacent tile"
  • Before there's a playable UI, I think it makes sense to make this a unit previewer, but the unit should be able to run around over terrain graphics and not just do the simple pink spin-cycle demo. (That way at least my efforts have a use at all.)
    • But then I have to figure out how to save the animation...a GIF of that might be too big, and even if it's not...well I'll have to see if Godot any capture/export capability built-in already.
  • I need to figure out how to organize the data in a meaningful, useful fashion. And how game logic references will map to it.
Edit: Given that I can already read and display PCX files, perhaps a more modest and short-term goal would be to have a previewer for various city/terrain/improvement graphics combinations.

Edit 2: Oh, I don't have to figure out tile arrangements. Godot can do that. I just need to figure out how to tell Godot what each tile is for, and it should handle the rest. Still a challenge, though. Also, I think the Godot part is going to be its own project that will display Civ3 graphics for various purposes including previewing graphics and being a view client to a game engine. Aaaaaaand I'm late for work.
 
Last edited:
I got a bit frustrated trying to figure out the palette conversions.

I know indexes 224-255 are fog/smoke and shadows, but it's not as simple as 224-239 transparent-to-white and 240-255 black-to-transparent. 255 is fully transparent, but 253 seems to be fully opaque white, at least for popHeads. I searched a lot through this forum and found some really helpful palette diagrams aimed at creators concerned with the unit colors, but I haven't found the exact in-game mapping for indexes 224-239. I'm not even sure if it's consistent throughout units, terrain, popheads, etc..

As for civ colors, I see the pattern of 0-15 and then even values of 16-62 being shades of the civ color, and I have an idea of how I want to store the relative intensities and color them, but I can't find a definitive specification on the relative shades, although I think I might be able to pull it from a game graphics palette if their relative shades of green are correct.

Part of my problem is that I'm not trying to create a unit, but trying to recreate the in-game palette conversions.

So I think the most personally appealing thing to do right now is to start decoding the FLC files. If that goes half as well as the PCX decoding this should be fun.

Edit: I also had it in my head that there are two civ colors, and that the civ color palette would be divided between the two. But after my searches I'm wondering if the ultimate palette conversions are defined in the BIQ.
 
Last edited:
Sometimes proof-of-concepts lead to amusing intermediate test successes.

https://lib.bigmoneyjim.com/civfan/pulsingpopheads.mp4

My end goal for this mini-effort is to live-rotate civ colors with a shader, but to prove the shader-loops-colors-based-on-time concept led me here, and it amuses me greatly.
 
Instead of decoding FLC files or figuring out palettes I started playing with shading the civ colors and figuring out how to place individual images rather than the whole sheet. I had way too much fun doing this as I saw gems like the screenshot and the first video.

The second video is a demo (to myself, mostly) that I can place individual popheads and color the civ-specific colors. With some palette fiddling I can get rid of the borders/dividers and any minor problems with pixel colors. The same techniques and some of the same code can be used against terrain and resource files, and any other pcx image sheets. So it's a significant milestone, even if it's not immediately useful. I think it's also a stepping stone towards animating the units as I'll probably unpack each FLC into an image sheet and pan the image sections to animate. Actually Godot will handle a lot of that for me.

The videos are 4mb-5mb each.

https://lib.bigmoneyjim.com/civfan/fastpopheads.mp4

https://lib.bigmoneyjim.com/civfan/popheaddemo.mp4
 

Attachments

  • 2018-05-05 17_05_24-Godot Engine - Civ3Play - Node2D.tscn.png
    2018-05-05 17_05_24-Godot Engine - Civ3Play - Node2D.tscn.png
    1.1 MB · Views: 176
The Godot code is becoming complex enough now that I decided to put it on GitHub as its own project: https://github.com/midnightfreddie/civ-viewer .

It's not really usable right now, but maybe someone will find parts of it useful.

I have toyed with it some today and learned some things about Godot but don't have anything to show for it. Yet. But I think I'm close to being able to generate tile sets from Civ3 terrain files and displaying them as a tile map (with manual tile placement for now). The code changes today were to wipe and recommit the git repo because I think I inadvertently had an art file or two in the repo and wanted to be sure it's out before putting it on GitHub. I'm also renaming and rearranging things to make more sense to others and to make it easier to reuse the pcx reader for several entity types (terrain, popheads, roads, etc..).

Edit: Found out that palette substitutions aren't consistent across image types: My terrain has some color shifting with the civ color shader. Not a big deal, but it will mean some extra logic.
 
Last edited:
Oh, here's something to show: terrain!

I was trying to figure out how to go from Image to TileSet when it suddenly occurred to me I didn't need to do that at all. I already know how to lay tiles in an iso-staggered map, and I already had the tiles segmented, so a simple loop laid these tiles out randomly.

I still need some palette tweaking, and there's no sense yet of meaning to the tiles yet or ordering them correctly, but this is another milestone, and putting overlay tiles, improvements, resources and cities takes no extra figuring, just extra time. I also need to figure out why it looks like there is a grid; I think it's probably alpha-blending the edges--yes, definitely, as I put a bright image behind it to test--so I'll need to figure out how to remove the filter flag via code.

Edit: Figured it out. The second screenshot still has some lines between tiles, but only between dissimilar edges, so that should sort itself out if/when I sort out meaningful tile placement.

Edit 2: Oh, I forgot to mention: now there is a setting for the civ3 root folder, and the popheads and terrain are being read straight from their installed pcx file locations.
 

Attachments

  • 2018-05-07 01_42_36-Civ3Play.png
    2018-05-07 01_42_36-Civ3Play.png
    1.3 MB · Views: 15,838
  • 2018-05-07 02_01_36-Civ3Play.png
    2018-05-07 02_01_36-Civ3Play.png
    621.1 KB · Views: 240
Last edited:
It´s beginning to look like Civ 3! :goodjob:
 
Does it exit to Windows whenever something goes wrong?
 
Nice turn of events, it is indeed starting to resemble Civ3. For the tiles lining up, the blocks in the PCX files correspond to a junction of four tiles, and thus each block represents 1/4th of four tiles. To figure out which one you use, you have to figure out which tiles border a vertex, and based on those tiles' terrains, you can figure out which PCX to use. For example, if the tiles bordering a vertex are plains, grassland, and coast, then it will be in wpgc.pcx.

In picture form, SOTD 99 is useful. The black grid is the "normal" grid; the red grid is the PCX tile grid:

sotd99.jpg


I can dig into what I've written on it in the past if it will be helpful; I wrote the code for that around 2010 or 2011, and have only really gone back into it once since then, so I don't remember all the details.
 
How did you change the font?
 
I didn't actually, that's a Firaxis screenshot from July of 2001 (pre-release).

https://www.civfanatics.com/civ3/sotd/ said:
Screenshot of the Day #99: A Connecting Principle
posted by Thunderfall at 2:07 AM
[screenshot no longer works post Xen Foro upgrade; I'd archived it locally prior to that]

An old pre-Civ3 release screenshot. It shows some debugging features (minimap river highlighting, excessive grids) and programmer art. There’s probably some old/placeholder art in there too.

This screenshot is dated July 21, 2001 and is submitted by Mike Breitkreutz of Firaxis. I am just glad Firaxis changed the font! Thanks to MikeB for this special screenshot.

PS: The next SOTD will be our 100th SOTD!!! Stay tuned.

That said, there is a way to do it yourself. I can't remember exactly what the combination of registry hacks (via HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes, I believe) and LSANS.fot replacements it is, but I think I have notes on it somewhere (whether on my HDD or at CFC or both, I'm not sure yet).

The notes I have found indicate that by adding:

"Lucida Sans,0"="Lucida Sans,204"

You can switch from your Civ3 from supporting Western European BIQs, to supporting Russian BIQs. This follows this Microsoft documentation of Windows 95 charsets. IIRC, 134 will switch it to supporting Chinese - but it's been a few years since I tested these. I have yet to find Arabic/Baltic/Thai/etc. BIQ files (does @Kyriakos have a Greek version of CIv3 with Greek BIQs, perchance?).

Changing the font is one of my wish list items for adding to my editor, I just have to rediscover how to do it myself!

------

Edit (Oct. 1, 2020): Good news from the future! You can change fonts simply by setting this to something like:

"Lucida Sans,0"="Arial Black,0"

This changes the font, while leaving the Western character set, should work for most fonts, and has been specifically tested with Arial Black.
 
Last edited:
Yeah, Hegemon doesn't count.
 
I remember that thread Civinator, thanks for linking it! And thanks for the info on a Greek version of Civ, Kyriakos. Didn't expect there was one, but didn't know for sure since I've never seen an exhaustive list.
 
Not sure I should bump this thread. I haven't done *anything* towards OTDA3 in a long time. And GitHub keeps sending me dire warnings that all the libraries I used have increasingly critical vulnerabilities. (I may be exaggerating some, but there have actually been several dire warnings on multiple dependencies.) And I let the otda3 dot com domain name go when confronting my domain collecting addiction. (Again, slight exaggeration.)

I'm also not sure at this point if I want to continue pursuing Angular; I'm often finding native JS more useful these days, or at least some of the new extensions like web components, and I have a big interest in webassembly (as a build target for compiled languages; obviously not native wasm coding). I also retired a few months ago, so while I want to stay relevant and current just in case, I may now tend to favor shiny fun stuff over shiny useful stuff. For example I seem to have lost interest in reactive programming (RxJS).

Hence why I'm posting. I did a thing with Godot (game engine with both 2D and 3D engines) the past day or two. First I updated it and reimported and checked my civ3 Godot stuff from earlier in the thread. I had to manually update my civ3 install location, but after that it all still works.

Then I started a 3D tutorial and kind of took off in my own direction once I saw some 3D basics. I'll post links to the web version and a video for the fun of it...I enjoy watching that way too much.

But some of the tactics I used in the 3D stuff made me realize I could apply some of the same tactics to the civ3 display stuff. And my c3sat and cia3 map generation already passes data and has the client render, so it really shouldn't be technically hard at this point to have Godot render the map with c3c-native imagery. (But probably still time consuming...maybe.)

And come to think of it, those particular ideas may not belong in this thread. But still, the same programming tactics could be used for OTDA3. The logic I had was pretty simple. And the way I had the units self-moving translates very much with the way I made the falling blocks thingy.

Anyway, here's my Godot 3D toy that really has nothing to do with Civ3 except it might spur me into some more Civ3+Godot tinkering:

13 MB wasm load, plus a startup delay, but runs in browser forever: https://lib.bigmoneyjim.com/falling-blocks3/falling-blocks.html

13 MB sounds huge to me for a web app, but this YouTube video is only a couple of minutes long and is probably much more than 13 MB:

My "tactics" were that each block manages itself, and the main scene just spawns any number of them. The encapsulation and scalability intrigue me.
 
Since it's 3 a.m. I'll just say that I'm still interested in CIv3 clones/offshoots.
 
Back
Top Bottom