-
Notifications
You must be signed in to change notification settings - Fork 5
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
Runtime map building + funcGodotMap function reference #8
Runtime map building + funcGodotMap function reference #8
Conversation
You should write the function name exactly as it is defined in the GDScript file: To maintain consistency across the plugin and the documentation, use the official description comments found in the script files rather than creating your own.
Functions should be listed in the order that they appear in the script files, just like signals and properties do. If a description is inaccurate, definitely report it on the plugin issues. Also, this is on me in a way since I'm pretty sure I added the signals in the reference, but we should order things the same way the Godot docs do, I think. So it should be Properties first, Methods second, Signals third. Don't worry about changing that though, I'll go through all the reference pages and fix it all at once.
I think we shouldn't jump the gun on it quite yet. We first need a project set up for minimal steps to runtime building so that we can make any tutorial on it follow that. That means a project with nothing but an unmodified func_godot, a simple map, and a scene with a single custom script to perform runtime building on
I think it's worth documenting. I admittedly don't think it'll really be an issue for most users since runtime building is more likely going to be used for custom maps which will be external files anyway, and the problem is caused by Godot saving packed .map files as .tres. That said, it's an opaque issue that can affect devs trying to do procedural map building with map files packaged with the PCKs on export, so to save those few the hassle of figuring it out we should document how the behavior of Godot's resource packing can affect runtime building of internal map files. A couple other notes on the Runtime Building page:
I appreciate the efforts and enthusiasm for trying to improve the docs though. Usually feels like a sorely neglected aspect of most tools out there. |
Thanks for the comprehensive review!
I've raised a separate issue for this and other "across the entire docs" issues can be addressed in one whole lot.
I think this would be best added to the the func_godot_example_basic repo. I can put together a basic example for this when I get the time. Or should this be in the test repo? I think it's more demonstrative than it is testing. Do you think we should be tutorialising it? I think making an example, pointing to it in the example repo and just making it known that you can do this and the common pitfalls would be sufficient imo. I'll take a look at addressing the other simpler parts of this review when I get more free time to look at it later this week |
Added a runtime building example project: |
Sorry I completely missed this in the haze of traveling around the US and returning back home. I think you hit the primary points of it pretty well. Lightmap building is something that you can't currently do in runtime or exported builds; only the editor. Coincidentally, I've been looking into writing a q3map2-like "Compiler" that will still allow users to save a .map, run a compiler program, and get a .tscn with the baked lightmap data and scene ready to play, much like the process goes in Quake. With what Tim has mentioned regarding VoxelGI, it makes me think: why can't any node like that (define an area to bake) work this way? If particleSDF fields can be baked outside of the editor, it'd be another useful tool to expose. And in that case, I think the two sections almost deserve a different approach with discussing those steps proper, with a breakdown of runtime vs in editor for each. That said, good lord is this a process to figure out so far as it's heavily intertwined with the Godot UI. |
Personally, I think they should be separated. One is about launching within an editor(which is most useful with runtime map building, there probably exists other reasons to use it but idk), and the other is about runtime map building. I'll remove this tip from the page since your PR addresses it
Imo, all that needs to be done is for the upstream work to be done on exposing lightmap baking in the node, and adding a --compile-lightmaps CLI arg. Once that's done, you compile it at runtime, to spit out a .lmbake file that's used every other time when loading the map. |
In theory it's pretty simple. In practice... it's a lot more complicated, from a cursory glimpse at how the LightmapGI stuff even works in the editor. Exposing it to the user: yes. Actually getting this feature: that's a doozy. |
I've made this change. For the parts using [code][/code] and [member] and [signal] I've changed these to just be
In addition, I've made this change. @sinewavey if this gets merged in before your PR, it might be worthwhile adding a note and a link forward under this page about launching straight from the editor being one of the benefits of this.
I have linked forward to the example repository you made and I've copied the script over verbatim.
This has been left to be addressed in #9 . Any further thoughts are welcome, happy to make other small changes! 👍 |
Yep, if the other docs are updated, as would my proposed PR page until it's live. Part of submitting PRs - includes fixing other ones if needed. |
They should be together. Launching from the editor is made possible through runtime / Runtime Building
Setting Up Runtime Building In Godot
Using Command Lines To Build From Map Editors
Building from TrenchBroom
Building from NetRadiant Custom
We should also check if JACK is capable of it, too. |
I've added this back in the previous minimal form. I've addressed the structure changes too. Thanks for the quick reviews btw! 👍 @sinewavey would it be possible for #10 to be reworked slightly to go in the section where I've currently got the brief text about using command lines to build from map editors? |
Easily. The language and wording of it should practically be ready to copy/paste in to your PR if you like. |
Up to you, personally, I'd prefer separate PRs, but I'm happy to combine them both into this PR |
@sinewavey bumping in case this has been missed, If there's no preferences I'd like to go forward with this PR so this information is available instead of hidden away |
Absolutely. I'll go ahead and close mine. |
I'll look at adding the stuff from your PR into this when I get some time later this week, thanks! 👍 |
Clarify NetRadiant workflow
Merged it @sinewavey |
Might be worth looking into! A good reliable method to automatically grab the map's global folder location would be useful. I'd do it myself, but I'm currently trying to solve func-godot/func_godot_plugin#15 |
With this PR the NRC section should probably mention the adjustments |
This works. You could also probably define alternative profiles for when you want to do any preprocessing for the map(lightmap baking, navmesh baking, etc to save those). See the screenshot below. The tool path is just the path to wherever godot.exe lives. It doesn't even necessarily have to be godot.exe if you want to use a different tool beforehand to prepare the level. Working directory is only necessary if you're doing things requiring relative paths. You could just as easily set the working directory to To be honest I think this is even simpler to explain than the launch engine solution. I'll do a rewrite of the currently written trenchbroom stuff to do it this way instead. On the topic of different tools, I'm not very involved in the Quake space(beyond lurking in their mapping discord), but there's probably custom tools that effectively do the BSP step to remove faces out of bounds and covered. I can imagine a setup where you use func_godot for the point/model entities, and process the brushes in a different tool and then import it into Godot as a model. That's just an idea I have since one of the pain points I have with func_godot is the manual process of selecting all faces to be skip(even though it's intentionally design this way, it's a lot of extra control, and a lot of extra work as the cost for that control). If you have any other ideas about those custom tools, I'd be interested to hear them. I think this would be a useful note to link to some example(common Quake .map processing tools) and some example usecases for them. EDIT: |
|
||
<p>To do so, you must define at least one or more build <b>commands</b>, which may refer to build <b>variables</b> also defined here, or one of the default variables the editor provides for you. To preview these defaults, or any of your defined commands and their current values, select <code>Build > Customize...</code> in the top menu bar and check the <code>build variables</code> option.</p> | ||
|
||
<p>A build profile might look somehting like this:</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling mistake: "somehting" should be "something"
@sinewavey @RisingThumb Reviewing this and it all looks good to me. Are we missing anything important? |
Pushed up 2 commits. e78d7c0 deals with what I said I'd do here that is a simpler approach to building maps(building using "Compile Maps" rather than "Launch Engine") #8 (comment) . The other 2 benefits of this, is we get to access variables that refer to the full path of the map, and to the path of the game. Up to you guys if we should go ahead with the "Compile Map" approach or the "Launch Engine" approach, can revert this commit for that, imo the former is simpler 70136f1 deals with the above PR comments. @sinewavey can you take a look at this commit in particular? I removed the line around the |
@RisingThumb looks good other than my mistake in titling the resource class name |
I kind of prefer this, partly due to the font, partly due to the highlighting. Also because the correct branding for FuncGodot is either "FuncGodot" or "func_godot", but not "Func godot". I do like telling folks to use the Compile menu though, as it allows you to have any number of build profiles saved and it's good to put new devs on that track. That said, |
Good catch, I've added this as a block note. I've also updated the image. Also had a lookover the rest of it, and made some minor corrections and fixes. Let me know if there's anything else, otherwise I'm happy with it currently |
Thinking about it, there is one more question that's left there. J.A.C.K. is previously discussed in Map Editor configuration, but there's no mention of it here. I don't use J.A.C.K., so I don't know if it's possible or just plain unknown, it may be worth opening another issue after this specifically for J.A.C.K. being mentioned here |
I'll take a look into it. I do have JACK installed, though I don't use it really. |
So looked into it. I could get it to launch but it didn't build the map. I'm guessing it wasn't running the extra commands for some reason, not too sure why. I would probably just mention briefly that tests attempting to launch maps from JACK didn't work out very well, and that while it may be possible the setup seems better suited to TrenchBroom and NetRadiant Custom. If we want to mention it at all. But better worded than what I just wrote. |
Personally, I think this kind of detail that it didn't work in initial tests is probably better suited for a separate issue to expand this page in the docs. For now I don't think it's worth adding on the page |
Following func-godot/func_godot_runtime_building#1 I have corrected the code example slightly in f734432 |
Looks good to me. Are we all happy with this? |
I think we're ready to send it out, then. |
I'm happy with it |
This should resolve #4
@sinewavey I'd be interested to hear your insight on this since I know you have a lot more runtime map building experience than I do, is there anything obvious I'm missing here. @RhapsodyInGeek what are your thoughts on this, about what should and shouldn't be included here?
There is a new page under tips and tricks titled runtime map building. There is also a new table added to the funcGodotMap class talking about the methods. I'm unsure about how best to list the parameters for the unwrap_uv2 method, since it's an optional parameter.
Additionally under the runtime map building page, I've noted that it's left to the user to bake what they want. I'm unsure if what we should be saying about the unwrap UV2 method here. idk how useful this is currently with this issue still existing godotengine/godot-proposals#8656 (comment)
Should we be documenting the import limitation for exported files? Since it's a pitfall that doesn't have an obvious solution and affects current stable build and the current 4.3 build(both requiring either of the other 2 import options selected instead of QuakeMap) I'm in favour of keeping this.
I have also documented the tip about using command line argument to pass map files as a launch option for Trenchbroom(Similar to Sinewave's point about this in the Discord for radiant). It's one of the cool not-so-obvious benefits of runtime map building
You can preview these changes here: https://risingthumb.github.io/func_godot_docs/FuncGodot%20Manual/FuncGodot%20Manual.html