Background Star Fields

So I’d like to know the proper way to include various stars points to a map using HODOR. Thus far I only used the background stuff but I have no idea about starfields. How basically does that should be sorted out.

How to do this with Hodor
http://image.noelshack.com/fichiers/2015/34/1439975908-starfield.jpg

1 Like

Actually, we created a new process for this when finishing HWRM - that involved painting stars in Photoshop over the background. The painted stars are then processed and converted into 3d points. I am not sure this is ready for public use - but I’ll confirm that.

hoded actually had/has a sort of similar feature, where you can import a tga and it’ll make stars based on the pixel data. I never really managed to make good use of it.

Thanks for your reply, I’ll be waiting.

Did somebody say stars?! No really, did they? Maybe I am just hearing things?!

So let’s talk about that… and how you can use HODOR to create them :slight_smile: For now, I’m just going to explain the script/inputs - some of the ‘tools’ we created for this process are really just tricks in Photoshop; stuff that makes it a bit easier.

The ‘cosmic’ action in HODOR can either take a background and generate images that describe where the stars are, or turn those same images back into a background.

Which operation HODOR performs depends on whether or not you tell it the source (images->background) or destination (background->images) paths. And you can indeed give it both to ‘check your work’ if need be.

What do you need to do this?

HODOR (duh.)
A STARS.DEF file (comes with HODOR - but you CAN edit it for your Mod)
A Background (_light) HOD (the visual sky sphere, with proper UVs, a single mapped image)
A Star HOD (I think the code requires a valid one to start, and another (or the same) if you want to generate…)

Here’s an example script…

= -$COSMIC_MESH=TestBack_light.hod
= -$COSMIC_SRCSTAR=TestBack.hod
= -$COSMIC_DSTSTAR=TestBack_Out.hod
= -$$COSMIC_DEFS=SteamWorkshop\HODOR\STARS.DEF

= -$$COSMIC_OPTS=Mat=background Width=4096 Height=2048
#= -$$COSMIC_OPTS=Mesh=PRE_Space
#= -$$COSMIC_OPTS=Merge

= -$COSMIC_DSTRGB=TestBack_DEST_Stars_RGB.TGA
= -$COSMIC_DSTTEX=TestBack_DEST_Stars_Tex.TGA

#= -$COSMIC_SRCRGB=TestBack_SRC_Stars_RGB.TGA
#= -$COSMIC_SRCTEX=TestBack_SRC_Stars_Tex.TGA

= -do=cosmic
= -action=null

This script will take TestBack_light.hod’s sky mesh (anything with the background shader), and using those UVs it will dump the stars in TestBack.hod to images TestBack_DEST_Stars_RGB/Tex - Those have values for which stars, where, how much alpha, the size and distance, etc.

If you were to enable the COSMIC_SRCRGB/TEX properties it would pull those images in and use them to generate TestBack_Out.hod.

I’ll go into more detail later - but part of me thinks that collectively the Mod community is sharp and resourceful enough to not need any additional info. I’ll see how you all do :wink:

7 Likes

Ooh! Thank you for this one :smiley:

I’ve just been reusing GBX created ones for the time being, seems to work as well :slight_smile:

Did anyone give this a shot yet?

Not yet - related question - is masking out stars best done via creating a new star map per above, or some other method?

Edit: de-conversion worked! I’m looking at dest_stars_tex and dest_stars_rgb files. :slight_smile:

Next up, galactic domination! :wink:

2 Likes

I need to try this soon. I was asking for for more info on starfields as this is the last major piece of map making I’m still missing.

Has anyone encountered this error?

Error - COSMIC_MESH isn’t a mesh HOD

I tried using M01 as an example and dumping the TGA files (which worked) and then making some modifications and re importing them and I received that error

I used the example script above and made the modifications to the files and the commented sections

= -$COSMIC_MESH=m01_light.hod
= -$COSMIC_SRCSTAR=m01.hod
= -$COSMIC_DSTSTAR=m01_Out.hod
= -$$COSMIC_DEFS=STARS.DEF

= -$$COSMIC_OPTS=Mat=background Width=4096 Height=2048
#= -$$COSMIC_OPTS=Mesh=PRE_Space
#= -$$COSMIC_OPTS=Merge

#= -$COSMIC_DSTRGB=TestBack_DEST_Stars_RGB.TGA
#= -$COSMIC_DSTTEX=TestBack_DEST_Stars_Tex.TGA

= -$COSMIC_SRCRGB=TestBack_SRC_Stars_RGB.TGA
= -$COSMIC_SRCTEX=TestBack_SRC_Stars_Tex.TGA

= -do=cosmic
= -action=null

I am also able to dump the TGA files from an existing starfield HOD, but struggling to generate a new starfield HOD.

I am using:

= -$HWRM_BASE=C:\Program Files (x86)\Steam\steamapps
= -$COSMIC_MESH=[path]dom_light.hod
= -$COSMIC_DSTSTAR=[path]dom_stars_out.HOD
= -$$COSMIC_DEFS=$[HWRM_BASE]\common\Homeworld\GBXTools\HODOR\STARS.DEF
= -$$COSMIC_OPTS=Mat=background Width=4096 Height=2048
#= -$$COSMIC_OPTS=Mesh=PRE_Space
#= -$$COSMIC_OPTS=Merge
= -$COSMIC_SRCRGB=[path]dom_stars_RGB.TGA
= -$COSMIC_SRCTEX=[path]dom_stars_Tex.TGA
= -do=cosmic
= -action=null

I get the error

Error - COSMIC_STAR isn't a background HOD

I tried making -$COSMIC_DSTSTAR:

  • Non-existent
  • An existing starfield HOD (to be overwritten)
  • An existing background HOD (out of desparation…)

EDIT: got it! It needs a valid starfield HOD as -$COSMIC_SRCSTAR even when creating a new HOD. Not sure what it does with that HOD though, or if it is even used…

2 Likes

Does anyone understand how the RGB and TEX files actually define the star types, brightness, etc.?

This:

RGB
RGB

TEX
TEX

Produces this:
result

But I cannot see any obvious link (except that whiter pixels in the RGB are bigger/brighter), but I imagine the R/G/B values of the pixels in both images defines the star somehow…

2 Likes

I don’t believe anything other than the greyscale value of the pixel is taken into consideration. From stars.def:

##=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=##
#### Example Star Definition File
##=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=##

16:  Neb07.TGA
32:  Neb01.TGA
48:  Neb02.TGA
64:  Neb04.TGA
88:  Neb05.TGA
100: Neb06.TGA
188: Neb07.TGA

128: B01.tga
144: B02.tga
160: B03.tga

If you want to change the look of the stars, you should be able to swap out the .tga’s in data > background > stars, or point it to new ones in the stars.def file.

Forgot, stars.def is in the HODOR directory.

2 Likes