Jump to content

mapkoc

Community Members
  • Posts

    115
  • Joined

  • Last visited

Posts posted by mapkoc

  1. At revision 21035.

    ERROR: JavaScript error: gui/gamesetup/gamesetup.js line 1706
    TypeError: g_GameAttributes.settings.SupportedBiomes.indexOf is not a function
      reloadBiomeList/biomeList<@gui/gamesetup/gamesetup.js:1706:14
      reloadBiomeList@gui/gamesetup/gamesetup.js:1705:16
      reloadMapSpecific@gui/gamesetup/gamesetup.js:1692:2
      updateGUIObjects@gui/gamesetup/gamesetup.js:2236:2
      initGUIObjects/<@gui/gamesetup/gamesetup.js:1204:4
      selectPanel@gui/common/tab_buttons.js:75:2
      placeTabButtons@gui/common/tab_buttons.js:51:2
      initGUIObjects@gui/gamesetup/gamesetup.js:1196:1
      onTick@gui/gamesetup/gamesetup.js:1909:3
      __eventhandler40 (tick)@setupWindow tick:0:1


    when trying to set up a single player game:

    Loading map data, please wait

    • Like 1
  2. @ljf: Congratulations!, you broke the AI :)

    I tried your strategy vs 2 very hard AIs in a team. You can even do extra hunting. First you neutralize 1 AI with the cav rush. Then either harrass a bit 2nd AI or better heal and get more cav because it has many men already. Then keep rushing 2nd AI and healing. It takes some time but it's easy.

    @SirPope: in svn already you can choose AIs behavior. If somehow AI could choose all those magic numbers dynamically depending of the circumstances I guess it would be op.

    • Like 1
  3. AI in alpha 22 improved with respect to a21. In a21 you could run with 1 horse around AI's perimeter and all soldiers would follow horse so you could kill women and capture buildings easily.

    At some point AI always gives up growing even if it has resources. AI can't play with very high res either, it's like it always follows a build order. That problem persists.

    Try doing the same vs 2 very hard AIs in same team. Its hard but cav spam still wins.

     

  4. 7 hours ago, elexis said:

    you have an aco@#&#036;%

    Is that an entity or a swear word? :huh:

    I was hoping you did all the work. :)
    Well, that was hard, first time. (D1191)

    I guess one should follow https://trac.wildfiregames.com/wiki/SubmittingPatches

    Since the code already mixes two styles and https://trac.wildfiregames.com/wiki/Coding_Conventions#Misc also (the for_each),
    i figured I choose the one I like best.:angel:

    9 hours ago, elexis said:

    add yourself to gui/credits/programming.json :-)

    No thanks, I'm good.

    • Thanks 1
  5. Right now we can only talk to the guy and ask him to insta resign a game to give points to the offended that presented the proof.

    He can refuse and its hard to get all parties at the same time.

    We could ban but he'll just create a new account and repeat.

    If we could  ask the ratings bot to register a result on demand, we could implement a system like ouGaming suggests. Wishful thinking.

    • Like 1
  6. The previous hack breaks sending more than 500.

    This is the only way I could solve "the bug".

    Move declaration of multiplier and amounts outside onPress callback, before
    for (let resCode of resCodes)
    and make multiplier an array and initialize, like this

        let multiplier = {};
        let amounts = {};
        for (let res of resCodes) {
            multiplier[res] = 1;
            amounts[res] = 0;
        }

    change updates of multiplier to multiplier[resCode]
    but inside g_FlushTributing reset arrays like this

    	for (let res of resCodes) {
    		multiplier[res] = 1;
    		amounts[res] = 0;
    	}

    Now it works as I expected

    a.png.f18e9f5290458b38d424185dcbdb4b71.png

  7. I found a way to reset previous clicks when masstributing and not releasing shift.

    Add multiplier = 1; before closing onPress, say in line 522.

    You still can't give several tributes with 1 shift because g_FlushTributing is only called on shift release.

        case INPUT_MASSTRIBUTING:
            if (ev.type == "hotkeyup" && ev.hotkey == "session.masstribute")


    Maybe with an event != "hotkeyup" ?

  8. I press Shift and click on food and without releasing Shift click on wood and release shift.

    a.png.07116e400a8cae5bb0c421eb93da8c57.png

    The result I would expect is to give the tribute as soon as I click without waiting to release shift.

    Now amounts[food] is dirty and if I shift click on food once and release

    b.png.bfdbd81c8b7700d939dbc879d4e90d6c.png

    If you click (no shift) on food, a 500 tribute will be sent, I have no idea why.

    The file elexis said is
    binaries/data/mods/public/gui/session/menu.js
    the function
    470 -> function diplomacyFormatTributeButtons(i, hidden)
    but I don't know how to fix :(

     

  9. Not sure if this is a bug or intended behavior. Tested on a22 and svn.

    If you try to pay tributes in diplomacy window and press Shift and click on any res and without releasing Shift click on another res, only 500 of last res is sent after releasing Shift. If you now click on first resource, a 500 tribute will be sent. If you shift click on first resource instead, a 1000 tribute is sent.

    I find this counter intuitive if intended.  If tributes are not sent when shift key is not release then they should be reset, not compounded like that.

    • Thanks 1
  10. Hi,  I adapted http://www.glicko.net/glicko/glicko.pdf to apply to raitings bot.

    import math
    
    # Rating deviation extrema
    RDmax = 140
    RDmin = 40
    
    # Linear mapping
    GPthr = 100		# games played threshold
    m = float(GPthr) / (RDmin - RDmax)		# slope
    
    # Simple Glicko without rating deviation aging
    def get_rating_adjustment2(rating, opponent_rating, games_played, opponent_games_played, result):
    	r = rating
    	rj = opponent_rating
    	sj = (result + 1) / 2	# outcome
    
    	# Linear mapping of games played to rating deviation
    	# instead of RD = min(math.sqrt(RD_{old}^2 + c^2), 350)
    	RD = RDmin if games_played > GPthr else m * games_played + RDmax
    	RDj = RDmin if opponent_games_played > GPthr else m * opponent_games_played + RDmax
    
    	# Rating delta
    	q = math.log(10) / 400
    	gj = 1 / math.sqrt(1 + 3 * math.pow(q * RDj / math.pi, 2))
    	Ej = 1 / (1 + math.pow(10, gj * (rj - r) / 400))
    	d2 = 1 / (math.pow(q * gj, 2) * Ej * (1 - Ej))
    	value = 1 / RD / RD + 1 / d2
    	# RDnew = math.sqrt(1 / value)	# not used for now
    	return round(q * gj * (sj - Ej) / value)

    It has 3 parameters that control how much a player gains or loses depending on its experience.
    The rating deviation (RD) is like the standard deviation and states the certainty of a player's rating and determines how much a result influences rating.
    To fit current code, I modified the algorithm to linearly assign RD \in [RDmax, RDmin] according to games played \in [0, GPthr]
    and RDmin if games played > GPthr
    With RDmax = 140 so inexperienced players dont jump too much, RDmin = 40 so experienced players can still slowly increase rating, and arbitrarily setting maximum experience with GPthr = 100 games played, we can test with

    from random import choice, seed, randint
    r1,r2 = 2100, 1200
    seed()
    for x in range(GPthr+10):
      print(r1, r2)
      res = choice([-1, 1])
      #r1 += get_rating_adjustment(r1, randint(1100, 2100), GPthr+x, randint(0, GPthr), 1)
      r1 += get_rating_adjustment2(r1, r2, GPthr+x, 0+x, res)
      r2 += get_rating_adjustment2(r2, r1, 0+x, GPthr+x, -res)
    print(r1, r2)

    Test 1: expert player like borg vs new player, 110 games with 50-50% wins

    b.png.5d456c7f914cc2e2ec4f8b4d0b9474c4.pnga.png.70b4a6ee757efbfed76adc3014207402.png

    You can see how with Glicko the expert is not greatly affected but possible smurfs.

    Test 2: Average fully experienced player always winning vs all kinds of players

    c.png.2651eee919fa1e2a47877efae039304a.pngd.png.01cbd719b6a9aa33bcba400243fc8e46.png

    The original rating was pretty certain but RDmin gives chance for improvement, quite slowly.

    Fics uses a variation of the algorithm: http://www.freechess.org/Help/HelpFiles/glicko.html

    • Like 1
×
×
  • Create New...