1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. To chat with the GameOgre community, you need to have at least 15 posts. Once you have the 15 posts, post at Become A New Ogre
    Dismiss Notice

any 1 can help me in battle system

Discussion in 'Online Game Development' started by rtkwar, May 31, 2011.

Thread Status:
Not open for further replies.
  1. shugo

    shugo Active Member Ogre Veteran

    Messages:
    2,092
    Likes Received:
    10
    Trophy Points:
    38
    Credit:
    14,250.21
    another way to avoid this, is to limit army size
     
  2. rtkwar

    rtkwar Member

    Messages:
    139
    Likes Received:
    0
    Trophy Points:
    16
    Credit:
    - 54.14
    you can make many things for give small players chance for win
    1-if you lost 400 planes and small player lost 100 we can divide this on 4
    you lost planes=rand(100,400);
    enemy lost planes=rand(25,100);
    thats mean your lost between 100 to 400 plane and same thing with enemy
    2-you can make emergency case too
    whats emergency case:if small player under attack he can use this option if he use this option his troops will be increase if he has 200 plane he will be have 400 plane
    but if he use this option he must sell all his factorys and spend all his money and factory not work for 3 days

    3-freeze city: in this option player can freeze his account in game for 1 month and no one can attack on him in this time

    4-support :small player can get support if he under attack


     
  3. rtkwar

    rtkwar Member

    Messages:
    139
    Likes Received:
    0
    Trophy Points:
    16
    Credit:
    - 54.14

    and you must remember that not all units can attack on all enemy units
    example:in world war2:
    in world war2 soldiers can't attack on planes but planes can kill soldiers
    not all soldiers can attack on tanks only bazoka men can destroy tank
    light tank or armour cars can't destroy heavy tank but light tanks and armourcars can kill soldiers
    whats make if you have 10000 soldiers and 100 bazoka men and enemy have
    2000 heavy tank and 1000 soldiers
    your soldiers can't destroy 2000 heavy tank you have only 100 bazoka men!!!
    and enemy can kill all your soldiers (how you solve this problem!!!!!!!!!!!!)
     
  4. shugo

    shugo Active Member Ogre Veteran

    Messages:
    2,092
    Likes Received:
    10
    Trophy Points:
    38
    Credit:
    14,250.21
    1- yeah that's a clever way of doing that, but the odds are still stacked against the big army
    2- I think would be a bad idea, because then you give big guy a chance to ruin the little guy's economy
    3- this could pose problems, what if that one frozen city blocks access on a map
    4- good idea, but very hard to script
     
  5. shugo

    shugo Active Member Ogre Veteran

    Messages:
    2,092
    Likes Received:
    10
    Trophy Points:
    38
    Credit:
    14,250.21
    yeah, don't have the answer for that one
     
  6. rtkwar

    rtkwar Member

    Messages:
    139
    Likes Received:
    0
    Trophy Points:
    16
    Credit:
    - 54.14

    iupload new version from my game world war2 today but ihave 2 problem:
    1-in market page how ican sure player input numbers only in text box thats code
     
  7. shugo

    shugo Active Member Ogre Veteran

    Messages:
    2,092
    Likes Received:
    10
    Trophy Points:
    38
    Credit:
    14,250.21

    you can't!

    that is why you have to filter them, when and where you get numbers or rather variables

    http://www.w3schools.com/php/php_filter.asp
     
    Last edited by a moderator: Nov 14, 2011
  8. shugo

    shugo Active Member Ogre Veteran

    Messages:
    2,092
    Likes Received:
    10
    Trophy Points:
    38
    Credit:
    14,250.21
    I found a solution for the battle casualties, in the case the two armies are quite unequal.

    The old way was to do this:

    For example the defender gets 50% casualties, then attacker would get: 0.5 * 0.5 = 0.25% casualties

    And this would give problems, because suppose the defender gets 90% casualties, which would give the attacker 0.9 * 0.9 = 81% casualties, which wouldn't be fair.

    What I did is this.

    If the loser casualties are more than 70% I check the total strength of all the armies in the battle. If the strongest army is at least 5 times stronger than the loser, then the solution is to do this.

    Code:
    if ($defendercasulaties >0.7){
    
    $envelopstrength = 5 * $defenderstrength;
    
    if ($attackerstrength > $envelopstrength){
    $attacker casualties = 1 - $defendercasualties;}
    
    }
    
    
    So now the attacker gets 10% casualties if the defender gets 90% casualties.


    But the great thing about this is that the attacker can still get high casualties if both armies are roughly equal in strength and the loser casualties are high (in this case it being the defender).

    I think it is simple but effective.
     
  9. rtkwar

    rtkwar Member

    Messages:
    139
    Likes Received:
    0
    Trophy Points:
    16
    Credit:
    - 54.14
    thanks , iwill try your new idea and iwill send to you my battle system too
     
  10. shugo

    shugo Active Member Ogre Veteran

    Messages:
    2,092
    Likes Received:
    10
    Trophy Points:
    38
    Credit:
    14,250.21
    hey, how is your site coming along?

    can you give me a link to your index page? That way I can add your site to my credits page.
     
  11. shugo

    shugo Active Member Ogre Veteran

    Messages:
    2,092
    Likes Received:
    10
    Trophy Points:
    38
    Credit:
    14,250.21
  12. Admin Post
    ogreman

    ogreman Ogre In Charge Staff Member GameOgre Admin

    Messages:
    37,225
    Likes Received:
    7,018
    Trophy Points:
    113
    Credit:
    16,208.51
    How is your battle system coming:)?
     
  13. rtkwar

    rtkwar Member

    Messages:
    139
    Likes Received:
    0
    Trophy Points:
    16
    Credit:
    - 54.14
    you want idea about my battle system ogreman?
     
  14. Admin Post
    ogreman

    ogreman Ogre In Charge Staff Member GameOgre Admin

    Messages:
    37,225
    Likes Received:
    7,018
    Trophy Points:
    113
    Credit:
    16,208.51
    Sure, what is it:)?
     
Thread Status:
Not open for further replies.

Share This Page