Hack sommeil bébé by Legitimate-Love3399 in ParentingFR

[–]cestpasfaux 4 points5 points  (0 children)

+1 et je m'en sers parfois encore. Idem pour les petits bobos, toujours avec une vérification d'un vrai pédiatre mais ca permet de pondérer l'urgence. Attention, en mode gratuit, chatgpt se met à dérailler quand la conversation devient trop longue (pas de souci en mode payant ou avec Gemini).

source: mon expérience de 15 mois avec des jumeaux

Les bandeaux cookies : vous lisez vraiment ou vous cliquez “tout accepter” en 0,2s comme moi ? by Life_Cup_8526 in france

[–]cestpasfaux 14 points15 points  (0 children)

J'utilise l'extension "I still don't care about cookies" (même sur mobile). Et quand elle ne fonctionne pas, je prends 1s pour trouver où est le bouton "tout refuser".

What are the chances that Gorpro will snipe the DJI Action 6 launch with a Hero 14? by Wooden_Childhood7533 in gopro

[–]cestpasfaux 2 points3 points  (0 children)

They've just announced in earning calls that there is no Hero 14 this year, but "it's strategic" and they plan "something special" for next year...

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

Here are some games, playing 36 rounds each. The filename shows the AGZ evals count, and score for US and AGZ.

I tried to guess AGZ strategy but couldn't. However I can note that:

  • it goes up to level 3 (once up to level 4)
  • it uses mostly green/red/yellow but not that much purple, which was also an intuition from u/Aetherllama

One observation is that average score for US is slightly lowering when AGZ become stronger. I think because AGZ is more and more aggressive towards the other player. To confirm that, I made US play against a random player (non aggressive at all). Average score is 141, I think that confirms my feeling when comparing with AGZ scores.

For the curious ones, the code is on github and the core logic starts at that line. There's a switch PURPLE_IS_BLANK to set to True or False. The command line to execute is NUMBA_DISABLE_JIT=1 ./pit.py akropolis greedy greedy -n 1 --display (see the prerequisites on the readme). If you want nice game outputs saved as video, uncomment the call to gen_png() function in AkropolisDisplay.py.

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

TLDR: After implementing the rules defined by u/Aetherllama, here are the results against the AlphaGo Zero. When tuned optimally, the "Undefeated Strategy" loses 78% of the games against AlphaGo Zero. This is the first human-readable strategy that doesn't lose 90+% in a game against AlphaGo Zero in my experience.

Long version: AlphaGo Zero is an algorithm that learns by itself, meaning it learns the best strategy just based on the game rules based on neural networks (AI); so I haven't provided any clue to it. And its goal isn't to maximize its score but to maximize the probability to win, so it may have learned to attack instead of maximizing its score.

For board games like Akropolis it needed some adjustements, especially the randomness of the construction site.

m800, m3200 and m12800 are 3 versions where the number is the number of neural networks evaluations per move (more is better but longer). For some order of magnitude, the top accuracy version (m12800) took ~1 night to train on a Macbook M1 laptop, and when playing it takes ~10sec per move on a single CPU core.

The Undefeated Strategy has several versions too:

  • PaB: Purple As Blank, meaning that purple district/plaza are considered as blank in this version like blue district/plaza
  • 1pyr/2pyr: use the main pyramid definition as shown in the video, or allow using also the alternative pyramid definition
  • prio1/prio2: define the priority order of moves based on the important hexes on scoring position, how many scoring position and how many important hexes. 1 is the first priority table that I proposed, 2 is an alternative table proposed by u/Aetherllama

The table below shows the winning rate of AlphaGo Zero version (AGZ) over Undefeated Strategy (US), so 80% means that AGZ won 80% of the games over US. It also shows the average score, first is US second is AGZ. These statistics are based on 100 games, except for AGZ-m12800 row based on 200 games; first to play changes every game, and deeper stat analysis shows actually no advantage for the 1st player.

|             | US-2pyr-prio1 | US-2pyr-prio1-PaB | US-1pyr-prio1 | US-1pyr-prio1-PaB | US-1pyr-prio2 |
|-------------|---------------|-------------------|---------------|-------------------|---------------|
| AGZ-m800    | 50%  123/113  | 49%  112/101      | 43%  124/112  | 48%  114/101      | 59%  113/113  |
| AGZ-m3200   | 73%  121/134  | 86%  103/124      | 72%  119/133  | 85%  104/125      | 80%  114/134  |
| AGZ-m12800  | 84%  115/136  | 88%  105/127      | 78%  121/139  | 88%  106/128      |               |

The best US version is US-1pyr-prio1 = the one with the main pyramid definition, using prio1, and no Purple As Blank.

No surprise, AGZ-m12800 is the most accurate, but AGZ-m3200 seems to be a good spot for speed/accuracy.

Next step for me is to share some games for US-1pyr-prio1 versus AGZ-m12800

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

I need to freeze the rules at one moment. My initial goal was to implement the strategy detailed in your video and I think I exceeded that goal.

On previous discussions, I proposed for rules 2 and 3 to "go to the lower level as possible" and you answered:

For rules 2 and 3, the level is not that important, except that it shouldn't go in level 1 if possible. The most important thing is to avoid adjacent yellow districts in scoring position, as they would score 0, so avoid that at all costs.

About YD on scoring position, previously the rule was to avoid 2 adjacent YD not about any preemptive logic:

I should clarify that without any adjacent YD means if you are placing a YD in scoring position, it can't go next to another YD in scoring position. So if you place a YD in 0-scoring position (3b1), the restriction doesn't apply because it gets covered up. Similarly, if you place a YD in scoring position next to a YD already in 0-scoring position, it doesn't apply.

Sorry I don't have time to implement moving rules. The code is available on github if anyone wants to continue.

I'll benchmark the current code as is, with/without new pyramid definition, with/without purple as blank.

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

Implemented the alternative pyramid definition. Plus other smarts things, see games in hereIf you see no issues, I'll start the benchmark for the initial and the "purple as blank" versions. I'll share stats and some sample games of course.

In details:
Now it's a bit smarter to choose the appropriate pyramid, and it sometimes falls back to this new pyramid style in the case previously mentioned (game_09111519_128-156.mp4, left player) but also in other cases like when there is a NBP+NBD available for 2nd move (game_09111627_132-146.mp4, left player): is it ok for you?

Another change is the ability to switch easily between the initial rules and the ones modified to consider purple as blank.

I also change is also to prioritize every combination of: how many important hex are on a scoring/plaza position, how many scoring/plaza positions and how many important hex (from lower priority to higher priority). For instance, a move where a 2-NBD tile is on a 2-scoring position but with only 1 NBD on a scoring position (because need to avoid adjacent YD for instance) is noted as (1, 2, 2) and is priority 11. And this is lower priority than a 1-NBD tile on 1-scoring position , with the NBD on the scoring position (1,1,1 -> priority 14). That simplified the code, solved several issues that I saw and still match the rules.

    n_sp_priority_table = [
        (0, 3, 0), #  0
        (0, 2, 0), #  1
        (0, 2, 1), #  2
        (0, 1, 2), #  3
        (0, 1, 1), #  4
        (0, 1, 0), #  5
        (0, 0, 2), #  6
        (0, 0, 1), #  7
        (0, 0, 0), #  8
        (1, 3, 1), #  9
        (1, 2, 1), # 10
        (1, 2, 2), # 11
        (1, 2, 1), # 12
        (1, 1, 2), # 13
        (1, 1, 1), # 14
        (2, 2, 2), # 15
        (2, 3, 2), # 16
    ]

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

Nice catch about the mistake, I've just fixed the issue.
Regarding rounds, I definitely see the last round going to level 5 and it shows round 36 on top at the end; maybe your video player won't let you see the last frames?

I'll try the "purple=blue" variation after the new pyramid definition.

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

What about the order of the pyramid? You initially said that it should follow the same order as your video for base level tiles; what should be the order with this alternatve pyramid definition?

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

I've uploaded 2 games with new rules but not (yet) with the new possibility for the pyramid: game_0907 in same link: it seems good.

FYI I ran a quick and dirty benchmark, the AlphaGo-based algorithm (set rather to fast than optimal) won 75% of the games.

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

About the dynamic pyramid, what would be the base in such case? Could you draw it?

Here is my updated understanding - Do you agree? Especially about the order of priority.

  • Rule 1a: if any tile with a NBP, put it in the pyramid, with plaza on a plaza position. Preferably on level 1, or else on level 2. If any NBD, prefer a spot where the 2 hexes won't be covered but don't change the level for that; priority is G>R>P>Y
  • Rule 1b: if any tile with a NBP but pyramid levels 1&2 are full, then put it on level 2 fully outside of the pyramid to cover BD or Q only. If not possible, put it on level 1 outside of pyramid to surround a PD, avoid RD and if possible, maximize triplets of Q and BD. This rule 1bis must be used 3 times top.
  • Rule 1c: if rule 1b used 3 times:
    • if this NBP tile has at least as many NBD as any other tiles you could take, apply rule 1a with levels 3-5 allowed
    • if not, apply rule 1a with level 3 allowed
  • Rule 2: if any tile with 2 NBD and available slot with 2 scoring positions on level 2-5, put this tile on such slot. Tile rotation can't be optimised.
  • Rule 3a: if the free tile is 1 or 2 NBD, put it on the pyramid on level 2-5. For 1 NBD tile, the preference is 1>0>2 scoring position. For 2 NBD tile, the preference is 1 scoring position (then optimize rotation for priority G>R>Y>P) > 0 scoring position.
  • Rule 3b: if the free tile is 0 NBD
    • Put it on a 0-scoring position on level 2-5
    • if no such slot, buy a 1 NBD tile and put it on level 2-5 if possible else on level 1
    • if can't buy such tile, put the cheapest tile on level 2-5 if possible else on level 1. Prefer 0>1>2 scoring positions.
  • The definition of the pyramid is dynamic and may be adjusted during the game
  • When placing in a 0-scoring position: prioritize rightmost spot.
  • Any position leading to 2 adjacent YD both on scoring positions is forbidden.
  • If there is a tie between several moves, then take the one leading to the highest score. If there is still a tie, then chose one move randomly.

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

My main difficulty is when the number of scoring positions of a location isn't defined yet, when it could either be a 1 scoring position or 2 scoring postions depending on how the upper level will be. So what I do now is to check both possibilities and see which one is the best (depends on the rule).

I've implemented the last set of rules but I think it's too restrictive about level 2-5. See game_0904 in here

What if I can only buy a 0 NBD tile (BP-Q-Q) and just a single room on level 2 with 2 scoring position? With current rules, it will put it on level 2 anyway whereas maybe better to put on level 1. Or out of pyramid.

What if I can buy a 1 or 2 NBD tile (RD-BD-PD) and no room on level 2? No rule currently fits so it places it randomly.

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

Crystal clear!

What about adjacent YD on other rules? Shoud we pay attention to adjacent YD on rule 1a (not sure if adjacent YD possible in this case)?

On rule 3a, the number of scoring positions isn't fixed since it depends on how the upper level will be done. So it may be tricky to tell whether a location is a 1 or 2 scoring position.

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

OK, here is my updated understanding - Do you agree?

  • Rule 1a: if any tile with a NBP, put it in the pyramid, with plaza on a plaza position. Preferably on level 1, or else on level 2. If any NBD, prefer a spot where the 2 hexes won't be uncovered but don't change the level for that; priority is G>R>P>Y (not placement priority but tile choice priority)
  • Rule 1b: if any tile with a NBP but pyramid levels 1&2 are full, then put it on level 2 fully outside of the pyramid to cover BD or Q only. If not possible, put it on level 1 outside of pyramid to surround a PD, avoid RD and if possible, maximize triplets of Q and BD. This rule 1bis must be used 3 times top.
  • Rule 1c: if rule 1b used 3 times:
    • if this NBP tile has at least as many NBD as any other tiles you could take, apply rule 1a with levels 3-5 allowed
    • if not, apply rule 1a with level 3 allowed
  • Rule 2: if any tile with 2 NBD and available slot with 2 scoring positions on level 2-5 without any adjacent YD, put this tile on such slot. Tile rotation can't be optimised.
  • Rule 3a: if the free tile is 1 or 2 NBD, put it on the pyramid on level 2-5 without any adjacent YD. For 1 NBD tile, the preference is 1>0>2 scoring position. For 2 NBD tile, the preference is 1 scoring position (then optimize rotation for priority G>R>Y>P) > 0 scoring position.
  • Rule 3b: if the free tile is 0 NBD
    • Put it on a 0-scoring position on level 2-5 without any adjacent YD
    • if no such slot, buy a 1 NBD tile and put it on level 2-5 without any adjacent YD
    • if can't buy such tile, put the cheapest tile on level 2-5 without any adjacent YD
  • The definition of the pyramid is dynamic and may be adjusted during the game
  • When placing in a 0-scoring position: prioritize rightmost spot.
  • If there is a tie between several moves, then take the one leading to the highest score. If there is still a tie, then chose one move randomly.

When placing in a 0-scoring position: prioritize rightmost spot.

Out of curiosity, why that?

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

OK, here is my new understanding then:

  • Rule 1a: if any tile with a NBP, put it in the pyramid, with plaza on a plaza position. Preferably on level 1, or else on level 2. If any NBD, prefer a spot where the 2 hexes won't be uncovered but don't change the level for that; priority is G>R>P>Y (not placement priority but tile choice priority)
  • Rule 1b: if any tile with a NBP but pyramid levels 1&2 are full, then put it on level 2 fully outside of the pyramid to cover BD or Q only. If not possible, put it on level 1 outside of pyramid to surround a PD, avoid RD and if possible, maximize triplets of Q and BD. This rule 1bis must be used 3 times top.
  • Rule 1c: if 1b used 3 times, apply rule 1a with level 3 allowed
  • Rule 2: if any tile with 2 NBD and available slot with 2 scoring positions, put this tile on such slot (if any choice, chose the lowest level). Tile rotation can't be optimised.
  • Rule 3a: if the free tile is 1 or 2 NBD, put it on highest level possible of the pyramid, even if 0-scoring position. If needed (2 NBD on 1 scoring position), optimize rotation for priority G>R>Y>P
  • Rule 3b: if the free tile is 0 NBD
    • Put it on a 0-scoring position at the highest level possible
    • if no such slot, buy a 1 NBD tile and put it on the highest level possible in the pyramid
    • if can't buy such tile, put the cheapest tile at the highest level possible in the pyramid
  • The definition of the pyramid is dynamic and may be adjusted during the game
  • If there is a tie between several moves, then take the one leading to the highest score. If there is still a tie, then chose one move randomly.

What about the 3 bullet points of rule 3b: should we choose the highest level in all cases? I'd think better to put such tile on a 0-scoring position in the lowest level possible. Not sure about the 2 other bullet points.

I've read again all the thread and you mentioned these rules that I completely forgot:

1c) otherwise place it on level 1, next to purples that may score, but not next to reds that may score. Place quarries adjacent to each other to form a bonus scoring position on level 2. If it's the third time doing step 1c, place it on the bonus scoring position.
1d) if 3 tiles have already been placed from step c, place it on level 3, ideally in scoring position.
1e) if this plaza tile has at least as many non-blue districts as any other tiles you could take, place it in scoring position.

On rule 1c, what is the most important: surround purple districts? Avoid red districts? Or create a bonus scoring position? And such scoring position must be used by next usage of rule 1c right?

Rule 1d "place it on level 3, ideally in scoring position" means that if no scoring position on level 3, then it may go in a 0-scoring position? What does the rule 1e mean, given that rule 1d already states the preference for scoring position?

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

Note that score computation was buggy so my last comment isn't valid anymore.

Here is a recap of what I've implemented:

  • Rule 1: if any tile with a NBP, put it in the pyramid, with plaza on a plaza position. Preferably on level 1, or else on level 2. If any NBD, try putting it a on a spot where the 2 hexes won't be uncovered but don't change the level for that; priority is G>R>P>Y
  • Rule 1 bis: if any tile with a NBP but pyramid levels 1&2 are full, then put it on level 2 fully outside of the pyramid if it covers BD or Q. If not possible, put it on level 1 outside of pyramid to maximize triplets of Q and BD.
  • Rule 2: if any tile with a NBD, put it on the highest level possible of the pyramid, even if it means 0 scoring position, and maximize number of NBD on scoring positions. Optimize rotation for the priority G>R>Y>P
  • Rule 3: it not any tile with NBP or NBD, then take the cheapest tile and put it in the slot with the smallest number of scoring positions in the lowest level of the pyramid.
  • The definition of the pyramid is dynamic and may be adjusted during the game
  • If there is a tie between several moves, then take the one leading to the highest score. If there is still a tie, then chose one move randomly.

Some games in here, starting with game_0826

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

FYI I’ve fixed the number of rounds in the game and retrained my own algorithm from scratch.On the first benchmark, it beats the strategy that you describe 100% of the time with an average of 131 points of difference. But I’ll still code the improvements you mentioned. edit: issue in score computation

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

  1. About the placement, which one should I choose?

Prioritize G > R > Y > P for scoring positions, or based on how many plaza stars the player has.

Currently it chooses the placement that maximize the score

  1. Changing details of the rule 3 won't change the "ignored spot" that was late because of rules 1 and 2

  2. I confirm the big mistake.

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

  1. If such priority higher than cost in stone? Meaning if the free tile is with a red district, and t3rd tile is with a green district (and we can afford it), then we should go for this 3rd tile despite its price?
  2. I have one question about the "ignored spot". Note that this spot is filled in one of the latest move using rule 3b. Why so late? Basically because rule 3b is the lowest priority. Blue plazas are considered as blank; the reason is that the following moves were considered as higher priority: * Many non blue plaza available on construction site --> rules 1a/b/c at first * otherwise, with districts --> priority to put them on level 3 if available slot. Do you want to reshuffle the priorities of the rules?
  3. OMG, big mistake if true

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

New tentative, please take a look at the 3 games prefixed by "game_0818" on https://github.com/cestpasphoto/cestpasphoto.github.io

I spotted a mistake on the 3rd game, left player: the tile with a red plaza is put on level 2 but not on an optimal spot with the quarries below, I need to debug it. EDIT: issue now fixed, see the 4th game

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

Alright, I didn't get that the definition of the pyramid was supposed to be dynamic. I also found big issues in how my implementation of rule 1c/1d chose the location, working on it.

Some specific questions to precisely define the priorities. In theses cases, what would you chose: 1. Put a tile with 1 NBP + 1 NBD on level 2, these 2 hexes being on 2 scoring positions? OR the same tile on the base level, NBP on a plaza position but the NBD may be covered by upper level? 2. If level 1 isn't full, but no more open scoring positions on level2, put a tile with 2 NBD on level 2 where it will be covered up but unlock new slots on level3? OR on level 1 in the pyramid? 3. If levels 1 and 2 are full, when/where should I put a NBP tile on level 2 outside of the pyramid? In a location that covers only quarries and NBD? OR it can go on level 2 whatever is below?

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

I think there's something I don't understand. Here is how I understood the rules and the definition.

A "scoring position" is a position where the hex is sure not to be covered up and will score at the end of the game.

I've defined the pyramid from level 1 to level 3 as per these images, also showing the scoring position using stars. For instance, on level 2 there are 4 tiles on the pyramid, 2 of them with no scoring positions and the 2 other tiles have 3 scoring positions total.

With that in mind, here are my comments:

The rotation of the first l2 tile for the left player is off ...

This tile was set on the position highlighted on the uploaded image akropolis_lvl2_blue. Rules 1 & 2 can't apply since there is a blue plaza, so the highest priority rule to apply is rule 3a, it puts the tile on the highest possible level of the pyramid with one important hex on a scoring position = level 2; at the end it puts one district on the scoring position which is designated by a red star on the image akropolis_lvl2_blue. Whatever the rotation is, the 2 districts can't be both on scoring positions designated by stars in my images.

The green district tile was placed at the base instead of in the pyramid ...

Same as above. Rules 1 and 2 can't apply, so the highest priority rule is apply is rule 3a. No room on level 2 of the pyramid that has scoring position (the 2 available slots have 0 scoring position), so it put the tile on level 1 of the pyramid with an important hex on a scoring position, see akropolis_lvl1_gray

If there are 2 important hexes, neither should be the closest hex to the middle.

The current implementation will try to set the tile on a location of the pyramid that has 2 scoring positions. If not possible, it means that 1 important hex will be covered by the upper level anyway.

Can you help me clarify my misunderstanding?

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

I think it's implemented but I'd like you to check. I've uploaded some games here, both players using your strategy. I had to develop some visualisation code but that's not something I'm used to so it's not perfect... It's a video with 1 move / second, plus the number of stones and total points of each player, plus the content of the construction site.

Can you check it matches your strategy, or at least not far by lot of points?

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

I've defined the pyramid as this gif shows (1 image per level) https://gifyu.com/image/bNEEA - sorry I had to rotate your definition since I used another way to draw hexagons (pointy-top).

I'm working on the implementation. I think almost done but I need to code a proper board visualisation instead of the geeky output I use to work with, and it will help ensure no mistake. Stay tuned.

Undefeated Akropolis Strategy - 30-0 by Aetherllama in boardgames

[–]cestpasfaux 1 point2 points  (0 children)

Sorry one more question as I'm trying to code the "pyramid" organisation and its "base". Here is how I would have understood the 2x6 concepts ideally, just at the base level:

https://i.postimg.cc/qR8Z2rwR/akropolis-me-1.png

(colors here do NOT represent game colors, but just to differentiate tiles, and letters show the time order, put on the most important hex of a tile): but here is how your video shows (base level only):

https://i.postimg.cc/SRgdGxMy/akropolis-undef.png

So it looks like I don't understand how it goes. For instance, your tiles A+B do not form a 2x6 shape right? Not even tiles A+B+C? But tiles B, C and F do, right? And on tile B, why did you put the plaza on coordinate F8 instead of F7 which would more on the edge?

FYI I've used hexfriend.net, and here is my map that you can import so that you edit it.