Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a dialog to customize run instances #65753

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Sep 13, 2022

Closes godotengine/godot-proposals#522

Current look:
image
image
(EDIT: the screenshots don't match after I updated the one above, but you get the idea xd)

@KoBeWi
Copy link
Member Author

KoBeWi commented Nov 2, 2022

Ok I implemented everything as originally requested.

@KoBeWi KoBeWi force-pushed the run_1000000_instances branch 3 times, most recently from 0e8029a to 4e56a84 Compare November 2, 2022 10:26
@reduz
Copy link
Member

reduz commented Jan 21, 2023

I think this looks good, but don't we have this for the multiplayer testing already?

@KoBeWi
Copy link
Member Author

KoBeWi commented Jan 21, 2023

Well, THIS is for multiplayer testing. Right now we just have an option to run multiple instances, as a dropdown.
image

@KoBeWi KoBeWi force-pushed the run_1000000_instances branch from 4e56a84 to 950968d Compare January 21, 2023 23:23
@KoBeWi KoBeWi force-pushed the run_1000000_instances branch 2 times, most recently from 488b8d3 to 43139a6 Compare March 26, 2023 20:30
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally (rebased on top of master da81ca6), it works as expected.

There are some things that should be improved before merging:

  • The SpinBox that sets the number of instances should be disabled if Enable Multiple Instances is unchecked.
  • Override Main Run Args should have a tooltip to denote that when unchecked, it will append to Main Run Args instead of overridding.
  • The dialog can be made extremely tall if set to 20 instances. I'd suggest setting the upper limit to 12, which fits on a 1080p display at 100% scaling.

Additional thought for a future PR:

  • If you reduce the number of instances and increase it, options for instances that were removed are lost, even if you do this without closing and reopening the dialog. I suggest keeping removed instance options in memory at least until the dialog is closed (preferably until the editor is closed). This way, you can decrease/increase the number of instances without losing options for unused instances.
    • This makes me wonder if multi-instance options should be persisted to project.godot as well, just like Main Run Args.

@KoBeWi
Copy link
Member Author

KoBeWi commented Jul 28, 2023

This makes me wonder if multi-instance options should be persisted to project.godot as well, just like Main Run Args.

Main Run Args aren't only for debugging. They can be relevant for an exported project.

If you reduce the number of instances and increase it, options for instances that were removed are lost, even if you do this without closing and reopening the dialog.

I could make the arguments persist across restarts by not truncating the saved array.

@KoBeWi KoBeWi force-pushed the run_1000000_instances branch from 43139a6 to 64dc897 Compare July 28, 2023 14:04
@Calinou
Copy link
Member

Calinou commented Jul 28, 2023

Main Run Args aren't only for debugging. They can be relevant for an exported project.

Reading the code, Main Run Args is only used when running a project from the editor using the run button. It's not even used if you run a project from a terminal using an editor build.

We currently don't have an equivalent that also works on an exported project, in case you want to override a CLI argument that has no equivalent project setting. (We should strive to add project settings for those instead, as it's more flexible overall.)

@KoBeWi
Copy link
Member Author

KoBeWi commented Jul 28, 2023

Ah, I don't know then. Moving it to Project Settings is easy, but I'd do it once someone actually requests it. I think main_run_args setting only exists because previously it was not possible to specify it otherwise.

@fire
Copy link
Member

fire commented Aug 21, 2023

https://gist.github.com/mrcdk/3c22d91a3b4fb784d5df60667a33cf1e

Godot 4.x example of how to launch multiple instances and tile them by using an editor debugger plugin to communicate with each instance

from

Mastadon:

https://mstdn.ca/@[email protected]/110899576749166547

@KoBeWi
Copy link
Member Author

KoBeWi commented Aug 21, 2023

This is some debugger hack. This PR makes implementing it much easier, because you can pass different arguments to instances.

@cyraid
Copy link

cyraid commented Oct 4, 2023

@KoBeWi Could you make it for Project Settings? I may change my mind with one project and do different CLI arguments, and then do different setup with another project. I wouldn't want to ruin the previous project just because it were Editor Settings. If that's what I'm understanding? Hoping it's Project Settings. ^_^

@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 4, 2023

It's not in editor settings, it's in project metadata, i.e. hidden per-project settings.

@cyraid
Copy link

cyraid commented Oct 4, 2023

@KoBeWi so this is from a year ago.. Does it really take this long for approvals? What is the main blocking point?

@KoBeWi KoBeWi force-pushed the run_1000000_instances branch from 64dc897 to 5ad42af Compare October 4, 2023 20:34
@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 4, 2023

It needs to be reviewed by a maintainer. Some PRs wait longer than others, because contributors are busy with other stuff and they get forgotten.

@cyraid
Copy link

cyraid commented Oct 4, 2023

@KoBeWi Oh I see. But I try and give gentle reminder and a nice boost of optimism but Calinou shuts it down and says not to post unless you have any new information (in different issue #). I'm new here and you've been super awesome, but is bumping / reminding not allowed? Should we get more reviewers? How do we become a reviewer? Sorry for all the questions. Thank you for taking the time to answer and being friendly.

@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 4, 2023

Well anyone can review, but only reviews from @godotengine members count towards merging. idk if you can see it:
image
Reviews/approvals from non-members might be helpful when assessing the PR, but usually random users aren't qualified to make technical review (they can however test if the PR works correctly or whether there aren't any typos etc.).

I try and give gentle reminder and a nice boost of optimism but Calinou shuts it down and says not to post unless you have any new information (in different issue #).

That's not how it works. Sure, bumping an issue might get it on someone's radar, but most often it just causes pointless notification, because if someone didn't have time to review something before, a random bump will not change that. The discussion on GitHub should be more focused; if you want to bring attention to a PR, you can come to the contributor chat. You can also leave a review as I mentioned. It has similar effect to a random comment, but brings more value.

@BastiaanOlij
Copy link
Contributor

Cool, @Calinou just pointed this to me as I was running into similar situations.

One thing I'd like to see added here is to not only be able to specify individual arguments for each instance, but also feature tags.

Bonus points if we can also start an instance on a remote device. I'd like to start a spectator server on desktop simultaneously with running my app on a Quest.

And would there be an ability to save this as presets, so I can switch between different configurations easily?

@cyraid
Copy link

cyraid commented Dec 13, 2023

@BastiaanOlij would the Multirun Addon be of any use? Please submit an issue and tag me if you can explain there tagging/presets and I'll see if I can add it for ya.

@KoBeWi KoBeWi force-pushed the run_1000000_instances branch from 5ad42af to d0fa160 Compare December 13, 2023 12:07
@KoBeWi
Copy link
Member Author

KoBeWi commented Dec 13, 2023

One thing I'd like to see added here is to not only be able to specify individual arguments for each instance, but also feature tags.

See #63529 I'll integrate that once this PR is merged.

Bonus points if we can also start an instance on a remote device.

No idea how this is done, maybe I could check the native run code 🤔 Not sure about argument support though.

And would there be an ability to save this as presets, so I can switch between different configurations easily?

I'd leave that for later.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally (rebased on top of 10e1114), it works as expected. The rebase has conflicts, but these are trivial to resolve.

Here are 12 simultaneous instances (the maximum you can set) in their full glory:

image

@akien-mga
Copy link
Member

Needs a rebase.

Overall I feel this dialog would still need a UX pass to make it look a bit nicer and with good use of vertical and horizontal space. And some of the other features we discussed above. But that can be done after this one is merged.

@KoBeWi KoBeWi force-pushed the run_1000000_instances branch from d0fa160 to 6755ad3 Compare February 3, 2024 23:34
@akien-mga
Copy link
Member

editor_scale.h moved to editor/themes/.

@KoBeWi KoBeWi force-pushed the run_1000000_instances branch from 6755ad3 to 535d210 Compare February 5, 2024 13:50
@adamscott
Copy link
Member

The dialog can be made extremely tall if set to 20 instances. I'd suggest setting the upper limit to 12, which fits on a 1080p display at 100% scaling.

I suggest that we don't instantiate a limit based on the UX. If so, it means that the UX is bad. I think that adding a scrollbar would ease the pain of having more than 12 instances.

editor/editor_run.cpp Outdated Show resolved Hide resolved
editor/run_instances_dialog.cpp Outdated Show resolved Hide resolved
editor/run_instances_dialog.h Outdated Show resolved Hide resolved
editor/run_instances_dialog.cpp Outdated Show resolved Hide resolved
@KoBeWi
Copy link
Member Author

KoBeWi commented Feb 5, 2024

Added scroll container:
image
However the dialog can no longer shrink, so it's meh with low count:
image

@KoBeWi KoBeWi force-pushed the run_1000000_instances branch from 535d210 to 5ab9e50 Compare February 5, 2024 18:07
@akien-mga akien-mga merged commit 0ebda8e into godotengine:master Feb 8, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@KoBeWi KoBeWi deleted the run_1000000_instances branch February 8, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to specify command-line arguments when running project instances from the editor
10 participants