Introducing Hercules' Map Zone Database

Ind

Development Administrator
Staff member
Messages
1,655
Points
113
Introducing Hercules' Map Zone Database
Hello~! - What?!

  • 1st, it is a merge from item_noequip.txt and skill_nocast_db.txt functionality.
  • 2nd, it is a major improvement on what these features did in both performance and usability.
map_zone_db.txt format sample

{
    name: "My Zone"
    inherit: ( "My Other Zone" )
    disabled_skills: {
        AL_HEAL: "PLAYER | MONSTER | ELEMENTAL"
        AL_TELEPORT: "MONSTER"
        MG_FIREBOLT: "NONE"
        //MG_NAPALMBEAT: "PLAYER"
        //ID11: "PLAYER"
    }
    disabled_items: {
        Assumptio_5_Scroll: false
        //Apple: true
        //ID501: true
    }
    mapflags: (
        "adjust_skill_damage    MG_FIREBOLT    250",
        "adjust_unit_duration    PR_SANCTUARY    50"
    )
    /* "command:min-group-lv-to-override" e.g. "heal: 70" */
    disabled_commands: {
        //Example Below makes @heal be used in maps within this zone only by those group lv 70 and above
        //heal: 70
    }
    skill_damage_cap: {
        //Exemple Below caps firebolt damage in maps within this zone to a maximum 50 damage,
        // (depends on HMAP_ZONE_DAMAGE_CAP_TYPE in src/config/core.h)
        // when cast vs players and monsters.
        //MG_COLDBOLT: (50,"PLAYER | MONSTER")
    }
}
Notes on the format

  • In disabled_skills the var following the name (: "PLAYER | MONSTER | HOMUN | MERCENARY | ELEMENTAL | PET | CLONE | MOB_BOSS") is what allows a zone to know what unit types should have this skill disabled. In the sample above, for example, in My Zone, player, monster and elemental unit types are unable to cast heal, while only monsters are unable to cast teleport. this variable may also be used to ignore skills from inheritance, for example if My Other Zone disabled a number of skills, including MG_FIREBOLT, in My Zone all of them will be disabled as well, except for MG_FIREBOLT since it is set as NONE.
  • In disabled_items the var following the name (: true or : false) is what allows a zone to override what it inherited, for example if My Other Zone disables a number of items, including Assumptio_5_Scroll, in My Zone all of them will be disabled as well, except Assumptio_5_Scroll since it is as false.
  • A zone may enforce an unlimited number of mapflags on all its maps, by using this sample all maps under My Zone will have Fire Bolt damage increased by 2.5x and Sanctuary will have its duration halved.
  • A unlimited number of maps may be linked to a specific zone through a mapflag
    Code:
    '<map name><tab>mapflag<tab>zone<tab><zone name>'
  • Changes
    The mf_restrict (restrict) was dropped.
  • item_noequip.txt and skill_nocast_db.txt were dropped, replaced by map_zone_db.txt.
  • setmapflag script command was modified to support the new zones.
  • @mapinfo was modified to support the new zones, also modified the formatting and made it include the amount of vendings.

[*]Improvements

  • As opposed to item_noequip.txt and skill_nocast_db.txt, map_zone_db.txt supports an unlimited number of zones.
  • map_zone_db.txt implementation surpasses the ones from item_noequip.txt and skill_nocast_db.txt, making item equipping (pc_useitem/status_calc_pc) and skill using (previously skillnotok, now status_check_skilluse) processing much faster and efficient.
  • @mapinfo performance was improved (was doing chat room dbmap lookups without even checking if player was on the map in question)
Special Thanks
  • to Muad_Dib <3.
  • to lighta for discussing the feature with me and helping design the unit-based restrictions on skills
  • to Bahmut and Emistry for ideas on how to format the file.
  • to kyeme for feature ideas.
Links~!

 
Last edited by a moderator:
Great! As always, Ind
default_biggrin.png


 
this is great +1 but i some little problems

previously on skill_nocast_db i can restrict clones to use skills with bitmask "16 = Cannot be cloned (clones will not copy this skill)"
i can't seem to see it here in the new implementation now, is it possible?

also; can i use item ID/skill ID for disabled_items & disabled_skills?

 
Thank you all for the feedback,



I've mistakenly mentioned @mapflag instead of @mapinfo in the notes, modified post to reflect that.



previously on skill_nocast_db i can restrict clones to use skills with bitmask "16 = Cannot be cloned (clones will not copy this skill)"
whops o.o looks like I missed that, thanks for bringing it up. I'll add it back but as a skill_db inf2 flag.

also; can i use item ID/skill ID for disabled_items & disabled_skills?
unfortunately not, libconfig does not allow setting keys to consist only of numbers.
 
I've mistakenly mentioned @mapflag instead of @mapinfo in the notes, modified post to reflect that.


Very good. Ind I missed these skills do not seem to be added in the new model, txt format looks very old would it not be better to do in conf?

Code:
3013,3  //KO_KYOUGAKU//Clone Forbidden/pointless skills77,16  //PR_TURNUNDEAD79,16  //PR_MAGNUS 
 
Last edited by a moderator:
previously on skill_nocast_db i can restrict clones to use skills with bitmask "16 = Cannot be cloned (clones will not copy this skill)"

i can't seem to see it here in the new implementation now, is it possible?
I've mistakenly mentioned @mapflag instead of @mapinfo in the notes, modified post to reflect that.
 

Very good. Ind I missed these skills do not seem to be added in the new model, txt format looks very old would it not be better to do in conf?

3013,3  //KO_KYOUGAKU//Clone Forbidden/pointless skills77,16  //PR_TURNUNDEAD79,16  //PR_MAGNUS 
There we go: https://github.com/HerculesWS/Hercules/commit/cfd2bdb06048c17decaafd0f5a3c04e3f0ac6a3b

By the way the

Code:
3013,3  //KO_KYOUGAKU
was a flag used to normal and pvp maps, it is present in the map_zone_db.txt
 
previously on skill_nocast_db i can restrict clones to use skills with bitmask "16 = Cannot be cloned (clones will not copy this skill)"

i can't seem to see it here in the new implementation now, is it possible?
> 

I've mistakenly mentioned @mapflag instead of @mapinfo in the notes, modified post to reflect that.
 

Very good. Ind I missed these skills do not seem to be added in the new model, txt format looks very old would it not be better to do in conf?

3013,3  //KO_KYOUGAKU//Clone Forbidden/pointless skills77,16  //PR_TURNUNDEAD79,16  //PR_MAGNUS 
There we go: https://github.com/HerculesWS/Hercules/commit/cfd2bdb06048c17decaafd0f5a3c04e3f0ac6a3b
By the way the

3013,3  //KO_KYOUGAKUwas a flag used to normal and pvp maps, it is present in the map_zone_db.txt
Thanks Ind. and as the file be a conf, wouldn't it be more logical ?

 
Updated first reply, added support for unit-type-based skill restrictions, new sample and descriptions are now available in the first reply of this topic.

In disabled_skills the var following the name (: "PLAYER | MONSTER | HOMUN | MERCENARY | ELEMENTAL") is what allows a zone to know what unit types should have this skill disabled. In the sample above, for example, in My Zone, player, monster and elemental unit types are unable to cast heal, while only monsters are unable to cast teleport. this variable may also be used to ignore skills from inheritance, for example if My Other Zone disabled a number of skills, including MG_FIREBOLT, in My Zone all of them will be disabled as well, except for MG_FIREBOLT since it is set as NONE.
Special Thanks
  • to Muad_Dib <3.
  • to lighta for discussing the feature with me and helping design the unit-based restrictions on skills
Links~!


 
Last edited by a moderator:
so the possible inputs for disable skills are: PLAYER | MONSTER | HOMUN | MERCENARY | ELEMENTAL

if i put MONSTER then that does that include SUMMONS (like alchemist's flora,hydra) & CLONES?

maybe you can also include CLONE/SUMMON Type monster as possible inputs (i think i'ts handled better here than in the skill_db)

i think also PET? since they can also cast skill

 
good point pets should also be a available option. clones/summons however are not their own unit types (since they're monsters), adding clones/summon option would slow down the processing to all the other types... i don't think its worth it/fair (since the option is already available through a different mean, as you said yourself, skill_db.txt)

 
I've identified a issue that makes swapping zones that have mapflags (uses the mapflag:( ) param) during runtime (e.g. by setmapflag) troublesome. I'm already working on designing a solution to this and it should be out soon. I apologise for the trouble. here is a temporary fix that will make gvg/bg/gvg2 zones work smoothly in the meantime: https://github.com/HerculesWS/Hercules/commit/e702cc0ab6dccfd0a10b5a1881841452c326affc

 
Last edited by a moderator:
one thing i do not like w/ the option of setting restrictions on clone skill usage handled on skill_db is that it is always global

i envy the capability of other unit types of having the the advantage/option to choose zones for disable skills (i love playing with clones
default_tongue.png
) but as you said it'll slow down the processing to all the other types so i think its not worth adding if it'll just degrade the performance

keep up the good job Ind
default_ani_meow.gif


 
Last edited by a moderator:
Can you enlighten me with adjust_skill_damage?

Say for example I want to adjust its damage in all maps (this includes damage done to monster, players, boss, everything)..

Do I need to set first at disabled skills like this..

RK_HUNDREDSPEAR: "NONE"

then..

mapflags: ("adjust_skill_damage RK_HUNDREDSPEAR    250")

if yes.. This is just what I did and I'm receiving lots of warnings. Thanky ou.

 
Back
Top