Skip to content

Adding documentation and smoothing out formatting for non-UI code.#10

Open
BeowulfDragon wants to merge 12 commits into
EmilyV99:mainfrom
BeowulfDragon:main
Open

Adding documentation and smoothing out formatting for non-UI code.#10
BeowulfDragon wants to merge 12 commits into
EmilyV99:mainfrom
BeowulfDragon:main

Conversation

@BeowulfDragon
Copy link
Copy Markdown

I was fiddling around with something and wanted to use this library, but found it hard to understand and read, so I have added a bunch of documentation and made the formatting more consistent and readable. I mainly followed the recommended GDScript style guide, except where an alternative style was consistently used and readable. I also broke up as many lines that went over 100 characters as I could, excluding some long strings.

This PR doesn't include documentation for the main UI and app code, only for the files in the ap_files, autoloads, and managers directories, and save_file.gd. Any non-documentation changes should have no functional differences, only changes to formatting.

No AI was used in the work done here, I'm just like this.

Tweaking the documentation of archipelago.gd and adding/changing spacing
and indentation (per the GDScript style guide suggested in the Godot
docs) to make it less of a wall of code.
ap_location.gd also has a super broken call, but I'm exclusively doing
documentation and formatting currently.
Finished writing documentation for all the classes in ap_files. Also
fixed some stuff in archipelago.gd. Finished the documentation of
command_manager.gd too.

Also I was wrong in a previous commit message about an error in
APLocation, I just didn't notice the conn member ~300 lines deep into
the source for AP.
With an asterisk, since there's a lot of UI in the domain code, so there
has been documentation of UI code.
Still need to do one last big read through before submitting a PR.
Making continuation lines more consistent, enforcing spacing around
operators, and more spacing in single-line dictionaries.
Also added documentation to SaveFile, as the docs for APSaveManager
wouldn't generate without that having documentation to generate.
Copy link
Copy Markdown
Owner

@EmilyV99 EmilyV99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did not review archipelago.gd, command_manager.gd, console_command.gd, or connection_info.gd yet (my brain is not prepared for those files atm).

Also didn't actually look at the generated docs in Godot from this yet.

Gonna drop this with the review comments I have so far though, will need to look deeper later (and probably remove the trackerpack stuff from config.gd on my end, which you noticed wasn't being used at all, as it was entirely outdated 😅)

Feel free to bump this in the discord thread if I don't look at it further soon and you have everything I've commented on here cleaned up

Comment thread godot_ap/ap_files/network_item.gd Outdated
Comment thread godot_ap/ap_files/network_hint.gd
Comment thread godot_ap/ap_files/network_slot.gd Outdated
Comment thread godot_ap/managers/configs.gd Outdated
Comment thread godot_ap/managers/saves.gd
Comment thread godot_ap/managers/saves.gd Outdated
Comment thread godot_ap/managers/saves.gd Outdated
Comment thread godot_ap/save_file.gd Outdated
BeowulfDragon and others added 4 commits May 12, 2026 14:39
Co-authored-by: Emily <35015090+EmilyV99@users.noreply.github.com>
For Network[Thing]s, Create -> Deserialize. While it's maybe technically
demarshalling rather than deserialization, deserialization gets the
point across enough. Also not using "create" makes it clear that nothing
is happening on the server or other clients.
Copy link
Copy Markdown
Owner

@EmilyV99 EmilyV99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looked through the command code, still gotta check the two big main files.

# Commands currently available to use, indexed by name.
var _commands_by_name: Dictionary[String, ConsoleCommand]

## Controls if debug commands should be hidden.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Controls if debug commands should be hidden.
## Controls if debug commands should be hidden.
## Cannot be modified in non-debug builds.



## Get the autofilled parameters for a command message, up to the number of arguments specified in
## [param capacity].
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## [param capacity].
## [param capacity]. A capacity of 0 is unlimited.

return
var cmd := get_command(msg.split(" ", true, 1)[0])
if cmd and cmd.call_proc:
if cmd.is_disabled():
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if cmd.is_disabled():
if cmd.is_disabled() or (cmd.is_debug() and debug_disabled()):

just noticed this issue on my end 😅


# Check if [param cmd] is enabled.
static func _cmd_is_enabled(cmd: ConsoleCommand) -> bool:
return not cmd.is_disabled()
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return not cmd.is_disabled()
return not (cmd.is_disabled() or (cmd.is_debug() and debug_disabled()))

same error on my end from above 😅


## Set [member autofill_proc].
func set_autofill(caller: Variant) -> ConsoleCommand:
assert(caller is bool or caller is Callable)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert(caller is bool or caller is Callable)
assert(caller is Callable)

caller being a bool here seems to be an error . . . huh. Another me issue 😅

Copy link
Copy Markdown
Owner

@EmilyV99 EmilyV99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finally done reviewing 😅 lmk if you have any follow-up questions on anything I commented on

var serv_version: Version
## The generator's Archipelago version.
var gen_version: Version
## The seed name received from the server.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## The seed name received from the server.
## The seed_name received from the server.

seed_name is the specific key the server sends, naming it the same in the comment here was intentional

var seed_name: String
## The ID of your player.
var player_id: int
## The ID of your team (unimplemented).
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## The ID of your team (unimplemented).
## The ID of your team.

teams are being implemented soon™ re: Silvris' teams PR, probably correct to remove this note now

var player_id: int
## The ID of your team (unimplemented).
var team_id: int
## The slot data from the server.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## The slot data from the server.
## The slot_data from the server.

same reasoning as seed_name

return hints

## All locations, by ID
## All locations, by ID.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## All locations, by ID.
## All locations, by ID.

extra line after getter/setter seems more correct to me for readability?

## Emitted for each item [i]packet[/i] received.
signal obtained_items(items: Array[NetworkItem])
## Emitted when the server re-sends ALL obtained items
## Emitted when the server re-sends ALL obtained items.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Emitted when the server re-sends ALL obtained items.
## Emitted when the server re-sends ALL obtained items, after
## [signal obtained_items] fires.

## The node is needed, as the representation can depend on the node's 'Theme'.


## Get the color represented by this complex color for the proviced [param node].
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Get the color represented by this complex color for the proviced [param node].
## Get the color represented by this complex color for the provided [param node].

## Gets a RichColor from a string. 'RichColor.NIL' is returned if the string is invalid.


## Gets a [enum RichColor] from [param s]. [code]NIL[/code] is returned if the string is invalid.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Gets a [enum RichColor] from [param s]. [code]NIL[/code] is returned if the string is invalid.
## Gets a [enum RichColor] from [param s]. [member RichColor.NIL] is returned if the string is invalid.

this should be a reference to the specific member, shouldn't it?

Comment on lines +300 to +303
## Null unless a node inheriting from [APSaveManager] is added to to
## [code]godot_ap/autoloads/archipelago.tscn[/code].
## [br][br]
## Can be [code]null[/code] if not provided in [code]godot_ap/autoloads/archipelago.tscn[/code].
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. The problem was present before, but this appears to be just saying the same thing twice in a row redundantly. Should reword to not repeat itself

## Changes this connection's DeathLink group
## Will only send/receive deaths with other clients in the same group

## Changes this connection's DeathLink group.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Changes this connection's DeathLink group.
## Changes this connection's DeathLink group name.

match comment on function below


## Set the current Archipelago status.
## Set to 'CLIENT_GOAL' when the player has 'won'.
## Set to [code]CLIENT_GOAL[/code] when the player has won.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this reference ClientStatus.CLIENT_GOAL with some syntax, rather than a generic code tag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants