Background Hods


(P2ambassador) #21

Since you mentioned the classic format of backgrounds … As far as I know, when creating a bitmap background converted to btg-format using relic’s vectorization tool (it’s differ from HW1 btg format), then this btg-file is imported into Maya using RDN plugin, and after tweaking in Maya exported to a standard hod-file. At the time, Relic has published examples of backgrounds for first mission, but not published this wonderful vectorization generator. Do you have it?

Tool which is creates so precise, and most importantly – compact colorized mesh, would be very useful for the community, IMHO, and, I think, not only for classic HW2 :slight_smile:


(making space ships) #22

Having used the somewhat newer BTG version, you’re not really missing anything. It does not create precise meshes, Relic used someone elses code to do that so even if we wanted to release that we wouldn’t.

http://www.codeforge.com/read/182928/qslim-2.1--libgfx--doc-_-vec3.html__html

^that toolset to be exact. Maya was only used to add in the level lights.

The workflow from Relic’s own documentation:

Overall Workflow

Create background texture in Photoshop.   
Create high-poly-count mesh in BTG to sample the background texture.
Simplify high-poly-count mesh using MeshSimp.
Edit simplified mesh in BTG.  
Create / edit star field mask texture in Photoshop.
Add textured stars and generate star fields in BTG.
Add lens flares
Modify mesh’s Y-rotation in the BTG (if necessary; you may need to iterate between steps 8 to 11 to line up the mesh with lighting).
Export background to HOD file using the BTG.
Setup lighting in Maya.
Test background in game.
Rinse and repeat steps 4 to 11 as required.

Having explored both workflows, the background generator written by modders is fairly superior to the BTG in the meshes it creates. BTG’s strength is the “ease” of painting the vertices to fix the numerous errors but these days there are better tools for that. We did an entire evaluation at the start of the project. The only true advantage is that the vertex meshes are non resolution dependent. Back in the day, they would have killed for ~20 megs of memory but today that is just a single ship and having the option of much smaller, refined detail and not having to spend a week or two slightly adjusting the colors and positions of vertices makes this dead technology without some serious advancements in some new tools.


(P2ambassador) #23

@scole, Thank you for the explanation!

The specified workflow from Relic’s own documentation is very useful. It is a pity that it was not provided in the RDN-package. In general, is it possible to publish Relic’s original tools for Homeworld2, as it is done for first Homeworld? Without support, “as is” – only the tools and documentation already available to them (I understand that you have enough work, and express my thanks for your answers and help even in off-duty time). HW2 stuff more than ten years and today it’s unlikely to contain any know-how, the publication of which can inflict harm to the company.

I know that there are different modder tools for creating custom backgrounds, but they create too heavy files (10, 20 and even 40 Mb). Frankly, I didn’t come across a tool that is able to convert, for example, Tanis background (2048x1024 32bit-texture) to ~200Kb hod-file with maintaining a similar clarity and accuracy (source is left, result is right):

A few years ago I also tried different vectorization tools – VectorMagic and another one (I can’t remember its name), that successfully convert bitmaps into svg-files (doesn’t say what would the appropriate format, but at least it’s possible to write a converter if the result was acceptable). But these tools poorly maintain sharp color transitions, and if I specify reasonable number of vertices, the result became too blurry.

Now, thanks to your tip, this problem seems can be solved! I downloaded the library you specified; also I found description of the algorithm, which shows results of its work. Most impressive is figures 7-9 – they clearly indicates that this is exactly what I was looking for. Also, this algorithm can be useful for automatic LOD generation. Thanks!

Sources for the HW2 BTG tool aren’t available, but for HW1 they are published in the source code package. It seems that I can represent all the bitmap dots as the vertices, unite them into triangles and give to input of this algorithm, get as result a optimized mesh and work with it. And there are modder tool, that can transform HW1-backgrounds to HW2 – but first of all I would like to get some kind of background’s vectorizer for first Homeworld.


(making space ships) #24

I’ll see what I can do. The person who would have final say on this is out of the country for a few days so it won’t be speedy.


#25

Does the background tool support cube maps as input? Is there a good cube map to sphere map converter?


(making space ships) #26

No, it does not and Genetica might convert cubes to sphere but that isn’t something I’ve ever had to do.


(Nathanius) #27

Hi all, necro-in this thread for the greater good :slight_smile:

I have run these examples through HODOR, with no other modifications, and it doesn’t spit out the main HOD! I only get the *_Light.HOD and a *.MAD with the planet example… If I use the _Light in a map on its own then I get crazy crazy results…

Am I missing something basic here? The HODOR script that @EvilleJedi posted above didn’t have anything different in it and the devs didn’t object to it at the time… has anyone had success with doing their own backgrounds?


(REARM V2) #28

I tried it when this was more or less fresh and I never got the the point where I would get a functioning bacground HOD.


(Nathanius) #29

Even the pre-packaged examples are crashing the game FFS >_<


(REARM V2) #30

HW@ got custom backgrounds. Ask @EatThePath

And report back, I want custom BGs too.


(Nathanius) #31

I’m actually looking at his Asset Pack right now :smiley:

EDIT//
Damn, they’re all skyboxes… my salvaged sphere maps are useless -_-


(Siber) #32

If you’ve already got some sphere mapped textures laying around making them into backgrounds should be relatively easy. PM me or skype me sometime, as I think this has gone a bit off topic… I’ve already sent herby a PM about potentally doing some background work for STC, too.


(REARM V2) #33

Make a tutorial, that’d be really cool.


(Nathanius) #34

I’ll Skype you about it! Maybe not this weekend… I’d love some collaboration :smile:

@Pouk, when I understand what to do I’ll do a tutorial :stuck_out_tongue_winking_eye:


(Siber) #35

I could have sworn these posts were all in the REARM thread earlier. What I get for not having coffee before I post.

What kind of crazy?


(Siber) #36

Incidentally, I use this script to convert all my hods, backgrounds included.

= -$$ROOT=C:\Games\Steam\steamapps\common\Homeworld\HomeworldRM\HWATRepo = -$$IN_SCAN=$[ROOT]\hodor_staging = -echo=-- Scan Path: $[IN_SCAN]$[CR] = -setmask=*.dae = -dump = -log = -$CONVERT_IN=$[SCAN_ROOT]\$[SCAN_REL_PATH]\$[SCAN_FILE].$[SCAN_TYPE] = -$CONVERT_OUT=$[ROOT]\data\$[SCAN_REL_PATH]\$[SCAN_FILE].HOD = -$SCAN_PARAMS=-do=convert = -scan=$[IN_SCAN] = -action=null = -echo=Scan Complete!$[CR] = -wait


(REARM V2) #37

Yeah …I was wondering how are background hods in the background hod related thread considered an off-topic. Nevertheless REARM thread is a petri dish for all kinds of technical problems and it’s often interesting to watch what will they grow into. So no OT either way.


(Nathanius) #38

For HODOR, I have two folders that I dump stuff into (DAE and HOD) depending on what I need done. Then two *.bat files which do my bidding

= -$HWRM_BASE=D:\Game Files\Steam\steamapps\common\Homeworld
= -$$IN_SCAN=G:\Games\Homeworld 2\Modding Tools\HODOR\DAE
= -echo=-- Scan Path: $[IN_SCAN]$[CR]
= -setmask=*.dae
= -dump
= -log
= -$SHADER_MAP=$[HWRM_BASE]\GBXTools\HODOR\SHADERS_STC.MAP
= -$SHADE_OPT_LOADDAE=ForceMAP
= -$HOD_SAVE_OPTS=MergeGoblins ForceScars FilterScars=thruster,bay
= -$CONVERT_IN=G:\Games\Homeworld 2\Modding Tools\HODOR\DAE\$[SCAN_REL_PATH]\$[SCAN_FILE].$[SCAN_TYPE]
= -$CONVERT_OUT=G:\Games\Homeworld 2\Modding Tools\HODOR\HOD\$[SCAN_REL_PATH]\$[SCAN_FILE].HOD
= -$SCAN_PARAMS=-do=convert
= -scan=$[IN_SCAN]
= -action=null
= -echo=Scan Complete!$[CR]
= -wait

You may notice I have it pointed at SHADERS_STC.MAP, this is the default SHADERS.MAP with shipAnim added to the ship shader

Disco crazy!


(ajlsunrise) #39

That looks like an error in the background shader…


(Eville Jedi) #40

I just wish we could get stars, I think I was able to get the examples to work, but not the star maps