Allow easy "func overriding" of specific map build steps for customization #116
Replies: 9 comments
|
I am open to the idea of exposing and structuring some functions in a way that makes things a bit easier to slot in, but I think C-style function pointers (the callable route) might be a bit more difficult route / out-of-the-normal GDscript expectation, though somewhat aligning with how things actually do work behind the scenes in Godot (for example, with the dummy Server classes that are almost pure abstract) However, at the current moment, the progress is far too early to make meaningful decisions on this yet. |
One of the things we're trying to do is simplify Core, not add extra complexity to it. There is a lot of bloat and spaghettification in the current implementations of the build process, making it very difficult to parse exactly what is going on. The code behind the build process is extremely labyrinthine as it is. The idea of callable interrupts or overrides in the build process is intriguing, and a spot I think could really benefit from that is adding more map formats to the parser. That said, something like custom tool textures you keep championing, I'm still not convinced of its applications, or how any of the build processes would be able to support what you proposed, whether it be the current iteration of FuncGodot or the new Core implementation we're working on. Also, as Vera already stated, the progress is still far too early to know what opportunities would even be available to interrupt. It also means we need to know what data we're supposed to expose to these interrupts? What steps are they supposed to occur? What does the interfacing for that look like? How do we keep the resource properties from becoming overwhelmingly cluttered? Do we add this new interfacing to the MapSettings resource or do we create yet another resource to handle the map building? Where does that new resource go so that it can be read by FuncGodot Core, which has no direct interface as it is generated purely during map build? What are the other applications for these interrupts? I can think of some at the parsing level, to add support for more map formats, but can you suggest any other applications beyond tool textures? What are the actual specific purposes of a feature like this? We need more than just
We need specific examples because a feature like what you're asking for is not trivial to implement. There are lots of considerations to make, and unless this feature is something that is impossible to pull off with the current systems in place, it doesn't seem to be worth the effort it'd take to implement it. |
|
It looks that this thread has mixed with the tool textures thread for some reason. In the discord server have seen a Vera's screenshot with something like From that we can assume that being able to easily use FuncGodot as a library to adjust the map build step to project needs is pretty handy.
Basically any kind of customization of the map build process. But now that you mention it, something i've been thinking of is creating my own map editor using FuncGodot as base. From all that has been said can get that is about being able to use FuncGodot as a library. About how to do it... could think about something. Envisioning a set of functions that could use to create a personalized map build pipeline by using the native one as example. In resume, being able to use FuncGodot as a library to have a custom map build pipeline. About performance, as it is a concern, we have a little problem here: The initiative of keeping all code as GDScript to maximize potential contributors, expose all and make it easier to handle sounds convincing at first, but has a problem similar to what Godot has. Transposing this to FuncGodot, the number of contributors will be limited, there's always a separation of a basic user base that only uses the built-in features, and an advanced one that is the one that looks at the source code, makes PRs, etc. So much of the performance problem would be in the most low-level tasks, like generating the meshes and collision shapes could be done in C++ functions that are exposed on the FuncGodot GDScript API and used on the rest of the code. |
Components
So could either use the built-in ones, extend those, or use the base ones for a fully custom solution.
Split reponsibilities by component
Just take it as a rough sketch. Side notes
About how using
|
|
as has been mentioned, a note on tool textures SUBORDINATION (TB side)2 types of tool textures, regarding how they relate to fgd ents. a) enforced: necessarily tied to a solid ent with properties in TB, so they just give visual feedback b) optional: complementary to a solid ent, no properties set on TB, done from Godot instead on map build, but still can do lookup on fgd ent data, like WHAT TOOL TEXTURES DOTB side:
Godot side:
as tool textures tend to be used for the same kind of things, its easier to have an idea in which map build steps they can be involved. here a list of potential tool textures for Godot: even more gameplay tied ones like: For those having a way to call a custom As can see things can complicate a bit for include some, better give a way for users to create their. Some can be done using fgd ents, while others not. Still pretty useful to can have a visual representation. NOTE: it doesn't necessarily mean that FuncGodot should support all. Example code about tool texturesTo have some idea. #FGToolTexture.gd
class_name FGToolTexture extends Resource
var call_on_buildstep_A : Callable
var call_on_buildstep_B : Callable
var call_on_buildstep_C : Callable
#FGMapSettings.gd
var tool_textures : Dictionary = { # can add more via inspector, those are FGDToolTexture resources
"clip": preload("res://dir/to/tool_tex/clip.tres"),
"skip": preload("res://dir/to/tool_tex/skip.tres"),
"origin": preload("res://dir/to/tool_tex/origin.tres"),
}
#FGMap.gd
func _mapbuild_step_A():
for tooltex in map_settings.tool_textures.values():
tooltex.call_on_step_A.call() # that is expected to be done iterating on the faces of fgd ents on the map file, there should be a way to pass arguments.
ofc is not that simple |
|
So much of this is way outside of func_godot's scope it's difficult to know where to begin.
There's too much assuming going on here. You're better off asking @sinewavey what
I've actually already added VMF support to the new parser, but this is so far the one place I can think of that might benefit from an interrupt or injection. That said, there's still no good suggestions for how to interface with that sort of custom tooling, and it's being set up to just as easily add new parse functions to be called within the main one. There are also not too many variants on the map file format to worry about. The only "weird" one seems to be Dark Radiant's formatting, the rest are all mostly the same data.
Any real study of the code would show you that this can't actually be done with what currently exists. That's the definition of spaghetti code: it's so interwoven with each other that pulling on one piece inevitably pulls at another. That's the main impetus behind the rewrite: what can we do to simplify the core functionality.
It's not going to be changed to another language. We haven't done all we can do with GDScript yet, and the benefits still outweigh the issues. GDScript may not be as performant as Native, but it's still performant. Part of our rewrite is to try to work in real optimizations. A lot of Core's processes and structs were bespoke for no real reason or benefit, a carryover from Qodot's original design in its mix of C, C++ GDNative, and GDScript. Every single tool texture you listed not only can be done with an entity and editor tags / shaders far more easily than trying to write some sort of tool script injection, but also Godot just doesn't handle any of these things on a per face / plane basis. It's just not how you should be trying to pull off any of these mechanics listed in this engine. A lot of what you're proposing sounds more like a completely different project to what FuncGodot's goals are intended to be, and a lot of it seems to be filled with breaking changes. None of it has obvious interfacing or integration solutions. To be clear, the Core rewrite we're doing is not intended to change the way users interface with FuncGodot: it's supposed to be invisible while fixing some longstanding bugs and hopefully improving performance by using some of the built-in Godot methods rather than the bespoke FuncGodot methods for map generation. It is not to change the nature or goals of FuncGodot or how it's used. Too many people have projects dependent upon the way things currently work. |
|
@azur-wolve May I ask why you can't make a new node that extends the current func godot map node, and simply override functions as you need and call super() when you need to call the original func godot map node behaviour? Also I agree with Tim, most of these can be done as separate brush entities or as shaders. The clip_* tool textures could instead just be a bit flag property that corresponds with each collision layer you want collisions on. A bunch of these are also just GeometryInstance3D properties which there is an open issue to expand this if they are essential to your project #37 |
|
For clarity, what RisingThumb mentions is exactly what I do with an inherited class: |
|
then its about of extending the native types |
Uh oh!
There was an error while loading. Please reload this page.
A core rebuild of FuncGodot has been mentioned various times.
It looks like a good moment for propose this.
Would want to suggest to make it easy to allow "overriding" functions of the FuncGodot core for custom map building.
Ideally consists in that every step would be split into a function for separation of concerns and easily having custom versions of it for a project.
Using #97 as example, there would be a function called ie
_apply_tool_textures()to make it easier to modify just that particular aspect instead of being just mixed with other parts of the map build process.Not sure if would be better to turn those funcs into callable variables, allowing to assign them a custom function that is assigned to.
This way would be able to just change specific functions rather than extend
FuncGodotMapand rearranging / recreating all the map build pipeline of functions just to change a particular step.So only assign a custom callable to
FuncGodotMap.whatever_callable = custom_callable.Not sure if that makes sense.
That would allow to have custom map build solution for features that are tied to projects or personal workflows that aren't merged into vanilla FuncGodot, without much trouble for being updated after new official releases.
All reactions