Resource icon

MAKE YOUR OWN UNITS - FLICster Version 1.0.1 (build 18) now available! 2016-10-05

Quick update.... I built a modified version of FLICster that emits JASC .PAL files when splitting a unit FLC. I then edited a unit (I took the Modern Worker's RUN animation, and edited the South animation to add a bird flapping its wings over the worker's shoulder). I used Animation Shop to open the file (ModernWorkerRun_S.FLC), and edited each frame with Paint Shop Pro. As I loaded each frame in PSP, I loaded the PAL file using 'nearest color'. This seems to keep the original palette order intact. Once the whole animation was updated, I saved the FLC file. Animation Shop 2 offers a dialog when saving FLC files, which allows you to determine how to resolve palettes. One of the options is to load a palette file - again, I loaded the PAL using 'nearest color' and saved it. I quickly learned that animation shop fools around with frame counts based on delays - my 10 frame file with 6ms delay per frame (default) ended up 60 frames. Quickly setting the frame delays to 1, I save it again... success.

I remerged the file, and loaded up a game with Modern Workers and Roads (not railroads, the units don't animate on Railroads). SUCCESS! When he walks south, the bird appears over his shoulder, the rest of the time, looks like normal. I should note this is my first unit acutally edited by hand... my earlier tests just consisted of swapping directional FLCs to make the units walk backwards (yes, I'm easily amused).

*SO* (and here I said quick update) - I've been playing with this at work (shame on me), so I may be working a little late. When I get home, I'll try to get a new build published, along with some detailed instructions for AS/PSP (the only apps I have).

All in all, I'm not very happy with the number of steps needed, and I'm working on a few ideas to improve the situation. Meantime, I thought that a poor tool beats no tool at all.

TUNE IN NEXT WEEK (well, later tonite, I think) - SAME BAT-TIME, SAME BAT-FORUM.

:)
 
Thanks for the link, DiB. The FLIC reference on Wotsit.com is actually a zipped of version of http://www.compuphase.com/flic.htm, the main reference I used for the Standard FLC part of this proj. Wotsit also has another reference labeled FLC, which includes FLC, FLI, and about a dozen other variants. I think that may make a nice cross-reference/double check.
 
I had trouble making changes to an existing FLIC using Jasc Animation Shop 3.

I separated the Marine Attack FLC and messed with the colors a little, replacing the greens with whites and greys. After I saved, the files wouldn't recompile so I read the readme and discovered the part about the palettes, so I changed the .ini file to make all the attack animations use the .flc I created. I then recompiled successfully. I went into the game (using modified rules so I could build marines right away) and promptly built a marine. I went and attacked my neighbor and something strange happened: the animation was successful, except there was a black box around my marine. This must have been the box that was supposed to be transparent, but it didn't remain transparent after I saved my FLC. I have no clue why it showed up black instead of the pink-ish color. (I also had this problem when adding new resources, but solved it -- easy since those were just .pcx files) Anyway, after I took the town I fortified my marine and the next turn my neighbor's warrior came and attacked me and the game crashed. I assume it crashed as soon as it called the attack FLC but why would it crash this time and not the time before??

Any ideas/suggestions?

By the way, has ANYONE successfully made their own unit with Animation Shop?
 
First, sorry this is very late in being posted. Had something unexpected come up this evening.

Second, I'm not building a new full install, at least not tonite. If you already have the tool, just replace FLICster.exe with the new one. If not, please run the installer (at the start of this thread) and then replace the exe with this version.

NOW: What's new? Palettes, thats what. In a CIV3-FLIC, all the directional animations share a palette. When FLICster splits a CLIV3-FLIC into Standard FLCs, each FLC gets its own copy of the palette. Animation Shop has a nasty habit of "optimizing" the palette (its not a bug, its a feature!) by re-arranging and even merging the entries. This is a Bad Thing. Further, when editing the cells in another program (say, PaintShopPro), if you make any changes to the palette of any cel, you can end up with multiple palettes in one animation. While this is technically legalk in a FLC, it seems to also be a Bad Thing for civ3.

So, on to solutions. Most of the Civ3 FLCs (mebbe all? not sure) follow a pattern - the first frame of the first direction (SW for those keeping score at home) has a palette (COLOR_256 chunk with 1 packet of 256 rgb tuples, but who's counting), and none of the other frames in any direction do. So, I've updated FLICster to take advantage of this.

When splitting a file, FLICster 0.1.2 will read the COLOR_256 chunk of the first frame of the first direction (basically, the palette for the whole animation) and emit the palette as a JASC .PAL file - a saved palette file usable by AS & PSP. It's created in the same directory as all the split files.

When editing a FLC file using Animation Shop, be sure to edit the individual frames in PSP (they're integrated... go for it). Once you open the frame in PSP, go to the Color menu, and choose Load Palette (edit palette and save palette aren't available yet, because PSP thinks the file has transparency info. Go figure), and load the .PAL file created during the split. You will be asked if you want to "flatten" the file. Yes, you do. BE SURE that when you load the palette, you choose 'Nearest color' error correction. Since all the colors in the picture are in the palette already, there's no error correction needed, and everything will look fine. Now, you are using the exact palette the original CIV3-FLIC used. IF YOU CHANGE THE PALETTE (edit palette on the color menu) - there are 3 rules. Rule 1 - stay away from the first row of 16 colors - all shades of blue. These are the colors that CIV3 translates for civ colors, ie, green for persia, pink for france, etc. Rule 2 - Don't touch that last color! The gawd-awful fucia we all know and hate is the transparency color, and I think Civ3 wants that in the last spot on the palette. Rule 3 - save the palette and use it for ALL of the animations, and all of the frames.

Okay, if you've gotten this far, then you have edited all the cells in a standard FLC file, and it's time to save the changes. First up, select all the frames at once in AS and right click to choose properties. In the ensuing dialog, change the frame delay to 1/1000 of a second. By default, the AS seems to use 6 ms, which is nice for viewing your FLCs in AS, but BAD BAD BAD for saving. Right before you save it, be sure you set the frame delay to 1 MS. Good.

Now, save it. When you save a FLC in AS, you get a dialog box. Click the CUSTOMIZE button. Pick 256 colors, and choose "Custom Palette". Now click Browse, and browse to your PAL file ( the one FLICster created for you, or the one you created if you edited the original PAL ). Okay, NOW you can save it.

I did test this, and it worked fine. I put a flapping bird over the shoulder of the Modern Worker's RUN animation (South bound only). Sorry, i'm no artist. Anyway, using the above steps to keep the palettes in sync, I re-merged the file and tried it in game. WORKS! WOOHOO! I would post it for people to see, but I did it at work (blush) and forgot to mail it home. I'll try to post it tomorrow.


As I've said before, I think this process is pretty &*%^** unwieldy, and I don't like it. I'm working on something better. In the mean while, I figured folks would rather have a poor tool than no tool at all. The updated EXE is attached. Stay tuned for more.

PLEASE post your successes/failures... I really want to see this help folks, but I don't have the time or the artistic talent to do as much testing as i'd like.
 

Attachments

  • flicster_0.1.2_small.zip
    23.4 KB · Views: 511
Rule 1 - stay away from the first row of 16 colors - all shades of blue. These are the colors that CIV3 translates for civ colors, ie, green for persia, pink for france, etc. Rule 2 - Don't touch that last color! The gawd-awful fucia we all know and hate is the transparency color, and I think Civ3 wants that in the last spot on the palette.

(In the following discussion, I'm assuming the colors in the palette are numbered 0-255, and the palette is conceptually arranged in 16 rows of 16 colomns. Row 1 contains colors 0-15, row 2 contains 16-31, etc.)

Actually, there are more reserved colors than the ones Moeniir mentions. For any of the reserved entries, the particular color used is irrelevant - the only thing that matters is its position in the color table. If you don't like the magenta, feel free to use any color you wish, as long as it's at position 255.

The last 8 colors (numbered 248-255) in the palette are used for alpha blending. The last color (number 255, usually magenta) is fully transparent. The other seven colors (248-254, usually all red) represent a "transparency ramp" (for lack of a better term). These colors are used for the shadow. Color 248 is the darkest (least transparent) part of the shadow, and each successive color is progressively lighter (more transparent).

The first 4 full rows (64 colors, numbered 0-63) - not only the first 16 colors - are used for civ colors. The civ colors are stored in the PCX files in the "Palettes" subfolder (under "units"). Each PCX file is only 1 pixel (in the primary color of the civ), but contains a palette of 70 civ-specific colors. The PCX palettes are reversed compared to those in the FLC files. For civ colors, the first 4 rows in the FLC palettes are replaced with the last 4 rows (in reverse order) of the civ's PCX palette (color 0 in the FLC is replaced with color 255 in the PCX, color 1 in the FLC is replaced with color 254 in the PCX, etc.). I'm not sure what the extra 6 colors (numbered 186-191) in the PCX palette are used for.

So, this means there are 184 colors (numbered 64-247) left over for arbitrary use in your units. It also means that creating professional, high-quality units is going to be really complicated - you'll need to use the right reserved colors in the right places to get nice looking shadows and proper civ-specific coloration.

Steve W. Brewer (SWB)
 
SWB-

Thanks for laying that out. Makes alot more sense. I've looked in my units\palettes directory. There are 2 sets of files: 32 ntp files (ntp00.pcx to ntp01.pcx) and 16 otp files (otp00.pcx to otp15.pcx). All seem to be 1 pixel files used to store palettes. Do you know why so many? I would have expected 16 files, for the max 16 civs in the game. I feel like I must be missing something stupid.

Thanks
 
There are 2 sets of files: 32 ntp files (ntp00.pcx to ntp01.pcx) and 16 otp files (otp00.pcx to otp15.pcx). All seem to be 1 pixel files used to store palettes. Do you know why so many? I would have expected 16 files, for the max 16 civs in the game.

I'm not sure what the otp files are used for, but it's definitely the ntp files that are used for civ-specific unit coloration. There are 32 of them because it's possible to pick from 32 different civ colors - open up civ3mod.bic in Civ3Edit, edit rules, and look at the color settings on the Civilizations tab and you'll see what I mean.

The 17 otp files (otp00.pcx to otp16.pcx) are still a mystery to me. They have a completely different palette layout than the ntp files. Although the first half of them seem to somewhat relate to the ntp files (the single pixels in otp00.pcx to otp08.pcx seem to be "lighter" versions of ntp00.pcx to ntp08.pcx), the rest do not. Plus, of course, there's only 17 of them compared to the 32 ntp's, so that would leave many ntp's without a corresponding otp anyway.

Steve (SWB)
 
A bug has been found (insert joke here) in the Merge code. I think I've got it licked, but I've sent a couple copies out for testing to people who've reported problems. I *plan* to post an updated FLICster sometime Thursday evening (Nov 29), but I'd like to hear back from my testers. Stay tuned.

In the mean time, if you are experiencing any problems, let me know about them.
 
It's still beta, but it's a whole lot better. Full details in the readme, but here's the highlight reel:

CURRENT: v0.2.2 (build 5) beta

* New versioning scheme. The build numbers will always go up, even with major version changes. The build numbers may also skip, because not all builds get released.

* Fixed a merge bug causing incorrect chunk counts in frame headers after direction 0

* Fixed a merge bug caused by assuming color_256 chunks always follow a byte_run. Sometimes they precede it.

* Now sets the Creator field of the standard FLC header to 0xF2F2F1F1 when merging. Civ may crash if another number is present.

Someone mailed me a set of animations they were working on, to help me test a bug. It was all new animation, and all 8 directions. Once I got the last bug knocked out, I got the new unit in the game. WOW! Hopefully we will start seeing some units posted here... Unfortunately, I have no artistic ability!

I'm attaching the latest SMALL patch, use if you already have the program. If you want the full installer, check the top of this thread, I'm mailing it to Thunderfall to post (too big for me to post).
 

Attachments

  • flictser_small_0_2_2_0005.zip
    28.8 KB · Views: 997
Thanks Moeniir, great job!

I dont have the programing skills to understand, much less make these editors. I am interested in making new units though. I made many for Civ2 MGE.

If I ever figure out how to make this stuff work, I deffinately will post any art for download here at CFC. Im going to take a crack at it this week. Wish me luck. Alot of it. :D

Thanks again, from the computer illiterate.;)
-joespaniel
 
ACtually 31000 Turkish Lira = 2 cents, or $0.02 USD. In America we sometimes refer to our opinions as "our two cents." 1 USD equals approximately 1.5 million Turkish Lira, give or take a few hundred thousand.
 
The "31,000 Turkish Lira" in my sig is also a link to Yahoo.com's currency converter. If you click thru the link, you should find that 31,000 TRL converts to $0.02 US, or my two cents worth, as Zippo pointed out. Used to be my 23,000 TRL, but the exchange rate fell :eek:

It's my little way of making my opinion appear to be worth more. If you think my opinion is worth very little, you could say that its my seven one-hundred-thousandths (0.00007) of an ounce of gold. :D
 
Moeniir, I wonder if you actually split my TerroristDefault.flc file to look at it? Somehow I cannot resplit to file now. Flicster say something like encounter a second chunk that is not 256 color, BYTE_RUN.

Any idea why this happen??
 
That is a bug (due to an assumption I made) which I really thought I had fixed. The first frame of the first animation caries two chunks, or groups of data. In an original Civ3 FLC, the first chunk is a compressed bitmap of the first animation cell, and the second chunk is the palette information. Unfortunately, when I wrote FLICster I incorrectly assumed that that order was manditory. Turns out, those two chunks can come in either order, and animation shop likes to put the palette first. FLICster's error message indicates that it can't find the palette because it only looks in frame 1 chunk 2 (well, frame 0, chunk 1, because it's all 0 based, but you get the point).

When I looked at your file, I was using the new version of FLICster, currently under development. It's got a bunch of new features, and completely eliminates the need for Animation Shop. I hope to release it soon, but it's not ready yet. Still debugging the delta encoding code (among other things).

Meanwhile, you should be able to modify the files you used to create your FLC and re-merge them. Even though FLICster won't split the FLC, its a perfectly good FLC, and you can re-build it from the sources as often as you like. If this problem becomes a major hassle before I can get the new FLICster done, I might be able to fix the bug and release a 0.2.3 version, but that will take time away from the new version, which I'd rather not do.
 
I can still open the flc file with AS, just not spliting them with Flicster. So I guess I will resplit the original file and copy and paste my image over (I deleted the split image...hehe)

I was just wondering why you can split it while I can't ;) I will be waiting for the new version of flicster :D

Doing all these animation is tedious work but when you completed the animation there is a sense of satisfaction I must say :cool:
 
Hey Moeniir.

Thanks to your help I have completed the Terrorist Unit animation and finally post them in the completed mod pack section :D

Keep up the good work :goodjob: I can't wait for the next version. Even with the current version, I can add frames into the animations (as long as each direction has the same number of frames). Woohoo :D

Doing thise flc files does take the toll on me though. Staring at the monitor for a long period of time trying to complete those flc really makes you tired :king:
 
Moeniir,

I notice that when I try to edit the flc for an animation that has only one single file (in this case, CruiseMissileDeath.flc), Flicster is unable to merge back the file after its been edited.

The number of frame remains the same, I can load the edited file back into AS but Flicster cannot merge the file. So the new animation cannot be used in the game. :(

Maybe you already getting this fix, but just to be safe I will post it here and let you know anyway. No that many file comes with only one flc inside anyway ;)
 
Top Bottom