Audiosurf 2

Audiosurf 2

Mod your music
Customize everything you hear, everything you see, and even the way you play. Choose a song, choose a mod, and choose a skin. Mix and Match!
Ofecks 11 Mar, 2017 @ 7:02pm
Scoring Issue
I'm currently working on a mod for my own enjoyment. It uses Casual as a base, but no grid, and each block pickup is worth an increasing number of points (much like Audiosurf 1, but it doesn't cap at 66). This is done with a "chain" variable that increases by 1 with each color/power block hit. Hitting a gray resets the chain completely. I've implemented this and end-of-song score bonuses properly, but I'd like to make it so *missing* a color/power block reduces the current chain by 1. I think I found the right place for this logic - as an else condition of the following if statement in the Collision function:

if (blocks[i].lane == playerLane) and (blocks[i].impactnode > highestNodeCollidedAt) then

Casual base has no else condition here. What I put in is as follows:

else
if blocks[i].type ~= 5 then
perfect = false
if chain > 0 then chain = chain - 1 end
end

Summary - missing any block besides a gray disqualifies you for the perfect bonus and reduces your current chain by one (but doesn't go below zero).

Now this works, but not quite as indended. The chain is definitely reduced on the next pickup after missing one block, but it's always by more than 1. For example, during testing I had a chain of 45, missed a block, expected the next one to be 44, but it was 36. On a quick 6-second song that has 5 color blocks and 1 gray, missing block #4 will give me 7 points total instead of 8 like I expect (1 + 2 + 3 + 0 + 2).

Any ideas? This doesn't make sense at all.
Last edited by Ofecks; 11 Mar, 2017 @ 7:14pm