Add support for Valve Map Format (.vmf) files#7985
Conversation
lildude
left a comment
There was a problem hiding this comment.
This PR is incomplete. You have not followed all of the instructions in the CONTRIBUTING.md file.
We also can not accept this grammar either as it doesn't have a licence. We can only accept grammars with one of the licenses linked in the CONTRIBUTING.md file.
|
I have added a license (MIT) to the grammar, but please let me know what I have not followed in the CONTRIBUTING.MD as I am confused on that! |
lildude
left a comment
There was a problem hiding this comment.
I've also just noticed your samples a huge! If they suppressed in the diff, they're too big. Please replace them with smaller, real world samples.
You've not generated the language ID as per step 4. You will also need to re-add your grammar to pull in the licence (see the instructions for replacing a grammar and replace your grammar with the same URL). |
Yeah, VMF files are reasonably large. I can make smaller ones, but they won't reflect real maps in real projects. I'm currently fixing the problems with the grammar and will also re-gen the IDs. |
|
I've just noticed we've already got a "Valve Data Format". How does this differ from a syntax perspective? Would this be better suited as adding this extension to the existing language? It's a data format so won't appear in the stats by default and if it's identical syntax, it saves you having to maintain a grammar. |
|
Valve Data Format is used to store game related metadata. Valve Data Format files store information data for resources, installation scripts, configuration scripts, and visualization elements. Valve Map Format files are the actual map source code used by Valve Hammer and VBSP, VVIS, and VRAD to turn the map into a BSP. They have very different grammar, so using the VDF grammar would not be suitable for VMF. |
|
I have updated the IDs for VMF. |
lildude
left a comment
There was a problem hiding this comment.
You've still not replaced the massive samples with smaller files nor re-added your grammar so that the license file can be cached.
|
I have removed the large VMF and kept the small one (this still has the basics of a VMF). I have cached my grammar license as well. |
|
Any updates? |
|
Your sample is still too big. As I said before, if it’s suppressed in the diff, it’s too big. |
|
I have made a smaller VMF file that is just a box brush. |
|
I have fixed the vendor README |
lildude
left a comment
There was a problem hiding this comment.
You shouldn't be manually changing the files modified by the scripts provided by the repo as by doing so you've now made this PR invalid as we already have a language with the source.keyvalues TextMate scope… VDF. We can't have two languages with the same scope but different grammars. Using the scripts to add/update the grammars would have highlighted this.
This reminded me to look at the PR that added VDF. That PR included a link to https://developer.valvesoftware.com/wiki/KeyValues. The VMF page in the same wiki states:
The Valve Map Format (VMF) is a plain-text file format that stores raw (pre-compile) map data, used by the Valve Hammer Editor (since version 4.0) to save production-stage maps and prefabs. It contains information on all map brushes and entities in the KeyValues format stored with a ".vmf" extension.
So VDF and VMF do indeed use the same underlying language.
I'm also reminded of a previous attempt to add VMF in #5413 and I'm going to stick with my decision in that PR here.
The VDF PR originally wanted to add the language as "KeyValues" as that's the language used for those files according to the wiki, but this was deemed too generic, hence "Valve Data Format". It think "Valve Data Format" is specific, yet generic enough, to cover these VMF files too.
Please update the PR to add .vmf as an extension to the current "Valve Data Format" entry. It's a data language so won't appear in the repo stats anyway and most users won't change this. They will however get the benefit of syntax highlighting.
Sorry to do this, but I didn't immediately remember we've effectively gone through this whole discussion before.
|
I have added VMF as a alias to VDF and moved the sample accordingly. |
lildude
left a comment
There was a problem hiding this comment.
You need to remove the grammar and related changes too.
|
I have removed the grammar for VMF. |
.vmf) files
Removed vmf-grammar submodule from .gitmodules
Samples are rejected if they are above a certain size: - github-linguist#7890 (review) - github-linguist#7985 (review) Clarify that samples have a size limit.
Description
The Valve Map Format (VMF) is a data language used for Valve Source engine maps created in the Hammer Editor. It stores map geometry, brush data, and entity properties.
Checklist:
#f79a10