|
Wang tiling is your friend: http://en.wikipedia.org/wiki/Wang_tiles EDIT: Actually, it's a slightly higher level than that you want, isn't it? I'd probably look at grammar rules and markov chains. EDIT2: Have a look at this paper: http://graphics.stanford.edu/papers/texture-synthesis-sig00/texture.pdf What you basically want is a reference texture with some natural looking patches of grass, water edges etc... and then use texture synthesis to make larger maps based on those smaller samples. TSDK fucked around with this message at 18:01 on Apr 22, 2008 |
# ? Apr 22, 2008 17:49 |
|
|
# ? May 11, 2024 16:55 |
|
DBFT posted:Apologies if I was vague One way to do it is to imagine your map as a series of layers - Sand, Rock, Grass, Water, etc. The value in your map of integers specifies the layer that occupies the center of each tile, while the adjacent numbers specify what layers occupy the neighboring tiles. Thus, if I have a terrain map like this code:
code:
Does that make sense? e: TSDK posted:Wang tiling is your friend: Wang Tiling is a much better approach
|
# ? Apr 22, 2008 17:51 |
|
If I'm not mistaken aren't the methods you gave me more to do with how the map will appear (blending one tile into another, etc.) rather than making the layout of water/land/rocks/etc look natural? I looked up Wang Tiles but I can't see how it relates to my problem all that well, I may have not been clear though
|
# ? Apr 22, 2008 18:07 |
|
DBFT posted:If I'm not mistaken aren't the methods you gave me more to do with how the map will appear (blending one tile into another, etc.) rather than making the layout of water/land/rocks/etc look natural? Ah sorry, I mis-interpreted again, then. This is probably the gold standard for what you're looking for: http://www.dwarffortresswiki.net/index.php/World_generation#How_World_Generation_Works
|
# ? Apr 22, 2008 18:18 |
|
Nuke Mexico posted:Ah sorry, I mis-interpreted again, then. Thanks for that, that's the sort of thing I was looking for. If anyone else has anything to help me that would be great, this is the first time I've tried world generation
|
# ? Apr 22, 2008 18:24 |
|
DBFT posted:If I'm not mistaken aren't the methods you gave me more to do with how the map will appear (blending one tile into another, etc.) rather than making the layout of water/land/rocks/etc look natural? It might be worth seeing if the file format for Dwarf Fortress is easy to interpret - no point writing your own generation code if you can generate one in DF and then extract the map data to your own format.
|
# ? Apr 22, 2008 19:40 |
|
DBFT posted:Thanks for that, that's the sort of thing I was looking for. If anyone else has anything to help me that would be great, this is the first time I've tried world generation What I've been using in the past is the Diamond-Square-Algorithm, but it can be a bit difficult getting it to do what you want. Still, I guess it can't hurt to take a look at it.
|
# ? Apr 22, 2008 19:59 |
|
What is the correct way to compute a depth buffer value from world position, because this gives my slightly wrong values:code:
|
# ? Apr 23, 2008 10:50 |
|
heeen posted:What is the correct way to compute a depth buffer value from world position, because this gives my slightly wrong values: code:
StickGuy fucked around with this message at 12:40 on Apr 23, 2008 |
# ? Apr 23, 2008 11:51 |
|
heeen posted:What is the correct way to compute a depth buffer value from world position, because this gives my slightly wrong values: I don't have a shader handy which does this, but a good place to start would be to look in the red book about how the depth value is calculated when no shader is bound. There is an overview here: http://www.opengl.org/resources/faq/technical/depthbuffer.htm see point: 12.050 If you want the quick and dirty answer, have a look at this thread here on GPGPU: http://www.gpgpu.org/forums/viewtopic.php?p=14124. I tested it out in my own engine on a (very) simple scene and it seemed to work okay. What you really need is the near and far plane, as the calculation is based on that (z buffer has more precision closer to the eye). My code looked like this: code:
|
# ? Apr 23, 2008 12:14 |
|
Wuntvor posted:What I've been using in the past is the Diamond-Square-Algorithm, but it can be a bit difficult getting it to do what you want. Still, I guess it can't hurt to take a look at it. So I would use this to generate a hightmap then use that to decide what is land and water? I think i'll try that out as it seems it works for other people. I think the best way for the type of game I'm trying will be to attempt something similar to dwarf fortress generating temperature, rainfall etc first then basing the map on that. If anyone has any other suggestions please tell me
|
# ? Apr 23, 2008 12:25 |
|
DBFT posted:So I would use this to generate a hightmap then use that to decide what is land and water? I think i'll try that out as it seems it works for other people. Though this method is theoretically for generating terrain geometries, Dwarf Fortress actually uses something similar to generate it's "elevation map", which in turn influences rainfall, rivers, temperature, and whatnot.
|
# ? Apr 23, 2008 12:37 |
|
Nuke Mexico posted:Though this method is theoretically for generating terrain geometries, Dwarf Fortress actually uses something similar to generate it's "elevation map", which in turn influences rainfall, rivers, temperature, and whatnot. Then it's decided, generating an elevation map using the diamond square algorithm just as soon as I can figure out how to implement it correctly. I'll no doubt be back asking for more help in the future but you guys have been a great help so far thanks.
|
# ? Apr 23, 2008 13:46 |
|
DBFT posted:Then it's decided, generating an elevation map using the diamond square algorithm just as soon as I can figure out how to implement it correctly. I'll no doubt be back asking for more help in the future but you guys have been a great help so far thanks. As a side note, the nice thing about the "multi-pass" method that dwarf fortress uses is that, in theory, each layer (rainfall, temperature, elevation, goodness/evilness, etc) can be both randomly generated for gross content construction and then hand-edited to help maximize "fun-factor". While I'm a big fan of procedural generation systems, I find that they're pretty much useless unless they allow for at least some kind of human intervention to make it ultimately 'fit' gameplay designs. This isn't as important for a sandbox game like dwarf fortress, but is necessary if you want to use tools like this for building more linear content.
|
# ? Apr 23, 2008 15:27 |
|
Nuke Mexico posted:As a side note, the nice thing about the "multi-pass" method that dwarf fortress uses is that, in theory, each layer (rainfall, temperature, elevation, goodness/evilness, etc) can be both randomly generated for gross content construction and then hand-edited to help maximize "fun-factor". While I'm a big fan of procedural generation systems, I find that they're pretty much useless unless they allow for at least some kind of human intervention to make it ultimately 'fit' gameplay designs. This isn't as important for a sandbox game like dwarf fortress, but is necessary if you want to use tools like this for building more linear content. Well the game is a sandbox and the main aim of the game is to explore the (randomly generated) island and colonize it (cut down trees, build huts, etc. etc). There's obviously more to it but what I'm saying is that human interaction in the island generation will hopefully be kept to a minimum. First i'll try to get the heightmap generated and see where it goes from there, If need be I suppose I will have to allow human intervention. EDIT: Random Fractal Terrain posted:For the square step, we use the same range for generating the random values. There are four diamonds at this stage; they all meet in the center of the array, so we calculate four diamond centers. The corners of the diamonds are averaged to find the base for the new values. Figure c shows the new values in black and existing values in gray. Should I be able to join the dots and see diamonds because I can't? I can't really see what is a diamond and what is a square? Heisenberg1276 fucked around with this message at 18:04 on Apr 23, 2008 |
# ? Apr 23, 2008 15:54 |
|
DBFT posted:Should I be able to join the dots and see diamonds because I can't? I can't really see what is a diamond and what is a square? Also, here you can find an implementation of this algorithm in C#. I wrote it quite a while ago, and it really isn't very readable, but maybe it'll still help you. The code skips the first three steps and does them manually, though, I probably wouldn't do it that way again. Basically, I was just trying to make it generate maps that would always have negative values at the borders and positive ones in the middle. I think I only used it to separate land from water, the way I did that was that I took an arbitrary value (like 0.0) as a starting point, calculated the water percentage and in several steps adjusted that value until it was close enough to the land percentage that I wanted. Hope this helps a bit, good luck. (and if you want to, you could also contact me on aim).
|
# ? Apr 23, 2008 19:31 |
|
Ok, the calculation seems to be correct, yet it seems to be z-culled away, any ideas? I'm raycasting triangles into triangles that lie in front of the former, if that makes sense. Here is what it looked like with my (apparently wrong) depth calculation. You can see the pool bleed into the border. edit: code:
|
# ? Apr 23, 2008 20:12 |
|
What are some of the most complete game engines for a indie developer? I'd like an engine to support simple networking (eg. synchronizing player movement) and allow me to create objects for the player to interact with. For example, I'd like to create an alarm clock that players can select and it would prompt them for a time (eg. custom scripted dialog box), and then at a set time everybody on the server would have an event fired making them lose health or whatever. I don't want to have to worry about the engine at all (eg. object selection, collisions, networking, etc). Does anything like this exist at all?
|
# ? Apr 23, 2008 20:50 |
|
Vinlaen posted:What are some of the most complete game engines for a indie developer? Look at Ogre 3D or Torque
|
# ? Apr 23, 2008 21:20 |
|
The Torque engine from GarageGames would do that. Or Unity.
|
# ? Apr 23, 2008 21:20 |
|
heeen posted:Ok, the calculation seems to be correct, yet it seems to be z-culled away, any ideas? code:
code:
code:
fragment shader is first clamped to [0, 1] and then converted to fixed-point as if it were a window z value (see section 2.11.1)." Enjoy. EDIT: Swapped gl_ModelViewMatrix with gl_ModelViewProjectionMatrix. StickGuy fucked around with this message at 06:42 on Apr 24, 2008 |
# ? Apr 23, 2008 22:21 |
|
HB posted:The Torque engine from GarageGames would do that. Or Unity. Unfortunately, Unity3D can only be authored on a Mac and I actually own Torque but it's incredibly difficult to modify and requires hard-core C++ knowledge to do anything "outside the box". (eg. anything except a FPS) Also, Ogre3D is only a rendering engine and won't do anything else... I'm looking for a one-stop complete package
|
# ? Apr 23, 2008 22:40 |
|
e: double post
|
# ? Apr 23, 2008 22:43 |
|
If you don't intend to sell your game, you could make it a total conversion for an Unreal or Source title. And I didn't realize Unity didn't have a Windows editor.
|
# ? Apr 23, 2008 22:43 |
|
HB posted:If you don't intend to sell your game, you could make it a total conversion for an Unreal or Source title. Maybe nothing exists like I'm trying to find... (I'm sorry if it seems like I'm being difficult!)
|
# ? Apr 23, 2008 22:49 |
|
Darnit -- double post.
|
# ? Apr 23, 2008 22:50 |
|
StickGuy posted:Enjoy. code:
edit alright, I think I found the error in your quote, did you mean to write gl_ModelViewProjectionMatrix? because it seems to work Edit: http://heeen.de/proj/refract.avi http://www.youtube.com/watch?v=hqLobCH8PFo heeen fucked around with this message at 23:48 on Apr 23, 2008 |
# ? Apr 23, 2008 22:59 |
|
Sorry about the typo. The video looks pretty nice.
|
# ? Apr 24, 2008 09:45 |
|
heeen posted:Edit: http://heeen.de/proj/refract.avi http://www.youtube.com/watch?v=hqLobCH8PFo This is a pretty good method for adding caustic effects, if you want to bump the bling up a notch. EDIT: There's also a nice technique which uses the water surface mesh rendered as triangles into a texture and projected onto the underwater geometry, where the brightness of the triangles is adjusted based on the size/gradient of the triangle relative to the rest size. This gives you sharper caustics, but I can't find a paper on it at the minute. They used that technique in the PS3 Big Duck demo. TSDK fucked around with this message at 10:41 on Apr 24, 2008 |
# ? Apr 24, 2008 10:28 |
|
TSDK posted:Looking good so far. Ooooh I invented something similar to this (but not as good) back in 2000ish. http://www.patentstorm.us/patents/6809729.html drat, "Don't publish but patent" companies.
|
# ? Apr 25, 2008 00:42 |
|
Nuke Mexico posted:Ah sorry, I mis-interpreted again, then. While on the topic of Dwarf Fortress, is there anywhere he goes over his general approaches to solving certain problems? As a pet project, I was going to work on a very simple game with similar concepts. My approach to the jobs would be to have each category of job (glassmaking, masonry, etc.) have its own priority queue, to manage which job inside that category was the most important. Then, when an actor needs to get a job, he looks at all the priority queues he has access to (say, for example, he doesn't have cheesemaking, he would skip that queue) and grabs the highest priority of the bunch. That seems to work pretty well, but the stl priority queue doesn't seem to have any iterator at all, so getting a complete list of jobs available would require maintaining a separate list of pointers. Although, I'd probably have to do that anyways, because using my system wouldn't allow for 'in progress' jobs to remain in the queue. I guess I could just set their priority to 0 while they are in progress, and restore it to the previous priority if the job fails. Then I could keep it in the queue. (Although I'd have to extend the stl implementation a bit, in which case I might as well write a basic iterator for it.) Anyone know where I could get more information about writing this style of AI? I'm not trying to do anything crazy complex with it, but I am trying to build an easily maintainable, expandable code base.
|
# ? Apr 25, 2008 02:44 |
|
forelle posted:Ooooh I invented something similar to this (but not as good) back in 2000ish.
|
# ? Apr 25, 2008 09:33 |
|
I am a big book person and was wondering if people could post a list of key Game Development books or list of ones they have found useful (specific to game development not general programming). Here is the list of current Game Development books I own: Introduction to 3d Game Programming (dx9) - Frank D. Luna Real Time Collision Detection - Ericson 3D Game Engine Design (1st ed) - David H. Eberly Game Programming Gems 1-4 For the next round of purchases I was thinking of getting the following books: Game Physics - David H. Eberly Artificial Intelligence for Games - Ian Millington Are there any key books or concepts I am missing out on? Also any recommendations on books would be helpful.
|
# ? Apr 25, 2008 22:00 |
|
TSDK posted:What the hell? Issued 2004? Hell, I think I've almost got prior art on that sucker as well. This is the patent I wrote, I can't imagine why they wanted to patent it though. I since found out about 4 other people who "invented" the same method at about the same time as me. The main crux was the the ability to integrated pretty minimally into a fixed function GL pipeline. But it was first submitted in 2000 (in the UK at least) forelle fucked around with this message at 01:34 on Apr 26, 2008 |
# ? Apr 25, 2008 23:50 |
|
Pfhreak posted:That seems to work pretty well, but the stl priority queue doesn't seem to have any iterator at all, so getting a complete list of jobs available would require maintaining a separate list of pointers.
|
# ? Apr 27, 2008 17:37 |
|
Can someone send me a link that outlines (in a non coding language specific way) what I need to do for a first person camera? I'm just thinking about the best way to do it (I'm using XNA) but I'd like to see some other stuff and get some ideas. Also, for anyone experienced with XNA, is there a link that explains the steps that XNA does take to render a model? I'm trying to figure out how to have my rendering in a seperate class, or at least be able to prepare the model (so my game.cs isn't filled with dozens of different model files and stuff), but all the tutorials I find are just "this is how you draw a model: copy this code in this method, this in that, and this code in the draw method and it works". I also have no idea what this does, and how I can break it apart: code:
The Monarch fucked around with this message at 00:26 on Apr 28, 2008 |
# ? Apr 28, 2008 00:22 |
|
I just started working on a C++ Direct3D project and am having a hard time figuring out how to use texture states. I'm trying to make a bump-mapped model of the earth. Right now, I can render a sphere with the earth texture on it, and I have it orbiting around a center point map. After searching google and MSDN for tips on bump mapping, i came across the following code:code:
I'm using texture images from this site: http://planetpixelemporium.com/earth.html Texture[i] is just the color map of the Earth, earthBump is the grayscale height map, and specularTex is the third texture from the above site.
|
# ? Apr 28, 2008 03:55 |
|
I have to present my independent study (XNA rts game) tommorrow, and I need some help cleaning it up. Anyone going to be around on AIM or IRC later tonight? I'm kind of bad at math things, which is where I need to make it look nice - mostly loop timing stuff.
|
# ? Apr 30, 2008 21:02 |
|
The Monarch posted:Can someone send me a link that outlines (in a non coding language specific way) what I need to do for a first person camera? I'm just thinking about the best way to do it (I'm using XNA) but I'd like to see some other stuff and get some ideas. Alright, I'm going to try to break the code apart for you. I've never used XNA specifically but I'm learning DirectX and have a fairly good understanding of the process of rendering something in 3D, so hopefully I can give you a good head start. code:
code:
code:
code:
code:
code:
|
# ? May 1, 2008 00:29 |
|
|
# ? May 11, 2024 16:55 |
|
Hover posted:Alright, I'm going to try to break the code apart for you. I've never used XNA specifically but I'm learning DirectX and have a fairly good understanding of the process of rendering something in 3D, so hopefully I can give you a good head start. Thanks, I'm starting to get the hang of this and even though I sort of new what you're saying here already splitting it up did help. I still don't like the fact that I have to start this whole loop: code:
|
# ? May 1, 2008 00:41 |