Jump to content
The Dark Mod Forums

Randomly and procedurally generated terrain...


Recommended Posts

I know that someone has already tried making a terrain generator, I just can't remember what the thread was called.

 

I was playing around with Quake3Arena and decided to fire up GTKRadiant. I made some terrain out of patches based on a 256 grey scaled image and it looked really good and took all of 5 minutes to do. Now I wondered what would happen if I selected those patches and copied them to the clipboard, then tried pasting them into DarkRadiant.

No good, didn't work nothing showed up, there were some token errors in the console window. So I saved the quake 3 map file and what it generated was very close to what doom 3's map format looks like. Is there a way to port GenSurf to work with Doom3's map format? I found the source code on ZeroWing's server and it's GPLed so no limitations there for us.

 

I know you guys are going to smack me around for even suggesting more additions to the feature list for DarkRadiant but it shouldn't be that difficult. (If I'm being an ass here about assuming just say so).

 

Here's the link to GTKGenSurf: Click Me Please

 

I'd love to have this functionality present in DarkRadiant. I wanted to put my castle up on a hill that you would have to climb, but doing this by hand is almost impossible to make it look as good as GenSurf could do. The problem that I've run into is that I don't understand enough about C++ code in games to modify it, and I can't get a hold of the original author (David Hyde) as all email addresses for him are from 2000-2001 era and don't exist anymore.

 

EDIT: Here are some editor pics of the terrain so far.

zyviewdd2.th.jpg3dviewrf0.th.jpgxyviewee2.th.jpg

 

If you want to do this yourself you can follow these steps:

 

Step 1: Open GenSurf and create whatever you want. Set the format to Quake 3 on the left side of the first Tab. Type in a name for your map (output file).

Step 2: Click on the button "Write Map". (I think it's called this) on the top right of the first tab in GenSurf (By default the map will be saved to the same directory as GenSurf)

Step 3: Open Q3toD3, and open the options windows. Here you will have to input the directory of Doom 3, I have Quake 3 installed so I also put that in. I'm not sure what will happen if you don't specify the Quake 3 dir.

Step 4: Click on the "Options" button and un-select all the options

Step 5: Click the "Add Files" button ( I think it's called this) and browse to the map that you created with GenSurf.

Step 6: Click the "Add File" button and it will be added to the main Q3toD3 window.

Step 7: Close the "Add Files" window and click the "Convert" button. It will show you the progress of the conversion in the window.

Step 8: Open DarkRadiant and go to File->Open... Browse to your Doom3 folder and go to base\maps and find the map that was just converted.

Step 9: Click "Open" and it will load in DarkRadiant. When it's done you will get an error about tokens, just ignore this. The terrain should be there.

 

Now you should be done, your Quake3Arena terrain is now playable in Doom3/DarkMod.

Good luck.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Sounds interesting. You can add that wish to the tracker if you like. GtkRadiant stuff is mostly incompatible with DarkRadiant, but if the code happens to be modular enough, it can be imported as a DarkRadiant plugin. Be aware that it won't have any priority on our roadmap, though.

 

The Q3 map format is not compatible with the D3 one. While it would be possible to write a converter, it's not worth the work, in my opinion.

Link to comment
Share on other sites

Sounds interesting. You can add that wish to the tracker if you like. GtkRadiant stuff is mostly incompatible with DarkRadiant, but if the code happens to be modular enough, it can be imported as a DarkRadiant plugin. Be aware that it won't have any priority on our roadmap, though.

 

The Q3 map format is not compatible with the D3 one. While it would be possible to write a converter, it's not worth the work, in my opinion.

 

Have you ever used GenSurf Greebo?

Check it out if you haven't yet: http://tarot.telefragged.com/gensurf/features/features.htm

 

BTW: How do I add to the wishlist tracker again?

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

I made some terrain out of patches based on a 256 grey scaled image and it looked really good and took all of 5 minutes to do.

 

Rather than waiting (hoping) for somebody to implement this functionality in DarkRadiant, you would be better off learning how to do it in Blender. It takes a similar amount of time and the flexibility you have for modifying your terrain in other ways is vastly superior to anything you could do in a level editor.

Link to comment
Share on other sites

Rather than waiting (hoping) for somebody to implement this functionality in DarkRadiant, you would be better off learning how to do it in Blender. It takes a similar amount of time and the flexibility you have for modifying your terrain in other ways is vastly superior to anything you could do in a level editor.

 

Yeah but gensurf creates patches in the editor which are then editable, you can modify the textures and control vertex points without changing a model.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

I assume the patch format is well known, right? Wouldn't it be possible to write an exporter for Blender that can export a model as a patch?

 

Harder than it sounds -- the patch format is defined mathematically based on control points, whereas a Blender-exported mesh would consist solely of vertices. You could use each mesh vertex as a control point, but the final result would not be the same.

Link to comment
Share on other sites

Yeahm, the result might not be exact, but maybe close enough? Maybe it would be possible to write a plugin for Blender that works like the patch editor and thus can save the right format? Don't know how good Blenders plugin interface is though, as I never worked with it.

Gerhard

Link to comment
Share on other sites

Yeahm, the result might not be exact, but maybe close enough? Maybe it would be possible to write a plugin for Blender that works like the patch editor and thus can save the right format? Don't know how good Blenders plugin interface is though, as I never worked with it.

 

I don't get it the plugin that already exists outputs this:

 

{   // map file for Quake3
"classname" "worldspawn"
// brush 0
{
patchDef2
 {
  organics/grass3
  ( 3 3 0 0 0 )
  (
   ( ( -2000 -2000 0 0 0 ) ( -2000 -1750 -34 0 1 ) ( -2000 -1500 -20 0 2 ) )
   ( ( -1750 -2000 24 1 0 ) ( -1750 -1750 245 1 1 ) ( -1750 -1500 110 1 2 ) )
   ( ( -1500 -2000 -32 2 0 ) ( -1500 -1750 128 2 1 ) ( -1500 -1500 216 2 2 ) )
  )
 }
}
// brush 1
{
patchDef2
 {
  organics/grass3
  ( 3 3 0 0 0 )
  (
   ( ( -2000 -1500 -20 0 0 ) ( -2000 -1250 72 0 1 ) ( -2000 -1000 -28 0 2 ) )
   ( ( -1750 -1500 110 1 0 ) ( -1750 -1250 331 1 1 ) ( -1750 -1000 165 1 2 ) )
   ( ( -1500 -1500 216 2 0 ) ( -1500 -1250 275 2 1 ) ( -1500 -1000 138 2 2 ) )
  )
 }
}
}

 

Which is very close already to Doom 3's format. You guys are talking about re-inventing the wheel when over in the corner their's one that's already 98% done. I really am lost here, this plugin was designed from the ground up to work with Id's format and it has already been integrated into GTKRadiant which is a variant of what were using anyways.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Nevermind, I got it into DarkRadiant and it looks amazing!!! I can't wait to show you guys what it's going to look like when I get the heightmap tweaked. Very natural looking terrain (or as unnatural as you want ;) and it took me 10 minutes to download all programs, create the heightmap, create the map file with gensurf, and convert it to doom3, and it only had one error upon opening and I forget what it was, but the terrain was there and it looked great.

 

Will be back with updates.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Nevermind, I got it into DarkRadiant and it looks amazing!!! I can't wait to show you guys what it's going to look like when I get the heightmap tweaked. Very natural looking terrain (or as unnatural as you want ;) and it took me 10 minutes to download all programs, create the heightmap, create the map file with gensurf, and convert it to doom3, and it only had one error upon opening and I forget what it was, but the terrain was there and it looked great.

 

Will be back with updates.

 

Do you mean you got the plugin working in Dark Radiant?

Link to comment
Share on other sites

Do you mean you got the plugin working in Dark Radiant?

 

Nope lol, I was able to convert the terrain file to doom 3 format and it works. Although because scale is everything, in order to make the scale of the map believable I had to increase it's size to 12000 x 12000 x 4000 so it has not finished dmapping yet, but when it does you will get the first screenshots.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Nope lol, I was able to convert the terrain file to doom 3 format and it works. Although because scale is everything, in order to make the scale of the map believable I had to increase it's size to 12000 x 12000 x 4000 so it has not finished dmapping yet, but when it does you will get the first screenshots.

 

Okay I was able to add terrain to the castle map so the castle is now sitting up on a hill with water around it. It looks pretty neat and I added a wall all the way around the "compound" so that the player can't exit the area and it gives a plausible reason for the wall to be there. I added some trees to the terrain and this really helps add some character, but I'm going to have to add alot more, maybe put some patroling AI out there.

 

Should be fun, and the performance hasn't really changed yet, still runs at ~25fps for me outside the houses in the castle as well as outside of the castle.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Can you upload the map? Or screenshot? Don't know how easy these would be to work with but was wondering if ultimately there could be 10 or 20 terrain prefabs that mesh together in different arrangments. Once buildings, trees added they would all look quite different in different missions.

Link to comment
Share on other sites

Can you upload the map? Or screenshot? Don't know how easy these would be to work with but was wondering if ultimately there could be 10 or 20 terrain prefabs that mesh together in different arrangments. Once buildings, trees added they would all look quite different in different missions.

 

Soon, I'm still tweaking the terrain as the shadows are really harsh, and converting all the patches individually to use 10x10 patch divisions explicitly is taking awhile (there's 144 of them).

I was wondering if you could add the functionality of changing all selected patches to use the same divisions? Right now if I have the Patch Inspector window open and select more than one patch everything is greyed out (obviously because they can have different settings), but it would be nice that I could select ALL the patches, and still be able to click "Fixed Subdivisions" and be able to change all selected.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

I was wondering if you could add the functionality of changing all selected patches to use the same divisions? Right now if I have the Patch Inspector window open and select more than one patch everything is greyed out (obviously because they can have different settings), but it would be nice that I could select ALL the patches, and still be able to click "Fixed Subdivisions" and be able to change all selected.

Yes, I was in need of something like that too. Please report it on the tracker.

Link to comment
Share on other sites

Very promising. This has potential I would think. But I'm just wondering what are the advantages over Dark Radiant's present capability? If you create say 9 flat patches laid out 3 x 3 and select them all then select vertex mode you can shape them as one giant terrain.

 

post-400-1212042146_thumb.jpg

Link to comment
Share on other sites

Very promising. This has potential I would think. But I'm just wondering what are the advantages over Dark Radiant's present capability? If you create say 9 flat patches laid out 3 x 3 and select them all then select vertex mode you can shape them as one giant terrain.

 

post-400-1212042146_thumb.jpg

 

Okay try making a river go through a valley, I did that last night and it took only 5 minutes.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Yeah, see what you mean. Took me about 45 minutes and it's crappy. Probably take hours to do a decent one. So what was needed to convert? To repost my earlier question: "Is that something that could be done meanwhile with a search and replace in a text editor?"

 

post-400-1212068732_thumb.jpg post-400-1212068748_thumb.jpg

Link to comment
Share on other sites

Yeah, see what you mean. Took me about 45 minutes and it's crappy. Probably take hours to do a decent one. So what was needed to convert? To repost my earlier question: "Is that something that could be done meanwhile with a search and replace in a text editor?"

 

post-400-1212068732_thumb.jpg post-400-1212068748_thumb.jpg

 

The tools you will need are:

 

Information about GenSurf can be found here: http://tarot.telefragged.com/gensurf/ [^]

Source code can be found here: http://www.qeradiant.com/cgi-bin/trac.cgi/...gensurf?rev=177 [^]

There is also a tool which converts Quake 3 maps to Doom 3 format complete with textures, models, material files etc. It can be found here: http://www.quake.de/q3tod3/ [^]

 

I would suggest that when converting the map to Doom3 format that you uncheck all the options as you just want the terrain and not a material file/folder and texture added to darkmod.

 

EDIT: I would make a suggestion; make sure that everything you input is divisible by 8 so that everything aligns to the grid nicely. So make the extents like X -4096, Y-8192 by X 4096, Y 8192 and for something that big I'd suggest divisions of at least 24x24. If you are going to use brushes instead of patches you might want to go higher so it looks better.

I always assumed I'd taste like boot leather.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...