Ranked Fire and Friendly Fire Effects.

Discussion in 'Modding' started by Ftoomsh, Jan 24, 2018.

  1. Ftoomsh

    Ftoomsh Well-Known Member

    This is good news, about points 2 and 3.

    I haven't noticed the problem with unformed units in TestBed3 (which is OCMOD3 plus your projectile physics and a few changes to suit).

    I have given muskets a long range like you have in Cavalli_Realism. The 17th C musket has 1500 range and 1400 search for example. I have given muskets a lower starting accuracy (dispertion of 128 for 17th C muskets for example) and then changed the shot-power upgrades in the academy to be upgrades that reduce dispertion. I need to refine precise values and costs but this seems basically okay so far. Muskets now have no attack upgrades for shot in barracks. This is because these upgrades are meaningless as shot-power itself is meaningless in TestBed3. I am running it totally off head-shots and I have given muskets 100% head-shots in General WVPMs code. Of course, they only get a head-shot if they hit. The remaining inaccuracy of the weapon (dispertion) and the inability to lead shots on moving targets is generating enough, or slightly more than enough, inaccuracy.

    I find un-formationed muskets do not do well because they do not bunch properly in attack. But if micro-ed properly by human player or AI maybe they could do better. I agree that I too would advocate making dispertion a modifiable parameter in General WVPMs formations framework. Then you can give musket formations a bonus dispertion reduction which of course equals an increase in accuracy. Maybe unformed 17th C musket units, for example, could have a dispertion of 256 which is reduced to 128 once in formation. It would be further reduced by the academy upgrades I mentioned.

    Even if you can make the musket weapon lead infantry targets travelling at right angles, to line of fire, for half the hit success rate they have when a unit is coming straight toward them, then this would easily be good enough based on my tests. I would not mind if muskets were still lousy at leading cavalry targets, especially fast cavalry almost out at maximum range. This would probably be a good thing in fact.
     
    Last edited: Feb 10, 2018
    Loner likes this.
  2. Ftoomsh

    Ftoomsh Well-Known Member

    Let me know when the fixes are in and in what lines and files, please. :)

    I ask because I have just tested Cavalli Realism and no fixes appear to be in there yet. In the in-game editor, the enemy will still fire at walls and some shots still go through and kill units. Some shots that go through also seem to do wall damage of 150. I wonder where this 150 comes from? A single soldier or a soldier in a formation will do this 150 damage if he does damage at all. This 150 might be a clue to what is happening, maybe?

    Ideally, both friendlies and enemies would treat walls and buildings the same. They wouldn't even try to shoot through them whether the walls and buildings were "theirs" or not. Is there a way to set this up?

    Again, I ask because I don't understand this area of code.
     
    Last edited: Feb 11, 2018
  3. Ftoomsh

    Ftoomsh Well-Known Member

    Please read all my above posts. Plus, I have done a bunch of further tests with interesting results. Here is what I have found.

    1. The standard SHOTMUSKET weapon can be made to not fire if friends are on line.

    2. The standard SHOTMUSKET weapon can be made to not fire through buildings or walls whether these are friendly or enemy structures.
    if ((enemyplmask and gPlayer[TObj(pObj).pl].myplmask)=0) or (gObjProp[cid, id].bBuilding) then // is friend or is building (Use this amended line in misc.script with code in italics added.)

    Keeping the SHOTMUSKET weapon allows us to keep incremental damage, WVPMs range damage system and all the standard upgrades for muskets. This weapon is easier to fine tune to give the casualty rates required and it does not have any problem leading moving targets. On the other hand, keeping it might cause other problems. I don't know the effects of either of these weapons when firing into (or through?) hills.

    For me this raises the issue of which musket weapon system is best for realism results? Since I don't know all the advantages of the Cavalli PPOINTT2 musket projectile, I can't answer this question. If Francesco fixes some of the issues we have been discussing, his PPOINTT2 might still be better. I will certainly be interested in Francesco's opinion here.

    I know I have been hammering away at this issue. I hope this is not getting tedious for anyone. But to me, the goal is the best realism simulation effects possible. Whichever system can achieve the best simulation results overall is the best system. I could never have made any progress or tested any of this without the work of General WVPM and Francesco Cavalli leading the way. :)
     
    Loner likes this.
  4. Rhayn

    Rhayn New Member

    I accidentally skipped this topic and wow, there are some real breakthroughs in here! Plus, on my side, I'm trying to code an "aoe pointer",basically a red translucent square or circle which shows the range and the dispersion of a units or formations, this only serve as aid to the player it has no real balancing effects and it should looks like the pointers in moba games when you're trying to cast a certain skill
     
    Loner likes this.
  5. Ftoomsh

    Ftoomsh Well-Known Member

    I have to note that my solution above to prevent SHOTMUSKET muskets shooting through enemy buildings also stops cannon (but not howitzers and mortars) from being permitted to hit enemy buildings. I have to go back to the script code and fix this up now. Lucky this is just in testing, not released yet. :)

    I have compared cannon code to mortar and howitzer code and I cannot yet find the difference that would stop cannon hitting enemy buildings under these conditions even though mortars and howitzers can still hit enemy buildings.

    Of course, I refer to the effect of the amended code line of Francesco Cavalli's which I added to as per the italics;

    if ((enemyplmask and gPlayer[TObj(pObj).pl].myplmask)=0) or (gObjProp[cid, id].bBuilding) then

    Can anyone spot the issue?

    Update: Okay, I have fixed this. I made cannons able to fire through/over friendlies. Use cannon with care and watch out with auto-fire... but shouldn't one always use cannon with care? ; )

    2nd Update: There is always a bug waiting to bite me! I have found that my code means if say red troops stand in front of red wall (outside base) then blue troops outside red base cannot fire at red troops outside red base while the red wall is in the blue troops maximum range! Thus if troops stand with back to own wall they are almost immune to enemy musket fire. Go figure! That's not what I expected. It looks like I need a better solution to this. Ideas anyone? Actually, I wonder if the SHOTMUSKET weapon might be the problem. This possibly would not happen with PPOINTT2?

    This bug I introduced is very frustrating. But for this my whole mod update would work with the SHOTMUSKET weapon. I think I understand why it happens. The shot musket ray checks the whole ray line and won't fire even if the building is on the ray line beyond the enemy troop on the ray line.

    There must be a way to make walls stop all muskets without bugs like this even with the SHOTMUSKET? Surely, there's a way?
     
    Last edited: Feb 14, 2018
  6. Rhayn

    Rhayn New Member

    Mmh, you would need a checker, maybe a boolean, that calculates if the buildings is somewhere in between the firing unit and the target
     
  7. Ftoomsh

    Ftoomsh Well-Known Member

    The logic of what is going wrong is probably trying to give me a hint on how to fix it. It goes like this.

    1. If A is firing on enemy B and A's wall is behind B then the warning "Musket blocked by wall" comes up for A but A can still shoot and kill enemy B troops.
    (This case could come up if enemy was inside your base and had your wall at their back.)

    2. If A is firing on B and B's wall is behind B then the warning "Musket blocked by wall" comes up for A and A cannot shoot and kill enemy B troops.
    (This case could come up if you had pushed enemy back against his wall so he has his wall at his back.)

    I am trying to figure out the logic of how this could happen. It's the _misc_IsBuildingInRay function in the file misc.script. The changes I have made from Cavalli's Realism mod approach are first, I have switched to using SHOTMUSKET not PPOINTT2. Second, I have changed one line of his code in misc.script by adding what is in italics.

    if ((enemyplmask and gPlayer[TObj(pObj).pl].myplmask)=0) or (gObjProp[cid, id].bBuilding)

    I know this is a change for approach from a projectile weapon (PPOINT2) to a non-projectile SHOTMUSKET. SHOTMUSKET has no problems leading targets and no problems doing incremental damage as well as headshots. It is easier to balance the whole mod with SHOTMUSKET adapted to not shoot through friendly units. This bit works well. However in trying to stop units shooting through buildings and walls I added the above code (in italics). The results are as I have outlined above.

    If I can't fix this before my pre-weekend release of OCMOD3 I will simply allow the muskets to shoot through buildings and walls like they do in vanilla. That fix will have to wait until I can solve it or until someone can give me an idea for a fix.

    I really do wonder why this has never been fixed in vanilla. It can't be too hard for real programmers. And then they could make an exception for wood walls and allow firing through those like in C1. BTW muskets could not fire through stone walls in C1 IIRC. I really wonder why these basic bugs are not fixed in C3. It should not be up to modders to fix basic bugs.
     
    Loner likes this.
  8. (OC)Fotheringill

    (OC)Fotheringill Active Member

    "... I really wonder why these basic bugs are not fixed in C3. It should not be up to modders to fix basic bugs...."

    Pretty much what I have been complaining about from the beginning along with dozens of other problems.
     
  9. Ftoomsh

    Ftoomsh Well-Known Member

    You have been the voice of objectivity and reason. I have been the voice of crazy, stupid optimism. To date, the reality of C3 has accorded with your viewpoint, not mine. Yet, I retain 1% of hope. When that is extinguished I will go off into the sunset... RTS speaking.

    And now the sun had stretched out all the hills,
    And now was dropped into the western bay.
    At last he rose, and twitched his mantle blue:
    Tomorrow to fresh woods, and pastures new.
    - John Milton.
     
  10. (OC)Fotheringill

    (OC)Fotheringill Active Member

    Ftoomsh

    If you are reading, remembering and quoting Milton, you have entirely too much time on your hands.

    What bugs my ass, other than very tall ants or near sighted foreign agents, is that a whole lot of what I have been bitching about was fixed in subsequent games in the Cossacks series UNTIL COSSACKS 3. Seriously, I was truly appalled when I played my first game of C3. I am strictly an end user and said to myself (and wife) they ain't done nothing in more than 15 years that I can see. I, and I suppose many other gamers, wish to go home, turn on their gaming equipment and play. I would bet a functioning gonad that either the developers screwed GSC, GSC screwed the developers, or one or both inadvertently screwed the 100,000 or so of us who purchased this game. Is this a niche game when compared to FPS games or a series like CoH? certainly, but I would bet the low sales numbers have something to do with a reissue of a game so old.
     
    Last edited: Feb 16, 2018
  11. Ftoomsh

    Ftoomsh Well-Known Member

    In a somer seson,
    Whan softe was the sonne,
    I shoop me into shroudes
    As I a shepherd were
    In habite an an heremite
    Unholy of werkes,
    Wente wide in this world
    Wondres to here;
    Ac on a May morwenynge
    On Malverne hilles
    Me bifel a ferly,
    Of fairye me thoghte.
    I was wery for-wandred,
    And wente me to reste
    Under a brood bank
    By a bournes syde;
    And as I lay and lenede,
    And loked on the watres,
    I slombred into a slepyng,
    It sweyed so murye. - The Visions of Pier Ploughman by William Langland.

    Those are some of the most beautiful verses ever written in English. :)

    The lack of a rhyming scheme and the use of an alliteration scheme instead is far more suited to the structure of English (old and new). The fashion of using end of line rhyming schemes in English came from the Romance languages and Italian in particular. But English produces far more beautiful and muscular effects by the use of Old English alliteration effects and the caesura (pause) in the middle of the line. can't you tell I was an English Major? ;)

    BEOWULF


    I. THE LIFE AND DEATH OF SCYLD.



    Lo! the Spear-Danes’ glory through splendid achievements
    The folk-kings’ former fame we have heard of,
    How princes displayed then their prowess-in-battle.
    Oft Scyld the Scefing from scathers in numbers
    From many a people their mead-benches tore.
    Since first he found him friendless and wretched,
    The earl had had terror: comfort he got for it,
    Waxed ’neath the welkin, world-honor gained,
    Till all his neighbors o’er sea were compelled to
    Bow to his bidding and bring him their tribute:
    An excellent atheling! After was borne him
    A son and heir, young in his dwelling,
    Whom God-Father sent to solace the people.
     
    Last edited: Feb 17, 2018
  12. Rhayn

    Rhayn New Member

    In off the moors, down through the mist-bands
    God-cursed GSC came greedily loping.
    The bane of the race of gamers roamed forth,
    Hunting for a prey in the high Steam hall.
    Under the cloud-murk he moved towards it
    Until it shone above him, a sheer keep
    Of fortified gold. Nor was the first time
    He had scouted the grounds of Hrothgar's dwelling.
     
  13. Rhayn

    Rhayn New Member

    This literature hiatus was fun but I'd like to put your attention to the firing algorithm of archers. When put in formation and located on the ridge of an hill, the archers in the backlines will eventually hit their comrades when trying to shoot to an enemy walking by the lower edge of the hill/plateau. Do you know by chance if there could be an easy wasy to fix that?
     
  14. Ftoomsh

    Ftoomsh Well-Known Member

    In the standard vanilla code, in data/scripts/lib/weapon.script the arrow weapon is not set to check for friends on line;

    _weapon_SetWeaponCheckFriendOnLine('STRELA', False);
    _weapon_SetWeaponCheckFriendOnLine('OSTRELA', False);

    In the misc.script is the code which determines that the weapons which are set to "false" can simply shoot through friendlies without hitting them. Cavalli's mod and OCMOD3 change that code a bit to take account of the musket weapon being set (in our mods) to not be able to shoot through friendlies. However, we have not affected arrows. Technically, they still fire through friendlies but since the graphic arc of the arrow makes it look like they don't, it's okay. It works visually, for balancing and for tactics so it's okay in my book. Arrows, even in reality, have a reasonable ability at direct fire (near flat parabolas) and indirect fire (high arcing parabolas). We can just assume the archers use the arcing fire when direct fire would hit the men in front. (Technically, some bows are specialised for one type of fire and other bows for the other type of fire but we can ignore that.)

    Use Notepad++ to edit your mod files (not your vanilla game folder!) and use Winmerge to compare vanilla files to mod files and you will see changes that modders have made. Modders files are in steam/steamapps/workshop/content/33420/######### where the hashes are the mod number: this is if you have downloaded a mod to your PC.
     
    Last edited: Feb 17, 2018
  15. (OC)Fotheringill

    (OC)Fotheringill Active Member

    Ftoomsh-

    You need to be introduced to books with salacious pictures annotating the text.
     
    Ftoomsh likes this.
  16. Ftoomsh

    Ftoomsh Well-Known Member

    I only read those books for the pictures.
     
  17. (OC)Fotheringill

    (OC)Fotheringill Active Member

    In my early youth, I had no idea Playboy magazine even had articles.
    Shortly thereafter, and when other magazines became popular and had very short "fantasy" stories, I wrote several and submitted them. They were all rejected. I spoke about the rejections with my mother who advised me not to worry about it, to not get depressed over it and that I should look at the bright side in that a dirty mind is its own reward. I am one of the richest men on earth.