Jump to content

Terrain Creation using Easygen

Szico VII

Recommended Posts

Originally written by Rgoer

  • Title: Terrain Creation in EasyGen
  • Subject: How to create terrain using EasyGen
  • Written by: Rgoer
  • Tutorial written for: JK2/3
  • Similar concept work like in: Hand-Shaped Terain in Radiant.
  • Difficulty level: 4/10
  • Expected time to complete for first attempt: 30mins
  • Prerequisites:Basic proficiency in JK3 modding and radiant.

Download EasyGen (as of this writing, version 1.42 is the most recent)

This version INCLUDES the custom rgoer templates...but don't fire EasyGen up quite yet.

Before we get going, we need to create a heightmap. A heightmap is just a greyscale bitmap file, where each pixel defines the elevation of one brush vertex of EasyGen terrain.

This is an example of a heightmap:


When you paint your own heightmap, you need to keep in mind that your heightmap needs to be one pixel wider in every dimension than the number of terrain brushes you want to make up one "side" of your terrain "square." For example, I wanted a 48-by-48 terrain, so I painted that example heightmap to be 49-by-49 pixels. This is because each heightmap pixel corresponds to a single brush vertex, and the vertex count is always one more than the brush count (one single brush has two vertexes per side).

Anyway, heightmaps aren't that complicated: brighter pixels represent higher elevation, and darker pixels are lower. White is the highest, black the lowest. If you have access to landscape software like Bryce or Terragen, you can export some nice heightmaps from those programs...

The only important peculiarities about EasyGen heightmaps is that they must be greyscale (8/16/24 bit all work fine), and they must be in Windows Bitmap (*.bmp) format.

Now it''s time to fire up EasyGen...
When you first start EasyGen up, you''ll probably see something like this:

Now is a good time to familiarize yourself with EasyGen''s 3D view controls. For the most part, you can move the camera with the same controls you use in Radiant. You also can drag the camera on the x/y plane with the right mouse button, and orbit with the left. Once you feel comfortable with EasyGen''s camera, feel free to move on.

As with any new software, one of the first things you want to do is check out the preferences. This tutorial was written with Star Wars Jedi Knight: Jedi Academy in mind, but you can alter the JA specific stuff here to work with whatever game you please. Here is how you should set your preferences up to work with JA:

Hit "OK" to save your changes to the preferences; now it''s time to import our heightmap:

You'll be confronted with a "Bitmap Import Setup" window. Hit the "Browse..." button and find your heightmap, then set the height to something larger than the default 256 units... however tall you had in mind when you painted the heightmap, something in the 1024 to 2048 range generally works for most cases.

Now, once we've imported the heightmap, we should see something along these lines:

And now the important stuff...
All of the EasyGen magic happens in the "Alphamap" tab... so let''s head that way:

We need to load some textures in order for EasyGen to have something with which to work its wonders... if you're working with JA, and you want to use default JA textures, you''ll need to unpack some from assets1.pk3 (in base). After you've done that, choose "Add folder..." from the "Textures" menu:

In the little browser, navigate to whatever texture directory you want to work with; I chose the "desert" set that I unpacked from assets1.pk3. At this point, notice that EasyGen tells you exactly what to do, right on the screen:

Click the first black square, pick a color, then choose a texture from the textures well. Oooh, ahhh; hit the little brown and green button I have circled in that image, and you''ll see that the terrain is now covered in the texture you just picked.

Now you want to create a palette of more color/texture combinations. Pick as many textures as you think you'll want to blend together on your terrain. Set your brush size with the "Paint radius" slider, and go to town painting on your terrain by holding ctrl+shift and using the left mouse button.

Keep this in mind:
Quake III (and, by extension, any Q3-engine game) can only blend at most TWO textures on a single surface triangle. EasyGen knows this, and warns you if you start creating three-way (or more than three-way) blends by turning the offending triangles black. If you start noticing triangles going black, it means you are trying to blend too many textures on a single surface, and you need to go back and repaint your blends until you have, at most, two textures blending on any given surface.

And now we wrap things up...
Eventually, you''ll end up with something like this:

Once you're satisfied with how your terrain looks (and you''ve remedied any black-triangle blending errors), you're ready to hit the "Export Terrain Entity" button (circled in red). You''ll be greeted with the "Radiant .map and related stuff settings" window... you want to set it up following this example:

It is key that you installed the "rgoer" templates correctly, and that you added "rgoer" (without quotes) to the templatelist.txt file. Also, note that I used the name "tutorial" for all my map-specific names; you will want to use whatever the name of your map or project is in those instances.

The alphamap should be saved to the base directory; just click the little "..." button and give it a name. This creates a .pcx file that indexes which textures should be placed where by the compiler.

The shader should be saved to the scripts directory; EasyGen was designed to work with Quake III: Arena, and this is a throwback to that game. We'll move the shader file to the shaders directory in a minute.

Lastly, make sure that you put "system/terrain" in for the "top" and "system/caulk" in for the "sides" of your terrain brushes. This is a must (pretty much everything on this export settings screen needs to be set up just right, or your terrain blending won''t work).

Now you're ready to hit "Continue >>", give your terrain map a name, and let it rip.

Now we're really getting there. Move your .shader file from the scripts to the shaders directory, and open it up in your text editor; there is one small change that must be made by hand, due to a bug in EasyGen.

Down at the bottom of the shader defitions, the very last one should be a definition for a shader called "terrain_base." This is the shader called by all the q3map_baseshader lines in the rest of the shader file, so it should be first (not last). Select this shader, cut it from the end, and paste it back in at the top so that it is the very first shader defined in your .shader file. Save it and you''re done.

Finishing Up:
All you have to do now is add your shader file to shaderlist.txt and copy/paste your terrain entity from the .map EasyGen created into whatever .map you''re working on.

You don't want to use the .map created by EasyGen, because it puts a bunch of garbage into the worldspawn that makes the .map unusable.

The terrain entities (which are really just func_groups) are fine, though, and you can just select the terrain, copy it, and paste it into whatever .map you want to, or load the map as a prefab into a new map.

Link to comment
  • 5 years later...

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...