Code Monkey home page Code Monkey logo

rampancy's Introduction

Rampancy

A new level editor for the Halo games based on a CSG/Brush workflow, similar to Source/Quake level editing.

Example

RampancyTest.mp4

sapien_l3i7oo4Zha Unity_kmgOSmG7sh

Status

The project is still early in development and some core issues need to be worked out. However, it should work as a solid proof of concept for those interested. Pull Requests for new features and bug fixes are welcome!

How to Setup

  • Download and Install Unity 2021.2.0b4
  • Download the mod tools for the Halo games you want, eg. Halo 1 on Steam
  • Clone this project from a command promt with admin (this is due to windows being annoying about creating symlinks) git clone --recurse-submodules -c core.symlinks=true https://github.com/GoomiiV2/Rampancy.git
  • Open the project (Rampancy/Unity directory) in Unity
  • Browse and set the paths for the mod tools you will use
  • Click the Rampancy menu at the top and then Debug > Open Level UI > Materials and then click Sync Materials from
  • Click Rampancy > Create Level give it a name with no spaces and then click Create new Level.
  • Click Window > Realtime CSG Window and dock it some where.
  • Click the Generate tab and create a large box in the scene, this will be the level.
  • You can then add more brushes to detail the level as you want later.
  • Press F6 to compile
    • The following only need to be done once/whenever you want to specifically edit just them.
      • In Guerilla, open the map scenario to configure the sky
      • In Sapien, open the map to add and configure player spawns
    • Once configured (if needed), press F5 in Unity to run the map in halo_tag_test

A bit more indepth example of creating a level: https://github.com/GoomiiV2/Rampancy/wiki/Creating-a-new-level

Supported Games

  • Halo 1 MCC
  • Halo 3 (Eventually)
  • Others (Uncertain, most likely at least Reach eventually)

But, why?

As much as I love Blender and other dedicated 3D authoring software, I don't find them as fun to use as brush based editors like Hammer for Source. So why not try and bring that to the Halo games now that we have mod tools.
As well as hopefully simplifying map creation and streamlining the process.

Yes, but why Unity?

Mostly for Realtime CSG. The awesome CSG library that's the core of this is tied into Unity, which means I am too!

I was looking at TrenchBroom and a Quake map compiler, but then I wouldn't really have the useful Subtractive Brushes.
Plus C# is nice <3

Why the name Rampancy?

I like to do silly things and creating a new level editor for the old Halo games seemed a bit of a wild and silly thing to do. I figured that seemed like something a Rampant AI would do, so it felt fitting for the name of this.

Libraries used with love! <3

rampancy's People

Contributors

goomiiv2 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

u3d-resources

rampancy's Issues

Add ASS support

To support Halo 3 need to be able to export to the .ass format.

Specify export location

It would be good if we could specify an export location at the level creation stage rather than being forced to use solo or multi.
I use data\levels\custom\mapname for my own stuff and someone I'm helping has theirs grouped under their own parent folder too.

Improve bitmap importing for Halo 1

Atm the bitmap importing is simple, it just get all the bitmap tags and extracts the bitmap plates and creates texture assets in Unity.

I'd like to improve this to go off the shader tags and create a rough version of that shader in unity, as in shaders with transparency will also have transparency in Rampancy.
And to also only import texture that are used in levels, atm it imports all bitmap including those for the ui and models.

Xml tag refs don't have the path, just the name

XML output for tag refs only has the name, Halo 1 tool xml outpath had the tags relative path, eg.
Halo 1: <tag_reference name="bump map" type="bitm">levels\a10\bitmaps\burn detail strips bump</tag_reference>
vs
Halo 3: <field name="bitmap" value="panel_generic_simple_bump" type="tag reference"/>

Add scale referance models

Add some models as game objects to help get a sense of scale.
Should have the chief, a warthog and a tank.

Mesh Based Decals

For Halo 1 having an easy solution to place projected decals on to the geo would be nice for things like light textures.

Does not run when following instructions in README.md

I followed the instructions in the readme and recursively cloned this repo as instructed.
When trying to open the project it errors complaining that some scripts fail to compile for the reasons shown in this image.

image

Add a model importer and converter.

There are some things that are better suited to a modeling app that you still might want to use with Rampancy, you can't really just import the mesh and be done (at least with Halo 1) since it has to respect the sealed world rules. (not counting floating objects).

So i'd like to try and create a mesh importer where the user can select a mesh and have it be converter to a collection of brushes that have the same shape and thus will interact with the rest of the geo right eg. clip and subtract etc.

The best way to do this is prob to make each tri of the mesh a brush shaped to it with the right uvs and normal's.

Could be fun to try atleast.

Better material browser

Unitys asset browser isn't great atm for this use case.
So should create or find a more focused material browser and tag the shaders on import for easy searching.

T-Junction Removal

Realtime CSG can produce invalid sealed world meshes some times, this is mostly from it creating T-Junctions in the output mesh.
So i need a way to decent and fix those.

A T-Junction is when a vert sits on an edge but isn't connected (there can be a gap, but the output from RCSG doesn't really have those).
image

So a rough way for me to fix this would be.

  • For each vert see if it is sitting on an edge
  • If it is split that edge, and the poly it makes into 2, connecting from one vert to the new vert on the edge.
  • Connect them up and repeat.

To make this fast I'd want to convert the Unity mesh into a half edge structure and then do the processing on that before converting and exporting.

Notes:
Simplgon has the ability to do this it seems: https://documentation.simplygon.com/SimplygonSDK_9.1.225.0/api/tools/tjunctionremover.html
They have a free tier, but seems its remote processing with limits so not a good fit for this
:<

An example of the problem and needed fix:
T-Junction Example

No tag-to-xml command like in Halo 1

No print-tag-to-xml like Halo 1. need to write to a file and then read back
It would streamline just being able to parse the standard output instead of writing to a file to read back in.

The other issue would still be the relatively slow start up time of tool to run a command, I'm not sure much can be done there in most cases as i expect its some tag index building or such.

But it means if i want to export all the shaders to Unity thats about 3k invoking of tool, even with doing in batches of 10 or 20 process at a time it can take a while.

ATM I work around this but scaning the tag file and looking for a hex pattern to pull out the tag paths for the texture slots I need, then checking the template string for if its transparent etc. Its not great if I want to make more accurate Unity shader versions of Halos shaders, but it works well enough for now and is faster than xml, to file, read parse for 3k ish mats (to xml was taking about 5 mins, this is less than a second.

Add a dengrate tri fixer / remover.

Or well atleast try!

I think most of the degen tris that are made now are a result of the t-Junction fixer and could prob be just droped from the export due to the nature of these ones.

Issue with level exporter?

Hi there! This tool is such a great idea, you're a genius! Anyways, I'm having an issue when I hit F6, it says

NullReferenceException: Object reference not set to an instance of an object
Plugins.Rampancy.Runtime.LevelExporter+<>c__DisplayClass3_0.b__0 (UnityEngine.GameObject x) (at Assets/Plugins/Rampancy/Runtime/LevelExporter.cs:47)
System.Linq.Enumerable+WhereArrayIterator1[TSource].ToList () (at <b024aa277ab0422080e4a1dbe1f3c835>:0) System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable1[T] source) (at :0)
Plugins.Rampancy.Runtime.LevelExporter.GetRcsgMesh () (at Assets/Plugins/Rampancy/Runtime/LevelExporter.cs:47)
Plugins.Rampancy.Runtime.LevelExporter.ExportLevel (System.String path, System.Boolean tJunctionFix) (at Assets/Plugins/Rampancy/Runtime/LevelExporter.cs:12)
Plugins.Rampancy.Runtime.Actions.ExportLevelJms (System.String jmsPath) (at Assets/Plugins/Rampancy/Runtime/Actions.cs:41)
Plugins.Rampancy.Runtime.Actions.H1_CompileStructure () (at Assets/Plugins/Rampancy/Runtime/Actions.Halo1Mcc.cs:20)
Plugins.Rampancy.Runtime.UI.LevelUI.CompileStructureAndPreviewLightmaps () (at Assets/Plugins/Rampancy/Runtime/UI/MainUI.cs:64)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()

I'm not the best with Unity, sorry

Vert welder and mesh optmisations

Atm the output JMS has a fair few duplicate verts and some that aren't fully aligned, they are close enough that tool will take them but I'd like to try and improve this.

Lightmap baking and export

Unitys light map has a few more features that Halo 1s light mapper to say the least.
So it would be neat to be able to bake hardware accelerated light maps in Unity and have those exported to the map.

Would also be nice to use xatlas to create the light maps uv as well and maybe seam optimizer as well to help.

Useful links:
https://c20.reclaimers.net/h1/tools/aether/

Look at supporting for the other Halo games too, eg, Halo 3.

Error when trying to export basic box level

Hi, i'm probably being dumb but I have a very simple level with only like 7 brushes in it, but I had some open edges that I tried to fix, and whilst nothing is visually wrong I cannot get it to export anymore. Whenever I hit F6 I get this error and I have no idea what it means or how to fix it!

No idea if this is a me issue or not, the error is extremely vague lol

ArgumentException: An item with the same key has already been added. Key: Rampancy.WingedMesh+Edge
System.Collections.Generic.Dictionary2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <fd976842c3634855aba83404a44c7daa>:0) System.Collections.Generic.Dictionary2[TKey,TValue].Add (TKey key, TValue value) (at :0)
Rampancy.WingedMesh.FromUnityMesh (UnityEngine.Mesh mesh) (at Assets/Plugins/Rampancy/Runtime/WingedMesh.cs:61)
Rampancy.LevelExporter.FixTJunctionsV2 (UnityEngine.Mesh mesh) (at Assets/Plugins/Rampancy/Runtime/LevelExporter.cs:31)
Rampancy.LevelExporter.ExportLevel (System.String path, System.Boolean tJunctionFix) (at Assets/Plugins/Rampancy/Runtime/LevelExporter.cs:18)
Rampancy.Actions.ExportLevelJms (System.String jmsPath) (at Assets/Plugins/Rampancy/Runtime/Actions.cs:44)
Rampancy.Actions.H1_CompileStructure () (at Assets/Plugins/Rampancy/Runtime/Actions.Halo1Mcc.cs:19)
Rampancy.UI.LevelUI.CompileStructureAndPreviewLightmaps () (at Assets/Plugins/Rampancy/Runtime/UI/MainUI.cs:64)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()

[Long long term] Look into not depending on Unity

This isn't exactly a super serious thing but one I would like to do, largely also depending on how people use this tool (or not).
This issue is to track things that are specifically tied to Unity and options that are less Unity specific that could be used.

I'm not the biggest Unity fan, despite this project, being in Unity :D but I won't go on about how i would want to use it personally for a substantial game.

The core reason for using Unity for this project was, Realtime CSG.
I didn't find another CSG lib that was as stable and as performant as it, Chisel could be great as a replacement but its also Unity too.
This is the biggest blocker, RCSG has most of its algo in a native dll, so I could try using it from a separate project and build the UI around that (with Veldrid and Imgui.net). It would be quite abit of framework setup for the rendering and UI, but it would be standalone.

The other option I looked at before RCSG was TrenchBroom and a custom or modified Q3 compiler to output halo mesh formats.
I love Trenchbroom but the down side for this project is that its non realtime csg and non subtractive.
The attraction of realtime and subtractive is that you get feed back much faster and with subtractive having a sealed mesh is easier to guarantee.

On the plus side, no Unity could mean loading the tags data directly for bitmaps / shaders and less working around Unity to get those things to work.

Its not been used yet but the other draw for Unity was the light mapper, esp the GPU one for Halo 1 maps. If not using Unity would like to find something else, maybe blender? I think there was a project already that was working on that?

Another plus for non Unity would mean distributing this is simpler, one download run and go, versus installing Unity and then this package.

Convert to URP

Convert the project and plugin to URP and create shaders for the games.
URP should be usable now and using it should allow more lights in deferred mode that should help with light previews.

Improve the error geomerty display

I use unity debug.Draw api at to render the wrl debug geo but, its really damm slow (Unity why do you choke with a few debug draw calls, like huge fps tanks, grrrr).

The new system would create a game object for each error instance and list it under a "Debug" object in the scene view.
The plus of this too is you can easily go to the site of the error and have more context information.

(Hopefully there won't be much need for this as the algo will make nice clean geo, right!?)

Terrain Tools

Halo is kinda known for out doors and vistas and, well Rampancy doesn't really have any landscaping tools to help with that D:

#8 can help with this, terrain could still be done in a 3d app and importing as a work around.

Or could make some custom terrain tools that use csg brushes.

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.