Giter VIP home page Giter VIP logo

corvid's Introduction

Support me on Patreon

Corvid (ˈkɔrvəd)

Corvid is a tool that converts Source Engine maps and their assets to be used in Call of Duty. It is currently in the beta-testing phase. This repository is for developers who know their way around Python and Git. If you are a mapper who wants to use Corvid, go to releases to download the latest version.

Supported games

  • Call of Duty 2
  • Call of Duty 4: Modern Warfare
  • Call of Duty World at War
  • Call of Duty Black Ops
  • Call of Duty Black Ops 3

What gets converted

  • Brushes (converted as patch meshes to have accurate UVs)
  • Displacements and their vertex colors for accurate texture blending
  • Rope entities
  • Prop entities
    • Static props
    • Physics props
    • Props with different colors
    • Props with different skins
  • Light entities
  • Sun color & sun angles (doesn't always produce perfect results)
  • Materials
    • Color maps
    • Normal maps (excluding ssbump textures)
    • Gloss maps
    • Blend maps
    • Color tints
    • Patch materials (material inheritence)
  • 2d skyboxes (converted to equirectangular images for Bo3)
  • 3d skyboxes / vistas (requires user to add everything in the 3d skybox in a specific visgroup)

Work-in-progress features

  • Spot lights
  • Proper brush conversion for plain brushes
  • Overlays (advanced decal entities)

Currently not supported

  • Infected shaders
  • Decals (infodecal entities)

Screenshots

Click to toggle

Inferno Cache Cache Cache Mirage Mirage Mirage Atrium Sacrifice Crossfire Crossfire Crossfire Bounce Bounce Contact

Installing & running

For mappers

Get the latest release from the releases section and learn how to use it from the tutorial below.

tutorial

For developers

Clone this repository and its submodules and install the dependencies using the following commands.

git clone https://github.com/KILLTUBE/corvid.git --recurse-submodules
python -m pip install -r requirements.txt

To run Corvid, launch app.py. Choose your Steam director and the game of the map you want to convert, use the VMF file of the map (you can use BSP Source to decompile maps). Once the conversion is done, the map will be ready to be used with its assets properly converted for Call of Duty's mod tools.

Issues and known bugs

  • Some models get converted, but they don't look as they are supposed to (They either have bad normals or look really messed up) and some models cannot get converted at all. This is because of the model converter I wrote. Updating it or using SourceIO's model loader will probably fix that issue.
  • Spot lights often have the wrong angles.
  • Some assets cannot get copied or converted at all. This is because they are either renamed or removed from the game. There isn't anything that can be done about this apart from adding those assets manually.
  • Converted assets might not get copied after the conversion is over if the map has been converted before. Choosing a different directory to extract those assets or deleting the previous ones seems to solve that issue.
  • Some brush faces don't get converted for reasons I cannot understand for now. It probably has something to do with the way I check for invalid vertices or slightly incorrect plane calculations.

Sources and references

Third party libraries and references

Special thanks to

  • Dylancyclone for VMF2OBJ tool which helped me understand a lot of things about Source Engine maps and inspired me to work on this tool.
  • masterex1000 for helping me understand the intricacies of map files, mesh generation and helping with calculating UV maps.
  • Geekidos, HitmanVere, OldmanCats, ThomasCat for testing the maps converted by Corvid and help me figure out the issues we had on Black Ops 3. Without their help, Corvid couldn't have Black Ops 3 support at all.

If you'd like to support my work, you can become a patron and help me keep working on this tool.

For further information and support, join the KILLTUBE Discord server

Icon file created by Freepik

corvid's People

Contributors

dikkemeuk avatar kingslayerkyle avatar moyogii avatar myuce 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

corvid's Issues

Brushes get converted with Caulk texture. Textures are then added with textured no-collision planes.

Is this intended? In the example video you made, this doesn't seem to happen. You can see the two surfaces z-fighting here:

screenshot

The actual brushes are not converted with the correct texture. They just have the caulk texture. Then additionally for each brush all of the sides are represented with planes with the correct texture on. Is there a reason the brush can't just have the correct texture? Does this not usually happen? The map I'm converting does not use displacements in Hammer for anything.

EDIT: Just realized, this might be what you mean with (converted as patch meshes to have accurate UVs). In that case, I guess this might just be a limitation of the current version and not really a bug of some sorts. In that case feel free to close. I just assumed brush UVs could be set just as one can in Hammer. I'm not very familiar with the CoD map formats.

Error "TypeError: string indices must be integers" at step 7

When converting "sp_a2_triple_laser_d" from Portal 2

Conversion stops at step 7 outputing following stacktrace :

Generating GDT file... Exception in thread Thread-4: Traceback (most recent call last): File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 950, in _bootstrap_inner File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 888, in run File "app.py", line 410, in convertButton_command File "C:\Users\Mehmet\Documents\GitHub\corvid\modules\MapExporter.py", line 473, in exportMap File "C:\Users\Mehmet\Documents\GitHub\corvid\modules\AssetExporter.py", line 314, in createMaterialGdt File "C:\Users\Mehmet\Documents\GitHub\corvid\modules\AssetExporter.py", line 403, in createMaterialGdtBo3 TypeError: string indices must be integers Exception in threading.excepthook: Exception ignored in thread started by: <bound method Thread._bootstrap of <Thread(Thread-4, started 8144)>> Traceback (most recent call last): File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 908, in _bootstrap File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 952, in _bootstrap_inner File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 1220, in invoke_excepthook AttributeError: 'TextRedirector' object has no attribute 'flush' Exception ignored in sys.unraisablehook: <built-in function unraisablehook> AttributeError: 'TextRedirector' object has no attribute 'flush'

requirements.txt error in line 6

ERROR: Invalid requirement: 'pyinstaller=4.4' (from line 6 of requirements.txt) Hint: = is not a valid operator. Did you mean == ?

just a typo you might wanna fix

Models not using correct skin

Seems like the conversion process ignores the skin KVP and exports the prop with skin 0. Here's an example I have from my map.

Hammer

HammerView

Radiant

RadiantView

HL2 door models glitch

image

This issue appears to occur on all of the door models in HL2.

By the way, is there a separate tool that can convert Source models to COD?

Team Fortress 2 gameDef missing gameRoot

This is a really cool tool. I tried it with a CS:GO map and it worked brilliantly. Then tried a TF2 map and it said a .vpk was invalid. Figured out it was because gameRoot in TF2's gameDef is blank - changing this to "Team Fortress 2" made it work too. Looks like Fistful of Frags has the same issue but I don't know the directory name for it.

Possible malware?

Ello, so I came across this tool when searching up things relating to porting source engine maps over into the BO3 mod tools and when I first heard of this I figured it sounded neat, however me being the paranoid person I am when it comes to .exe files I did run the corvid.exe through VirusTotal and I didn't like the results:
image

Again maybe it's just me being paranoid and these are possibly false detections but I just wanted to open this issue on here and get some clarification is all :)

AttributeError: 'str' object has no attribute 'x'

The following error appears when trying to convert a decompiled version of d2_prison_02.bsp using the standard Patch meshes brush conversion method with Corvid 0.0.4.

Traceback (most recent call last): File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run File "app.py", line 436, in convertButton_command File "C:\Users\Mehmet\Documents\GitHub\corvid\modules\MapExporter.py", line 605, in exportMap File "C:\Users\Mehmet\Documents\GitHub\corvid\modules\AssetExporter.py", line 757, in exportSkybox AttributeError: 'str' object has no attribute 'x'

Full log
Corvid-log-27.07.2021_(11.17.45).txt

'vpk is not a valid file'

Hello! While compiling the map, I get this error of "'pak01_dir.vpk' is not a valid file!" I can't seem to figure out what the problem was.

image

Error thrown when converting 'bm_c1a0a_d' from Black Mesa

Error at the end of step 10:

Brush face 11474 has less than 3 vertices. Skipping... Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 950, in _bootstrap_inner File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 888, in run File "app.py", line 410, in convertButton_command File "C:\Users\Mehmet\Documents\GitHub\corvid\modules\MapExporter.py", line 616, in exportMap File "C:\Users\Mehmet\Documents\GitHub\corvid\modules\AssetExporter.py", line 719, in exportSkybox TypeError: string indices must be integers Exception in threading.excepthook: Exception ignored in thread started by: <bound method Thread._bootstrap of <Thread(Thread-1, started 15036)>> Traceback (most recent call last): File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 908, in _bootstrap File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 952, in _bootstrap_inner File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 1220, in invoke_excepthook AttributeError: 'TextRedirector' object has no attribute 'flush' Exception ignored in sys.unraisablehook: <built-in function unraisablehook> AttributeError: 'TextRedirector' object has no attribute 'flush'

Can't really understand this one, also paths point to dev's user folder.

convertLight error when _light doesn't have a fourth color property

in MapExporter.py, around line 274, rarely there's a case when an entity's _light property has 3 numbers. I've encountered this with the maps cs_italy (Counter-Strike: Source version) and gm_bigcity.
An example is shown in the attached picture:
image

The program throws an error when in convertLight in MapExporter.py tries to set the "radius" property to _color[3], which in this case is out of bounds.

I managed to overcome this issue in a rough way, by setting the fourth property to a constant number in such cases.

AttributeError: 'TextRedirector' object has no attribute 'flush'

Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 950, in _bootstrap_inner
  File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 888, in run
  File "app.py", line 410, in convertButton_command
  File "C:\Users\Mehmet\Documents\GitHub\corvid\modules\MapExporter.py", line 481, in exportMap
  File "C:\Users\Mehmet\Documents\GitHub\corvid\modules\AssetExporter.py", line 314, in createMaterialGdt
  File "C:\Users\Mehmet\Documents\GitHub\corvid\modules\AssetExporter.py", line 409, in createMaterialGdtBo3
TypeError: replace expected at least 2 arguments, got 0
Exception in threading.excepthook:
Exception ignored in thread started by: <bound method Thread._bootstrap of <Thread(Thread-1, started 3692)>>
Traceback (most recent call last):
  File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 908, in _bootstrap
  File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 952, in _bootstrap_inner
  File "C:\Users\Mehmet\AppData\Local\Programs\Python\Python39\lib\threading.py", line 1220, in invoke_excepthook
AttributeError: 'TextRedirector' object has no attribute 'flush'
Exception ignored in sys.unraisablehook: <built-in function unraisablehook>
AttributeError: 'TextRedirector' object has no attribute 'flush'

I get this error often with different types of maps hl2/csgo/sourcemods.
What does this mean? What is the issue?

btw thanks for this project, i love it!

Error when running for the first time: corvid folder doesn't exist in Temp

I've encountered this bug while running the program for the first time. The program tries to delete the corvid folder in Temp, which initially doesn't exist, hence it throws an error. This can be fixed with a simple check for its existence.

ps. I hope you don't mind issues being reported, as I'm aware that it's still in development. I hope I can help with this.

Error after generating .map file

Started to use the tool now, although after it generates the .map file I get this strange error afterwards and the tool just stops the process:
image

Map I'm trying to convert is TF2'S Dustbowl.

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.