H2xDev / GodotVMF

A VMF importer for Godot Engine
MIT License
84 stars 5 forks source link

Attempting to import a TF2 uncompiled map, getting a wall of errors #1

Closed Gamepro5 closed 4 months ago

Gamepro5 commented 4 months ago

Here are the errors I am getting: image image

Here is what my config looks like:

{
    "entitiesFolder": "res://examples/entities",
    "gameInfoPath": "C:/Program Files (x86)/Steam/steamapps/common/Team Fortress 2",
    "instancesFolder": "res://examples/instances",
    "materialsFolder": "res://examples/materials",
    "mdl2obj": "res://mdl2obj.exe",
    "modelsFolder": "res://examples/models",
    "nodeConfig": {
        "defaultTextureSize": 512,
        "fallbackMaterial": null,
        "generateCollision": true,
        "generateCollisionForModel": true,
        "ignoreTextures": [
            "TOOLS/TOOLSNODRAW"
        ],
        "importModels": false,
        "importScale": 0.025,
        "overrideModels": true,
        "textureImportMode": 1
    },
    "vtflib": "C:/Program Files/Nem's Tools/VTFEdit"
}

I am using Godot 4.2.1 stable.

The map I tried importing is this.

H2xDev commented 4 months ago

Hello!

I'd suggest you to resave the VMF in Hammer++, since the VMF doesn't contain precised vertex data (vertices_plus data inside of brushes). The vanilla version of Hammer is not supported yet.

Also you have wrong gameInfoPath in the config. C:/Program Files (x86)/Steam/steamapps/common/Team Fortress 2/tf2 will be correct.

Gamepro5 commented 4 months ago

image image

Hi, Thanks for the quick reply. I fixed the path and re-exported it in hammer++ (ALT+B). It is drawing some stuff now but it is drawing all of the invisible player clip brushes and doesn't seem to find any of the materials. Do I need to convert each individual one into a TRES and put it in my example folder?

For TF2, the materials are located in a VPK.

H2xDev commented 4 months ago

@Gamepro5 As I mentioned in Readme, exporting resources from VPKs are not supported yet. To import all materials you need to extract all materials from VPKs into the tf2 folder first.

Also you can add all tool textures into the ignoreTextures in the config after then faces with these materials will be ignored.

Gamepro5 commented 4 months ago

@H2xDev Thanks again. Extracting the VPK into the game's directory still doesn't fix the complaining that it does about there not being any .TRES files. Do I need to find a program that can recursively convert each VTF from the exported directory into TRES, and then put an exact replica of that folder of converted TRES into my Godot directory?

H2xDev commented 4 months ago

@Gamepro5 Reread the Installation page and recheck your config file.

Gamepro5 commented 4 months ago

@H2xDev Sorry for bothering you again. I re-read the installation page 3 times just to be absolutely sure I didn't miss anything. I keep getting the yellow warnings that the materials TRES is not found. It doesn't seem to be generating them. Did it work on your end?

image

{
    "entitiesFolder": "res://resources/entities",
    "gameInfoPath": "C:/Program Files (x86)/Steam/steamapps/common/Team Fortress 2/tf2",
    "instancesFolder": "res://resources/instances",
    "materialsFolder": "res://resources/materials",
    "mdl2obj": "c:/mdl2obj.exe",
    "modelsFolder": "res://resources/models",
    "nodeConfig": {
        "defaultTextureSize": 512,
        "fallbackMaterial": null,
        "generateCollision": true,
        "generateCollisionForModel": true,
        "ignoreTextures": [
            "TOOLS/TOOLSNODRAW"
        ],
        "importModels": false,
        "importScale": 0.025,
        "overrideModels": true,
        "textureImportMode": 2
    },
    "vtflib": "C:/Program Files/Nem's Tools/vtflib132-bin/bin/x64/VTFCmd.exe"
}
H2xDev commented 4 months ago

@Gamepro5 I try to test it on my end and i'll get back once i get some information about it :)

H2xDev commented 4 months ago

@Gamepro5 So, I updated the plugin and now texture import should work. Download the plugin from the repository and try again.

Change the vmf.config.json:

- "gameInfoPath": "C:/Program Files (x86)/Steam/steamapps/common/Team Fortress 2/tf2",
+ "gameInfoPath": "C:/Program Files (x86)/Steam/steamapps/common/Team Fortress 2/tf",
Gamepro5 commented 4 months ago

It works partially. It fails to convert some of them but doesn't say that they aren't found in the directory.

  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/pl_barnblitz/woodwall_redworn001b.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretefloor003a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall002d.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall001e.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/brick/wall028a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall009.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretefloor007c.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall003.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/tile/floor_tile_006a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/metal/wall016_stripless.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/wood/wood_bridge001a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/wood/western_woodwall002.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/wood/western_woodwall004.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/wood/grain_elevator_silo_10d.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/wood/grain_elevator_silo_10b.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/dev/reflectivity_10b.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/pl_barnblitz/woodwall_orangeworn001.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/wood/grain_elevator_facade_14a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/wood/grain_elevator_silo_10a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/tile/floor_tile_004a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall001b.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/brick/brickwall005c.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/brick/brickwall005.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/water/water_powerhouse.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/coalmines/red_wall3_bottom.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/coalmines/red_wall3_middle.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/pl_barnblitz/woodwall_grayworn001.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/computerwall_red_stained.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/wood/grain_elevator_facade_14b.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/water/water_2fort.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/pl_barnblitz/woodwall_grayworn001b.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretefloor009.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/tile/tile_ceiling_001a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/tile/floor_tile_002a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/wood/grain_elevator_facade_14c.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/wood/wood_bridge002.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/tile/floor_tile_005a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall006.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/tile/floor_tile_007b.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/metal/floorplate01.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall012z.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/computerwall007trim.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretefloor004.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall005.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall012c.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/tile/floor_tile_004b.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/tile/floor_tile_003a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/computerwall004trim.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/signs/world_map001a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/lights/white.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall003c.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/tile/floor_tile_007a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/dev/reflectivity_70b.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/glass/glasswindow002a.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/concrete/concretewall015b.tres
  core/variant/variant_utility.cpp:1111 - [GodotVMF] Material TRES is not found in the project: res://resources/materials/metal/chicken_wire001.tres
Gamepro5 commented 4 months ago

Also you can add all tool textures into the ignoreTextures in the config after then faces with these materials will be ignored.

This might be a seperate issue but I know that I listed the right names and it stills renders the HINT brushes and all other brushses.

"ignoreTextures": [
            "tools/toolsblack",
            "tools/toolsclip",
            "tools/toolsskip",
            "tools/toolsskybox",
            "tools/toolsnpcclip",
            "tools/toolstrigger",
            "tools/toolshint",
            "tools/toolsfog"
        ],

image image

H2xDev commented 4 months ago

@Gamepro5

It fails to convert some of them but doesn't say that they aren't found in the directory.

I guess VTFCmd couldn't convert these textures into PNG for some reason. Also TF2 depends on some materials from HL2 VPKs (hl2 folder near to tf). Try to extract them into tf folder as well.

This might be a seperate issue but I know that I listed the right names and it stills renders the HINT brushes and all other brushses.

Looks like i forgot to add case check. Try to convert these texture names to upper case. I'll fix that soon

Gamepro5 commented 4 months ago

Looks like i forgot to add case check. Try to convert these texture names to upper case. I'll fix that soon

But the names aren't uppercase in the directory.

H2xDev commented 4 months ago

But the names aren't uppercase in the directory.

They're uppercased inside the VMF. Importer before import a material looks inside VMF's materials and compares with ignore list