Quick devlog with some learning from a protoype

5 months ago by Shin to c/godot

What can you learn from a prototype? Can a prototype generate something meaningfull for a game? Or they are just wasteful energy? This is the dicussion and leanings from this weekend.

This may be interesting for people to read. Just a warning, all AGPL, so using this code snippets will make your source open. Hope you like the reading.

petrol_sniff_king 3 points 5 months ago

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.

path: 0 24005680, hotness: undefined, score: 3, children: 2
Shin 2 points 5 months ago

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.

path: 0 24005680 24014045, hotness: undefined, score: 2, children: 1
petrol_sniff_king 2 points 5 months ago

You're welcome, my friend. :)

path: 0 24005680 24014045 24020009, hotness: undefined, score: 2, children: 0
godot
godot

@programming.dev

login for more options
7983
1194
559

Welcome to the programming.dev Godot community!

This is a place where you can discuss about anything relating to the Godot game engine. Feel free to ask questions, post tutorials, show off your godot game, etc.

Make sure to follow the Godot CoC while chatting

We have a matrix room that can be used for chatting with other members of the community here

Links

Other Communities

Rules

  • Posts need to be in english
  • Posts with explicit content must be tagged with nsfw
  • We do not condone harassment inside the community as well as trolling or equivalent behaviour
  • Do not post illegal materials or post things encouraging actions such as pirating games

We have a four strike system in this community where you get warned the first time you break a rule, then given a week ban, then given a year ban, then a permanent ban. Certain actions may bypass this and go straight to permanent ban if severe enough and done with malicious intent

Wormhole

!roguelikedev@programming.dev

Credits

  • The icon is a modified version of the official godot engine logo (changing the colors to a gradient and black background)
  • The banner is from Godot Design

go to feed...