multitheftauto / mtasa-resources

This project maintains a list of up-to-date resources that come with Multi Theft Auto.
https://multitheftauto.com
MIT License
151 stars 147 forks source link

editor_main: OOP node in editor_test #424

Open dnl-k opened 1 year ago

dnl-k commented 1 year ago

So I recently reinstalled MTA, fired up the editor and loaded one of my maps only to find it not working. Took me a while to find out that the editor test mode no longer enables OOP.. as seen in 95f3c36307512bb35e7efb727e101c1bbc136564 While it may be true that not many people use OOP, it's still a feature that should work right out of the box.

jlillis commented 1 year ago

I was afraid this was a possibility. Just to make sure I'm understanding fully, do you have additional map scripts in your maps that rely on OOP being enabled or did something else break? If you have custom map scripts that use OOP, how common are they/how many maps do you have that are using them?

dnl-k commented 1 year ago

I have been and would like to continue using additional scripts that are written with OOP. I don't know how common they are in general, probably not that much. But that shouldn't really matter?

jlillis commented 1 year ago

After some discussions on the dev discord the concern is that just enabling OOP in a resource's meta.xml will cause an increase in memory usage and performance penalty of about 20%. This would mean that by having the editor generate map resources with OOP enabled we would automatically be enabling a memory/cpu penalty for all map resources - all of which include the mapEditorScriptingExtension scripts at minimum. This is (and was) problematic.

I realize that this change in default behavior is frustrating to deal with but given these facts I think the best course of action is to advise users to either (a) don't use OOP in map resource scripts or (b) have them enable OOP manually.

dnl-k commented 1 year ago

It shouldn't be problematic if you enable it only when OOP is set to true in the original meta file, instead of always.