Jump to content

EasyGen problems (missplaced triangles and bad texture scaling in-game)


Go to solution Solved by kwenga,

Recommended Posts

Oh, here we go. My first post. Good morning, jkhub!

 

I'm trying to create my own terrain map using easygen, and because my modding skills are 1/10, I'm struggling. I'm struggling hard. And I need your help.

To be absolutely clear - I saw similar problems discussed here before, but provided solutions were not so clear (probably because my skill level).

First problem: missplaced triangles in-game. Terrain looks fine, but there are few triangles which are obviously out of place. Perfect example was pictured in this topic: http://jkhub.org/topic/4229-mapping-bug-with-a-terrain-ingame/
I saw some sort of explanation provided by experienced mappers (http://jkhub.org/topic/4171-first-terrain-some-issues/?p=61755), but I still cannot understand what should I do. "Changing subdivisions". Where? How? WHY?

My easygen window, to make it easier.

eJleMVJ.png

 

But there is more to it. Another problem, this time it is more frustrating. Texture scalling.

In easygen, my textures are larger than in compiled map. Identical problem was posted and discussed in this topic: http://jkhub.org/topic/5663-terrain-texture-size/

I did everything, from using different templates (ended up at 'rgoer') and even fixing minor bugs (moving missplaced shader to right directory, fixing order of terraing shaders in .shader file) and I'm nearly out of ideas.

I think it can be fixed by using larger textures (just stretching them in paint or something), but it really isn't a solution.

 

Help me, jkhub. You're my only hope.

 

 

Link to comment
Guest KENNITHH

Heya kwenga, I think you should try Divisions 64 and Div. Width 256 instead of 288, if I remember correctly, it has to be like

16-32-64-128-256-512-1024-2048-4096-..

or it could be your height, its uneven as I think it should be a nice even number that can easily be divided..

 

about the texture problem, I bet the shader messes it up somehow.

 

(lots of guesses though , been a while since I used it)

Link to comment

Tested. Changed divisions to 64, div.widt. to 256, height to 4096 (it was a power of 2 in all cases, just to be sure) and my map is still broken. I don't know what to do next.

 

About shader... here it is. Check it out, maybe you'll find something.

 

 

 

textures/newres/terrain_base
{
    nopicmips
    q3map_lightmapaxis z
    q3map_lightmapmergable
    q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
}

textures/newres/terrain_0
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/dugdirt.jpg
    {
        map textures/yavin/dugdirt.jpg
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_1
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/s_mud2.jpg
    {
        map textures/yavin/s_mud2.jpg
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_2
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/rock3.jpg
    {
        map textures/yavin/rock3.jpg
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_3
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/temple_stone2.jpg
    {
        map textures/yavin/temple_stone2.jpg
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_4
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/mudside_b.jpg
    {
        map textures/yavin/mudside_b.jpg
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_5
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/rockmossy.jpg
    {
        map textures/yavin/rockmossy.jpg
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_6
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/marbly.jpg
    {
        map textures/yavin/marbly.jpg
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_0to1
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/dugdirt.jpg
    {
        map textures/yavin/dugdirt.jpg
    }
    {
        map textures/yavin/s_mud2.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_0to2
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/dugdirt.jpg
    {
        map textures/yavin/dugdirt.jpg
    }
    {
        map textures/yavin/rock3.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_0to3
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/dugdirt.jpg
    {
        map textures/yavin/dugdirt.jpg
    }
    {
        map textures/yavin/temple_stone2.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_0to4
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/dugdirt.jpg
    {
        map textures/yavin/dugdirt.jpg
    }
    {
        map textures/yavin/mudside_b.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_0to5
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/dugdirt.jpg
    {
        map textures/yavin/dugdirt.jpg
    }
    {
        map textures/yavin/rockmossy.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_0to6
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/dugdirt.jpg
    {
        map textures/yavin/dugdirt.jpg
    }
    {
        map textures/yavin/marbly.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_1to2
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/s_mud2.jpg
    {
        map textures/yavin/s_mud2.jpg
    }
    {
        map textures/yavin/rock3.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_1to3
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/s_mud2.jpg
    {
        map textures/yavin/s_mud2.jpg
    }
    {
        map textures/yavin/temple_stone2.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_1to4
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/s_mud2.jpg
    {
        map textures/yavin/s_mud2.jpg
    }
    {
        map textures/yavin/mudside_b.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_1to5
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/s_mud2.jpg
    {
        map textures/yavin/s_mud2.jpg
    }
    {
        map textures/yavin/rockmossy.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_1to6
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/s_mud2.jpg
    {
        map textures/yavin/s_mud2.jpg
    }
    {
        map textures/yavin/marbly.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_2to3
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/rock3.jpg
    {
        map textures/yavin/rock3.jpg
    }
    {
        map textures/yavin/temple_stone2.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_2to4
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/rock3.jpg
    {
        map textures/yavin/rock3.jpg
    }
    {
        map textures/yavin/mudside_b.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_2to5
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/rock3.jpg
    {
        map textures/yavin/rock3.jpg
    }
    {
        map textures/yavin/rockmossy.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_2to6
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/rock3.jpg
    {
        map textures/yavin/rock3.jpg
    }
    {
        map textures/yavin/marbly.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_3to4
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/temple_stone2.jpg
    {
        map textures/yavin/temple_stone2.jpg
    }
    {
        map textures/yavin/mudside_b.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_3to5
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/temple_stone2.jpg
    {
        map textures/yavin/temple_stone2.jpg
    }
    {
        map textures/yavin/rockmossy.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_3to6
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/temple_stone2.jpg
    {
        map textures/yavin/temple_stone2.jpg
    }
    {
        map textures/yavin/marbly.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_4to5
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/mudside_b.jpg
    {
        map textures/yavin/mudside_b.jpg
    }
    {
        map textures/yavin/rockmossy.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_4to6
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/mudside_b.jpg
    {
        map textures/yavin/mudside_b.jpg
    }
    {
        map textures/yavin/marbly.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

textures/newres/terrain_5to6
{
    q3map_baseshader textures/newres/terrain_base
    qer_editorimage textures/yavin/rockmossy.jpg
    {
        map textures/yavin/rockmossy.jpg
    }
    {
        map textures/yavin/marbly.jpg
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        alphaGen vertex
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

 

 

Link to comment
Guest KENNITHH

I think I remember, can  you tell me the size of your bmp?

 

& have you tried fiddling with q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 ) like increase / decrease it?

 

btw could you add spoilers around your quote?

 

you do it by adding [ spoiler ] in front of it and  [ / spoiler ] behind it (without spaces)

Link to comment

Okay, I did what you said. Changing values of tcGen ivector did nothing. By definition, ivector "Projects a texture Ns units by Nt units along a chosen axis. q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis", so theoretically it should fix everything. It does not. Higher values, lower values, random values - no effect at all. I'm affraid that I'm missing something very obvious, like forgetting to put shader in pk3 (it took me 3 days when making my first map, to realise why skybox is missing ^^), but I did it so many times it became a routine.

 

About bmp... I don't have one. I was just playing with easygen without a template or any plans, so all terrain was manually shaped. However, I can export it, easygen has that option.

From first map: 73x73 pixels, 6,47 KB bitmap

From second map (with fixed divisions): 65x65, 5,36 KB bitmap

 

Edit:

I think it might be overall size of this map, because now I'm looking back at my oldest experiments with easygen, partially implemented to some of my testmaps, and I can't find any missing triangles. Textures are also bigger, but that is because I was afraid of shaders and it was textured triangle by triangle in radiant. ;)

Link to comment
  • Solution

Small, but crucial update - I think I've found solution for glitched triangles. It is not as good as it could be, but in my case it was the only way. It is very easy to fix in easygen (no more searching for glitches in radiant!).

 

First of all - all glitched triangles were FLAT. As I looked through my maps and experiments, it became obvious that all flat surfaces generated by easygen suffered from errors. If you want to leave some plain terrain for buildings etc., you should do it afterwards in radiant by merging triangles in that perticular area, or by adding extra brush covering/substracting glitched space.

If you have a map which suffered from errors, and you still have it saved in your easygen (.egn files) directory, you can easily locate and change all flat surfaces by clicking hp9IuuJ.png button, which will highlight plain triangles. Then, you should use optional modifier - smooth, hill, whatever you want, just something which will tilt those triangles and remove red markings. Give it minimal value, so overall look of terrain won't change that much.

 

I'm still working on that texture problem, so any help would be appreciated.

 

Edit: Textures fixed. Don't ask how, it's too embarrasing for me. And I was right, it was something VERY obvious.

Solved!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...