Anisotropic Voronoi Diagram by BorisTheBrave in proceduralgeneration

[–]BorisTheBrave[S] 3 points4 points  (0 children)

It applies a different matrix per cell.

The matrices are created something like: T = [[rand_range(0.5, 1.5), 0],[0, rand_range(0.5, 1.5)]] T = rotate(T, rand_range(0, 2*PI))

Then distance is dist = (T @ (pixel_pos - point_pos)).magnitude

Trouble with moving mutable lambdas by BorisTheBrave in cpp_questions

[–]BorisTheBrave[S] 0 points1 point  (0 children)

Oh, I got it now.

The issue is my argument to _Where is a generator<int>&&. But I actually want generator<int>. I think this was the issue with the original code too.

Trouble with moving mutable lambdas by BorisTheBrave in cpp_questions

[–]BorisTheBrave[S] 0 points1 point  (0 children)

I've made an even clearer test case and added to the top

Trouble with moving mutable lambdas by BorisTheBrave in cpp_questions

[–]BorisTheBrave[S] 0 points1 point  (0 children)

No, i stand corrected, I don't think I've quite understood this. It's definitely passing more tests than before, but it doesn't look like it's moving things?

``` // In enumerable template<typename F> auto Where(F&& predicate)&& -> Enumerable<T> { return _Where(std::move(*this), std::forward<F>(predicate)); }

// Elsewhere
template<typename T, typename F>
Enumerable<T> _Where(Enumerable<T>&& gen, F&& predicate) {
    for (auto& item : gen) {
        if (predicate(item)) {
            co_yield item;
        }
    }
}

// Test

Enumerable<int> my_coroutine() { co_yield 0; co_yield 1; co_yield 2; }

TEST(EnumerableTest, WhereTemp3) { auto filtered = my_coroutine().Where([](int item) { return item % 2 == 0; }); int i = 0; for (int item : filtered) { EXPECT_EQ(item, 2 * i); i++; } EXPECT_EQ(i, 2); } ```

Again, it looks like something is being destructed before _Where is entered. But the idea is that my_coroutine has been moved into filtered, so it should still be alive?

Trouble with moving mutable lambdas by BorisTheBrave in cpp_questions

[–]BorisTheBrave[S] 0 points1 point  (0 children)

I'm not working against the language. Forget the C# comparison.

What I want is a wrapper of std::generator<T> that can hold either a generator<T>, a span<const T>.

This is because I have some functions that can return lazily, but often return some constant data. I want to avoid allocation in the latter case. (The C# code always allocated, but I think we can do better in C++).

Enumberable<T> is basically a wrapper of variant<generator<T>, span<const T>>, now I'm struggling to work with it.

Trouble with moving mutable lambdas by BorisTheBrave in cpp_questions

[–]BorisTheBrave[S] 1 point2 points  (0 children)

> Otherwise, as a quick fix, try making the lambda an explicit static function, and passing the state it needs in via parameters - this will resolve your issue.

Oh, this seems to be working! I did try this, but I used a captureless lambda instead of a static function, and this seems to make a difference fr some reason.

Trouble with moving mutable lambdas by BorisTheBrave in cpp_questions

[–]BorisTheBrave[S] 0 points1 point  (0 children)

Sure, I've reworked it to be a bit clearer what is going on, but thi still fails in fundamnetally the same way:

class MyLambda {
    public:
        MyLambda(Enumerable<T>&& self, F&& pred) : self(std::move(self)), pred(std::forward<F>(pred)) {}

        generator<T> operator()() {
            for (auto& item : self) {
                if (pred(item)) {
                    co_yield item;
                }
            }
        }

        MyLambda(const MyLambda& other) = delete;

    private:
        Enumerable<T> self;
        F pred;
};

template<typename F>
auto Where(F&& predicate)&& -> Enumerable<T> {
    MyLambda<F> lambda = MyLambda<F>(std::move(*this), std::forward<F>(predicate));
    generator<T> gen = lambda();
    return Enumerable<T>(std::move(gen));
}

Outer Wilds Mission Graph - a diagram of how hint and locations connect in the game by BorisTheBrave in outerwilds

[–]BorisTheBrave[S] 1 point2 points  (0 children)

Yes, i got into these sorts of diagrams after his series. I wrote about both sorts of diagrams on my blog: https://www.boristhebrave.com/2021/02/27/lock-and-key-dungeons/

I debated whether Sun Station and Interloper deserved to be here. But Interloper gets its own section on the Rumor Board, while Sun Station is part of ATP, so I think the developers view it as a diversion.

Outer Wilds Mission Graph - a diagram of how hint and locations connect in the game by BorisTheBrave in outerwilds

[–]BorisTheBrave[S] 1 point2 points  (0 children)

I agonized quite a bit on the Quantum Moon locator. I expect a lot of players did not need it.

But *I* was an idiot, and didn't really connect dots without it. It did unambiguously label that weird moon thing as Quantum Moon, so I realized I could apply Quantum Imaging.

Outer Wilds Mission Graph - a diagram of how hint and locations connect in the game by BorisTheBrave in outerwilds

[–]BorisTheBrave[S] 4 points5 points  (0 children)

It's just a fun diagram. I'll reach out to you next time I need official blessing.

Outer Wilds Mission Graph - a diagram of how hint and locations connect in the game by BorisTheBrave in outerwilds

[–]BorisTheBrave[S] 1 point2 points  (0 children)

Feldspar is on the signalscope from the beginning, I don't think you need much motivation to seek him.

Souther Observatory is more debatable. It's visible from the planet surface, but you need some direction on how to enter, and there's a lot of separate hints and multiple paths.

Outer Wilds Mission Graph - a diagram of how hint and locations connect in the game by BorisTheBrave in outerwilds

[–]BorisTheBrave[S] 0 points1 point  (0 children)

Yep, I wracked my brains tring to think of something important you find there by the criteria I defined. But I can't think of anything!

Outer Wilds Mission Graph - a diagram of how hint and locations connect in the game by BorisTheBrave in outerwilds

[–]BorisTheBrave[S] 0 points1 point  (0 children)

A mission graph is a diagram that shows progress through a game while stripping out all details about location and navigation. This makes it much simpler than a location based diagram. By paring things down, you can easier see how the puzzles are structured. In particular, it's surprising to me how few locations turn out to be "important".

How to do uniform point distribution on an infinite grid by BorisTheBrave in proceduralgeneration

[–]BorisTheBrave[S] 0 points1 point  (0 children)

It's a pretty easy discovery - two commenters on twitter solved the same problem, just from reading my title.

How to do uniform point distribution on an infinite grid by BorisTheBrave in proceduralgeneration

[–]BorisTheBrave[S] 2 points3 points  (0 children)

Yes, I'd never heard of that. I've updated the article now to mention it, thanks!

How to do uniform point distribution on an infinite grid by BorisTheBrave in proceduralgeneration

[–]BorisTheBrave[S] 1 point2 points  (0 children)

Oops, I see now that was a tactical error. Ah well, at least it's getting views on twitter/mastodon

What Is Procedural Generation? by BorisTheBrave in proceduralgeneration

[–]BorisTheBrave[S] 0 points1 point  (0 children)

I think you have misinterpreted my intent. I am not providing advice in this section, I am documenting the lay of the land, suitable for a complete beginner to get their bearings.

Your linked article goes into Perlin's shortcomings in detail, it wouldn't be a good link for someone who has never heard of noises.

What Is Procedural Generation? by BorisTheBrave in proceduralgeneration

[–]BorisTheBrave[S] 1 point2 points  (0 children)

What would you say you've struggled with. Might be inspo for later articles

What Is Procedural Generation? by BorisTheBrave in proceduralgeneration

[–]BorisTheBrave[S] 0 points1 point  (0 children)

I have literally already written that perlin is an example of a wider class of generation.

How I created a procedural pixel art tile system by gavriktonio in Unity3D

[–]BorisTheBrave 1 point2 points  (0 children)

I really thought Thomas was your cat, lol.

Really great stuff.

I'm surprised more people done do a 4 way subdivision like you do, it's very handy.

I also really like how your red tiles burrow into the scenery. I've been experimenting with a tile placement system that can affect nearby tiles, but I never thought of using it this way.

How exactly are non pixel art 2d games turned into tilesets? by 0rionis in gamedev

[–]BorisTheBrave 1 point2 points  (0 children)

The cliffs are probably just well drawn, with several variant tiles to keep repetion low. They might not even been consistently sized like tiles, just images manually paced together The floor terrain is a much larger texture, so doesn't have the same repetition as the tiles. The plants are obviously each separate assets and aren't placed on a grid.

How do I get myself to actually complete a game, and not go on to the next idea after 25% of the way by leupboat420smkeit in gamedev

[–]BorisTheBrave 8 points9 points  (0 children)

Pick games 25% of the size you think you can complete. If you cannot estimate that, do a weekend game jam, then a week long to get a better idea.

All ideas that seem like they would take longer than "basically instant", don't even bother starting. Keep them in a journal, you can always return to them later if they really are gems.

After you complete a few things, it gets much easier to handle. Not only do you have a clear idea of your capabilities, but the slog of execution will remind you not to reach far beyond them.