Giter VIP home page Giter VIP logo

godotvmf's People

Contributors

h2xdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

godotvmf's Issues

Incomplete material data.

Material importer ignores VMT properties other than $basetexture and VTF data other than the single image that is the base texture.

The biggest issue is the lack of mip texture export. Even with VTFs where mip textures are included, the importer ignores them.

It would be great if the most used properties changed Godot material properties such as $translucent turning transparency from disabled to alpha.

Where can I find another copy of mdl2obj?

Hello, I am a developer working on a game in the Godot Game Engine and it was truly strange to me that your project was announced literally just a day before I got started on making the project I intended on making now, gotta say, that's pretty handy. On the other side of things though, I am a Linux user and have been trying to acquire the most native files that I can get to get started, so far I have gotten BSPSrc, VPKEdit, VTFCmd with Wine but as to where I can find another copy of mdl2obj I am somewhat completely stumped.

It's not as if I don't trust you or anything, but I'm personally wondering where mdl2obj.exe comes from, how it works, etc. I plan for players of my game to be able to create levels in VMF files and load them at runtime, but them requiring all of these tools and having to set all of it up is somewhat of a pain, luckily for some tools like VTFCmd, I know where certain links are and I know what licenses certain softwares use, like BSPSrc is public domain, which is great! But mdl2obj?

Where did you get that, exactly, did you make it? Is it related to https://github.com/fzwoch/mdl2obj ?
What license is it, can I compile a native version of it for Linux? Can I look at it's source code? I am very keen on learning the ins and outs of the source engine and as far as I have searched, I cannot seem to find it.

If you have any information, please let me know :)

partially works on linux!

I have come from the reddit post and I mentioned on using linux, I have spent a few days on trying to get the hammer++ to work on linux and I finally got it working, now I have tested your plugin and it seems to work so far with basic geometry squares and rectangles (havent tested complex geometry yet) and it seems to work for that, but the textures dont seem to load in, though I am missing one third party dependency since it is an exe file I am not sure how it will work on the linux side.

Incomplete model import.

I'm sorry for the long hold, I had trouble with college that I had to deal with first. Good job on improving the plugin by the way, I'm immensely happy with how nicely it's coming along.

Here's a list of issues and enhancement proposals for the model and material import:

  • Most MDL models have a separate collision model that is not used by GodotVMF and instead a convex collision shape is generated that sometimes does not resemble the model at all. This is most noticeable with trees and grass. Trees get collision that includes their branches and results in a huge area to be inaccessible under the tree instead of just it's trunk being solid. Most props that would normally not be solid at all as for not having a collision model at all, like grass, now have a huge collider that gets in the way.
  • Model skins not supported.
  • prop_static's Collisions property in hammer is ignored. All settinigs use the generated collision model instead of the one included in the MDL for Use VPhysics, nothing for Not solid or a bounding box for Use bounding box.
  • I know it would take a while but it still would be nice to import animations and include an animation player with prop_static entities as well because some models have an actual animation as their idle sequence, as well as some models like combine doors having several animations for opening/closing ect. I kinda want to test if I can just use hl2 viewmodels and character world models and their animations.
  • props_combine/stasisvortex.mdl is missing transparency.
  • items/ammocrate_smg1.mdl and props_c17/tv_monitor01.mdl have weird artifacts.
  • Some materials wrongfully have backface culling while others wrongfully don't.
    Examples:
    props_combine/combine_booth_short01a.mdl glass on the front is only visible from the inside, on the sides is only visible from the outside.
    props_c17/paper01.mdl is invisible from the bottom.
    material metal/metalfence007a is not backface culled but it should be.

Another thing, it's probably a dumb question but I want to know if it's even possible to somehow have shaders from the materials translated to compute shaders that can be used in Godot with any sort of accuracy, if at all.

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

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.

Displacement feature is incomplete and questionable design choices

First and foremost

I'm somewhat of an experienced developer, so I thought about fixing stuff myself, but I'm not too confident in knowing how GodotVMF works yet and I don't feel like making commits to the project if my use case is going to be extremely specific, so I thought I'd let you know about these kinds of things, because for the past few days, I've been trying to get a custom map, particularly a surf map, to load for testing by using GodotVMF.

Before update 1.2.0 (Displacement) I was able to get the map to load correctly, although the models were missing their textures and everything else was too because I hadn't extracted the vpk. A full map and no textures is completely fine because I can just substitute the missing textures with my own materials, but as of right now, importing the map doesn't seem to work.

First, though, I need to talk about my setup, here is my config:

My config

{
	"entitiesFolder": "res://assets/entities",
	"gameInfoPath": "/home/lachrymogenic/Development/Godot Engine/VMFTest/mesa/",
	"instancesFolder": "res://assets/materials",
	"materialsFolder": "res://assets/materials",
	"mdl2obj": "/home/lachrymogenic/Development/Godot Engine/VMFTest/mdl2obj",
	"modelsFolder": "res://assets/models",
	"nodeConfig": {
		"defaultTextureSize": 512,
		"fallbackMaterial": null,
		"generateCollision": true,
		"generateCollisionForModel": true,
		"ignoreTextures": [
			"TOOLS/TOOLSNODRAW"
		],
		"importModels": true,
		"importScale": 0.025,
		"overrideModels": true,
		"textureImportMode": 1
	},
	"vtflib": "/home/lachrymogenic/Development/Valve Dev Utilities/VTFCmd/vtfcmd.sh"
}

just incase you're wondering, yes, I put vtflib in a completely different location and yes it is a shell file but it does indeed work, it runs wine and passes all the arguments to the wine executable.

Attempting to study how the code works, I set my gameinfo folder to the folder that BSPSrc produces when you extract a map with the "Extract embedded files" option on. I moved this folder to the project folder. On the old version, it works and imports in custom materials from that map. I also had to change the code because materials and other stuff wouldn't load in general because for some reason the code tries to apply .to_lower() to the path files, for what reason is somewhat unknown. Simply encasing code like

var vtf = (config.gameInfoPath + '/materials/' + baseTexture + '.vtf')\
		.replace('//', '/') \
		.to_lower()

with

var vtf = (config.gameInfoPath) + ('/materials/' + baseTexture + '.vtf')\
		.replace('//', '/') \
		.to_lower()

is what allows me to use my gameinfo path, which includes uppercase letters. I've often had to restart and reload the project multiple times in order to get it working correctly.

Everything was fine in the old version except for an issue where I cannot load custom model materials. But as of right now, my output is spamming this: `Vertex amount (8) must be a multiple of the amount of vertices required by the render primitive (3)' and I'm not sure why though I can only conclude that the Displacement feature is unfinished and other commits have broken functionality of the importer, such as the merging of "develop" into the main branch. This is what it looked like before and after

Before

(I had to redo the before image and models take too much time to load and materials are being a pain rn so I didn't load them in, just pretend that they're there and some textures on the wall are actually there in this image etc.)
ramps before

After

after
wtf lol godotvmt

With all this being said, I'm not sure if there is anything else that I can provide to help diagnose the issue, maybe I'm the issue, because in trying to revert back to the old version, I have managed to screw myself over and now absolutely NO entities are rendering... except they are now for some reason?

Reverted to commit eedac7d

I reverted to the version I was using 3 days ago and moved some parts of my config from res://assets (my own folder) to res://examples and renamed the name of the map to use all lower case, turn off import models in the config and loaded up a completely different map and I've managed to get entities to import again

Very weird, I'm going to attempt to study more about how this code works and then modify it to work with my use case, get it to load model materials, but I still thought I should let you know and also that there may be things you might want to tweak, like using all lower case stuff for file paths is a pretty bad idea when most people have capitals in their file paths, I don't know if Windows disregards it or something but Linux for sure doesn't like that.

To be honest, I should have studied it first instead of blindly trying to load in decompiled BSPSrc maps and expecting it to just run perfectly, but if I do manage to learn enough about your project that I'm able to fix some things, I still might be apprehensive to commit due to the potential possibility that whatever works for you breaks for me and vice versa, though I am really keen on using and potentially helping with this project.

To conclude

  • Model materials do not work (for me atleast)
  • I don't get why .to_lower() is there sometimes.
  • Displacements update might be broken for now
  • Entire process is quite slow, actually, and relies heavily on external tools, is there not a way to speed it up?

I don't expect others to do all the work for my issues but what I'm worried about is that the devs of this project have real working model support and displacement support that just works for them but not for me and by optimizing it to work for me, it won't work for them. This might be related to the fact that I am using decompiled maps instead of maps made with Hammer++

mdl2obj Linux and macOS support

Currently the code for mdl2obj is shipped as a Windows executable mdl2obj.exe.

I suppose it makes sense to not ask users on Windows to go install Node.js. For better support of Linux and macOS I would advocate to ship the raw Javascript and ask those users to simply install Node.

I would be happy to create a Pull Request with those changes if you think that is good enough of a solution.

As a side note the mdl2obj repo seems to be missing the source-mdl source code that is required to make it work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.