Cavalli's Musket Ball

Discussion in 'Modding' started by Ftoomsh, Feb 5, 2018.

  1. Ftoomsh

    Ftoomsh Well-Known Member

    I have been conducting more experiments with Cavalli's musket bullet. Why this projectile? Well, because it stops units firing through friendlies and through structures. This in turn will enforce proper line tactics and make flanking attacks effective. It will stop blobbing and stacking of firing units. Firing units in blobs will be destroyed by firing units using correct line tactics.

    Cavalli's musket ball projectile has certain features, at least in my tests.

    1. It only does head-shots. This is actually a good thing for a realism mod. Musket balls typically killed or maimed (creating combat ineffectives) with almost every shot that hit.

    2. It can be made 100% accurate by using a dispertion of 0 (zero). At the other end of the scale, a dispertion of 1024 makes it unlikely to hit a barn door from 20 paces. I have tested different dispertions with single shooters and this works. However, I have met two problems as below (points 3 and 4).

    3. I have made the barracks attack upgrade for 17th C muskets one which reduces dispertion, so that this becomes an accuracy upgrade. However, it currently does not appear to be working. When I hard code different dispertions in the unit script, the changes work. But when a unit starts with a high dispertion and I run the upgrade this does not appear to work. Relevant bits of upgrade code are (for an example);

    _pru : SetUpgStructFoodGold(upgstruct, upgplace, member, -25, 2000, 100, True, -25, 1000, 300, True, -25, 500, 700, True, 0, 0, 0, True, 0, 0, 0, True, 0, 0, 0, blacksmith, ''); // Mushketer_ev

    &

    AddUpgradePack(country, upgstruct, gc_upg_tooltiptype_none, gc_upg_type_attdispertionperc, posx, 1, True, ind, linkind); // Ftoomsh

    4. I have found another problem. When I test a single shooter at zero dispertion, he is 100% accurate. However, when a line of 15 shooters shoots at a line of 15 pikes, the accuracy is way down. They might kill about 3 to 5 pikes. I think what is happening is this. The game scripts / engine either targets randomly or it is built to multi-shot individual targets because the vanilla has an incremental damage system. Multi-shotting makes sense for an incremental damage system. It takes several shots to kill one target. However, multi-shotting, whether by design or by probabilities, is not what this Cavalli musket ball needs. It needs each man in the formation to pick his own target. Then changing dispertion (accuracy) will be the way to control upgrades and balance for muskets. Not sure how to address this though.

    Any ideas on the above are welcome.

    Footnote: I have made a range upgrade for muskets which does work. The shotpower upgrades in the academy now upgrade musket range in my test mod. This test mod is not publicly available yet. People on my Steam friends list can download it. It's called TestBed3. Of course it is not finished or balanced yet.

    Second Footnote:

    Somewhere in the scripts or the engine (I hope in the scripts), there must be the code which handles how each unit acquires its next target. Presumably it does a scan clockwise or anti-clockwise for the next target in range and then acquires it (starting the scan from looking straight ahead one would presume . Do units in formations do coordinated scans? It's an interesting question. This would all come under "target acquisition" but heaven knows what coding term the game uses. I guess I will go searching. Any hints would be much appreciated.

    Third Footnote:

    Okay, I have made real progress. All extra ideas are welcome! :)

    I moved the accuracy upgrade from the barracks to the academy. Now the fire power upgrade increases accuracy which is great. I give muskets (the 17th C musket as a test) a dispertion of 256. Then each of the four upgrades reduces dispertion by 50%. I think this will give;

    0th : 256 , 1st : 128 , 2nd : 64 , 3rd : 32 , 4th : 16

    Correct me if I am wrong. Results certainly look okay.

    I have also discovered that multiple units do indeed multi-shot enemy units leaving others untargeted. This will not be an issue. The percentage outcome of kills is what matters and I now have enough levers to adjust this. Improving the accuracy helps. I might be able to put range upgrades in the barracks but will these work? Why does the accuracy upgrade work in the academy but not in the barracks? I guess it's designed for the academy and my code was not enough to make it work in barracks?
     
    Last edited: Feb 6, 2018
    Loner likes this.
  2. Loner

    Loner Active Member

    This is not a bad thing, this is surely what happens in reality.:cool:
     
  3. Ftoomsh

    Ftoomsh Well-Known Member

    At my current stage of re-design I have one design conundrum. Placing the accuracy upgrade straight into the 17th C Barracks under the attack upgrades does not work. This upgrade works when in the Academy but does not work when placed straight into the barracks. I suspect the upgrade code in the player.script is the problem. The code for barracks takes a different form from that for academy upgrades. This is probably because academy upgrades are one button per upgrade but barracks upgrades give sequential upgrades in the same button position. Is it possible to put an accuracy upgrade (dispertion) into barracks without messing this upgrade up for cannon in the academy?

    I suspect I will have to create a new upgrade (called maybe muskdispertionperc) and put this in barracks with the barracks style code which creates buttons one after another in the same spot until the upgrades are all done. Is this correct? Would this be hard to do?

    Note: I ask these questions and then go and try it myself. If I solve it myself then well and good. If I get stuck I can always hope for an answer here. :)
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice