Godot: The open source game engine

21 readers
1 users here now

A community for discussion and support in development with the Godot game engine.

founded 1 year ago
MODERATORS
126
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/SteinMakesGames on 2024-10-14 16:39:08+00:00.

127
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/TheOrioli on 2024-10-14 15:07:44+00:00.

128
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/wpaciej on 2024-10-14 13:42:05+00:00.

129
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/pineapple_works on 2024-10-14 13:14:02+00:00.

130
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/KhalzButHorny on 2024-10-14 12:04:49+00:00.

131
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/not_tomm on 2024-10-14 12:44:16+00:00.

132
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/gamedevserj on 2024-10-14 10:03:40+00:00.

133
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/ComedyReflux on 2024-10-14 08:30:25+00:00.

134
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/TaianYT on 2024-10-14 07:52:42+00:00.


Everything is in the title: is there any downsides to Autoload/Singletons ?

I'm quite new when it comes to GameDev and Godot in general, and I learnt about autoloads a few months ago. I've tried not to use them too much and really push forward the usage of class with static functions/variables, signals and other methods to keep my code organized.

But when I look at Autoloads, it just seems so powerfull and it seems like it could be used to pretty much anything. So here's my question, apart from the fact that you could easily end up with a messy code structure, is there any downsides with them ? For example does it take more memory to run, more performances ? Something else ? Or is it just a very handy option I should use more often ?

I'm really curious about it, thanks !

135
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/4procrast1nator on 2024-10-14 05:46:34+00:00.

136
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Pozykahn on 2024-10-14 00:19:19+00:00.

137
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Cayuga007- on 2024-10-13 21:06:56+00:00.

138
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/arnemcnuggets on 2024-10-13 22:17:08+00:00.

139
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/D-GreenGames on 2024-10-13 21:53:07+00:00.

140
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/AmilcarMen on 2024-10-13 21:31:03+00:00.

141
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Terra_Greatness on 2024-10-13 19:25:38+00:00.

142
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/InsightAbe on 2024-10-13 17:56:01+00:00.

143
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Balarius on 2024-10-13 16:40:16+00:00.


The code below used to take up just...all the space, an if statement for every word amongst other inefficient code. Im sure theres an even better way of doing the same thing but man, Woo! Just felt like sharing my days minor accomplishment with y'all.

Learning Note!: I learned doing this, that - Array.pop_front( ) is immeasurably less efficient than Array.pop_back( ). Because pop_back only returns (selects) and removes the final entry in the array, so its only targeting one entry. pop_front returns and removes the first entry but then has to shift all other entries down 1 spot because there always has to be a 0 option in an array.

func chooseWord():
  if WordArray.is_empty():
    print("Resetting WordArray")
    WordArray = ["Rat", "Car", "Box", "Map", "Key", "Pig", "Can", "Dog", "Hat", "Bat", "Bee",             "Arm", "Fly", "Saw", "Cow", "Ear", "Ice", "Sun", "Eye", "Gem", "Owl"]

    WordArray.shuffle()

  word = WordArray.pop_back()
  $ImageHint.texture = load("res://images/" + word + ".png")

144
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/sundler on 2024-10-13 16:18:07+00:00.

145
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/igorbronnikov on 2024-10-13 15:16:35+00:00.

146
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/notpatchman on 2024-10-13 15:01:51+00:00.

147
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/ovsko on 2024-10-13 14:16:26+00:00.

148
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Mantimestwo on 2024-10-13 13:17:01+00:00.

149
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/xmBQWugdxjaA on 2024-10-13 09:14:26+00:00.

150
 
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/godot by /u/Nepacka on 2024-10-13 12:36:56+00:00.

view more: ‹ prev next ›