Code Monkey home page Code Monkey logo

godot-tbloader's Introduction

TrenchBroom Loader for Godot

This is my personal modified version of TBLoader, where I'm adding features that I need for my own projects, as well as experimenting with ideas I have along the way.

Please note that this is all experimental and not guaranteed to work properly. Although it seems to.

Usage

Please refer to TBLoader's original instructions for anything you need to know. Most of it works the same, with some differences pointed out below.

Current major changes and reasoning:

Bug fixes

  • fix objects "rolled" wrongly : objects rotated around the X axis in TB, would be rotated the opposite way in Godot.

  • account for 'origin' property on brush entities : brush-entities ignored the origin property and were always positioned at the center of their geometry, making it imposible to create rotating brush-entities in TB (doors, levers, fans...). This is fixed, such that you can now set their origin property to the position where the "hinge" should be, and the node in Godot will be positioned correctly.

    Unfortunately TB doesn't currently have a way to visually edit the origin, but you can use a dummy point-entity, place it where the hinge should be, and copy-paste its origin to your brush-entity.

Changes

  • added a cfg file : this makes it a bit easier to have your settings in one place, that all TBLoader nodes can draw from. The TBLoader node comes with a button (a checkbox) to create a new cfg file, and it will use those settings when building maps.

  • removed hardcoded entities : the plugin can provide example entities without having them hardcoded, such that users can always delete all of them and create their own entities from a totally clean slate, if they want. I may build an example project with some more complex entity systems.

  • switch to Valve (220) map format : it provides much better texturing capabilities, and maybe other benefits, and is actualy supported by TBLoader (without my intervention). As far as I'm aware there's even no good reason to use the Standard (Quake1) format. (Even for people mapping for Quake1.)

  • added pre-/post-build passes : the post-build pass mmakes it possible to perform adjustments to the map after building, such as rearraging entities in the tree, setting up GI, lightmaps, occluders, navmeshes, etc. I can't think of a use for the pre-build pass, but I added it just in case.

    This comes in two ways:

    • if the root node of the map scene has a script that implements _pre/_post_build_setup, then they get called.

      func _pre_build_setup(loader: TBLoader): pass
      func _post_build_setup(loader: TBLoader): pass
    • a separate build script can be set in the config file, which can also implement _pre/_post_build_setup, and they will also be called if they exist.

      func _pre_build_setup(map_root: Node3D, loader: TBLoader): pass
      func _post_build_setup(map_root: Node3D, loader: TBLoader): pass
    • both options work independently of each other, but there's probably no point using both at the same time.

  • removed automatic handling of clips : the way I see it, different projects have different clipping requirements, so there's no point hardcoding this. Some projects may get by with a simple clip, others will need monster_clip, player_clip, projectile_clip, among others, all of which will probably use different clip textures, and all of which will require setting up different collision layers and/or masks.

    Users will decide what they want; the plugin makes no assumptions.

    It's easy enough to create an entity for each clip (and to set it up for having transparency in TB), and it can then be setup during post-import as desired. At the same time, some users (like me) might like to keep clip geometries around for runtime debugging purposes. Others can easily get rid of them by simply queue_free()-ing their mesh node during post-build.

  • simplified names of meshes and collision nodes : this is my ongoing attempt at making it a bit easier to do post-build node rearrangements, by having them named and arranged in predictable/consistent patterns. I'm still fiddling with it, trying to figure out what might work best, and so the way I handle this may change in the future.

godot-tbloader's People

Contributors

codecat avatar dmartinek avatar eirexe avatar emmyleaf avatar hemebond avatar krazyjakee avatar levrault avatar macronic avatar makepanic avatar rogerahuntley avatar skaruts avatar somebody1121 avatar tdcranila avatar the-sink avatar

Stargazers

 avatar  avatar

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.