Updated ET EasyGen tutorial


(Jizaboz) #1

I am dioing some tests of a new map I’m working on, starting with making a simple terrain area. Following the EasyGen tutorial at Surface worked fine for my older RTCW map, but with ET I’m having 2 major problems.

  1. After creating the terrain in EasyGen, and then compiling, loading up the terrain in ET produces the “checkerboard” effect. No textures from the seemingly correct shader file are visable. The name of the terrain shader for the new map has been added to the shaderlist.txt and all textures are in the correct location.

  2. Kind of unrelated… why when I try to hit L for limbo in a test run of a map does ET crash? What spawn points, etc are nessasary to prevent this?

If anyone knows of a EasyGen tutorial specific to ET, or knows the reason for my problems, please respond to this post. If such a tutorial already exists on the forums, please private message me with a link and delete this thread.

TIA


(G0-Gerbil) #2

For 2nd point, you need to specifiy mapcoordsmins and maxs in worldspawn - a quick search of the forums will pull this up.
For 1st poinbt, be aware you may well have to edit the easygen output shaders - last time I checked it dumped a whol;e load of unoptimised crap in there, and the end result was nasty and slow :frowning:


(Jizaboz) #3

I had read something about the max and min coordinates, but skipped that step in my last test. Thanks for the reminder, looks like that has to be done.

I checked out the scripts and even and one test tried manually editing them, but I got the same results. Here is the shader script last produced by EasyGen. I already checked to make sure the paths are correct.

textures/mars/terrain_0
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/mars/jiz_dirt1.tga
rgbGen vertex
tcmod scale 0.195 0.282
}
}

textures/mars/terrain_1
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/mars/marsdirt_2.tga
rgbGen vertex
tcmod scale 0.195 0.282
}
}

textures/mars/terrain_2
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/mars/marsdirt.tga
rgbGen vertex
tcmod scale 0.195 0.282
}
}

textures/mars/terrain_0to1
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/mars/jiz_dirt1.tga
rgbGen vertex
alphaGen vertex
tcmod scale 0.195 0.282
}
{
map textures/mars/marsdirt_2.tga
rgbGen vertex
alphaGen vertex
tcmod scale 0.195 0.282
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
}

textures/mars/terrain_0to2
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/mars/jiz_dirt1.tga
rgbGen vertex
alphaGen vertex
tcmod scale 0.195 0.282
}
{
map textures/mars/marsdirt.tga
rgbGen vertex
alphaGen vertex
tcmod scale 0.195 0.282
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
}

textures/mars/terrain_1to2
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/mars/marsdirt_2.tga
rgbGen vertex
alphaGen vertex
tcmod scale 0.195 0.282
}
{
map textures/mars/marsdirt.tga
rgbGen vertex
alphaGen vertex
tcmod scale 0.195 0.282
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
}

textures/mars/terrain.vertex
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/mars/jiz_dirt1.tga
rgbGen vertex
tcmod scale 0.195 0.282
}
}


(G0-Gerbil) #4

Yup good old messy easygen. As a comparison, here’s the terrain shader from helmsdeep. Note it’s not quite ‘standard’ because I’m doing texture scaling to minimize texture repeating on stretched / distant terrain. Of important though generally is the base shader, and using q3map_tcgen instead of tcmod, which is much faster.

To neaten up the shader to a more normal one, you’d:

  1. Remove all the q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 ) lines from the individual shaders and put it in the base shader.
  2. Remove the q3map_globaltexture from base shader
  3. Remove any tcMod scale lines from the shaders
  4. Remove the commented out lines of course :wink:

//////////////////////////////////////////////////////////////////////////
// Normal lightmapped terrain
//////////////////////////////////////////////////////////////////////////

textures/mml_helmsdeep_terrain/terrain_base
{
	q3map_lightmapMergable
	q3map_lightmapaxis z
	q3map_lightmapsize 512 512
	q3map_globalTexture 

//	q3map_normalimage textures/sd_bumpmaps/normalmap_terrain.tga

	surfaceparm landmine
}

// Standard ground rock
textures/mml_helmsdeep_terrain/terrain_0
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

// Scaled up rocks (twice normal size)
textures/mml_helmsdeep_terrain/terrain_1
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 1024 0 0 ) ( 0 1024 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

// Scaled up rocks (four times normal size)
textures/mml_helmsdeep_terrain/terrain_2
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 2048 0 0 ) ( 0 2048 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

// Scaled up rocks (eight times normal size)
textures/mml_helmsdeep_terrain/terrain_3
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 4096 0 0 ) ( 0 4096 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

// Scaled up rocks (twice normal size) - offset
textures/mml_helmsdeep_terrain/terrain_4
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 1024 0 0 ) ( 0 1024 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

// Scaled up rocks (four times normal size) - offset
textures/mml_helmsdeep_terrain/terrain_5
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 2048 0 0 ) ( 0 2048 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

// Muddy water texture
textures/mml_helmsdeep_terrain/terrain_6
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	{
		map textures/mml_helmsdeep_terrain/riverbed.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

// Normal alternative terrain shader
textures/mml_helmsdeep_terrain/terrain_7
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

textures/mml_helmsdeep_terrain/terrain_0to1
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain.tga
	}
	{
		tcMod scale 0.5 0.5
//		tcMod transform 1.0 0.0 0.0 1.0 0.5 0.0
		map textures/mml_helmsdeep_terrain/terrain2.tga
		alphaGen vertex
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

textures/mml_helmsdeep_terrain/terrain_0to4
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain.tga
	}
	{
		tcMod scale 0.5 0.5
//		tcMod transform 1.0 0.0 0.0 1.0 0.5 0.5
		map textures/mml_helmsdeep_terrain/terrain2.tga
		alphaGen vertex
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

textures/mml_helmsdeep_terrain/terrain_0to6
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain.tga
	}
	{
		map textures/mml_helmsdeep_terrain/riverbed.tga
		alphaGen vertex
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

textures/mml_helmsdeep_terrain/terrain_0to7
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain.tga
	}
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
		alphaGen vertex
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

textures/mml_helmsdeep_terrain/terrain_1to2
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 1024 0 0 ) ( 0 1024 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
	}
	{
		tcMod scale 0.5 0.5
		map textures/mml_helmsdeep_terrain/terrain2.tga
		alphaGen vertex
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

textures/mml_helmsdeep_terrain/terrain_2to3
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 2048 0 0 ) ( 0 2048 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
	}
	{
		tcMod scale 0.5 0.5
//		tcMod transform 1.0 0.0 0.0 1.0 0.0 0.5
		map textures/mml_helmsdeep_terrain/terrain2.tga
		alphaGen vertex
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

textures/mml_helmsdeep_terrain/terrain_3to5
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 4096 0 0 ) ( 0 4096 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
	}
	{
		tcMod scale 2.0 2.0
		map textures/mml_helmsdeep_terrain/terrain2.tga
		alphaGen vertex
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

textures/mml_helmsdeep_terrain/terrain_4to5
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_base
	q3map_tcGen ivector ( 1024 0 0 ) ( 0 1024 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
	}
	{
		tcMod scale 0.5 0.5
//		tcMod transform 1.0 0.0 0.0 1.0 0.0 0.5
		map textures/mml_helmsdeep_terrain/terrain2.tga
		alphaGen vertex
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		tcGen lightmap
	}
}

textures/mml_helmsdeep_terrain/terrain.vertex
{
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	{
		map textures/mml_helmsdeep_terrain/terrain2.tga
		rgbGen vertex
	}
}

//////////////////////////////////////////////////////////////////////////
// Faded out vertex lit terrain
// Original shaders by Ratty Redemption @ jolt mapping forums
//////////////////////////////////////////////////////////////////////////

textures/mml_helmsdeep_terrain/terrain_fade_base
{
//	q3map_normalimage textures/sd_bumpmaps/normalmap_terrain.tga

	q3map_tcgen ivector ( 900 0 0 ) ( 0 900 0 )
	q3map_tcmod rotate 37

	surfaceparm landmine

	// So it's drawn on top of the normal terrain
	polygonoffset
}

// Where actually blends from fully opaque to full transparent
textures/mml_helmsdeep_terrain/terrain_fade_0to1
{
	q3map_baseshader textures/mml_helmsdeep_terrain/terrain_fade_base
	surfaceparm grasssteps
	{
		map textures/mml_helmsdeep_terrain/terrain.tga
		alphagen vertex
		rgbgen vertex
		blendfunc blend
	}
}

Ignore the second set of terrain textures, they are for a specific effect and aren’t following normal q3map2 terrain rules.


(Jizaboz) #5

Thanks for your example script. I’ll manually edit the shader I got now, and forget about trying to get EasyGen to generate a script that even remotely works. I’m just going to take my time with this over the weekend, as I have a few other things going on. Still, if anyone reading this knows of a straight-forward tutorial on generating terrain exlclusively for Enemy Territory, please share with the crowd.


(MadMaximus) #6

actually… i love easygen for making terrain for et. best program i have seen for doing it as long as you know how to make it work.


(Jizaboz) #7

Yes sir, my thoughts exactly. But that’s what I’m getting it… we need a tutorial on how to make it work properly for ET as opposed to RTCW. I noticed the thread on EasyGen And Radiant, and I didn’t have this plugin mentioned. Let’s see what happens taking this and Gerbils advice with my next attempt…


(G0-Gerbil) #8

I think you can use easygen like you did for RTCW, but for optimal results you simply have to hand-code the shaders once easygen has done it’s thing.
Complete pain, but once you’ve done it once it’s a doddle. Easygen has it’s uses, but IMO they are pretty much limited to allocating textures - since the rest you can do easily enough in radiant, and you’ll probably end up hand-editting it there anyway.
Just remember - if you don’t need it, don’t use ‘thin terrain’, it’s got a memory / speed overhead.


(Jizaboz) #9

I’ve been trying to get this to work, but now I’m getting the same ol’ orange and black grid. This time the grid is scaled larger so I know the shader is activating, but something still isn’t right. Here’s the shader I’m trying now. Note that I’m trying different scaling as an experment because I need to change the scaling in my final product.

textures/mars/terrain_base
{
q3map_lightmapMergable
q3map_lightmapaxis z
q3map_lightmapsize 512 512
q3map_globalTexture

// q3map_normalimage textures/sd_bumpmaps/normalmap_terrain.tga

surfaceparm landmine
}

// Jizaboz basic dirt
textures/mars/terrain_0
{
q3map_baseshader textures/mars/terrain_base
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
{
map textures/mars/jiz_dirt1.tga
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

// Scaled up Mars dirt 2 (2 times normal)
textures/mars/terrain_1
{
q3map_baseshader textures/mars/terrain_base
q3map_tcGen ivector ( 1024 0 0 ) ( 0 1024 0 )
{
map textures/mars/marsdirt_2.tga
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

// Scaled up Mars Dirt (2 times normal size)
textures/mars/terrain_2
{
q3map_baseshader textures/mars/terrain_base
q3map_tcGen ivector ( 1024 0 0 ) ( 0 1024 0 )
{
map textures/mars/marsdirt.tga
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/mars/terrain_0to1
{
q3map_baseshader textures/mars/terrain_base
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
{
map textures/mars/jiz_dirt1.tga
}
{
tcMod scale 0.5 0.5
// tcMod transform 1.0 0.0 0.0 1.0 0.5 0.0
map textures/mars/marsdirt_2.tga
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/mars/terrain_0to2
{
q3map_baseshader textures/mars/terrain_base
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
{
map textures/mars/jiz_dirt1.tga
}
{
tcMod scale 0.5 0.5
// tcMod transform 1.0 0.0 0.0 1.0 0.5 0.0
map textures/mars/marsdirt.tga
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/mars/terrain_1to2
{
q3map_baseshader textures/mars/terrain_base
q3map_tcGen ivector ( 1024 0 0 ) ( 0 1024 0 )
{
map textures/mars/marsdirt_2.tga
}
{
tcMod scale 0.5 0.5
map textures/mars/marsdirt.tga
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/mars/terrain.vertex
{
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
{
map textures/mars/jiz_dirt1.tga
rgbGen vertex
}
}

I’ve noticed this script produced a build error I had not seen before, whereas I usually see “Cannot find image for shader terrain_, etc” For some reason there are now 0000’s and 0001s, etc added to the ends of the paths on the errors. I’ve got no idea what’s wrong, but I’ll keep tweaking and trying. In the meantime, perhaps someone will read this and find an error.


(G0-Gerbil) #10

It might possibly be I failed to mention some terrain entity key / value pairs. Not too sure on this so I’ll just list all the ones I have on my one:

classname func_group
lightmapscale 2.0
alphamap textures/mml_helmsdeep_terrain/terrain.pcx
shader mml_helmsdeep_terrain/terrain
layers 8
terrain 1

obviously the paths will need changing.

Hope that helps.


(Jizaboz) #11

A recent re-build gave me a new error saying “<mymapname>.bsp is version 46 and should be 47.” WTF?

My paths and even the typing case matches. I’m using the newest EasyGen shader template and putting the base part at the top. The alphamap is in ETmain. All textures have pixel sizes to the power of 2. The textures are 24 bit, .tga images.
I’ve got the version of q3map2build (with the q3map2 version that came with it) that was available Jan 1, 2004. I feel like I’m missing something here but every time I check and think I’ve found something, nothing happens. The terrain continues to load orange and black in the game.


(G0-Gerbil) #12

/Have you possibly got a PK3 or duplicate BSP somewhere that the program is finding instead of your new one?
I know that when I compile a working version of helms deep, if I’ve forgotten to take the old FP version’s PK3 out of etmain/ then it all goes pear-shaped.


(Jizaboz) #13

I never made a .pk3 file for the map, as all the terrain tests have failed anyway. I don’t see anything that could be confusing the program because the .BSP in the /maps actually has a date of 2 minutes before I got the error (the most recent build)… I guess maybe I’ll try building the map from scratch again after deleting everything.


(Jizaboz) #14

It was the wrong compiler version causing the map version number! I had 2.5.3 and should have had 2.5.12…

Thanks for everyones help so far, terrain is still black and orange but it least I can mess with it again now.


(Jizaboz) #15

Actually, I found it was just orange and black in the areas where I had added custom textures. Areas with SD images loaded just fine! (Whew)

Now all I have to do is figure out why my custom textures are going onto brushes fine in Radiant, but not displaying when added to the terrain shader. If anyone knows anything about this, please let me know. Below is my shader file for the custom textures themselves. I’ll be trying to figure it out in the meantime.

// mars_surface.shader
// Written by JIZABOZ

textures/mars/jiz_dirt1
{
q3map_nonplanar
q3map_shadeangle 100
surfaceparm landmine
surfaceparm gravelsteps
implicitMap -
}

textures/mars/marsdirt
{
q3map_nonplanar
q3map_shadeangle 100
surfaceparm landmine
surfaceparm gravelsteps
implicitMap -
}


(Jizaboz) #16

Finally, working terrain. Here’s ANOTHER thing I discovered… textures can’t be ANY size you want them in the power of 2. As soon as I re-sized my two custom textures to 512x512,
everything worked beautifully.

… so marks the end to my problems getting started with general ET mapping and terrain. Thanks to everybody that gave their input!

Some of these points in this thread really should be in an updated EasyGen tutorial specific to ET. If one doesn’t exist, perhaps I’ll write one.


(KillaDarkness) #17

sorry… lol long time away i didnt use custom its just a regular game texture