OSP Code Optimisation Heraldic Map Banners (proof of concept)

Users who are viewing this thread

Lav

Sergeant Knight at Arms
I never liked Native map icon banners. Map icons are limited in number and those banners are eating away about 150 slots out of 256 available. That's simply too much for my taste. In the end I decided that I want to replace all of them with just a single banner mesh, which would be painted with whatever heraldry is appropriate.

So, without further ado:

Heraldic Map Banners

To create a heraldic map banner, you need to make following modifications:

Code:
    ("heraldic_banner",0,"custom_map_banner_03", banner_scale, 0,
        [
            (ti_on_init_map_icon,
                [
                    (store_trigger_param_1, ":party_id"),
                    (call_script, "script_get_banner_mesh_for_party", ":party_id"),
                    (cur_map_icon_set_tableau_material, "tableau_heraldic_map_banner", reg0),
                ]
            ),
        ]
    ),
This trigger retrieves the party_id, calls "script_get_banner_mesh_for_party" (covered later) to determine what banner mesh to use, and then finally applies the heraldry to our banner using a new tableau.
Code:
    ("heraldic_map_banner", 0, "missiles", 512, 256, 0, 0, 0, 0,
        [
            (store_script_param, ":banner_mesh", 1),
            (set_fixed_point_multiplier, 100),
            (init_position, pos1),
            (position_set_x, pos1, -12),
            (position_set_y, pos1, 113),
            (position_move_z, pos1, -20),
            (cur_tableau_add_mesh, ":banner_mesh", pos1, 0, 0),
            (init_position, pos1),
            (position_set_z, pos1, 10),
            (cur_tableau_add_mesh, "mesh_tableau_mesh_custom_banner", pos1, 0, 0),
            (cur_tableau_set_camera_parameters, 0, 100, 200, 0, 100000),
        ]
    ),
The tableau material uses only standard meshes, fully available in Native.

Finally, the script to determine the banner mesh to use. Currently it is just a stub:
Code:
    ("get_banner_mesh_for_party",
        [
            (assign, reg0, "mesh_banners_default_b"), # Stub for the moment
        ]
    ),
Obviously this script needs some love, but it's enough for proof of concept.

Once everything is ready, and your script "get_banner_mesh_for_party" is ready to determine banner meshes for your parties, assign your "icon_heraldic_banner" to them instead of selecting one of the dozens available flags.

It is recommended to use this in combination with Banners and Flags Standardization Pack, due to it's uniform banner placement.
 
I m building the same system as alternative to custom banner. My aim is to get all advantages of using custom banner like no strange cloth like on shield and of course no need map icon for every heraldic.
And it will have advantages of standard banner like more rich of colors.
I think we need new textures without cloth effect and do the effect via normal map for materials of flags and banners mesh.
 
To get rid of cloth effects on shields you need to move them to tableau item mesh, together with bump and specular maps, right?

That would be extremely interesting, especially if you can make all three flag types compatible with all game heraldry. This is what I'm personally most interested in, so I would be able to differentiate banner *types* for different parties of the same noble family - you would have family head running around with vertical banner, other family members with horizontal ones, and non-hero patrol and reinforcement parties under square banner.

Another thing I'm considering is putting extra images on unit flags, like putting a small replica of kingdom banner in the corner of lord's banner (kinda like there's a small UK flag on the flag of Australia).
 
Did you guys try the code out or it's just an idea?
Doing what Lav said would make the whole thing more efficient. More map icon slots, faster load times, smaller size on disk. Nice :mrgreen:
 
My code works fine, however I only converted one type of banner (vertical tall) - vanilla square and horizontal custom banners conflicted severely with Standardized Banner Pack textures, and I'm not yet good enough with texturing and tableaus to work my way around that. I could possibly make them work with vanilla banner textures, but I don't like them, so there.

Dunde's project is something else though, he aims at remaking the entire heraldry system, heraldic flags for map icons is just a small part of his project. Should be incredibly cool once it's completed, but when I estimate the amount of work to be done I'm not extremely optimistic about seeing the results any day soon. :smile:
 
Right. What about combining what you want to do here with your other idea? The "thought bubble". I mean you could create a whole new type of banner (like the one in batte mode over your own and allied units) and make it heraldic.

That would look good. I think  :mrgreen:
 
I changed the whole model for the banner and it looks decent:
mb1.jpg

Next I will try your code.
 
Back
Top Bottom