XP Formula & Mechanics

How Nevi calculates levels from XP, the exact thresholds for each level, spam protection, and how XP batching works.

The level formula

Nevi uses a square-root-based formula to convert raw XP into a level:

level = floor(0.177 * sqrt(xp)) + 1

The inverse formula calculates how much XP is needed to reach a specific level:

xp = ceil(((level - 1) / 0.177) ^ 2)

This curve is designed so that early levels come quickly, keeping new members engaged, while higher levels require exponentially more XP, making them genuine achievements. A member might hit Level 5 in their first few days, but reaching Level 50 takes sustained activity over weeks or months.

Level thresholds

Here's a reference table showing the total XP required to reach key levels. These values are calculated using the inverse formula xp = ceil(((level - 1) / 0.177) ^ 2).

LevelTotal XP RequiredXP from Previous Level
10-
23232
312896
5508192
102,573540
156,225860
2011,4641,179
2518,2891,498
3026,7011,818
4048,3882,457
5076,2833,097
75174,1564,694
100310,2606,292

Notice how the gap between levels grows steadily. Going from Level 1 to Level 2 takes just 32 XP, but going from Level 99 to Level 100 requires over 6,000 XP. This keeps higher levels feeling meaningful and prestigious.

XP per message

XP is earned once per message that a user sends. The amount of XP awarded varies slightly per message to add a bit of natural variance, but the key rule is simple: one message = one XP award.

Message length does not affect XP. A one-word message earns the same XP as a paragraph. This keeps the system fair and prevents members from gaming it by sending artificially long messages.

Spam protection

To prevent members from farming XP by spamming short messages, Nevi enforces a cooldown between XP awards. If a user sends multiple messages in rapid succession, only the first message within the cooldown window earns XP - the rest are silently ignored for XP purposes.

This means normal conversation is always rewarded, but rapid-fire spam or copypasting won't give any XP advantage. The messages still send normally - they just don't count toward XP.

Tip

If you have channels where spammy behavior is expected (like bot command channels), you can ignore them from XP tracking entirely so they don't interfere with the leveling system.

XP batching

For performance, Nevi does not write XP to the database on every single message. Instead, XP updates are accumulated in memory and flushed to the database every 30 seconds.

This means there can be up to a 30-second delay between a message being sent and the XP appearing in the database. In practice, this is invisible to users. Level-up notifications still fire at the correct moment because the in-memory XP count is always up to date. The batching only affects when the data is persisted to disk.

This approach lets Nevi handle high-traffic servers efficiently without overwhelming the database with constant writes.

Related Commands

/leaderboardeconomy

View the server leaderboard