[–] 19 points 5 months ago* (last edited 5 months ago) (1 child)

I'd just like to interject for a moment. What you're referring to as Xbox, is in fact, Xbox on PC or as I've recently taken to calling it, PC plus Xbox. Xbox is not a gaming system unto itself, but rather another free component of a fully functioning PC system made useless by the PC data-extracting utilities, forced Copilot integration and bloated system components comprising a full OS as defined by Microsoft.

  • source
  • parent
  • context
  • [–] 9 points 5 months ago* (1 child)

    If status is modified in another thread you could have a race condition with method 1 because you're checking it twice. The two methods are not exactly the same code due to that.

  • source
  • [–] 4 points 5 months ago* (1 child)

    Are 1 and 2 magic values in this case?
    You could use consts or even use an enum to further improve readability:

    const STATUS_ERROR   := 1
    const STATUS_WARNING := 2
    # or alternatively:
    enum Status { FINE, ERROR, WARNING }
    

    In the latter case, you'd change status to be the new enum type Status.

    edit: Wait, nevermind. I think you're already using enums in the actual code (not screenshot).

  • source
  • [–] 14 points 5 months ago

    The match statement is cleaner.

    With the sequential if statements, it might seem on a casual read that both if statements could pass - you'd catch both warnings and errors. Only by looking at the conditions do you realize that only up-to-1 of them will run.

    With the match statement, it's very immediately obvious that only one of the commands will run.

  • source
  • [–] 7 points 5 months ago (1 child)

    Not sure about how to do this with Godot, but a common pattern for this in other languages is creating something like a 32 bit value where the lower bits are the enum and the upper bits are the status code (assuming they are <=16bit each) and then doing a switch on the resulting packed value.

  • source
  • [–] 2 points 5 months ago (1 child)

    eww, that would mean giving google your govt id and essentially being their bitch. I'd rather use literal paper and write code by hand, then do it on or for anything google related

  • source
  • [–] [S] 2 points 5 months ago (1 child)

    I didn't hat the opportunity to write on this comment yesterday, so I'll do it today. Freaking awesome idea. Right now when I need to make some more "complex" logic for the AI, I'm using the singleton for the CombatManager to keep it with its data. But having a resource for the combat_context would solve and make it able to have more isolated, and for sure create even a replicable combat (since each turn is "predictable")... Love it. Thanks for the comment.

  • source
  • parent
  • context
  • [–] 3 points 5 months ago (2 children)

    Hey, Shin!

    You seem pretty excited about your weighted selection strategy for choosing enemy actions, and I thought I'd share with you some other cool tricks.

    I'm going to hide them in a spoiler, though, in case you're like me and you really love figuring things out on your own.

    Tap for spoiler

    If you get your action weight from a function call, something like:

    action_heal.get_weight(battle_context) => float;

    You can use the information in battle_context (remaining HP, for instance) to dynamically change how likely each action is to be chosen, which seemed to be something you wanted to look into.

    You can even return a weight of 0 if the battle_context would suggest the action would be useless.

    For something much more complicated, you might want to look into a concept called a Behavior Tree. Even if you don't use one, you might learn a lot from how they're constructed. Video game AI, robotics, and all kinds of other stuff use them pretty often.

    If you want to see an example of a what a really simple behavior tree is capable of (so simple it might be more accurately called a Decision Tree), you should look into Final Fantasy 12's Gambit system. This game actually lets players program their own party member AI to do certain things when certain conditions are met, and it ends up being a really useful if barebones model that I've based a few AI systems on. If you wanted to combine that with the weighted random-choice trick to add a little more decision variety, I'm sure there's a cool way to do that.

    ❤️ 1
  • source
  • [–] 8 points 5 months ago*

    Jetbrains being amazing as usual. Their tools are the best in the business. There are entire languages that are only usable because of their work.

    I just wish they hadn't gone all-in on AI. I know it was either that or lose IDE market share, but they should at least have made the AI features opt-in.

  • source
  • [–] 3 points 5 months ago

    This is good.

    The asset library has needed an overhaul for a while.

    Reviews and tags will help a lot, the currently existing search features... well you basically have to know the name of what you are looking for, and even still, I've run into things that literally have the exact same name, but are made by different people.

  • source
  • [–] 3 points 5 months ago

    My dream is that we see an economy of "parts makers" flourish thanks to this, but this will live and/or die based on who exactly starts filling up the store - and with which assets.

  • source
  • view more: ‹ prev next ›