Custom heralds and transparency

Blake00

CFC Archivist & Social Media Helper
Moderator
Supporter
Joined
Sep 24, 2016
Messages
1,560
Location
Australia
Hi guys,

Because @Metro Polis and I haven't messed with the game enough already :lol::lol: we're looking at some custom heralds too (the animating dudes in the diplomacy screen). However some problems have emerged.

Metro created a video using animation frames of HoMM2 units which is a very cool idea. However when he put them in-game they had a big pink box around them.
upload_2019-8-16_16-52-28.png


He then started looking at video transparency settings in the editor we found (in this thread on creating custom wonder videos) that supports indeo video exports (the format Civ2 MGE needs).
upload_2019-8-16_16-53-56.png


However I don't think playing with that stuff will help him as I'm pretty sure its in regards to multi layered videos. Eg one layer has a picture of a house, then another layer of the video has a picture of some clouds, so you make the house picture semi transparent so that you can see the clouds in the other picture. If you don't do that then one picture just overrides the other in the final exported video and you'd never know the under layer picture was there. I don't think it's talking about making the actual exported video itself transparent as I can't recall ever seeing any transparent videos on the internet. Only ever seen transparent gifs and pngs on the net. But I could be wrong as I'm far from an expert on this stuff haha.

However I'm pretty sure that it is actually Civ2 that is making the video background transparent. So if you save the video with a background colour that Civ2 treats as transparent then it 'should' work.

When I feed an original herald video file into an old AVI to GIF converter program I have it interestingly shows the video background as pink. However Metro already tried that colour with his dwarf video and it didn't work (unless it was accidentally a slightly different shade of pink?).
upload_2019-8-16_16-57-8.png


When I take a snapshot in VLC video player of the same video file the background is completely black. So maybe trying black as the background colour and seeing what Civ2 does with it might be the go
upload_2019-8-16_16-58-0.png


When I play it in windows media player it has a black background too however there's lots of weird glitches in the black area that kind of reminds me of transparent gifs.. so that almost makes me think the video itself is some how transparent even though I said above that I thought it was not possible haha.

When I load an original herald into the video editor it also gets that pink background.
upload_2019-8-16_16-58-41.png


So now we're left a bit confused..

Is the transparency being handled by the video itself or the game? I was sure it was the later but I'm starting to doubt myself now.

Does anyone here know more about this or if there were any threads where someone really delved deep into this stuff many years ago? I did a search for the world herald here and didn't find anything other than discussions about how to turn them off lol.
 
Last edited:

Blake00

CFC Archivist & Social Media Helper
Moderator
Supporter
Joined
Sep 24, 2016
Messages
1,560
Location
Australia
Hmm maybe it is both.. eg you give the video a certain background colour and then you tell it to work out transparency from it using 'first frame analysis'.

but you have to get the background colour right and it looks like the pink is just off a bit.

Eg in @Metro Polis 's test shots I can see that the pink has values of:
Red - 254
Green - 0
Blue - 253

Whereas the pink in the original herald has a pink value of:
Red - 255
Green - 34
Blue - 255

However when I look at the palettes used in the diplomacy screen they all have a pink value at the bottom. eg..

And to make things more confusing that has a different value again lol of:
Red - 255
Green - 0
Blue - 255


So I think you used the wrong pink as the background colour mate. However which one to choose from is the next problem haha..

Maybe a grab a picture change the custom diplomacy palette I posted here , make sure the background pink is (R 255 G 0 B 255), stick it in the video editor (and don't waste time making lots of other frames, just leave it at one frame that goes for say 60 seconds) and save it as an avi (without touching the video transparency stuff) and see what happens.

I also find myself wondering if when the video is saved and compressed does it do anything to colours at all.
 

Blake00

CFC Archivist & Social Media Helper
Moderator
Supporter
Joined
Sep 24, 2016
Messages
1,560
Location
Australia
Looks like we don't need help because @Metro Polis has done it!!!! But I'll post the results in this thread so others can learn from our work and create cool stuff in the future if they wish to. :)

Metro took a picture of the custom palette I made (in the custom leaders thread), inserted it into a video using the editor he found (in this thread on creating custom wonder videos), and then tested it in game to see what colours were transparent and to our surprised it was a couple of the whites lol! Not pinks or blacks! He then tried white on his Dwarf test Herald and it worked a treat! :)

GOT IT, MAN! HaHaHa! Yeah man, it's the white in third line it seems!

In the faces colour palette that colours are 3 times 255 and also the one in front of it, which has less (and even the bmp screenshot I used for the video differs slightly) - maybe there are more to have no glitches like in your herald's video.

My project configuration in Ulead3 for the test video is: avi, 24bits, 100x100 height and width, 29.97 fps, Indeo4.5, bit rate: 842 KB/Sec, 10 frames, 100% quality and Transparency: First Frame Analysis with best quality. It's the only one configuration I tested, to keep close to the original videos, but maybe it will work with other configurations and bit rates to make the file size really small and not a 2MB video.

We can place that units' animation wherever we want to, the omega sign in the background is the top left corner.
upload_2019-8-16_20-43-6.png

upload_2019-8-16_21-0-10.png


What's even crazier is that Metro then did another test where he was able to push over the Herald to over the top of the leader portrait and then use it to create facial animations!!! We're probably not going to do this in our scenario but we just had to post the results here for others to see as people could do some really cool stuff in their scenarios with this!!!

We could even use it to overlay the leaders' picture and have him show emotions (like Archibald smiling and Archibald looking angry and gnashing teeth just like the leaders did in Civ1, haha! Here's a quick test, it's only an animated gif based on your mk.dll file changing faces from neutral to happy, back to neutral and then angry every second. I only changed the area around the mouth and the eyebrows.

If people decide to turn on heralds, they will see the emotions, if they turn them off, then it's only the neutral face from mk.dll. This one didn't took me more than 5 minutes, but it clearly isn't perfect and doing that 42 times on different faces could leave us wasted and done. On the other hand, if each of us would do 21 and we aren't too fastidious about the looks, we could finish it in one day maybe. Each harald has a starting emotion in the video and four others he can show (unpatient, happy, angry, reluctant) and from which he returns to that neutral one again after 3 seconds. We could easily shrink them to 2 or 3 only or change the eyes, too (I think Civ1 leaders closed their eyes when they didn't like one of your respones). Using a creature instead would be way quicker.
faceman.gif

faceman.gif
 
Last edited:

Metro Polis

Warlord
Joined
May 5, 2012
Messages
258
Location
Southern Hell
We broke into the heralds video mechanics. You can make your own videos, 5 sec. long (astonishing because the original heralds' videos were 15 sec. long, so maybe the game uses a time warp).

0-1 sec: introduction (only once at the beginning of the meeting)
1-2 sec: waiting for a reply (an infinite loop)
2-3 sec: cheerful (when you accept something)
3-4 sec: ready to fight (when you make them mad)
4-5 sec: reluctant (when you refuse something)

Looks like this now, actually the genie is moving around, hovering when waiting and having all those other moves/emotions in-game:
upload_2019-8-23_17-16-55.png

There are a few colour glitches we can't to anything about, because the we can't get a grip at the heralds unique colour palette from their video. And well, the council members work the same way, I guess. So, if somebody would like to act in front of a white screen... :king:
 

Kasius Klej

Chieftain
Joined
Feb 14, 2021
Messages
31
We broke into the heralds video mechanics. You can make your own videos, 5 sec. long (astonishing because the original heralds' videos were 15 sec. long, so maybe the game uses a time warp).

0-1 sec: introduction (only once at the beginning of the meeting)
1-2 sec: waiting for a reply (an infinite loop)
2-3 sec: cheerful (when you accept something)
3-4 sec: ready to fight (when you make them mad)
4-5 sec: reluctant (when you refuse something)
:king:

This is excellent hacking. It inspires me to do something similar some day.

It is a mystery why would original be 15 seconds long, when 5 seconds seemingly covers the whole protocol.
Let's solve this mystery. I remember the protocol from civ1.
0-1 sec: speaking
1-2 sec: waiting for your reply, blinking eyes, smiling perhaps, bluffing after demanding stuff, having 4 men sometimes to back up his bluff behind him. Indeed you'd have infinite time to figure out the answer.
And then it all depended on your answer.
The outcome was either "cheerful" or "ready to fight", or "reluctant". If he was cheerful, next time we meet he'll probably be reluctant. And if he was ready to fight, conversation was over.
And then I think there was one more question about exchanging maps, if he was alright with continuing conversation, so the video went back to "waiting for a reply" and then the conversation about ended with "reluctant" part of the video.

So it looks it only takes 5 seconds of video to cover all happenings in the diplomacy room in Civ2. That is excellent discovery.
But how can I guess whether the guy is bluffing? I mean, I never see the 4 guys in his company like in civ1. In civ1 I could guess whether he was bluffing. Why would I give 50 gold if there was going to be peace anyway? That was an important part of diplomacy in civ1 and sometimes you'd know in a second what's gonna happen.
It's the same protocol in civ2, but something is missing.
I wish I would have an example files, so I would look up into the mystery further. What is in the 10 minutes that are extra? My guess is it's the background and in background there are clues to help you figure out what to answer. Or perhaps the game just dropped the clues, leave them out completely, and those 10 minutes of video are empty and unused?

Whatever the case, I'm almost certain that it isn't a time warp causing this 10 minutes difference.
 

Kasius Klej

Chieftain
Joined
Feb 14, 2021
Messages
31
Hello,

I solved some of the questions that were bugging me yesterday and also came up with alternative method for making custom heralds.

Only 4 scenes are used, the scenes are stored in first 5.1 seconds of the movie.
Now I used 24 frames per seconds, since this is the best for making stop motion animation, and the structure of the movie is:
1st second "greetings"
2nd and 3rd second "loop"
4th "happy"
5th+ "angry"
6th and 7th The movie has to be at least 7 seconds long so it doesn't crash, so for in last two seconds any scenery you provide won't show in the game, but you have to provide that anyway.

If you use different frame rate, like 10 fps or 50 fps, the above structure seems to shift. I haven't tested this any further, since I got solid 3 mega bytes movies for my heraldry by now, but I noticed even before, since I was working with portraits, how you can give somebody a character by just exchanging the scenery for "happy" and "angry" and tricks like that. You should have seen how Alexander the great laughs when I ask him if he would like to exchange maps.

The video size can be up to 380x600 pixels.

Transparency is difficult to achieve. In my Sony Vegas movie editor, I couldn't switch on "first frame analysis", so I couldn't get that. On the other hand, I could do some other stuff like zoom in or roll 14 gif presets so I could render 14 movies just like that.

This is the video settings I used:

 

Metro Polis

Warlord
Joined
May 5, 2012
Messages
258
Location
Southern Hell
Sounds cool, can you upload a picture or video/animated gif what it looks like in-game?

Actually something gave me a bit of headache back then: the heralds use unique time schedules, some differ slightly. That means: when one herald-leader changes his face at - let's say 3.0, others do that 3.1 or 2.9. You have to sort that out by trial and error if you want to avoid some emotions starting or ending incorrectly.
 
Last edited:

Metro Polis

Warlord
Joined
May 5, 2012
Messages
258
Location
Southern Hell
Transparency: simple turn the background purely white. Then it should be turned transparent automatically in-game.

And when it comes to bluffing: pay attention to the number of weapons/signs on the left and right of the leader's face. The more there are, the stronger his army (on the left) and research (in the right) is.
 

Metro Polis

Warlord
Joined
May 5, 2012
Messages
258
Location
Southern Hell
It makes everything easier with the videos if you start and end each emotion with the "loop Emotion" to overlay the different time schedules.

What also helped me a lot was a "counter video" starting at 0.0, 0.1,...for the first second, 1.0, 1.1... for the second and so on. Such a counter is great just to see how it works and how you have to line up the pictures for the video.
 

Blake00

CFC Archivist & Social Media Helper
Moderator
Supporter
Joined
Sep 24, 2016
Messages
1,560
Location
Australia

Blake00

CFC Archivist & Social Media Helper
Moderator
Supporter
Joined
Sep 24, 2016
Messages
1,560
Location
Australia
Hello,

I solved some of the questions that were bugging me yesterday and also came up with alternative method for making custom heralds.

Only 4 scenes are used, the scenes are stored in first 5.1 seconds of the movie.
Now I used 24 frames per seconds, since this is the best for making stop motion animation, and the structure of the movie is:
1st second "greetings"
2nd and 3rd second "loop"
4th "happy"
5th+ "angry"
6th and 7th The movie has to be at least 7 seconds long so it doesn't crash, so for in last two seconds any scenery you provide won't show in the game, but you have to provide that anyway.

If you use different frame rate, like 10 fps or 50 fps, the above structure seems to shift. I haven't tested this any further, since I got solid 3 mega bytes movies for my heraldry by now, but I noticed even before, since I was working with portraits, how you can give somebody a character by just exchanging the scenery for "happy" and "angry" and tricks like that. You should have seen how Alexander the great laughs when I ask him if he would like to exchange maps.

The video size can be up to 380x600 pixels.

Transparency is difficult to achieve. In my Sony Vegas movie editor, I couldn't switch on "first frame analysis", so I couldn't get that. On the other hand, I could do some other stuff like zoom in or roll 14 gif presets so I could render 14 movies just like that.

This is the video settings I used:


I faced a challenge recently in that I wanted to do some more custom video work for Metro & my Heroes of Might & Magic 2 mod however all the video work done for our mod to date was by Metro, and while I helped him here & there with figuring out import/export video settings in the old Ulead Video Studio Indeo Codec video editor Metro found (talked about earlier in this thread) I never did find my own way to convert video files into an old format supported by Ulead and I couldn't remember what Metro used to convert them either. I see Kasius uses Sony Vegas Movie editor above which is probably the superior way as the way we did it with editing custom videos in one editor and then exporting over to Ulead to converting into Indeo format meant each video was getting compressed and distorted twice, whereas Kasius appears to be doing it all in the one program. However Sony Vegas Movie editor isn't free and when videos play in Civ2 they get distorted by various pixel dithering effects to bring them down to the MGE's 256 colour limit so any ugly artifacts caused by double processing appear to get hidden anyway haha so I decided to find my own way to export videos from a free modern editor that I could use in the old Ulead editor to convert to Civ2 Indeo format.

I usually use the popular and completely free ShotCut video editing program for editing all my retro gaming youtube videos these days so I really really wanted to find a away with that. It took some time but I finally found a ShotCut export setting that worked. If I export as a classic MPEG-2 file from the preloaded export template options it will export the video as a classic MPG file that will load just fine in the old Ulead editor. However for whatever reason I did need to export the video at 30 frames per second (so ignore the 15FPS in the screenshot below) for Ulead to keep the correct length and timing in the video and then use Ulead to convert it back to 15 frames for Civ2. Not great for video quality but at least it works lol. Oh and I also needed to click on the Codec tab and lower the video's GOP to '15 - Fixed' from 75 and the bitrate down from 8M to 1M otherwise ULead will still struggle with it.

upload_2022-2-19_17-31-24.png


So I now finally have a way to make custom Civ2 videos like Metro and Kasius have in the past. Am already cooking up some fun death and victory videos for some of my other mods. And for those with a keen eye looking at the picture above you will see that I'm using ShotCut to place custom images over the top of of the Civilization 2 Grand Council Video Advisors! As far as I know no one has ever replaced them before and I'll be the first as I'm going to animate some Heroes of Might & Magic 2 Hero faces and have them animating over the top of the original video advisors. By mounting over the top of the original advisor video files I can retain all the critical audio cues and timestamps ensuring the right speech still plays for the right situation. However now it'll be my custom heroes screaming "GIVE ME MORE SOLDIERS NOBLE LEADER SO THAT THEY MAY SHEATH THEIR SWORDS IN THE BEATING HEARTS OF OUR ENEMIES!!!" haha. :)

Test's so far appear to be working well! :)

 
Last edited:

Blake00

CFC Archivist & Social Media Helper
Moderator
Supporter
Joined
Sep 24, 2016
Messages
1,560
Location
Australia
Well I've started making my custom High Council with animating HMM2 hero faces. I created animating gifs with the heroes talking and then inserted them into ShotCut on a layer over the top of the original video and then exported using settings mentioned in my previous post.



However the next step is proving challenging as usual as every time I use Ulead months or years apart I get a bit lost so I'm going to stick steps here for myself and others if they need it too. This will work for wonders and council but heralds require a bit more with transparency stuff (see first post in thread).
  1. New project
    1. New Name
    2. Template - AVI 320x240 29.97fps Intel Indeo Video
  2. Insert media files
    1. Add video
    2. Select the MPG file you made in ShotCut
  3. Finish
  4. Save Project
  5. Make Movie
    1. Options
    2. General
      1. Frame rate - 15
      2. Frame size - User Defined 320x240 wonder / 88x120 council
    3. Compression
      1. Quality - 100% (takes longer)
      2. Audio - PCM - 22.050khz, 8bit, Stereo wonder / Mono council
    4. Save
  6. If the rendering % moves fast and then suddenly comes to a stop and looks like it's stuck, don't worry it's still going, if you go look at the file your created you'll see it's size increasing, slowly, so you may have to wait a while! Although the output may end up all out of sync and more often then not it means your source file is still too 'modern' for this old editor to handle so you probably need to lower the MPGs bitrate and GOP frames (see previous post).
upload_2022-6-27_19-46-35.png


EDIT: And here's the final product working in the game!

 
Last edited:
Top Bottom