User File #638201181626369727

Upload All User Files

#638201181626369727 - flooder c64 custom board script

flodderc64.lua
Game: Flooder ( GBC, see all files )
212 downloads
Uploaded 5/19/2023 6:36 PM by Cephla (see all 19)
ok, this one's going to need a bit of an explanation. I found another flooder game https://josipretrobits.itch.io/flooder this time for the C64. The gameplay is identical to the GBC game which this script is written for except it's a level based game with all patterns being preset and the solutions gradually getting harder with the board getting bigger with each level. There's also no limit on the amount of moves that can be made, just as long as you can beat the level, you win. But that's not good enough for a TAS and I want to find the optimal solution for each level. My first thought was to adapt the brute force script for the GBC version for this version, but unfortunately the colour changes are not instantaneous and it takes a million years for the board to change colour one pixel at a time. It also doesn't help that you can only have 10 colours loaded at a time and you have to wait for the game to change colour ten times before you can load the next ten so this isn't a viable solution. Or is it? I've already got a script for the GBC game so why not recreate the C64 game in that game? What an absolutely fool proof solution. This file recreates the first level of the easy mode in the C64 mode by using colours 1-4 and a 6th grey colour to make the empty space.
I'm yet to modify the brute force script to make all pixels turn grey when the board is solved but I've got ideas for that. The C64 game isn't particularly fun to TAS and it takes ages so I haven't made much progress and I haven't actually used this custom pattern script properly yet. The best method I've tried so far to find the fastest solutions is good ol' google sheets (at one point I was using google slides lmao) but I haven't worked on this for weeks and probably won't again but thought it'd be worth uploading anywa
function setboard()
    --row 1
    mainmemory.writebyte(0x1F35,1)
    mainmemory.writebyte(0x1F36,0)
    mainmemory.writebyte(0x1F37,2)
    mainmemory.writebyte(0x1F38,3)
    mainmemory.writebyte(0x1F39,2)
    --row 2
    mainmemory.writebyte(0x1F43,1)
    mainmemory.writebyte(0x1F44,2)
    mainmemory.writebyte(0x1F45,3)
    mainmemory.writebyte(0x1F46,3)
    mainmemory.writebyte(0x1F47,3)
    --row 3
    mainmemory.writebyte(0x1F51,0)
    mainmemory.writebyte(0x1F52,1)
    mainmemory.writebyte(0x1F53,3)
    mainmemory.writebyte(0x1F54,3)
    mainmemory.writebyte(0x1F55,1)
    --row 4
    mainmemory.writebyte(0x1F5F,1)
    mainmemory.writebyte(0x1F60,1)
    mainmemory.writebyte(0x1F61,0)
    mainmemory.writebyte(0x1F62,2)
    mainmemory.writebyte(0x1F63,2)
    --row 5
    mainmemory.writebyte(0x1F6D,1)
    mainmemory.writebyte(0x1F6E,1)
    mainmemory.writebyte(0x1F6F,2)
    mainmemory.writebyte(0x1F70,3)
    mainmemory.writebyte(0x1F71,3)
    --row 6
    mainmemory.writebyte(0x1F7B,2)
    mainmemory.writebyte(0x1F7C,0)
    mainmemory.writebyte(0x1F7D,1)
    mainmemory.writebyte(0x1F7E,2)
    mainmemory.writebyte(0x1F7F,2)
    --row 7
    mainmemory.writebyte(0x1F89,3)
    mainmemory.writebyte(0x1F8A,2)
    mainmemory.writebyte(0x1F8B,2)
    mainmemory.writebyte(0x1F8C,2)
    mainmemory.writebyte(0x1F8D,2)
    --row 8
    mainmemory.writebyte(0x1F97,3)
    mainmemory.writebyte(0x1F98,1)
    mainmemory.writebyte(0x1F99,2)
    mainmemory.writebyte(0x1F9A,2)
    mainmemory.writebyte(0x1F9B,1)
    --row 9
    mainmemory.writebyte(0x1FA5,2)
    mainmemory.writebyte(0x1FA6,1)
    mainmemory.writebyte(0x1FA7,2)
    mainmemory.writebyte(0x1FA8,1)
    mainmemory.writebyte(0x1FA9,1)
    --row 10
    mainmemory.writebyte(0x1FB3,0)
    mainmemory.writebyte(0x1FB4,0)
    mainmemory.writebyte(0x1FB5,2)
    mainmemory.writebyte(0x1FB6,3)
    mainmemory.writebyte(0x1FB7,2)
end

function setborder()
    --row 1
    for i = 0x1F3A, 0x1F42 do
        mainmemory.writebyte(i,6)
    end
    --row 2
    for i = 0x1F48, 0x1F50 do
        mainmemory.writebyte(i,6)
    end
    --row 3
    for i = 0x1F56, 0x1F5E do
        mainmemory.writebyte(i,6)
    end
    --row 4
    for i = 0x1F64, 0x1F6C do
        mainmemory.writebyte(i,6)
    end
    --row 5
    for i = 0x1F72, 0x1F7A do
        mainmemory.writebyte(i,6)
    end
    --row 6
    for i = 0x1F80, 0x1F88 do
        mainmemory.writebyte(i,6)
    end
    --row 7
    for i = 0x1F8E, 0x1F96 do
        mainmemory.writebyte(i,6)
    end
    --row 8
    for i = 0x1F9C, 0x1FA4 do
        mainmemory.writebyte(i,6)
    end
    --row 9
    for i = 0x1FAA, 0x1FB2 do
        mainmemory.writebyte(i,6)
    end
    --row 10 + rest
    for i = 0x1FB8, 0x1FF8 do
        mainmemory.writebyte(i,6)
    end
end

setboard()
setborder()