Results 1 to 13 of 13

Thread: Creating better grass

  1. #1

    Default Creating better grass

    Just a little tutorial on creating better grass in RTW. This probably applies to M2TW as well but I've never modded that.

    One of the ways that RTW was limited was the ability to have only one grass type per climate which tends to create less interesting battlefields. On closer inspection of descr_grass.txt, however, you can see that the capability for adding more than one grass type per climate was there all along but for some reason wasn't made use of.

    After a bit of experimenting I found that by changing the coding in the descr_grass file you can make different ground types on the battlemap use different strips of your grass texture file. The all important part of the code here is in red, which specifies the vertical position of the top and bottom of the strip (the top of the texture file is 0 and the bottom is 1) that is used by the ground type (in green). You need to make sure you leave a small gap between strips otherwise you get the bottom of one strip visible in the top of another one.

    Other settings that you can play around with are height and width, but these ones are fairly good starting points.

    Code:
    climate temperate_forest_open
    {
     texture     data/textures/forest_open.tga
     spacing     0.5 
     present_in_winter  false
     ground_type grass_short
     {
      avg_height   1.0   
      width    2.0    
      density    40
    tex_v1    0.0   
    tex_v2    0.18   
      falloff    0.4
      colour    0,0,0
      correction   0.1
     }
     
     ground_type  mud
     {
      avg_height   1.0   
      width    2.0    
      density    50
    tex_v1    0.2   
    tex_v2    0.38   
      falloff    0.4
      colour    0,0,0
      correction   0.1
     }
     
     ground_type grass_long
     {
      avg_height   1.2   
      width    2.0    
      density    60
    tex_v1    0.4   
    tex_v2    0.58   
      falloff    0.4
      colour    0,0,0
      correction   0.1
     }
     
     ground_type scrub_dense
     {
      avg_height   1.2   
      width    2.0    
      density    40
    tex_v1    0.6   
    tex_v2    0.78   
      falloff    0.4
      colour    0,0,0
      correction   0.1
     }
     
     ground_type forest_dense
     {
      avg_height   0.7   
      width    2.0    
      density    50
    tex_v1    0.8   
    tex_v2    0.98   
      falloff    0.4
      colour    0,0,0
      correction   0.1
     }
    }





    As you can see, I've specified bluebells as the type of grass that appears in the forest_dense ground type (the strip between vertical position 0.8 and 0.98), so in the open forest climate in RS2, which I've created as a beech/birch forest, bluebells appear under the trees.

    In this shot you can see a variety of different grass types - short grass and long grass in the middle with some forest type off to the right as you go in under the trees (just out of the picture).



    Here you see the grass used for the scrub ground type:




    In addition, here are another few pointers to getting better grass.

    1) Keep the bottom part of your strip reasonably thinned out to avoid getting lines where grass meets ground.

    2) I tend to rub out part of the bottom of each strip as well to reduce this effect further and to encourage blending of the grass with the environment

    3) Grass looks better if the top is lighter than the bottom

    4) It's good to have some variation in light/shade and colour between the different blades of grass - it just looks so much better.

    5) Colours often have to be exaggerated in order to get a decent level of saturation on the battlemap as grass colour is affected by the "distant" colour of the ground type that is coded in the descr_geography.db file.

    6) There are various sources of grass texture that I've used here - but largely through google images...one or two grass elements were created using freely available photoshop brushes within GIMP.
    Last edited by tone; August 03, 2010 at 04:57 AM.


    Under patronage of Spirit of Rob; Patron of Century X, Pacco, Cherryfunk, Leif Erikson.

  2. #2

    Default Re: Creating better grass

    Thanks for this (the pics are absolutely hideous)!

    Not sure if this belongs to the mapping section btw, it's not really mapping (and it's not texturing either)...

  3. #3

    Default Re: Creating better grass

    I'll try and do a vegetation tutorial soon


    Under patronage of Spirit of Rob; Patron of Century X, Pacco, Cherryfunk, Leif Erikson.

  4. #4
    DAVIDE's Avatar QVID MELIVS ROMA?
    Join Date
    Nov 2005
    Location
    ITALIA
    Posts
    15,811

    Default Re: Creating better grass

    for med2, things are different because grass is created differently by programmers. Btw cool tutorial

  5. #5
    Éorl's Avatar Domesticus
    Join Date
    Jun 2009
    Location
    Germany
    Posts
    2,295

    Default Re: Creating better grass

    5) Colours often have to be exaggerated in order to get a decent level of saturation on the battlemap as grass colour is affected by the "distant" colour of the ground type that is coded in the descr_geography.db file.
    Yeah, that part is really annoying (white flowers are basically impossible because of that, or look a bit garish with the BGR color code of the respective descr_geography.db bleeding in).

    I thought it was known by now that grass variations could be used in RTW.
    I read this so called Bible, and found it to be a third rate story in which this so called 'jesus' is nothing more than a shameless lampooning of Brian, which has inspired joy and laughter in millions.
    -unknown YouTube user

  6. #6

    Default Re: Creating better grass

    Tone, Ive been messing around with this for a little while and can't seem to change anything. Any chance you could post your descr_grass file? or at the very least shoot me a few lines from it so I can ballpark it

    thanks

  7. #7
    Kylan271's Avatar Domesticus
    Join Date
    Jul 2007
    Location
    Vietnam
    Posts
    2,235

    Default Re: Creating better grass

    Very appreciate it,not that I am able to work on it yet. After Prometheus work in comparison to RTW vanilla,now what I see in RS 2,wow....,very artistic Tone! Excellent work,rep4U.


  8. #8

    Default Re: Creating better grass

    Quote Originally Posted by AceFighter21 View Post
    Tone, Ive been messing around with this for a little while and can't seem to change anything. Any chance you could post your descr_grass file? or at the very least shoot me a few lines from it so I can ballpark it

    thanks
    Here's the descr_grass.txt from RS2. Don't forget that you need to create new grass texture files with different textures on and reference them correctly in the descr_grass.txt file.


    Under patronage of Spirit of Rob; Patron of Century X, Pacco, Cherryfunk, Leif Erikson.

  9. #9

    Default Re: Creating better grass

    Do you know why there are climates where grass appear in the shore of rivers, or even inside the water? while it does not happen at other climates. I have not found any related text in descr_grass.txt, nor in descr_water.txt.

    In RS2 I think the grass appear at swamp rivers, while in our mod it happens at infertile climate, where the texture of river shores are rocks :/. Any idea how to avoid it?

    I have noticed the grass growing in rivers is the one definied as "ground_type grass_short". I suspect it is related to descr_geography.db more than grass files, but I think this is a good place to ask.


    Btw, my 2 cents about descr_grass.txt to contribute a bit with the tutorial:

    1) grass growing at height over 2000 meters are affected by the winter terrain colour (defined at descr_geography.db) instead of the summer colour.
    It seems hardcoded, same than there is no vegetation over 2000 meters.

    2) there are 2 parameters to change the density of the grass:
    - spacing: it affects to all ground types, and defines the distance between grass sections. The lower the number, the more density.
    - density: can be different for each ground type, and it defines the density of each grass section. Again, the lower the number, the more density.
    Last edited by Bardo; January 22, 2011 at 07:34 AM.

  10. #10
    Echbart's Avatar Decanus
    Join Date
    Apr 2006
    Location
    Slovenija
    Posts
    588

    Default Re: Creating better grass

    +My question it is - can these be done with vanilla textures ( visible changes ) or do i need new textures?

  11. #11
    Muizer's Avatar member 3519
    Patrician Artifex

    Join Date
    Apr 2005
    Location
    Netherlands
    Posts
    11,110

    Default Re: Creating better grass

    I find that for some reason (or rather, no apparent reason) the "ground type" that governs what kind of grass you get does not always match the "ground type" that governs the ground texturing. For instance, you might dictate grass type A for mud and type B for forest in descr_grass, but that won't prevent grass type B from appearing where descr_geography makes mud textures appear. Any thoughts on this? (and no it's not a matter of wrong grass texture references, rather a matter of mismatched boundaries causing an "overlap" where the grass type does not match the ground texture).
    Last edited by Muizer; December 30, 2011 at 04:04 PM.
    "Lay these words to heart, Lucilius, that you may scorn the pleasure which comes from the applause of the majority. Many men praise you; but have you any reason for being pleased with yourself, if you are a person whom the many can understand?" - Lucius Annaeus Seneca -

  12. #12
    Éorl's Avatar Domesticus
    Join Date
    Jun 2009
    Location
    Germany
    Posts
    2,295

    Default Re: Creating better grass

    Yes, thoughts, but no solution. My guess is that the placing of grass corresponds to the offmap translation of groundtype distribution, i.e. does not tie in with the small scale detail in groundtype distribution on the actual battlemap. It'd make sense, since the grass coloring is also gained from the offmap translation (the offmap colors as defined in the descr_geography.db).

    Frankly, even though you can make good grass textures and even different ones for different groundtypes per climate, I don't like the way grass is implemented in RTW/BI:

    - The coloring is affected by the offmap colors defined in the descr_geography.db, which makes it hard to get bright colors for flowers for example. You can do things to make flowers work, but not globally, and not satisfyingly. For any screenshot with flowers in grass textures that looks good, I can provide you ten from the same battlemap where it looks mediocre or crappy.

    - The brightness of the grass is affected by daytype, but not by the shading if the ground. The grass on the shadow side of a hill is as bright as the grass exposed to the sun.

    - The falloff looks really bad, no matter what you do, especially when you move the camera. The brightness of the grass in areas that are in shadow further aggravates this.

    - The grass 'behaves' strangely on steep slopes (they don't even have to be that steep), aligning into thick parallel lines of grass textures that look very unnatural.

    All these points bug me to an extend that I rather create nice detailed ground textures for the battlemaps and always turn off grass altogether (which also improves performance, btw), only turning it on when making nice full detail screenshots where I can choose the best angles and frames.
    I read this so called Bible, and found it to be a third rate story in which this so called 'jesus' is nothing more than a shameless lampooning of Brian, which has inspired joy and laughter in millions.
    -unknown YouTube user

  13. #13
    Muizer's Avatar member 3519
    Patrician Artifex

    Join Date
    Apr 2005
    Location
    Netherlands
    Posts
    11,110

    Default Re: Creating better grass

    It's true that the on map distrubution of groundtypes can be different from the off map one. I've only noticed it when using extreme settings in descr_geography though.
    "Lay these words to heart, Lucilius, that you may scorn the pleasure which comes from the applause of the majority. Many men praise you; but have you any reason for being pleased with yourself, if you are a person whom the many can understand?" - Lucius Annaeus Seneca -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •