QOTD: What are your favorite features in the latest version of Godot and how have they improved your game development process?

3 years ago by Ategon to c/godot

russmatney 8 points 3 years ago

Anonymous functions and callables have been a really nice step-up for GDscript.

Lots of formerly annoying things are much cleaner now, like getting away from connecting signals with strings, and using map and filter, etc.

path: 0 132312, hotness: undefined, score: 8, children: 2
b64 1 point 3 years ago path: 0 132312 147635, hotness: undefined, score: 1, children: 1
russmatney 5 points 3 years ago

Indeed! I pulled a few below (too many?) from my current project, Dino, which is on github if you want to dig into more.

Some of these make use of custom autoloads, but should still show the idea. Note the use of bind in places as well, which is making use of the same func/callable improvements.

  • Inlining a setup_fn to be called on the player after they're respawned:
func on_player_died(_player):
  Game.respawn_player.call_deferred({setup_fn=func(p):
    Hotel.check_in(p, {health=p.initial_health})})
  • Inlining a hide_fn predicate in a list of data (these dictionaries eventually get mapped into buttons)
var menu_scenes = [
  {label="Start Game", fn=Game.restart_game.bind(SuperElevatorLevel)},
  {label="Dino Menu", fn=Navi.nav_to_main_menu,
   hide_fn=func(): return not (OS.has_feature("dino") or OS.has_feature("editor")),
}]
  • Gathering a list of resource_paths from a list of levels:
var level_paths = levels.map(func(l): return l.resource_path)
  • A basic inline connect:
player.ready.connect(func(): player_ready.emit(player))
  • A more interesting connect:
func on_player_spawned(player):
  player.died.connect(on_player_died.bind(player), CONNECT_ONE_SHOT)
  • Creating a bunch of actions that use predicates heavily:

I have a general actions system, so it's nice to be able to implement small functions to describe some behavior rather than create a fully named function for every piece of logic.

var actions = [
  Action.mk({label="Open", fn=open_door,
    source_can_execute=func(): return state == door_state.CLOSED}),
  Action.mk({label="Close", fn=close_door,
    source_can_execute=func(): return state == door_state.OPEN}),
  Action.mk({label="Unlock", fn=unlock_door,
    source_can_execute=func(): return state == door_state.LOCKED,
    actor_can_execute=func(actor):
    if actor.has_method("can_unlock_door"):
      return actor.can_unlock_door()
    }),
  Action.mk({label="Jostle", fn=jostle_door,
    source_can_execute=func(): return state == door_state.LOCKED,
    actor_can_execute=func(actor):
    if actor.has_method("can_unlock_door"):
      return not actor.can_unlock_door()
    return true
    })
  ]
path: 0 132312 147635 149222, hotness: undefined, score: 5, children: 0
feidry 7 points 3 years ago

Being relatively new to Godot, I don't have particularly good sense of what's new or old but some of my favorite features of the engine are:

No. 1 above all else is how lightweight it is.

The fact that it's totally open source and will never cost me a dime.

I really didn't like GDScript in the beginning but after working with it for a while, I've come around to see how fast and easy it is to get things going.

I love that if you set a custom splash for your game, the editor gets the same splash. Makes it feel a lot more personal to your project.

Some of these are going to sound pretty inconsequential but I don't think so. All of them remove startup friction and get you wanting to work on your game more.

path: 0 127645, hotness: undefined, score: 7, children: 0
F4stL4ne 5 points 3 years ago

Multiple instances launch, that's really cool to work on multiplayer games.

path: 0 160032, hotness: undefined, score: 5, children: 0
ZachAR3 4 points 3 years ago

New pathfinding system, I use a procederul map in my dungeon crawler and previously needed to use AStar3D which was clunky, since old path finding didn't support building during gameplay. Now it does in addition to active object avoidance which is awesome, there are still a few big issues like not being able to set an avoidance radius per object it's per zone (meaning you can't have big and small objects pathfind in the same zones easily without colliding into walls or having to be extremely far from them)

path: 0 131309, hotness: undefined, score: 4, children: 0
Zinx 2 points 3 years ago

Still waiting for 4.1, but just being able to have the script editor and shader editor in two different windows will be amazing.

path: 0 205991, hotness: undefined, score: 2, children: 0
greeen_tomato 1 point 3 years ago

+1 something like friday evening until sunday night would be nice imho.

path: 0 168139, hotness: undefined, score: 1, 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...