Game Internals › Anipop › Difficulty

How Anipop sets your difficulty

Before each attempt at a main level, the game works out how hard that level should be for you. Then, move by move, it steers the colours of the falling pieces to get you there. The more you play and the more you spend, the harder it aims.

The whole process

The game calls this system “fuuu” (its current version is UBFuuu2025). Every attempt at a main level goes through these steps:

  1. Each level has a designed target: the average number of attempts it should take. Most levels are set at 5; easy ones at 1.05, the hardest at 45.
  2. You get two ratings from 1 to 16, one for how much you play and one for how much you spend on boosters. A table turns the pair into a difficulty index from −9 to +9. Your skill rating then shifts it a little.
  3. The index stretches the target. At −9 the level is tuned to about 1 attempt; at +9, to 1.6 times its target. If you keep failing your newest level, a pity rule (保底) brings the target down step by step.
  4. Real measurements pick a setting. For each upcoming level, the server sends how many attempts players needed at each of 24 assist settings. The game picks the setting that matches your personal target.
  5. During play, falling pieces are recoloured. After each move the game checks how far ahead of or behind schedule you are. To help, it turns new pieces into the colour that is already most common on the board. To hinder, it turns them into the rarest colours.

Everything here comes from the game's scripts and built-in tables. The server can choose a different variant of each table for each player; the numbers on this page are the default variant (group 0). See what the code can't tell us.

Try it: your target for a level

This uses the game's default tables and follows its code (UBFuuuSelectAdjust). Change the inputs to see where the difficulty index lands in the activity × spending table.

Designed target: 5 attempts

Your average over the last month, weighted toward recent days. Gives the activity rating .

Every 10 passes today add 1 to the activity rating.

1 means you buy no boosters. The server works out the rating from the value of boosters you've used recently; how that's measured.

The server rates how well you play recent levels.

–

Difficulty index by activity and spending

Spending rating 1 to 16 across the top, activity rating 1 to 16 down the side

Not modelled: the server's experiment groups and optional modules (listed below), and a cap that stops the index rising more than 2 above the previous area's.

From index to target

The difficulty index stretches or shrinks the level's designed target. Below, the bars show the personal target for this level at every index; the outlined bar is yours. A fractional index (from the skill rating) is rounded up or down at random, in proportion.

The activity × spending table

Along every row the index rises with spending, and down every column it rises with activity. In the default table:

  • a player who rarely plays and never buys boosters is at −9: every level is tuned to about one attempt;
  • a player making about 14 attempts a day without paying is at −5;
  • the same player as a top spender is at +2;
  • a heavy player who is also a top spender is at +6, the highest the table goes.
PlayerIndex5-attempt level14-attempt level

The server holds seven other variants of this table and assigns one per player. All of them rise with spending and activity; the amounts differ.

What goes into the ratings

Activity

The server reports how many attempts you made on each of the last 30 days and whether you logged in on each of the last 28. The game weights them, (last 3 days ÷ 3 + 2 × last 7 ÷ 7 + 2 × last 30 ÷ 30) ÷ 5, scales by how many of the last 7 days you logged in, and looks the result up: the rating is 1 at under one attempt a day and 15 at up to 46. Players who have reached the newest levels (the last 30 or so) get the top rating, 16. A newer variant uses 28 days of logins and attempts instead.

Levels passed today add 1 per 10 passes. The code's comment explains why: returning players start with a low rating and easy levels, and this stops them using that to race through events.

Spending

By default the rating comes from a server figure for the value of the boosters you've used over your last 30 areas of 15 levels. The units aren't visible in the app. Without that figure, the game counts them itself: half a point per +2 moves bought, a tenth per +2 moves from watching an ad, and a point per +5 moves (some variants also count hammers, rockets and line brushes). The thresholds rise as you progress, so the same spending earns a lower rating later in the game.

Skill

The server sends a skill rating from −4 to 3, worked out from how you've done on recent areas. Ratings −4 to −2 lower the index, by up to 5. Ratings −1 and 0 lower it by 0.5 to 1, except on the first 300 levels, where they raise it by 1 to 1.5. Rating 1 lowers it by 0.5 on levels 301 to 990 and otherwise leaves it alone. Ratings 2 and 3 only count on the newest levels, where they raise it by 1 to 3, though never above 6.

Server experiments

Optional modules, switched on per player, adjust the result. Each of these is in the code; whether you get it depends on the server:

  • from level 301, add 2 to both ratings (harder);
  • halve the target for the first level you play each day (kept between 2 and 5);
  • multiply the target by 1.5 for returning players up to level 1,000 who are on a winning streak;
  • use a gentler table for unstarred levels that aren't flagged as hard.

Pity: 保底

On your newest level, while you have no stars on it, the game counts your failures. Once they reach a threshold, the level stays in pity mode until you pass it, and the target drops in steps as failures continue. For example, in the default table:

Personal target up toPity starts atThen the target becomes

A target of 1 picks the setting that helps most.

Choosing a setting

The game has 24 assist settings, from −16 (help as much as possible) to +7 (hinder as much as possible). For each upcoming level, the server sends the average number of attempts real players needed at each setting. The game finds the two settings on either side of your personal target and picks between them at random, favouring the closer one. Occasionally (2% of the time) it then moves the choice one setting up or down.

If the server hasn't sent measurements for the level, the attempt plays with no adjustment at all. The attempts you make are reported back, which keeps the measurements current. Attempts that would distort them, such as ones where you used a booster other than +3 moves before starting, aren't reported.

In play: recolouring the drops

The game has a curve for each level that says how much of each goal you should have collected after each move. After every move it compares your progress with that curve and works out a strength, ds:

  • roughly +1 for every 3% of the level's moves you are behind schedule, up to +15;
  • −1 to −5 when you're well ahead;
  • adjusted by whether you're catching up or falling behind, and by how few moves are left;
  • shifted by the setting: at +7 the game starts at −5 and allows at most +8; at −16 it starts at +12.

So at the hardest setting the game works against you unless you fall far behind, and at the easiest it helps even when you're ahead. Each new animal piece is then recoloured according to ds. Try it below: the board's piece counts are on the left, and each press drops 20 new pieces from one spawner.

Pieces on the board

The rules

  • When helping (ds 1 to 15), each piece that isn't already the board's most common colour has a chance of becoming it: 15% at ds 1, rising to 85% at ds 15, and smaller once several of that colour have dropped this move. Two limits stop it looking rigged: one spawner can't drop too many of that colour in a row, and only so many pieces can be changed per move. When a limit is hit, the piece is changed to some other colour instead.
  • When hindering (ds −1 to −5), pieces are pushed toward the colours that are rarest on the board, favouring the rarest of all. Fewer pieces share a colour, so matches and cascades are rarer.

The demo uses the game's rule tables (UBFuuuFalsifyConfig) and its rule order (UBFProductItemDiffChangeLogicV2). It simplifies one thing: a real board fills and clears as pieces land, while here the board counts stay fixed for the whole drop.

Where this steering aims you, relative to finishing on your last move, is the subject of Out of moves, so close.

Bought moves

If you buy +3 moves before a level, those extra moves count as further behind schedule, so the game helps more. If you buy +5 moves partway through, the adjustment normally switches off for those moves. In some server groups it stays on and keeps helping, and one of those groups limits that to players the server tags as non-spenders or low spenders.

Sources and confidence

What the code can't tell us

  • Which variants are live. Most tables have 2 to 8 variants, and the server picks one per player. This page shows the default. All the variants of the activity × spending table rise with spending.
  • How the server rates you. The skill rating and the spending figure are computed on the server, and the spending figure's units aren't shown.
  • The measurements. The attempts-per-setting data for each level comes from the server and isn't in the app.
  • Why spenders get harder targets. It may be meant to keep spenders spending, or it may compensate for boosters making levels easier anyway. The code doesn't say.

Where this comes from

Anipop 1.161 for Android. Its Lua scripts are encrypted; after decrypting them, the logic is in ubf/UBFGamePlayScene/logics/sceneModules/gameMod/modFolder/diffAdjust/:

  • DiffAdjustModMgr: when the system runs, the optional modules, and bought moves;
  • ubfuuu/UBFuuuSelectAdjust: the ratings, the difficulty index, the personal target and pity;
  • ubfuuu/UBFuuuSelfFeedback: choosing a setting from the server's measurements;
  • ubfuuu/UBFuuuDiffLogic and configs/UBFuuuDiffLogicConfigSetMap: progress against the curve, and ds;
  • ubf/UBFPlay/logics/product/UBFProductItemDiffChangeLogicV2 and configs/UBFuuuFalsifyConfig: recolouring.

The tables are in ubf/metaConfig/ubfuuu_*_config.lua: designed targets (ds_avg_map), the activity × spending table (diff_index_map), the stretch table (final_diff_map), pity (baodi_count_map) and the rating thresholds.