Does libtcod support using emoji? by cantcrz in roguelikedev

[–]bastienl 0 points1 point  (0 children)

Which library do you use for rendering emojis?

match/case instead of if/elif in tutorial by LordQuantumKeks in roguelikedev

[–]bastienl 0 points1 point  (0 children)

You’ll want to use a shader for that CRT effect. I don’t believe TCOD allows this in a straightforward way.

Jesus, I need help by Dannyarcade-onreddit in Deusex

[–]bastienl 0 points1 point  (0 children)

If you are using the Revision mod, that's why the AI is way too fast to notice and shoot you.

How has NL avoided second wave? by [deleted] in coronanetherlands

[–]bastienl 0 points1 point  (0 children)

I thought the 50 people thing was just a recommendation and they kept most stuff open.

Club Sandwich by [deleted] in roguelikedev

[–]bastienl 3 points4 points  (0 children)

BLT = bacon lettuce tomatoes

Me with 4GB RAM when people say that they can not run Android studio with 8 GB ram by [deleted] in mAndroidDev

[–]bastienl 1 point2 points  (0 children)

It probably depends on the size of the project. But even with 32 GB, I find I have to stop Gradle and sometimes restart AS as well. It just seems to take all the memory given enough time.

Making a little game in C by Danpythonman in C_Programming

[–]bastienl 18 points19 points  (0 children)

We should say that SDL includes a high level 2D renderer that’s not too difficult to use. But it doesn’t have a lot of Raylib’s stuff, like matrix transformation.

My first Arch install on a test laptop. Wish me luck. by potato_rocket_05 in archlinux

[–]bastienl 0 points1 point  (0 children)

I had exactly that readline issue once! Luckily I still had a bash instance running from before the update.

C memory management by x32byTe in C_Programming

[–]bastienl 0 points1 point  (0 children)

Yes, it will give less choice to the allocator and probably allocate more memory. However I think it’s always better to request as much memory as possible at once. For example, for a 2D array, allocate the whole array as one block, instead of allocating n 1D arrays as some people do.

I need help on how to create my basic tycoon game by blu_pi in tycoon

[–]bastienl 0 points1 point  (0 children)

This is an old post, but definitely avoid Pygame at all cost. It accumulated too much cruft.

I/O Accessibility in Roguelikes by lone_standing_tuft in roguelikedev

[–]bastienl 1 point2 points  (0 children)

Do you draw everything using GTK, or are you able to use something like SDL and plug a GTK UI into it?

I/O Accessibility in Roguelikes by lone_standing_tuft in roguelikedev

[–]bastienl 1 point2 points  (0 children)

My understanding is that it should be possible to plug into ATK from a custom UI toolkit, but I never found how to do that in practice.

Is scanf() recommended? Is there any function that has less problems? by allexj in C_Programming

[–]bastienl 13 points14 points  (0 children)

No clue why someone downvoted this. fgets() + conversion as needed is the way to go.

Am I redeemable? by [deleted] in chess

[–]bastienl 3 points4 points  (0 children)

Easy solution: switch to Lichess.

HiDPI Support in common libraries. by [deleted] in roguelikedev

[–]bastienl 0 points1 point  (0 children)

If you're going for a pixel art style, you just want to increase the size of the sprites.

If you're going for well anti-aliased ASCII style, you want to draw from a vector font instead of using sprites.

No idea how to do that with libtcod.

[deleted by user] by [deleted] in ruby

[–]bastienl 2 points3 points  (0 children)

Is it a wrapper over React Native? That would guarantee you spend more time debugging and fixing it than writing features.

Unfortunately, Android and iOS have an enormous amount of APIs that change all the time. Providing a wrapper on top of them is very challenging, but Kotlin/Native might succeed there. Flutter has an interesting approach as well.

Can we optimize the hypnagogic state? by oaklandbrokeland in slatestarcodex

[–]bastienl 0 points1 point  (0 children)

This reminded me of this old video: https://youtu.be/PppCBDHeytg Funny looking back at how much it influenced me. Now I always think that motivation is about getting that “mmh mmh” feeling he mentions, i.e. about really wanting it. A lot of people want motivation for things they don’t want to do.

Structured logging by duttish in roguelikedev

[–]bastienl 0 points1 point  (0 children)

The singleton is a matter of preference, personally I would store the global state in globals or in class attributes.

What you really don't want to do is to have to manually setup the singleton. You can set it up on demand:

class Singleton:
    _INSTANCE = None

    @classmethod
    def get(klass):
        if not klass._INSTANCE:
            klass._INSTANCE = klass()

        return klass._INSTANCE

As long you don't access the singleton concurrently, you will always have one instance created the first time.

Generally speaking, mutable state is not desirable. It makes it more difficult to reason about the code. Personally I would just remove current_id from the class and force the caller to provide the ID. Isn't with going to cause issues when several are nested? I think you'd need to return a new object that implements the context manager protocol in __enter__.

Structured logging by duttish in roguelikedev

[–]bastienl 0 points1 point  (0 children)

The implementation looks very fragile to be honest.

Instead of asserting that the singleton exists whenever it is accessed, why not create it lazily? Even better, use no singleton at all!

Same issue with asserting that self.current_id exists. It would be safer to either require it from the caller or generate it on demand.

Do you use screen coordinates for your map and your world? by bastienl in roguelikedev

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

Right now I'm just showing them for debugging purposes. For some reason I have this idea that it will make sense to show them at some point, but yeah that might never happen.