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

Moved object types into the project #3123

Closed
wants to merge 1 commit into from
Closed

Conversation

bjorn
Copy link
Member

@bjorn bjorn commented Aug 25, 2021

This change moves the storage of object types from a separate file into the project. The main advantage being to simplify the user experience (avoiding the need to manage an additional file, as well as getting rid of the the "global" vs. "overridden by project file" distinction).

When a loaded project referred to an object types file, its types are now automatically imported to the project. This is not done for the global object types file however, so instructions are probably needed for those who need to import the file manually (documenting the location of this file).

When the object types file was changed outside of Tiled, it was automatically reloaded. Automatic reloading still needs to be implemented for the project.

The new setup is not ideal for those who were generating the object types file. A potential solution would be to add a scripting API for registering object types.

Feedback welcome!

@eishiya
Copy link
Contributor

eishiya commented Aug 25, 2021

I find it very convenient to have multiple Projects share the same object definitions file, as my Object Types are what my engine will accept and the default property values are the defaults the engine uses, the definitions do not vary per game. I would like the option to have multiple projects continue to use the same Object Types definitions, so that updates to it will affect all my projects using that engine.

I think the current approach of being able to choose what definitions file your project uses is great for my scenario. However, if possible, I think Tiled should start with local definitions by default, and provide the option to select an external file instead.

All that said, I imagine my use case is somewhat unusual. The reason my definitions change and need to be updated on a semi-regular basis across multiple projects is because I am still working on the engine in conjunction with the games (which stress different aspects of it, hence it not just being one project). I imagine most people will either be working with a stable version, or will at least have a fixed engine version per project, in both cases, they'd just import their object properties once and not have to worry about sync across projects.
As such, I do not expect to have my needs catered to perfectly. I can deal with exporting/importing instead, especially if an option to replace the definitions is provided, to better handle cases were properties are removed or renamed. Even better would be an option to append new Object types and replace existing Object types, but I imagine having this option would just confuse most people, and it may better be implemented via scripting. (Ditto for enums! I'd love this Append+Replace ability for enums especially...)

When a loaded project referred to an object types file, its types are
automatically imported. This is not done for the global object types
file however, so instructions are probably needed for those who need to
import the file manually (documenting the location of this file).

When the object types file was changed outside of Tiled, it was
automatically reloaded. Automatic reloading still needs to be
implemented for the project.

The new setup is not ideal for those who were generating the object
types file. A potential solution would be to add a scripting API for
registering object types.
@bjorn
Copy link
Member Author

bjorn commented Jun 14, 2022

Superseded by #3376, since the property types were already stored in the project.

@bjorn bjorn closed this Jun 14, 2022
@bjorn bjorn deleted the wip/object-types-in-project branch June 14, 2022 14:45
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