User Tag List

Results 1 to 9 of 9

Thread: Combat Odds Calculation?

  1. #1
    No Products Registered

    Join Date
    Mar 2010
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Combat Odds Calculation?

    Is there an object that will perform calculations such as odds for a Combat Results Table?

    I designed a Combat Results Table and a die roll; however, in order to use the table the player would need to manually calculate the odds (not very effective).

    Therefore, is there an object that would perform the calculations or a way to have the game perform the math and display the odds in a string or something...anything?

    Comparing two values does not work because it does not calculate odds nor does it take into account that several units may be attacking not to mention close air support, artillery, and terrain modifiers.

  2. #2
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Combat Odds Calculation?

    Yes its possible. You would be best to do it with fastloops and loop through each variable in the calculation.

  3. #3
    No Products Registered

    Join Date
    Mar 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Combat Odds Calculation?

    Comparing two values does not work because it does not calculate odds
    Can't you just divide one value by another? Of course, that will give you a number with decimals, but I'd have thought that this can be converted into the odds without too much difficult.

    Along the lines of:

    Let Value C = A/B

    Where A is the attack factor and B is the defence factor

    If Value C is greater or equal than 1 and less than 2, let Value D = 1

    If Value C is greater or equal than 2 and less than 3, let value D = 2

    etc

    where D is the (unmodified) combat odds column

    Then you can perform simple additions and subtractions to value D to reflect combat odds modifiers such as terrain etc.

    I haven't looked into this properly yet, so I am just thinking aloud. But I assumed all this would be relatively straightforward. If there's one thing a computer can do it is arithmetic.

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Combat Odds Calculation?

    Of course it's possible, you just need to program in the same rules the player would be using.

  5. #5
    No Products Registered

    Join Date
    Mar 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Combat Odds Calculation?

    I have just been looking into how one might approach this, and I believe that the object you are best to use for calculations is the Special Conditions object (the very first box across in the events menu).

    The second action down is called "Change a Global Value", though in fact you can use it to set values, not just change them. If you click on "Set" then a box pops up that enables you to build expressions (equations) including basic arithmetic operations such as Add, Subtract, Divide etc.

    I would therefore create a series of equations for combat calculation. First you would have to use the Special Conditions object to add up the attack strengths of all the units involved in the attack, which would give you your first Global Value ("combined attack strength"). Then you would have to divide this by the defence strength giving you a second Global Value ("unmodified combat odds").

    Then you could create a series of events that compare the "unmodified combat odds" with round integer values, and use this to get rid of the decimals (again using the Special Conditions object). This would give you a new Global Value ("rounded combat odds").

    Finally you could perform basic Add and Subtract calculations on the "rounded combat odds" to provide you with your "final combat odds", needed for the CRT.

    This is how I would approach it (though I have not yet tried). Basically the Special Conditions object ("Set a Global Value" action) can be used just like a calculator.

  6. #6
    Clicker Multimedia Fusion 2Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2010
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Combat Odds Calculation?

    You can also do that in any counter, or alterable value of an object, if you don't want to worry about having mess in your global values.

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperiOS Export ModuleMac Export ModuleSWF Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JasonDarby's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    4,938
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: Combat Odds Calculation?

    You can also use a numeric array to store your basic combat table and then use the Expression Evaluator to do calculations on that.

  8. #8
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Combat Odds Calculation?

    I think the MMF2 Technical Manual on my site, under Projects, has formulas for Combat Tables.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  9. #9
    No Products Registered

    Join Date
    Mar 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Combat Odds Calculation?

    I would suggest the following as the simplest solution. Insert a new active object somewhere off map. You could call it the Combat Resolution Object or some such. Then, you can use that object's Alterable Value slots to store all the information you need for combat resolution: combined attack strength, unmodified combat odds, modified combat odds, etc.

    In the events editor, you would right-click underneath that object and then click on Alterable Values (Set). Up pops the expressions box that can be used for calculations.

Similar Threads

  1. Odds of a hit?
    By KLiK-iT in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 21st April 2012, 03:53 PM
  2. Making a Racing Game, and other odds and ends.
    By cchapeton in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 15th July 2010, 11:02 PM
  3. IA jeu de combat arcade
    By samcool_129 in forum File Archive
    Replies: 2
    Last Post: 30th June 2010, 12:32 AM
  4. Close combat
    By ZCKLEGEND in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 7th August 2008, 11:21 AM
  5. melee combat
    By jonboy7039 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 13th July 2008, 10:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •