Crafting
Learning paths through this topic
Refund a cancelled craft fairly, including paid coins, and never twice
A player starts a craft and changes their mind. Taking nothing back is harsh, giving everything back lets them park materials for free, and a refund that can be triggered twice by a double tap is a money printer. This entry returns materials in proportion, treats paid coins more kindly, and pays out exactly once.
Work out how long the player was away when the phone's clock cannot be trusted
Crafting jobs finish while the app is closed, so the game compares the clock now with the clock at the last save. But players change time zones, phones fix their clock overnight, and some players set it forward on purpose. This entry gives away-time that is never negative, uses the server when it can, and stops the clock from being used both ways.
Ask "are you sure?" before a craft uses up something precious, and only then
On a phone a thumb slips, and one wrong tap can turn a rare treasure into a plain potion. But a confirmation on every craft trains players to press yes without reading, so the one that matters is ignored too. This entry decides when to ask, when to stay quiet and how hard the confirmation should be to press.
Make a craft button on a phone work once when the finger lands twice
On a touchscreen a nervous tap often arrives twice, and a slow connection makes the game send the same request again. The player pays for two crafts and gets two, or pays twice and gets one. This entry tells a repeated tap from a repeated message, so each gets the right answer.
Build a quantity "+" button that speeds up while held and lands exactly on the maximum
Choosing how many to craft with a plus button takes forever if you can only add one per tap, and becomes a lottery if it runs wild when held. This entry adds one on the first press, starts repeating after a short pause, speeds up in stages, never jumps past the limit, and gives the same result whatever the frame rate of the phone.
Send one "your potion is ready" notification, not five and not at 3 a.m.
Crafting jobs finish at different times, and the phone should tell the player. Five buzzes in a row feel like spam, and one at three in the morning gets the app deleted. This entry groups jobs that finish close together into one message, moves the ones that fall in the night to the morning, and merges what then lands at the same moment.
Sort a long recipe list on a small screen so what you can make comes first
A phone shows six recipes at a time, and the list has sixty. Alphabetical order hides the one you can craft right now. The recipes that are one ingredient short deserve the next places, and locked ones the last. This entry orders the list that way, with a stable result, and how many copies you can make.
Keep players' items when an update renames or removes an ingredient
A game update renames "oak plank" to "plank" and drops an old gem. Players who update must find all their things in the new names, and nothing may vanish silently. A player who opens an old save on a newer version, or a newer save on an older one, must not lose what the game does not know. This entry maps the old save to the new without losing anything.
Make a crafting lottery stop handing out the part you already own
The player opens a salvage crate and gets the same helmet for the fourth time, while the boots never show up. It feels rigged even though it is random. This entry draws from what the player does not own yet, and turns the extras into something useful once the set is complete.
Charge a fair price for repairing only a part of the damage
A full repair costs four iron. The shield is only a little scratched, so the game asks for 0.2 iron, rounds it to nothing, and repairs are suddenly free. Or it rounds up to a full price for a tiny fix. This entry prices every fraction and repairs as much as the bag can pay for.
Limit how many crafted platforms a player can leave standing at once
A freeze ability builds little ice blocks to climb. Without a limit, the player builds a staircase to the sky and skips the level, and the game slows to a crawl. This entry caps the number, removes the oldest first, lets blocks melt, and handles two blocks placed on the same spot.
Decide what happens when a second power-up is grabbed while one is active
A platformer player runs through a fire flower while an ice charm is still glowing. Does the new one replace the old, add to it, or merge into something new? Without a rule, the answer depends on which line of code ran last. This entry gives one clear answer for every pairing.