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

Scribble fails to "recognize font" in latest Beta #8304

Closed
biyectivo opened this issue Nov 5, 2024 — with GM Bug Reporter · 10 comments
Closed

Scribble fails to "recognize font" in latest Beta #8304

biyectivo opened this issue Nov 5, 2024 — with GM Bug Reporter · 10 comments
Labels
project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes

Comments

@biyectivo
Copy link

Description

Title basically - importing Scribble into a blank project and trying to render text, in the latest Beta, renders a "Font xxx not recognised". This happens in all platforms.

Now I realize this is a third-party library, but it works perfectly both in monthly, LTS and the previous Beta, so it has to do with something that was changed in this last iteration.

Steps To Reproduce

  1. Create a blank project with a room and an object
  2. Import Scribble (any version, but I used Scribble Deluxe 9.3.3)
  3. Type on the object's Draw event:

scribble("Hi world").draw(room_width/2, room_height/2);

  1. Run

Which version of GameMaker are you reporting this issue for?

IDE v2024.1100.0.665 Runtime v2024.1100.0.691

Which operating system(s) are you seeing the problem on?

Windows 10.0.26100.0

Which platform(s) are you seeing the problem on?

GX.games, HTML5, Windows

84e53f2e-f222-444f-8272-ebba745f2cb0

@gm-bug-reporter gm-bug-reporter bot added runner-bug In-game bugs with the "GameMaker Studio 2" runtimes project This issue has a sample project attached labels Nov 5, 2024
@gnysek
Copy link
Contributor

gnysek commented Nov 5, 2024

This seems to be not a bug. It's caused by using font name as string in GM, so preference "Automatically remove unused assets when compiling" removes that font from project, because default font is referenced as string, not as resource (either using nameof() or font_get_name() ).

Until it's not solved in Scribble, you can find examples of how to solve it in Scribble issue I've made: JujuAdams/Scribble#584

@stuckie
Copy link

stuckie commented Nov 5, 2024

Closing as above, thanks.

It's also already written in the release notes.
See also: #8198

@stuckie stuckie closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
@github-project-automation github-project-automation bot moved this from Triage to Done in Team Workload Nov 5, 2024
@JujuAdams
Copy link

Scribble 9.3.4 attempts to detect when this asset stripping is enabled and will direct developers to disable it.

@rwkay
Copy link

rwkay commented Nov 5, 2024

Scribble 9.3.4 attempts to detect when this asset stripping is enabled and will direct developers to disable it.

why not just fix it? this is a user requested feature and will be required for prefabs...

@JujuAdams
Copy link

JujuAdams commented Nov 5, 2024

Because it is not a solveable issue my end. Users reference sprites and fonts in-line in strings and regularly reference these assets only in strings (and these strings may or may not be stored in external files). A "solution" would require the user to manually reference every single font and, more problematically, every single sprite that they intend to use with Scribble separately to the text content. This isn't reasonable and opens the door for human error.

I can think of further established practices in GameMaker that this feature will break. asset_get_index($"spr_player_{jerseyColour}_walk") and its ilk will now no longer work unless that sprite is specifically referenced without digging around in the options. For e.g. Swords Of Ditto this would be thousands of references, references that would've needed to be maintained and updated as we iterated on art assets.

This feature is too aggressive. There are situations - prefabs - where pruning at compile time is sensible but pruning the main project itself will cause many problems for games of a certain complexity. This undermines the value of the feature for larger games that might benefit from it. There are good reasons to clean out a main project file from time to time but this should be done as a UI component where the developer can decide for themselves what is and isn't worth keeping.

@gnysek
Copy link
Contributor

gnysek commented Nov 5, 2024

There are cases, when it cannot be fixed in library, like:
asset_get_index("asset_" + _variant);
tag_get_assets("my_selection")[0];

Auto enabling it by default is bad IMO, I've wrote more about it in #8305 .

@gurpreetsinghmatharoo gurpreetsinghmatharoo moved this from Done to Not Planned in Team Workload Nov 5, 2024
@rwkay
Copy link

rwkay commented Nov 5, 2024

Unfortunately the compiler cannot know that you are using an asset without a reference - there are several ways you can get around that

  1. Add an array that lists all the assets that you are definitely wanting to keep i.e. a simple global.keepAssets = [ sprFoo, fntScribble1, fntScribble2 ]; , would suffice
  2. Use nameof(fntScribble) as that will keep the symbolic part of the name in place and the compiler will turn it into a string (we were looking forward when we added the nameof function.
  3. We left in the option to switch this off - though switching it off will lead to larger executable sizes (and prefabs will still work, but you will get all the unused assets as well as the used ones)

One solution that I will experiment with is always enabling the feature - but when Using unused assets is off just setting all the assets of the main project as Used and leaving the prefabs as Unused (so the prefab assets will be stripped) - and only report the main project assets as being stripped (as that is all the user really cares about).

We don't want to add a tick box to every asset to say to "keep" it as that is an unnecessary burden on the UX and user to tick everything.

@Grisgram
Copy link

Grisgram commented Nov 5, 2024

We don't want to add a tick box to every asset to say to "keep" it as that is an unnecessary burden on the UX and user to tick everything.

Understandable, but if gamemaker-assets are kept in the hierarchy in asset browser, you could send part of the responsibility to the user and allow him to "keep" an entire tree of assets. with one tick. not a thousand ticks.

we could organize our projects then in a way, with, say like a group named "dynamics" as a root node in the project and just tick this one node as "keep". so everything below it, will stay.

@tabularelf
Copy link

tabularelf commented Nov 5, 2024

One solution that I will experiment with is always enabling the feature - but when Using unused assets is off just setting all the assets of the main project as Used and leaving the prefabs as Unused (so the prefab assets will be stripped) - and only report the main project assets as being stripped (as that is all the user really cares about).

That’s definitely a more preferable outcome. Marking assets unused is already pretty possible (like with sprites & audio via texture groups, and then telling the compiler to not export that group for every platform). A feature like this is great, but not something I think SHOULD be enabled by default either.

I know it’s something that should be user controllable on how much unused assets are processed. So having more options on how assets are handled is good. If someone wants to go full on aggression mode, that’s their choice. If someone wants it just that aggression on prefabs, again, their choice. Or have it off. These are the kinds of things that should be controllable enough by the user that they have options.

We don't want to add a tick box to every asset to say to "keep" it as that is an unnecessary burden on the UX and user to tick everything.

I can understand that, and not something I could argue against other than the IDE already supports adding asset tags as a whole. Which suffice to say, hasn’t been a huge UX burden. (Outside of tags not being automatically applied to per group folders… I swear that in itself is a feature request but I cannot recall the current state of it). But in terms of textures and audio, you already effectively got an easy way of having “Keep” applied (as mentioned above)

Nonetheless, I think this is the situation I suspect would be good down the line.

  • Keep this option as it is, but have it off by default.
  • Have a separate option that targets prefabs, have that enabled by default.
  • Preferably, allow an option where “Keep asset” can be checked. Especially if a developer wishes to include a specific resource. Or allow asset tags to be included. Or find a way to allow more thorough control of per-asset inclusion.
  • If the above is still not preferable, or not being able to be remedied. Suggesting to use audio groups & texture groups (and datafiles platform export option) in the manual as an alternative to excluding certain assets to prevent everything being culled.

@rwkay
Copy link

rwkay commented Nov 5, 2024

Behaviour of Remove unused has been subtly changed see #8312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes
Projects
Status: Not Planned
Development

No branches or pull requests

7 participants