Open KormexGit opened 11 months ago
Another issue that bothers me especially when I try to help new folks on the GMC's Programming subforum: I see there has been a lot of work to get GML Visual to call instances instances instead of objects, but If Object At Place
and If Any Object At Place
remain.
Is your feature request related to a problem?
In it's current form, GML visual is good for acquainting a brand new game dev with how coding logic works, but not much more than that. You can make simple games with it, but anything larger or more complex runs into issues with bulky blocks taking up too much visual space and tons of GM features that straight up cannot be accessed without writing code anyway.
Describe the solution you'd like
To start, visual needs a LOT of missing blocks added. Here's a list I've compiled of some of the things missing. Not completely exhaustive, but should demonstrate just how much cannot be done with blocks and requires writing code.
Missing Blocks
Arrays Currently has no blocks.
Structs Only has making a constructor and a block for the new keyword. Since constructors are part of the regular function block, actually making one correctly is rather confusing. There's no way to define a struct literal directly without typing it out as code or using a constructor. All other struct related functions are missing.
Collision Missing the following: All point_in_shape functions. All rectangle_in_shape functions.
Motion planning Currently has no blocks.
Math No math section, only a random section. Missing things like the following: round, ceil, floor, abs, sign, max, min, clamp, lengthdir_x/y, cos/sin/tan, dcos/dsin/dtan, point_direction, point_distance, angle_difference, all date/time functions, all matrix functions.
Functions No way to create method functions ("temp" checkbox in the declare a new function block makes it a method, but one stored in a local variable, which isn't super useful). Also missing blocks for method, method_get_self, method_get_index, method_call.
Animation curves Currently has no blocks.
Strings Currently has no blocks.
Drawing Missing the following: draw_sprite_stretched, draw_sprite_part, draw_sprite_pos, draw_sprite_tiled. And all ext versions of the above. draw_tile, draw_tilemap.
Shaders Currently has no blocks.
Rooms Missing the following: Get room variable (persistent, room_height/width, name). Set room variable (persistent, room_height/width, view enabled, viewport/camera). Room creation or manipulation functions, like room_add, room_duplicate, room_assign, room_instance_add.
Assets Missing asset_get_index, asset_get_type, and all tag functions.
Display and Window Currently has no blocks.
Camera Currently has no blocks. There is a set view variable block, but nothing for cameras variables.
Device Input No blocks for device input functions, including the rather important device_mouse_x/y_to_gui. No blocks for gesture input. I don't see any blocks for retrieving mouse_x or mouse_y, though this might exist and I just can't find it. Also missing a few mouse functions: mouse_clear, mouse_lastbutton, mouse_wheel_up, mouse_wheel_down. Missing blocks for a number of advanced gamepad functions, such as gamepad_is_supported, gamepad_set_vibration, and many others.
Surfaces Currently has no blocks.
Built in Physics Currently has no blocks.
Skeletal Animation (Spine) Currently has no blocks.
Files Missing the functions for JSON, base64, md5, sha1, csv, and zip.
Misc. Functions Missing things like variable_instance_get/set, variable_globalget/set, nameof, typeof, the various is and _exists functions, variable_clone, script_execute_ext.
That's a lotta missing blocks! Some of them are definitely advanced, obscure, or rarely used, so perhaps there could be some sort of optional tab for the less common functions to not overwhelm new users with the sheer amount of blocks. Other existing things like buffers and rollback could be moved there as well.
Obsolete Blocks
There are also some blocks that could potentially be moved to a deprecated section, due to being for deprecated or outdated functionality. I say moved to a separate section and not outright removed because removing them would be an issue for compatibility.
The blocks for game save and game load, functions that the manual itself advises users not to use. Perhaps they could be replaced by blocks like "Save Data to File", which would take a array or struct as an argument and save it to a JSON file for you, cutting out the boilerplate normally needed for that (plus the opposite for loading).
The "Instance Variables" section, which deals with lives, score, and health. These already don't use the deprecated built in variables, instead creating new instance variables for you when used.
Maybe the timeline section? I don't think they're deprecated yet, but they've been more or less obsoleted by sequences and are rarely used.
The script_execute block, which is basically obsoleted by function call (also it fills out the script argument as noone by default for some reason, which crashes the game if you run it without editing it).
The instance change block, because instance_change is whack and it's usually recommended to not use it.
Ability to Turn User Created Functions into Custom Blocks
Related to YoYoGames/GameMaker-Bugs#2916 and YoYoGames/GameMaker-Bugs#2915, I think it would be great if there was a way to automatically turn any custom functions you create in visual into blocks, with their own section in the toolbox. Even better would be if methods were listed there as well, but only the methods available in the scope of the current object you are editing. This would tie into visual's strength of having all your options listed out in a big toolbox, and not needing to memorize what options are available.
Workflow and Visual Clarity
A very common place for beginners to get tripped up (myself included, when I first started using GM!) is that what blocks are attached to each other isn't super intuitive. Here, the Set Instance Variable block looks like it's connected to the If Key Down block due to the line on the left, but it's not! The only hint is the small red "empty". I've had to help quite a few beginners with this one, and have also seen experienced GM users who try visual out of curiosity get confused by it.
Even once the block is connected properly, what the line of the left actually means doesn't feel very clear, making it hard to tell at a glance how all the code is connected. I've talked to several people who agree that GMS 1's way of presenting blocks was easier to understand. I think the lines connecting blocks are one of the places visual has a lot of room for improvement, UI design wise.
Another common complaint with visual is the size of the blocks, causing them to take up tons of screen space and become difficult to work with once you have a lot of them. Visual actually does have features to mitigate this, but those have some issues that affect how much they actually help. There's the compacted overview of your code on the left, but when you first open a visual editor window it's so small you can't even read all it's text. You have to manually stretch it larger for it to be readable. It also has the issue of it not being super clear what code is nested. On the left here is un-nested code, on the right is nested - the only difference is a very small indent, which isn't easy to see at a glance.
There's also the option of collapsing blocks, which makes them take up much less space. Great for when you're not actively editing them! However, there doesn't appear to be a way to do something like collapse or expand all blocks at once, meaning you have to manually click to collapse each one individually. If there is a way, it's far too hidden, because I went looking for such an option and could not find anything. A button in the IDE you can click to expand/collapse everything, as well as hotkeys, would help a lot. This collapsed view also has the issue that the summary text is nearly the exact same color as the background when using the default IDE colors/theme, making it very difficult to read.
With the new code editor coming, defaulting to a full screen editor for visual would also help with issues related to the blocks taking up tons of space.
Issues With Existing Blocks
There's a few blocks with problematic or nonsensical GML, which can be seen when they're converted or when using live preview.
There's likely more, but I haven't gone through and checked every block. Those are just the issues that stood out to me while testing things for this request.
Describe alternatives you've considered
The main alternative I can think of is to completely redesign visual from the ground up, but that would take a lot more work and dev time.
Additional context
No response