tuna

joined 5 months ago
[–] [email protected] 16 points 3 months ago

And make sure the time is synced to the cloud so they need internet connection, and so the player can't be sneaky and reload the game to reset the timer if they pressed x too many times

[–] [email protected] 6 points 3 months ago

This reminds me of my ex gf 😅 not only does she enjoy "kid" shows and movies, but HER NAME IS ANDY TOO. That image would definitely dealt some damage. For us though we broke off on good terms. Right person, wrong time, wrong place :(

[–] [email protected] 2 points 3 months ago

Happy to participate!

The one thing I wasn't super sure on was the undo timer... was it really 30 seconds 😅? I thought it was 5-15s, but i didnt really time it. And I'll be honest, I missed it maybe 3 times, so not much.

Besides just increasing the delay, there's 2 other thoughts:

  • A bigger target takes less time to hit (tho making it bigger might bother some, as it obstructs the canvas)
  • Two times I missed were bc I failed to notice my mistake. Maybe some extra visual feedback when you place a pixel could help. For example: when the void made it to my art, I accidentally made a dark gray become black, so it was harder to notice the color change. i was too busy focusing where to place the next pixel

Overall if you feel that the undo time was fine as it was I could easily respect that decision :)

[–] [email protected] 5 points 3 months ago (1 children)

I think I agree on the cooldowns. Often times I wanted to step away and let the pixels accumulate, but it's hard to resist when you realize you'd be missing out on double or triple the amount of pixels you could be placing. If the goal was to reward the player for actively placing pixels, all I can say is it didn't feel very rewarding.

I kinda disagree about the integer scaling. 1x to 2x zoom is a very big shift without any in-between. It would also feel strange on pinch-to-zoom on mobile without in-between. I think instead it could snap to an integer scaling, or have a zoom slider that works to integer scaling. Overall though I agree, having a way to snap into integer scaling makes the pixel art look better

[–] [email protected] 20 points 3 months ago (3 children)

On mobile I kept opening the whois pixel by accident when dragging. I often tap and hold to initiate a drag because I'm still looking at the art, but when i drag away and let go, it opens the whois thing. I think if you drag a certain screen-space distance away it should cancel the whois pixel lookup.

The heatmap I found too hard to tell where recent pixels were placed. I think at 100% opacity the "cold" pixels should be dark blue instead of their actual color.

A couple times I placed a dot, realized I actually didn't want it there and ran out of time to undo, which felt bad having to wait 30s. I wish it was a bit longer.

When you try to place a pixel a few milliseconds too early I feel like it should queue it and wait the few milliseconds for you.

I'm not super sure on the canvas having transparency. Most people treated the canvas as white, not transparent. If you wanted a white-on-white drawing, people will just make an outline.

Maybe a concept worth testing: if you place a pixel next to your own pixels, you get a (slightly) reduced cooldown, that way you get an extra boost when completing your art. (At the same time, I think there is beauty in the canvas being as simple as possible:)

[–] [email protected] 3 points 3 months ago
  1. RIP Apollo
  2. I almost didn't join lemmy because the first time you sign up in the fediverse it feels like a big deal. What got me to actually follow through was to impulsively join a silly instance (RIP iusearchlinux.fyi)
[–] [email protected] 3 points 3 months ago

i tried to fill in the blåhaj but i ran out of time D:

[–] [email protected] 3 points 3 months ago

I noticed it and placed a few pixels :D

Here's one on the claw

[–] [email protected] 1 points 3 months ago

You might be okay with this:

macro_rules! span {
    ($line:expr, $column:expr) => {
        Span {
            line: $line,
            column: $column,
            file_path: None,
        }
    };
    ($line:expr, $column:expr, $file_path:literal) => {
        Span {
            line: $line,
            column: $column,
            file_path: Some($file_path.to_string()),
        }
    };
    ($line:expr, $column:expr, $file_path:expr) => {
        Span {
            line: $line,
            column: $column,
            file_path: $file_path,
        }
    };
}

Playground

However, sometimes I don't want to pass in the file path directly but through a variable that is Option<String>.

Essentially I took this to mean str literals will be auto wrapped in Some, but anything else is expected to be Option<String>

[–] [email protected] 1 points 4 months ago

Another optimization:

  • The first index of each index array can be filled by a function. For 257x257 that would remove 8,487,169 checks out of... 2,164,392,321. Not much, but it's basically a free optimization, so might as well!
[–] [email protected] 2 points 4 months ago (1 children)

More progress on the Finite Projective Plane (incidence matrix) generation from last week. There already exists an algorithm to generate boards of order p+1 where p is prime. It is stateless, so with CUDA we can generate huge boards in seconds since all you need is the x, y position and board size. 258x258 under 3s!

However, p+1 isn't the only sequence. It seems by our observations that the fermat numbers also generate valid boards, using our "naïve" algorithm.

Unfortunately 3x3, 5x5, and 17x17 might not contain all the nuggets of generality to find a nice algorithm like the p+1, so we're gonna generate the next up: 257x257. We've been improving the naïve algorithm since it is too slow. (The resulting image would be 65793x65793)

  • Rather than allocating the 2d boolean grid, we represent where the true elements would be using row and column indexes. This is okay because of the constraint which limits how many true elements can be in a row/column
    • benefit 1 — less memory usage: "O(2n)" vs O(n²) ((for 257x257: 129MiB vs 4GiB))
    • benefit 2 — faster column-major lookups (flamegraph spent a lot of time sitting in iterators)
    • overall speedup: about 2.7x
  • Speed up index lookup with binary search
    • The index list is sorted by nature. To exhaustively check a dot is valid, it checks n² spots in 2 lists of size n. Slightly more expensive than the grid given the 2 index lists. Rather than slice::contains, use slice::binary_search(...).is_ok()
    • overall speedup: about 2.1x

Next steps:

  • Assume a square grid and exploit its diagonal symmetry to treat row lookups as column lookups
  • Use multi threading to gain a partial speedup
    • Essentially if row 1 is 50% completed, row 2 can be up to 50% completed.
    • I think you get different speeds depending whether the threads and symmetry folds are both row/column major or one is row-major and the other is column-major. My gut says both need to be aligned because there's less waiting involved.
[–] [email protected] 2 points 4 months ago* (last edited 4 months ago)

Apparently generating "Finite Projective Planes". For context on how I got here, I went camping with my family and brought the game Spot It. My brother was analyzing it and came up with the same type of pattern.

When we got home he made a python script to generate these boards, but it was quite slow, so he half joked asking me to rewrite it in Rust.

I kinda struggled a bit since I didn't fully understand what it was doing. Near the end I even got a segfault using safe code😃! (i was spawning a thread with a large stack size, and allocating huge slices on its stack, rather than you know.. boxing the slice Lol.) When I finally got it working, it ended up being in the ballpark of a 23x speedup. Not bad for changing the language choice!

There's lots of room for improvement left for sure. The algorithm could benefit with some running statistics about cols/rows and the algorithm itself is quite naïve and could maybe be improved too :P

view more: ‹ prev next ›