carenalgas / popochiu

Godot plugin to make point n' click games in a similar way to tools like Adventure Game Studio and Power Quest.
MIT License
159 stars 17 forks source link

Singleton names are not clear #77

Open BenjaTK opened 10 months ago

BenjaTK commented 10 months ago

I think the singleton names should be renamed to be words instead of just letters. It's really hard to understand what each singleton does without looking at the wiki, and it's good practice in programming to have clear naming. Maybe the singletons could be renamed to: E -> Popochiu R -> Room C -> Character I -> Inventory D -> Dialog G -> GraphicInterface A -> Audio

mapedorr commented 10 months ago

This was something I initially did to maintain consistency with PowerQuest, the Unity plugin that inspired me to build Popochiu. I suppose it's something that can be discussed because I agree that good naming is essential. However, one thing I personally like about using only letters is that it makes the lines of code shorter.

I'll share this with the dev team to have an initial discussion.

mapedorr commented 9 months ago

We're going to discuss this in order to find a possible solution. One of the ideas is to make the interface classes to work independent of their autoload name.

stickgrinder commented 9 months ago

Adding my two-cents. From my previous experience with PQ and from the tests I did while contributing to Popochiu, the short version is a blessing and we should not remove it, maybe just provide an alternative.

Look at the readability of these two chunks of code:

Character.John.Say("I feel a strange noise")
Audio.Play("whistle")
Inventory.Remove("baloon")
Inventory.Add("deflated_baloon")
C.John.Say("I feel a strange noise")
A.Play("whistle")
I.Remove("balloon")
I.Add("deflated_balloon")

Once you learn mapping half-a-dozen letters to their respective classes (something that you do in a matter of... hours?), eye-scanning the code becomes so much easier in game scripts.

Whyshchuck commented 9 months ago

There are programmers who say that in times of autocompletion short cuts in variable names have no more place as it makes code less explicit.

But I would advocate for shortcuts as they make people with AGS background feeling like at home.

mapedorr commented 9 months ago

I have some ideas for a refactor that maybe will allow us to give developers the option to change the name of those autoloads. That change also leads me to believe that we might make it unnecessary to restart the plugin when it's installed for the first time.