Tangler Discussion Forums

Discuss

Topics

Click a Topicto start discussing

    Hi all, ever wondered if your 8 light infantry guys holed up in the mountains have any chance at taking out that pesky 1 unit heavy tank down in the valley?  Well, according to the WeeWar Battle Simulator, they have a 20% chance.... so go for it!

    I've wanted this kind of tool for a while and finally decided to hack it out.  I'm not much of a programmer, so I implemented it all in Excel.  It allows you to select the unit and terrain type, then hit go and you can watch the battle simulations unfold before your eyes.  At the end, you get a nice graph of the possible outcomes (see below).  The calculations are done in a macro, so when you open the Excel file and get that warning, don't worry it's not a virus... I promise. Smile

     

    Another nice feature is that all the unit attack and defense stats are right there on the spreadsheet (which I pulled straight from http://weewar.com/specifications).  This way, it is easy to tweak these values and see the effect on the outcome.  I think this would be useful in figuring out how to rework some of the unit stats to achieve more balance as has been discussed extensively in the Piffle thread.

     

    Anyway, it's mostly just for fun... just promise not to use it against me in battle!

    12-1-07 Update: New Version 3.0 here

     

    Also, one minor "bug" (i.e. I'm just lazy)... it doesn't take into account range of attack.  So, for instance, if you pick to attack something with an artillery, it will show the artillery taking damage as well.  You just have to know if that is going to really occur or not.

     

    2007-10-25 23:33:40.0

    Writing that kinda stuff in Exel? Man thats HardCore! Cool

    anyway, might turn out to be usefull
     

    2007-10-26 02:36:35.0

    Pluto: Awesome.  I haven't tried it, but I know that such a thing is a great tool.  But... EXCEL? ;)

    2007-10-26 06:22:10.0

    Any chance or hope of you porting it to ... anything else? :)  Such as an online webpage.

    2007-10-26 06:23:23.0

    I can take what he has done and do it has a flash-based calculator. Can someone hosted?

    2007-10-26 07:27:19.0

    Hehe, yeah, I was kinda embarrassed to post it here with all you serious programmer types here. Tongue out  But unfortunately Excel and visual basic is about the extent of my programming prowess.

     

    Anyways, it's very easy to use and probably faster than a webpage ??
     

    2007-10-26 08:30:03.0

    Well I'll take a stab at creating it as a flash application, and if no one can hosted then I'll provided it as an AIR app.

    2007-10-26 08:48:11.0

    madmike: I can host.

    2007-10-26 10:19:41.0

    hey madmike, once you get a rough draft, can i see the code?  I'd like to help... I can probably figure it out once it is started.

    One thing I'd like to do next is to integrate support for the bonus you get with multiple sides/artillery attacks.  I was going to do that in the Excel version, but I can hold off for the flash one though.

     

    2007-10-26 11:28:56.0

    Hey, don't knock Excel. Surprised

    I started working on something very similar to this back when we first started trying to understand the combat system but gave up in frustration when none of the values and formulas provided on the specs page made sense.  Now with the updated specs page, I'm glad to see things actually work out correctly.  Smile

    As an upgrade, version 2.0 of this sheet should take into account the simultaneous attack bonuses.


     

    2007-10-26 16:46:10.0

    As an upgrade, version 2.0 of this sheet should take into account the simultaneous attack bonuses.

    and terrain effects

    ..unless I just missed the part that lets you enter terrain info
     

    2007-10-26 16:50:17.0

    @Super-King,

    terrain effects are in there: cells B4 and B7 for attacker and defender, respectively.


     

    2007-10-26 17:37:46.0

    So it is.. and in such an obvious place as well.. I must be blind.

    Just ignore me, I'll go stand in the corner out of the way ;)

    2007-10-26 19:11:40.0

    small update.  There was a small bug where the bonus effect wasn't being added into the battle simulation

    New version available.

    2007-10-28 16:14:53.0

    The tool is nice and works. I only have one question:

    Why don't you calculate the outcome instead of trying it out? Its just statistics and (at a first glance) solvable.

    2007-10-29 04:16:15.0

    Thanks.

    I agree with you.  But there are two reasons for actually running the simulations:

       - math has never been my forte, especially statistics

       - I think it's fun to see the probable hits accumulate on the screen Laughing

     

    If anyone cares to provide the appropriate equation for calculating the statistics, I can incorporate that in.
     

    2007-10-29 12:06:26.0

    I have to agree with the fact that seeing the graph-bars race up to their eventual positions is fun. XP

    2007-10-29 15:18:18.0

    Pluto - you want to make sure the first post of this tread has the last version too, otherwise we have to scroll mid-thread to find the 1.1. That thread will reach the Marianas over time, so it will be useful to always have the last version in the first post.

    2007-10-30 00:24:25.0

    Import it into Google spreadsheets, then share it to those that haven't got, or dont want to use excel.

    2007-10-30 04:13:27.0

    Oh hai, BTW, good work

    2007-10-30 04:21:56.0

    thanks hugobrain, good idea.  post now updated.

     

    humphammer, i thought about google spreadsheets, but it doesn't support macros at the time.

    a flash version is in the works.
     

    2007-10-30 08:37:54.0

    Hi Folks, due to popular demand, I hacked out a Flash version of the Weewar Battle Simulator.  It has a new shiny GUI, faster throughput, and faster calculation times... all in your browser.  However the current version does not yet support bonus effects or capturing units.

    It is pretty easy to use.  Just click on the unit type, number, and terrain for the attacker and defender, then hit BATTLE!  It will output the probabilities of the battle outcome in terms of units left over at the bottom.

    Have Fun!
     

     

    You can access it here.

     

    Screenshot:



     

    2007-11-02 20:53:41.0

    Hm... doesn't seem like the server is responding?

    2007-11-02 21:31:33.0

    looks like they are doing server maintenance now... I guess try again later.


     

    2007-11-02 22:22:46.0

    If you get continued problems, I can offer to host it.

     

    2007-11-02 22:24:21.0

    seems to be scheduled maintenance... should be done by 2am EST

    2007-11-02 22:32:44.0

    Wow much better then in Excel. Awesome!

    Feedback: font for X on unit stats (re. unit: X / number: X / terrain: X) could be bigger. Barely seeable now for poor eyesight like mine. I should send you some soundfiles... =) KaBoom!

    2007-11-03 00:48:54.0

    Excellent work, Pluto.  I think I shall be using this.:)

    2007-11-03 05:45:41.0

    Bookmarked and now on my bookmark toolbar, right next to the one for Weewar itself XP

    (and already in use for strategisement)

    2007-11-03 09:08:49.0

    thanks guys, glad you like it.Laughing

    hugobrain... i'll work on larger fonts in the future, but for now try right-clicking and zoom in.  hopefully that's a quick fix.

     

    2007-11-03 09:27:53.0

    great. will be trying it out shortly

    2007-11-12 08:44:36.0

    you might wanna disable certain situations, as 6 zerks on a mountain vs 10 battleships on a forest....
    the prediction does indicate that nothing happens, but you know....some geek might still sue you.

    erm, I might be pushing it right now, but anyone willing to write a greasemonkey script that will calculate all that and tells me the most likely outcome if I attempt to attack in the game? THAT would be ace!

    But this is already very useful! No criticism intended....



     

    2007-11-12 09:06:03.0

    yeah, the thing is i just took the stats from the weewar stats page.  so even though, for instance, hard units are not allowed to enter the mountains, it has a negative effect on their defense and attack stats (same goes with water units on land).  I guess I could just hard code in the stats as being like +99 defense so they won't take any damage in that type of scenario.  Otherwise, it is kinda cool to say... hmmm... what if i have two battleships going at it in the mountains! Laughing

     

    I thought about the GM approach, but I think it would be hard (at least for my skills) to implement an elegant solution.  The thing is, a skilled player doesn't really need the simulator, except on rare occasions.  So, you don't really want a simulator always in the way.  Anyways, it might be fun to do!
     

    2007-11-12 10:53:45.0

    I considered writing a greasemonkey script to do this.  The display could be hidden until required, so it wouldn't get in the way. It would be pretty easy for the most part, but for some reason the math keeps kicking my ass.  I tried the Excel spreadsheet, but OpenOffice Calc didn't like the macros.  I tried creating a spreadsheet of my own using the formula on the stats page, but I must be missing something because my results weren't anywhere near useful.  I'll probably attack it again when I'm bored and less sleepy.

    Anyone who'd like to help is guaranteed to be the first beta tester.:)
     

    2007-11-12 11:15:52.0

    hey straind, i can put up the code from my flash file to help you with the math.

    2007-11-12 12:49:45.0

    That sounds good.  I'm working on a few projects right now and I'm trying to limit my weewar activities to only 20 hours per day.  After all, I need to sleep sometimes.

    2007-11-12 20:43:06.0

    perfect would be: I select one unit, then move or whatever, but when preparing for attack, as in the red hexagon appears, then there could be a note somewhere, telling me the outcome. no popup which you have to klick of course. I have my inspiration from heroes of might and magic 4, in which it telles you the range of units you'll be killing. I agree, mostly its unnessassary, but on rare occasions I sit there thinking should I or should I not? These are tyhe times that now your simulator will save me some time ... and losses.

    Btw: just to make it look nicer, how about giving the units on the right, the defender a different color? now everything is just red. no practical reason however.

     

    2007-11-13 06:38:12.0

    on rare occasions I sit there thinking should I or should I not?

    On those occasions I hit the bookmark to the simulator and plug it in by hand :P

    2007-11-13 15:02:55.0

    actually, now that I have such a simulator I catch myself using it more often than I anticipated

    2007-11-14 03:59:40.0

    Um for some reason, the simulator is always returning 100% chance of 0 survivors for both sides, no matter what I pick.  What gives?

    2007-11-14 18:11:06.0

    pistos, make sure you have all the fields filled in (unit, number, and terrain) before hitting "BATTLE"  that should do it

    2007-11-14 23:17:21.0

    terain is not actually necessary I think. But the numbers I forgot at start...

    2007-11-15 02:41:23.0

    Ah, whoops, I didn't put in the number of units.  No wonder. :)  Thanks, Pluto.  You may consider having it default at 10.  As well, if maybe you could highlight or box the selected items.

    2007-11-15 06:27:38.0

    hmmm, yes highlighting is a good idea.  thanks.  i will work on that one.

    2007-11-15 08:34:47.0

    erm, again, maybe I am pushing it, but How hard would it be to include multi attack bonuses?

    Also, maybe you could have some defaults when you start the thing? numbers:10 like pistos suggested, terrain: grass....


     

    2007-11-16 05:13:54.0

    hey Pluto, I'm a flash geek - let me know if you want some help with the interface to make it more in-game-weewar-like;)

    seriously, message me or something
     

    2007-11-20 19:56:26.0

    this has really shaped up! Excellent tool. See it in a weewar.com/tools section near you soon!

    2007-11-21 03:01:21.0

    I got one question: If you calculate one thing, and you klick battle again, the result changes. not significanyly but the same setaup still produces different results. Is that normal?

     

    2007-11-21 09:14:04.0

    Happens for me too

    2007-11-21 12:41:57.0

    Why when a heavy art attacks a heavy tank does the heavy art take damage?

    2007-11-21 13:12:31.0

    to streen, yes that is normal.. when weewar calculates a battle, random numbers are used in several places, so to get an accurate simulation of the outcome, my simulator performs 10,000 such calculations per scenario you pick.  I chose this as a tradeoff between speed and accuracy.  If you perform 1 billion (pinky finger to mouth) calculations, then your results would be more consistent and accurate, but the extra time it would take is probably not worth it.

     
    to winter - Currently this version does not support range… meaning that if choose to simulate an attack between an artillery and a tank, for instance, the simulator will show them as both taking damage. You just have to know that if an artillery is out of range of the tank, then it will not actually take any damage and vice versa.

     

    defbyte, thanks for the offer, may take you up on it later!
     

    2007-11-21 14:49:46.0

    right on PLuto, lemme know!

    2007-11-21 17:41:32.0

    Hm.  Good thing to [only now] be aware that this thing actually does n rolls of the dice.  I thought it calculated everything deterministically.  I may have to whip something up...

    2007-11-22 09:54:48.0

    actually, this was brought up earlier in the thread... and I still think that on the back end, yes a deterministic calculation is more elegant, but on the front end there really is no difference.  It might account for a few percentage points here and there, but nothing that would really affect your decision making.

    2007-11-22 16:03:05.0

    Hey Pluto, I just found out about this tool recently and I just wanted to tell you thanks, it's really awesome.  You can be my wingman anytimeTongue out


    I look forward to the next version.
     

    2007-11-28 20:11:40.0

    Excellent!  Thanks for your comments.:)

    2007-11-28 20:34:02.0

    I've actually been working on the next version for a few days now.  I hope to finish it up in another day or two.

    Stay Tuned!
     

    2007-11-28 20:36:21.0

    Love it!Laughing

    2007-11-29 08:48:45.0

    Ok, here's the latest version: 3.0 ready for testing before I update all the links and such.  Let me know what you think

     

    New features:

    • supports capturing units
    • supports bonus effects
    • larger display of battle units
    • larger display of battle outcome
    • bonus calculator


    Hopefully these new features are relatively intuitive to use, but I'll add some instructions later.

     

    Happy Simulating!

     

    2007-11-30 00:25:30.0

    I like that there are 2 different colours for units now and that they are also included in the results. reduces ambiguity.

    I like default grass, but could I convince you to include a default of 10 for unitcount?

    I like the display of what you selected.

    bonus calculator looks funny, but not sure if its that usefull. and the total bonus part I dont understand. whatever I do its always on 0.

    Overall, good job.
     

    2007-11-30 04:46:00.0

    Looking great Pluto, awesome work.  Weewar is down right now, but can't wait to test it out against you.:) LOL.

    2007-11-30 07:54:57.0

    Very good work Pluto!

    2007-11-30 08:00:14.0

    it's very slick.  Took me a couple tries to figure out the bonus but I think it's implemented well.  Nice work, Pluto.

    2007-11-30 23:36:15.0

    Thanks for the comments.  Streen, that was a good idea to make the default unitcount set to 10.  I also added another little feature to let you set the unitcount to the most probable battle result.  And I added some instructions to explain the bonus calculator.

    And I added some code to ban your IP from using it, iPharted! Wink
     

    2007-11-30 23:53:39.0

    No wait.  I meant use it on someone else! Tongue out

     

    2007-12-03 06:33:45.0

    very good, I like the new changes. +2 for the default unit value idea

    2007-12-04 19:28:13.0

    There appears to be a problem with your statistics. According to them, a 10, DFA on plains attacking a 10, reg infantry that is capturing a base has a 100% chance of killing it. But I have found on multiple occasions that this is not the case and the infantry often survives with 1hp left.

    2007-12-05 12:44:07.0

    I was under the impression that the simulator just sends a large number of requests to the servers for the battle scenario in question then averages the results..

    2007-12-05 14:35:08.0

    hence how you can get 1 or 2 percent changes by clicking "Battle" repeatedly

    2007-12-05 14:35:33.0

    aRkayy: I am aware of this discrepancy and have been trying to figure it out.  It seems that when simulating any attack on a capturing unit the results are slightly skewed by about one hit point.  All other types of attack simulations appear to be accurate.

    The simulator actually does all the calculations internally based on the unit stats and formulas on the weewar.com/specifications page.  So there is either a slight error in my calculations, or there is another unpublished stat regarding capturing units, but probably the former.  I will continue to look into this and have a fix in the next few days.
     

    2007-12-05 15:24:20.0

    We are looking into this from our end, too. (thanks for  the email with all the details!)

    2007-12-06 07:36:11.0

    I am wondering: Would it not be better/easyer to feed the formula with the maximum values and again with the minimum values and take it from there?

    I mean, the randomness must come from somewhere, I guess 1 variable. How about using the lowest possible and the highest possible values and build up probabilities from there? Would that not be easyer than running the same formula 10.000 times?
     

    2007-12-06 07:38:52.0

    hey alex, thanks for looking in to it.

    streen, i'm not sure what you mean by feeding values into formulas, but running the same formula 10,000 times or greater is actually quite easy when you make a computer do it for you. Smile

     

    2007-12-06 09:37:49.0

    As I was commenting earlier up, it should be possible to determine a probability distribution entirely by calculation, without having to run any trials whatsoever.

    2007-12-07 07:07:35.0

    so what could be the story with the probability discrepancies?  Does the game code utilise a different formula than the published one?  I'm noticing too many high-variance outcomes of battles, such as DFA-10 vs. DFA-10 on grass terrain and one or both will wind up with 1-strength when the sim tells me both will die 100% of the time (regardless of how much I run the Battle button)

    2007-12-09 18:48:59.0

    Hi Warmech, thanks for bringing up that scenario, I was not aware of it before.  It seems like it is related to the situation mentioned above with DFA's vs. capturing infantry.  In both of these cases, I don't think it relates to different random number generators (although that might account for some minor discrepancies in other battle scenarios; and that was a cool article by the way).  I will try to explain:

    According to weewar.com/specifications, here's how a battle goes down:

    • first you need to calculate the p-values for both units.  For DFA vs. DFA, each unit will have a p-value of 1.0 (0.05 * (((14 + 0) - (4 + 0))+0) + 0.5).
    • Next you compare the p-value to a bunch of random numbers between 0 and 1.
    • If the random number is less than the p-value then it counts as a hit.

    So basically, if you have a p-value of 1 then every hit counts, and you are guaranteed to decimate your opponent.

    For a DFA vs. a capturing infantry the same is true.  The DFA get's a p-value of 1.1, but is capped at 1.0: (0.05 * (((16 + 0) - (4 + 0))+0) + 0.5).  So, here again it makes sense that the DFA should totally wipe out the capturing infantry.

    But, as we know, this is not what happens in the game.  I emailed the developers last week to try to figure this out, but I haven't heard back from them (presumably they are working on the server issues which is definitely a more pressing issue).

     

    So, if you've read this far, here are my theories:

    • The attack and defense stats are modified in certain battle scenarios which are not fully disclosed on the specs page.  By playing around with the stats I've figured out a couple of ways that can mimic the true battle outcomes, but again I'm still waiting to hear back from the devs on this.
    • OR (and this is something I just thought about while re-thinking about random numbers)... The specs page says that p-values are compared to random numbers "between 0 and 1."  I originally took this to mean numbers that go from 0 to 0.999999....  Well, by playing around with my code, if you actually use numbers between and including 0 to 1 AND you cap the random numbers to only one decimal point (i.e. your randoms are: 0, 0.1, 0.2,... 0.9, 1.0), then you can also mimic the observed battle outcomes.

     

    So, until I get some clarification from the developers, it's good to keep in mind that the simulator has some limitations.  Thanks for all your interest!

    2007-12-10 00:31:31.0

    Pluto: DFA vs. Cap'ing Unit "(0.05 * (((16 + 0) - (4 + 0))+0) + 0.5)"

    Okay, this may have already been mentioned (and it doesn't deal with DFA vs. DFA issue), but shouldn't the Td value, for a capturing trooper/H'craft be +2?  One thing is, in playing aroudn with your sim program, I've noticed that I get different results from when I have a trooper capture a base vs. changing it to capturing a grassy field (or swamp, etc) while being attacked by something like a 'Zerk or a Battleship that doesn't insta-kill like DFA.  Unfortunately, this still results in a p=1 so it doesn't really dispute anything, but I wanted to make sure there was some consistency with the discussion and the sim.

    Before I got as far as the discussion on decimal places, my mind was already going there.  You mentioned the random number being between 0 and 1 but I was thinking, "yes, but including or excluding?"

    I've often thought that, in some battles, the variance gets mad-ridiculous.  I agree with your theory about 1 decimal spot and including the 0 and 1 in the range explaining a lot, since it would be possible (but somewhat improbable) for a lot of crazy results to happen when the RNG rolls a lot of 0's and 1's.  But with all the battles taking place in a game, that sample size leaves a lot of room for crazy runs of improbabilities.

    It is also interesting that, assuming this is the correct way to interpret the rules, that if the tie between the RNG and the P-number went to the attack instead of the defense, we'd eventually see 'Zerks and Battleships get knocked out by L-Troopers. Tongue out

    <Word-Nazi Alert> "decimate" means to reduce by a tenth.

    2007-12-10 02:41:43.0

    sorry, for the DFA vs capturing infantry, that should have been (0.05 * (((16 + 0) - (2 + 2))+0) + 0.5) - still the same p-value.

    also, when considering the RNG range, capping at once decimal point is necessary to increase the probability of getting a 1.  Otherwise it does not matter if your range includes 1 or not, because if you go out to two or more decimal points the battle outcomes are virtually the same than if you don't include 1.  Nonetheless, capping at one decimal point still gives you a pretty wide (3-4) battle outcome hit spread.

    I was wondering if someone would pick up on the decimate. Wink  I'm actually a Roman history buff and it was a subtle play on words considering that the battle in question was a 10v10.  I'm weird like that.



     

     

    2007-12-10 05:43:11.0

    i gotta run now, but i will reply to your other points later


     

    2007-12-10 05:59:46.0

    Here we go again with undisclosed formulae and calculations. :P

    Count my vote for the devs to just copy and paste their combat function(s) source code into a public post.  I don't see how publicizing these things will: make the game worse; eat into their potential income; infringe on anyone's privacy or security.

    Weewar users (and third-party devs) have been shooting in the dark for long enough, I say...

    2007-12-10 06:56:02.0

    So.. Pluto wrote this:

    According to weewar.com/specifications, here's how a battle goes down:

    • first you need to calculate the p-values for both units.  For DFA vs. DFA, each unit will have a p-value of 1.0 (0.05 * (((14 + 0) - (4 + 0))+0) + 0.5).
    • Next you compare the p-value to a bunch of random numbers between 0 and 1.
    • If the random number is less than the p-value then it counts as a hit

    Pluto, when you do your random numbers do you ever get a 1? Or are you only looking for numbers between 0 and 1 but not including them?

    It'd be nice to have the source code for both your combat and the official weewar code to compare them.

     

    2007-12-10 12:39:17.0

    Pluto, "also, when considering the RNG range, capping at once decimal point is necessary to increase the probability of getting a 1. Otherwise it does not matter if your range includes 1 or not, because if you go out to two or more decimal points the battle outcomes are virtually the same than if you don't include 1.  Nonetheless, capping at one decimal point still gives you a pretty wide (3-4) battle outcome hit spread."

    This was my understanding of your theory.

    As I said, this certainly fits the results I've seen, in terms of having odd streaks of crazy variance.  Just out of curiosity, how long does it take you to recode the Sim?  It would be interesting if you could quickly make a side-version of the sim that runs off the 1 decimal place + including 0 and 1.0 rolls just by swapping out a couple lines.

    2007-12-10 15:20:56.0

    Something I just noticed from the Spec's page: "For each sub unit of the attacker six random numbers (r) between 0 and 1 are generated. For each r < p a hit is counted. The total number of hits divided by 6 is the number of sub units the opponent loses during the attack."

    Have the dev's ever revealed how the fractions that will result from this are rounded?

    2007-12-10 15:42:17.0

    Here here, Pistos.  A little more disclosure here would be nice.

    Winter, that is a good idea.  I'm posing my code at the bottom.  Maybe the devs will follow suit.  In this case, Math.random() returns a number n such that 0 <= n < 1.  To get 0 <= n <= 1, with n capped at one decimal point, I use: Math.floor(Math.random()*11)/10;

    WarMech, I just round those results but I'm not sure differences here can account for the discrepancies.  Also, it's not too difficult to change up my code, so here's a little toy to play with where you can change the decimal capping of the RNG.

    Ok, here's the code:

    function runHitSim(pValue:Number,atkNum:int,defNum:int):int{
        var defenderUnitLoss:Number = 0;   
        var randNum:Number;   
        for (var attackerSubUnit:int = 1; attackerSubUnit <= atkNum; attackerSubUnit++){       
            var attackerHits:int = 0;       
            for (var h:int = 1; h <= 6; h++){           
                randNum = Math.random();
                //randNum = Math.floor(Math.random()*11)/10;           
                if (randNum < pValue){
                    attackerHits++;
                }
            }       
            defenderUnitLoss += attackerHits / 6;
        }   
        var defenderUnitsLeft:int = defNum - Math.round(defenderUnitLoss);   
        if (defenderUnitsLeft < 0){defenderUnitsLeft = 0}   
        return defenderUnitsLeft;
    }
     

    2007-12-10 20:05:41.0

    Rounding: My point about this is that it can make a difference how they may round (if they do at all)  If there is standard rounding, it would fit yours, but if not we could see a lot more of the strange variances.  For example, if every decimal is rounded up, we would see 1 hit out of 60 cause 1 damage.  Alternatively, if all decimals round down we would see the case with the DFA vs. DFA winding up with 1 left more often, right?  You'd only need 1 miss out of 60, which would make finding this result running a p-value of 2 decimal places a lot more common.  I'm just saying, it could be a possibility.

    After today I'm thinking that there are some bugs that may account for some of the strange results, lately.  I just got through a game where I had an enemy 'Zerk strenght of 7, I fired on it with DFA-10, which resulted in it being reduced to 4, which is terrible luck but it happens.  Then I attacked with a 'Zerk-6 to his 'Zerk-4 with a bonus of +2 from previous attacks and it did the thing where the battle results said one thing and quickly switched to somehting else.  Final result?  Both 'Zerks at 3 (!!!).  I don't think there's any theory of how the battles are calculated for that kind of result to ever happen.  I was getting bizarre results like that all of that game (this was the one where, earlier, DFA-10 vs. DFA-10 resulted in one dying and one living... obviously mine died Undecided)  Anyway, thought I'd mention that as it may be that some of these crazy-variances may go away as the Dev's close in on whatever issues are happening.
     

    2007-12-10 20:24:58.0

    I think you are on the right track and this has to do with rounding / capping. But I am not the right person to answer this, Unfortunately I am the only one with a moment to spare while we are busy trying to fix the current issues (so sorry!).

    As soon as things are back to normal we will follow up on this!

    2007-12-11 04:20:43.0

    Alex, thanks for checking in.  The current issues are definitely more pressing, but we look forward to your input when you get the time.

    WarMech, that is certainly a weird result for the zerk 6 vs. 4,  Maybe it's related to the current game issues.  And I agree that if there is rounding up that could definitely change things, but I guess we'll have to wait to see what the devs have to say.
     

    2007-12-11 06:45:12.0

    I just saw that bug you mentioned, WarMech.  I attacked a capturing infantry (10) with a DFA (7) and the result popped up first as DFA-7, inf-4, then less than a second later: DFA-7, inf-3.  I'm not complaining Laughing  but that sure is weird.

    2007-12-11 08:27:23.0

    happened to me as well. seeing 2 different outcome and the second one is the one that prevails I would say its certainly related to the recent slowness issues

    2007-12-11 11:07:14.0

    I've seen some odd battle happenings - where I attack, results screen pops up, I ok it, then it pops up again with a different set of results. Only happened once or twice, and amid a lot of lag (maybe my frustrated multiple clicking buggered something up Innocent)

    2007-12-11 11:43:42.0

    SK- I saw the same thign while clicking madly.  I thought I'd managed to get a double attack some how.

    It actually shows up in the replay, you see the unit get hit twice.

    2007-12-11 20:22:55.0

    Yeah, my whole point talking about the double-result-last-one-counts bug is just to point out that we need to be careful figuring out the simulator discrepancies right now because occasionally we're going to get results due to a bug instead of the normal result from the code.

    2007-12-11 22:22:10.0

    that being said, I do still believe there is a true discrepancy going on that is not bug related

     

    2007-12-11 22:22:59.0

    Alex: Yes, thanks for checking in on the thread.  Having the source code for the battle calculations would be most satisfactory.  :-9:)

    2007-12-12 10:13:08.0

    Pluto, you are right. Random numbers are calculated in discrete values between 1 and 100 ( 1,2,3,4,5..., 99,100 ). But the equasion uses a lesser than (<). Due to the fact that the p value is capped at 100, there is always a 1% chance to miss for each roll of each subunit. If there is one miss in 60 rolls then there are only 9 sub  units destroyed.

    We think about changing the operator to <= ... so fights with a p value of 100 would always result in 10 destroyed subunits. What do you think ?

    Another balancing patch is in the queue and the specs will be updated along the way.

    2007-12-13 08:59:03.0

    My opinion is that I think, at the very least, it shoudl be consistent.  If there's always a 1% possibliity of a unit surviving, the code should also give a 1% chance of killing a unit, so like if a trooper attacked a 'zerk, every once in ahwile he should get a hit

    that being said, I'm well-known for being anti-variance so I would personally prefer the option you recommended.

     

    2007-12-13 16:00:01.0

    Hi Bert, thanks for your comment!

    So, I understand that you multiply your p-values by 100 and compare that to random numbers of 0 < n <= 100.  This seems to have the same effect as what I described above with capping the random number to two decimal units.

    Then when you say: "If there is one miss in 60 rolls then there are only 9 sub  units destroyed,"  I take this to mean that you are rounding down... i.e. 59/60 rolls = 9.8 hits = 9 units destroyed (whereas I was doing standard rounding, so 9.8 hits = 10 units destroyed).  After thinking about it, I guess this makes more sense since you can't really destroy 0.8 units of something...

    These two fixes are also actually the best fit to the empirical data that I have collected... compared to the old version, or the one decimal point capping that I described above.

    So, unless I am missing something I will go ahead and make these changes and roll out the new version.

     

    2007-12-13 21:50:32.0

    Alrighty, the old version is now updated, at the same URL..  Also, check out this toy for comparing how far you were off with the previous version... in most cases it's only about 20-40 probability %'s, but is obviously more of an issue at the ends.

    2007-12-13 22:21:48.0

    Wow, great job on the battle sim, Pluto! =)

    2007-12-13 23:00:43.0

    Excellent job. Glad we got this figured out!

    2007-12-14 03:00:42.0

    Leave in the 1% chance to miss!

    It's great to have a chance to take a base when the only thing protecting it is a single DFA.  Eventually one of your troopers will live through it.  There's other examples, but this one is the most concrete to me.


     

    2007-12-14 11:40:08.0

    Thanks guys for your help and interest.

    I also like the 1% chance to miss, but mostly just because I'm used to that being the game mechanic...
     

    2007-12-14 11:56:25.0

    I would be against that 1% chance.

    If an expencive DFA cant even kill 10 capturing troopers, then what the point really? This actually happened to me so often that I dont even build DFAs anymore.
     

    2007-12-15 04:13:51.0

    well done, Pluto!

    2007-12-15 16:02:13.0

    whoa, plugged the DFA-10 vs. DFA-10 in and there is now slightly less than 50/50 chance of 1 of each DFA being left.  Is that right?  I didn't think that happened that often.

    2007-12-15 16:04:01.0

    Battle Sim re- link for reference:

    And WarMech, that sounds right to me. Usually when I have dfa vs dfa, one is left surviving.

    Chance of both being destroyed: .55*.55 = .3025

    Chance of one being left: 2 * .45 * .55 = .495

    Chance of both remaining with 1 point: .45 * .45 = .2025

    2007-12-15 16:33:10.0

    Thanks Warmech, and yes it does actually happen that often.  Some of the empirical data I mentioned above was a few DFA vs. DFA battles I tested out in the game.

    I carried out ten DFA-10 vs. DFA-10 battles, and my results were:

    • 13/20 (65%) 0 units left
    • 7/20 (35%) 1 unit left.

    So, considering sampling error, I'm pretty satisfied that the simulator is now in accord with real game results.

     

    2007-12-15 17:42:40.0

    gotcha, to be honest I have probably seen less than 10 DFA vs. DFA battles with mostly kill-kill results.  so, low sample size, but I wanted to be sure.

    2007-12-16 01:38:48.0

    I hate doing dfa vs. dfa because I usually end up with 0 and my opponent is left with one.  A horrible gamblel.

    2007-12-16 07:37:30.0

    I love that gamble:)


     

    2007-12-17 14:11:05.0

    hehehe me too.... I just can't stop myself:P

    2007-12-17 15:02:28.0

    a dead DFA is a good DFA!

    I like the way the simulator is performing now. the last changes you mad really did it. Before that it really started to piss me off;)

    Now its pretty much perfect.
     

    2007-12-19 09:02:02.0

    Pluto, I have a small tweak/suggestion.  When you pick a unit it defaults to 10 on grassland, regardless of type.  Can you make the Ships & Subs default to water terrain?

    2007-12-24 02:26:06.0

    ah, yes, that would be a good idea!

    2007-12-24 11:40:43.0

    cool.

    2007-12-27 04:37:17.0

    minor bug i found:  If you choose the strength of either attacker or defender first, then select the unit, the default strength of 10 will then override the previously selected strength.

    2007-12-29 12:10:38.0

    Ok, last new year's update: Weewar Battle Simulator for Greasemonkey.

    Yes that's right, a battle simulator packed into a greasemonkey script for use in the same window as your game.

    It's got a lot of functionality crammed in, so play around with it and I will post some more detailed instructions later.

     

    Happy New Year!!!
     

    2008-01-01 01:09:38.0

    locked and loaded and ready to give it a try, good idea btw, thx

    2008-01-02 03:05:20.0

    one other thing, Pluto, when you mess around with the code, is have the Capturing Infantry default to Base terrain

     

    2008-01-02 19:16:34.0

    cool greasemonkey simulator!  when will terrain be changeable?

    2008-01-03 12:13:04.0

    well one thing you can do is to move your unit into attack position and then click "Enter Sim Mode," do you simulation, then Exit Sim Mode.  then you can either carry out your attack, or cancel your move.  For now that is the best way to change terrain.  For anything else, it's best to stick to the Flash version.

    2008-01-03 14:42:28.0

    tx!  i understand now.  i had no idea that i could click on the map to have it know what i wanted as far as unit and terrain (and i guess strength too, but i came up with another way to tell it that yesterday - i clicked on the "0" below the unit strength number).  again, tx :)

    2008-01-04 05:31:01.0

    Thanks! Smile

    I made a page on the wiki to help explain it a little bit more, for those interested.

    2008-01-05 13:09:09.0

    that's pretty neat!  Never used greasemonkey before...

    2008-01-05 14:53:01.0

    Pluto knocks it out of the park again. This is incredibly helpful to have the simulator in the map itself. It's very nicely implemented as well.

    One question, I may be missing this somewhere, but how do you simulate an artillery attack? Thanks!
     

    2008-01-07 23:05:43.0

    Thanks for the kind words!

    I'm not exactly sure what you mean by artillery attack.  If you mean how do you simulate an attack for units that are not adjacent, then you just click on them.  You can simulate a battle between units on opposite sides of the map if you want to.  This way you have more choices in terrain and unit diversity because the script doesn't currently let you manually change that.
     

    2008-01-07 23:29:56.0

    Ohhhhhh... so this simulator not only reads the unit, terrain, and strength from the map, but also the position of the unit on the map? I take back everything I said before. This is WAY better than that!;)

    I think there might be a calculation problem though. I just put a DFA with strength of 10 on plains against a Hvy Art with a strength of 5  on sand 4 hex away from the  DFA.  The simulator shows the Hvy Art  with  0-51, 1-43(which seems correct), but the DFA ended up with 5-3, 6-94, 7-3. I don't think the DFA should have lost anything in that battle. Am I wrong there?

     

    2008-01-07 23:53:25.0

    oops, sorry i didn't know that's what you meant.  it does not yet read position, but i would like to include that in the future.  for now, it works just like the flash version in that when you simulate artillery attacks, you just have to know if they are in range or not.

    2008-01-08 10:09:59.0

    Ok, that makes sense then. Still incredibly cool - keep up the great work!

    2008-01-08 10:17:41.0

    how do you play wewar?


     

    2008-01-09 06:57:48.0

    do you want an invite?  if so, then tell us your email address.  i or someone else will then be able to invite you.

    2008-01-09 07:00:30.0

    if you don't want an invite and instead just want a basic description, then let us know.

    2008-01-09 07:19:13.0

    update: ships and capturing infantry now default to their appropriate terrains (for the flash version battle simulator)

    2008-01-13 11:52:55.0

    you might have to clear your browser cache to get the update

    2008-01-13 14:02:51.0

    well done, Pluto!

    2008-01-13 18:55:43.0

    tanks a lot

    2008-01-13 19:16:53.0

    Is the multiple attacking bonus still in effect?  It doesn't work on the simulator.

    2008-05-22 21:06:31.0
To send a message, Join Now (it's quick and free) or Sign In
Edit Topic
Delete Topic
Are you sure you want to delete the topic