Discussion in 'Modding' started by Ftoomsh, Nov 30, 2019.

  1. Ftoomsh

    Ftoomsh Well-Known Member

    OCMOD4 is an experimental mod, publicly available, done at the request of Daddio. The key features of OCMOD4 so far are;

    (1) No firing though friendly troops (same as the new OCMOD3).
    (2) Only the front 3 ranks of formations will fire (same as the new OCMOD3).
    (3) Formations changed to suit line tactics (same as the new OCMOD3).
    (4) NO upgrades at all in barracks, stables and depots (different from OCMOD3).
    (5) Slightly less upgrades in the Academy (different from OCMOD3).
    (6) Higher costs of military units as upgrade costs are removed (different from OCMOD3).

    What's the idea behind OCMOD4? The idea is to release the player from upgrade clicking and trading clicking (probably best played with no market). The player can then spend more time on military tactics, especially linear tactics and flanking which both become more important with the firing changes.

    Next Goals

    My next goals for OCMOD4 are first to prevent unit bunching, especially in attack, and also to prevent formation stacking. So far, I am having a lot of trouble understanding moveable unit radius and moveable unit collision in terms of how it is implemented in vanilla. As usual, the code seems to be spread all over the place in the scripts and there are obviously different rules for spacing and different rules for collision depending on units and unit situation. For example when units bunch in attack they act like they require no unit radius at all (or maybe just one pixel). Another example, formation spacing is not set by collision, otherwise other friendly formations could not be stacked on top of the first formation.

    Secondly, I will look at morale but first I would like to diminish unit bunching and formation stacking as much as possible without excessively affecting unit pathing, formation movement etc. Preventing even friendly formations passing though each other, for example, would be great, at least for close order formations.

    However, I am a bit stuck on these goals. I think I need some hints from better programmers. Help! :eek:

    I should mention that State vs Country has a great innovation to prevent player-ordered bunching in attack. The attack button moves the formation forward in correct formation shape and spacing even if the attack icon is clicked on an enemy troop or formation. Can I ask where and how in scripts this is implemented? This is a great improvement. However, it still does not solve (so far as I can tell) engine auto-attack effects when units are in attack range. This still generates bunching. I know the following question has been asked before, but I don't recall the answer. How does one turn off peace mode when in-game-editor testing State vs Country Plus?
    Last edited: Nov 30, 2019
    Loner likes this.
  2. Loner

    Loner Active Member

    This is exactly my thinking, my '19th Century Mod' has the same basics with no Barrack upgrades and limited Academy upgrades for the same reason you mention. If you want I can PM you what I have done so far for you to look at.;)
  3. Ftoomsh

    Ftoomsh Well-Known Member

    Sure, you can PM me. While a mod is still in test you can always put it on Steam as a private mod which gives access to Steam friends only.

    To me, it's important to work in no-fire-through-friendlies, anti-bunching/anti-stacking and morale/veterancy at some point. Because I am not a good programmer (just a parameter modder) I take a long time to figure these sort of things out. Or I have to copy ideas from other modders. Cavalli paved the way for no-fire-through-friendlies. I tested a different variant of his approach and came up with the idea (with helpful suggestions probably, I forget) of lifting the "y" origin of the shot just enough that ranks 2 and 3 could fire (over the heads of ranks in front while bfriendonline checking was happening.

    I've seen some great modding work done by accomplished programmers. It's always puzzled me that anti-bunching/anti-stacking and morale haven't received more attention. That's why I am hoping to get some hints in that direction to aid my search for the relevant routines. Ebel has sent me some files on a possible approach to morale in the relevant game engine. However, as yet I do not understand those files. Meanwhile, after getting 3 rank fire, I have fixed on bunching and stacking as in more desperate need of a fix. Bunching and stacking are bugs not features in my book. Morale is a nice to have add-on that may have to wait a bit... although whichever turns out easiest to fix will get done first. ;)
    Last edited: Nov 30, 2019
  4. Loner

    Loner Active Member

    I have no code writing ability at all, Awar has helped a lot, all I can do is delete what I don't need and art work to a reasonable, but not brilliant, standard.
  5. Ftoomsh

    Ftoomsh Well-Known Member


    This is still a work in progress. Here is the latest;

    (1) Most of the upgrades have been removed, even economy upgrades. The military and economy have been re-balanced to work without upgrades. Fine re-balancing will be ongoing.
    (2) Stables are a little cheaper and easier to get in 17th C. This means 17th C stables and cavalry numbers balance more sensibly with 17th C barracks and infantry numbers.
    (3) All Muskets (friend or enemy) now cannot shoot through any stone walls or buildings. Hat tip to General WVPM and Awar for helping me with this. Also to Ebel for unit box height data.
    (4) The AI is untouched as yet and has been broken by the extensive changes in OCMOD4. My intention is to finish the basic mod design, all other code and the balance testing before fixing the AI.
    There is no point in fixing the AI until the rest of the game is finished and balanced. Unfortunately, you can't game test this mod yet except in multiplayer (or in the game editor for plain tests).

    Ideas behind this mod are;

    (1) Remove the upgrades and change the focus to strategic and tactical management and coordination of formations of the army. (Almost finished removing upgrades).
    (2) Have realistic firing, with no shooting thru friendlies and no shooting through solid structures except wood walls, to enable more realistic tactics. (Substantially solved. Might need further tweaks.)
    (3) Prevent unit bunching and formation stacking (not solved yet).
    (4) Introduce a morale system (not solved yet).

    Please try it, if it sounds interesting to you.
    Loner and Awar like this.
  6. Ftoomsh

    Ftoomsh Well-Known Member

    I am thinking that OCMOD4 needs a peasant limit. However, I am also thinking that an absolute limit is a mistake. Rather, I would prefer to make the peasant limit about 15% (or even 10% if possible) of the population limit set in Options. For example, if a multiplayer game had a population limit of 5,000 set then the peasant limit would be 500 or 750 at the most. The idea would be to leave most of the population limit for troops. This would require re-setting peasant production rates of course. When full population is reached, the ability to support the army should be stretched to the limit. This would give a knife-edge criticality to keeping peasants safe and deter the use of them in fights away from base. No fire through friendlies also does that too. Peasants are less useful as bullet absorbers. To go along with that I would probably cap resource accumulation for Eu nations at 100,000 per resource except gold. Other nations would probably need different caps and even caps on gold as their economies and costs work differently. This sort of model would not support navies. OCMOD4 is really just a land battles mod. At most I would permit landing ships and gun-boats on water. Yachts are the closest thing to gunboats in vanilla.
  7. Ftoomsh

    Ftoomsh Well-Known Member

    Deleting what you don't need in upgrades leads to breaking the AI as I found out. The AI is not my priority yet but I tried a quick fix of the AI (just progresseconomicai.inc) but it was not as easy I thought it would be. I commented out all the references to TryUpgrade that I didn't need. I searched for logic where the AI depends on an upgrade to progress to the next stage and found what I could and dealt with it. Still the AI was broken and would not make more than 28 peasants. It would not make any military units and would not make a building past the barracks, on 5,000s start. I've put that issue aside for now. How has your mod affected AI?
  8. Loner

    Loner Active Member

    I didn't delete anything from progresseconomicai, it was just country.script and unit.script I was talking about, as far as I'm aware it hasn't had an affect on the A.I but I don't know for certain.
  9. Ftoomsh

    Ftoomsh Well-Known Member

    But you must have rewritten progresseconomicai to accommodate the new units. Otherwise, the AI would not produce them... or that's my guess.
  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