calculateAttack mal function

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • yamilrh wrote:

      yo implemente su steemnova/includes/classes/missions/functions/calculateAttack.php al 2moons y estab roto, no reportaba las batallas ni ganabas recursos ni nada..
      replace "SteemNova.php" (if you have DS Extension) or "SteemNova_array.php" (not recommended) as calculateAttack.php to get battle engine
    • короче если вы хотите нормальный расчет бо ... то надо делать сами..м не один изначально не предназначен для всего - допиливайте любой.. просто выберите один ...пофиг какой и делайте его сами.. не можете сами ...наймите кто может
      Делаю качественно в сроки! на любой версии moons, встрою, или напишу любой мод , но дорого! afire-space.com
    • No. Generally, the Ogame battle engine is not optimal. The bigger the battle, the more resources the server uses.

      It is possible (with a very large amount of frame, really big) to create a battle that will count for a month (there will be a lot of ships, and the processor will not be too efficient).

      PHP is not a fast language. Programmers (since version 7) try to speed it up and you can see it, because it is actually getting faster. But it will never be as fast as for example C++.

      So the battle engine based on PHP is very difficult to implement. We used the so-called "Data Structures" instead of "Arrays" to speed up the engine, but that's not enough. It seems to me (but I may be wrong) that we have reached the limit for PHP. It's best to rewrite the battle engine (to C++?), which allows for much more performance, or give up and develop OPBE.

      In SteemNova we do both things. That is why we have two battle engines and everyone can choose the right one.
    • well said.
      Is it possible to implement the battle engine in c ++ and connect it to php?
      I do not dominate the C ++ language at all; but a programmer who knows him can do it.
      How do I connect both languages?
      any advice?
    • php.net/manual/en/function.shell-exec.php
      This command ofc. works on VPS. On hosting (like 000webhost) you can't run applications.

      Or just upgrade this code:
      github.com/xetys/rapidcs

      It's PHP5 (I think) battle engine, external extension, so need to be upgraded to PHP7.3+

      The post was edited 2 times, last by fervi ().

    • mys wrote:

      Kaizoku wrote:

      is that steamnova result 100% same as speedsim?
      @Kaizoku, In steemnova I have rewritten combat engine completely. It is 100% same as speedsim/websim/ogame.Based on ogame.fandom.com/wiki/Combat. See my commits github.com/steemnova/steemnova/pull/50
      It is most accurate combat engine right now.

      However it has weakness if doing large battles. PHP is not good for large arrays, so calculating battles with over 500k units can take seconds. Up to minutes for million battles.
      looked calc code, why rapidfire shoots have so many random? if in battle 1 deaths star versus 200 light fighter s has a chance get in first round only 1 kill or 200 and small chance get a 1 kill in each round, ofc when u have more than 1 ship this random is leveled, but still
    • fervi wrote:

      @Kaizoku

      I was trying to find some engine optimization options. If you have any ideas, let me know.
      в этой боевой системе каждый корабль стреляет отдельно, т.е каждый выстрел каждого корабля калькулируется, что как по мне излишне. например если в бою 10000 легких истребителей будет считаться 10000 выстрелов. вы например можете если кораблей больше 1000 объединять их по 10 штук, если 10000 по 100штук, результат боя будет как бы усредненным значением, а не полной симуляцией каждого выстрела

      таким способом вы сможете симулировать даже миллиардные флоты

      The post was edited 1 time, last by Kaizoku ().

    • I understand. That's not how the Ogame engine works. Don't misunderstand me. I was thinking about such optimizations myself. But the more optimizations like that, the more we move away from the Ogame's results.

      That's why we support two engines in SteemNova - SteemNova and OPBE (we have a lot of bugfixes). Of course OPBE is a fast engine (that's why I like it), but it will never give as good results as in Ogame. Compromises.

      I personally hope that JIT in PHP8 will somehow solve this problem. Maybe another project that will go into the branch.
    • Of course the default version of OPBE need some optimizations BUT if changing functions at ShipCleaner, ShipType and PhysicShots class AND changing some values for the constants, it’s possible to get quiet good and realistic results. Opbe is kinda tricky but once you understand it’s structure, it’s worth using it

      I think it’s also very important to have REALLY balanced combat values for ships and defenses and the right rapid fires for a balanced fight.




      Look at this for example: github.com/jstar88/opbe/blob/m…bject/PhysicShot.php#L143


      If the shield value divided by the shield cell value (default: 100) is bigger than the damage, the damage output is always zero what is NOT right, especially if there are billion of units against 1 unit. At least this is how I understood the function.

      *Edit: I seen that SteemNova also bounces the damage in case it’s less than 1%. Anyway this is not realistic, for real, so fighting billions of low units vs 1 Death Star will result in a draw or even loose ? Not realistic :thumbdown:

      The post was edited 1 time, last by XenQen ().

    • fervi wrote:

      I understand. That's not how the Ogame engine works. Don't misunderstand me. I was thinking about such optimizations myself. But the more optimizations like that, the more we move away from the Ogame's results.

      это не будет сильно отличаться от огеймоской просто будет брать более менее усредненный вариант калькуляции, погрешность результата там будет минимальна - около 1%
    • someValue = 0
      ships = 1000000

      for(i=0; i < ships; i++){
      someValue += rand(1,2)
      }

      or

      NewSomeValue = 0
      n = ceil(ships / 100) - 1

      for(i=0; i < n; i++){
      NewSomeValue += rand(1,2) * 100
      }

      s = ships - (n * 100)
      for(i=0; i < s; i++){
      NewSomeValue += rand(1,2)
      }

      результат NewSomeValue ~ someValue будет практически одинаковым, но быстрее в сотню раз, или я ошибаюсь?

      The post was edited 1 time, last by Kaizoku ().

    • Если правильно все сделать вы можете проводить бои с миллиардами кораблей за такое же время как и бои с тысячью кораблями, и с таким же результатом
    • подумайте миллион раз добавлять по 1 к сумме или 100 раз добавить по 10000 результат будет тот же но время потраченное будет отличаться в 10000 раз
    • XenQen wrote:

      Of course the default version of OPBE need some optimizations BUT if changing functions at ShipCleaner, ShipType and PhysicShots class AND changing some values for the constants, it’s possible to get quiet good and realistic results. Opbe is kinda tricky but once you understand it’s structure, it’s worth using it

      I think it’s also very important to have REALLY balanced combat values for ships and defenses and the right rapid fires for a balanced fight.
      It's possible. Unfortunately, despite the OPBE (GNU AGPL) license, no one is releasing the code of their fixes. This is a big problem, because instead of creating something good (and legal) - everyone has different bugs in the game engine.
    • There is a problem in number of shoots while grouping units. A group of 100 units hits once instead of 100 times - even if it hits 100 times more powerful.
      Also when we try to hit grouped enemy, we hit only one and always the same unit in a 100, instead of diving our attack power over 100 behind.
      The bigger the group is, the combat result difference grows to classic engine.
    • mys wrote:

      There is a problem in number of shoots while grouping units. A group of 100 units hits once instead of 100 times - even if it hits 100 times more powerful.
      Also when we try to hit grouped enemy, we hit only one and always the same unit in a 100, instead of diving our attack power over 100 behind.
      The bigger the group is, the combat result difference grows to classic engine.
      цель атаки тоже будет группой кораблей, с общим количеством хп, вы можете добавить например количество оставшихся выстрелов и если после выстрела вся группа уничтожается и остаются выстрелы найти нового врага и стрельнуть по ним
    • mys wrote:

      There is a problem in number of shoots while grouping units. A group of 100 units hits once instead of 100 times - even if it hits 100 times more powerful.
      Also when we try to hit grouped enemy, we hit only one and always the same unit in a 100, instead of diving our attack power over 100 behind.
      The bigger the group is, the combat result difference grows to classic engine.
      цель атаки тоже будет группой кораблей, с общим количеством хп, вы можете добавить например количество оставшихся выстрелов и если после выстрела вся группа уничтожается и остаются выстрелы найти нового врага и стрельнуть по ним
    • а в функции explodeAndDestroy вы можете постараться съимитировать распределение выстрелов по разным кораблям внутри группы

      так же помимо рандома в скоростреле в этой боевке как я понял корабли могут выстрелить по уже уничтоженному кораблю

      PHP Source Code

      1. $victimShipId = rand(0, count($defender['units'])-1);
      2. $victimShip = &$defender['units'][$victimShipId];
      поэтому не вижу смысла стремиться к полному соответствию к боевке огейма, когда она не столь идеальна как кажется