1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Custom heralds and transparency

Discussion in 'Civ2 - Scenario Creation' started by Blake00, Aug 16, 2019.

  1. Blake00

    Blake00 Chieftain Supporter

    Joined:
    Sep 24, 2016
    Messages:
    291
    Gender:
    Male
    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: Aug 16, 2019
  2. Blake00

    Blake00 Chieftain Supporter

    Joined:
    Sep 24, 2016
    Messages:
    291
    Gender:
    Male
    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.
     
  3. Metro Polis

    Metro Polis Chieftain

    Joined:
    May 5, 2012
    Messages:
    199
    Location:
    Southern Hell
    I originally grabbed the pink of the units.gif (saved it as a .bmp first for our old video editor can't handle gifs) as it is transparent in the game, too. Maybe it switched colour during converting?
     
  4. Blake00

    Blake00 Chieftain Supporter

    Joined:
    Sep 24, 2016
    Messages:
    291
    Gender:
    Male
    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! :)

    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!!!

     
    Thorvald of Lym likes this.
  5. Metro Polis

    Metro Polis Chieftain

    Joined:
    May 5, 2012
    Messages:
    199
    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:
     
    Thorvald of Lym and Blake00 like this.
  6. Blake00

    Blake00 Chieftain Supporter

    Joined:
    Sep 24, 2016
    Messages:
    291
    Gender:
    Male
    Location:
    Australia
    Last edited: Sep 29, 2019
    JPetroski likes this.

Share This Page