niektb Posted March 10, 2014 Report Share Posted March 10, 2014 (edited) I thought of the following map: SchwarzwaldThis is a map with a rich valley in the middle filled with a lot of resources. Players start on the hills near the edge of the map. This is a map with a high forest density (Like AOEII's Black Forest map) The generation script is based on FeXor's Realistic Terrain Generation method. Spoiler The only thing I need to know is how to bias the realistic terrain generator to create a valley. Furthermore do I want to know how you made sure that the levels are playable. I noticed BTW that a lot of other RM-scripts use a heightbased texture painting too without looking very tiled. I'll try and see if it works for me. Some questions were raised during the process:Okay, now since I'm trying to use the other texture mechanics I need to know how to select existing parts of the map by height and paint them with a class. Paint with a class isn't too difficult. That just the following line:paintClass([Classname]); That little piece of code should be in a createArea call, with itself features a placer and a painter. In that painter the paintClass piece should be added. But how do I select a height (For example all waterareas (= all places with height < waterheight). Secondly I'm wondering whether there is a way to select tiles by slope rather than by height. Edited March 10, 2014 by niektb Quote Link to comment Share on other sites More sharing options...
FeXoR Posted March 10, 2014 Report Share Posted March 10, 2014 (edited) Okay, now since I'm trying to use the other texture mechanics I need to know how to select existing parts of the map by height and paint them with a class.Paint with a class isn't too difficult. That just the following line:paintClass([Classname]);That little piece of code should be in a createArea call, with itself features a placer and a painter. In that painter the paintClass piece should be added.But how do I select a height (For example all waterareas (= all places with height < waterheight).Secondly I'm wondering whether there is a way to select tiles by slope rather than by height.A placer for a specific height would look like://///////////////////////////////////////////////////////////////////////////////////////// HeightPlacer//// Class for tiles of the same height//// lowerBound: Only tiles higher then this will be included// upperBound: Only tiles lower then this will be included///////////////////////////////////////////////////////////////////////////////////////////function HeightPlacer(lowerBound, upperBound){this.lowerBound = lowerBound;this.upperBound = upperBound;}HeightPlacer.prototype.place = function(constraint){var ret = []; for(var x = 0; x < g_Map.size; x++){for (var y = 0; y < g_Map.size; y++){if (g_Map.height[x, y] > this.lowerBound && g_Map.height[x, y] < this.upperBound && constraint.allows(x, y)){ret.push(new PointXZ(x, y));}}}return ret;};However, I try to avoid placer but it's up to you ofc.I can't find placers for slopes. If you want to use slopes extensively perhaps look into the getGrad() of my erosion approach: http://www.wildfiregames.com/forum/index.php?showtopic=16233&page=5#entry274289This will generate a "slope" map. Edited March 10, 2014 by FeXoR Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 10, 2014 Report Share Posted March 10, 2014 I like, we have a map like the lake with a Island in middle and a forest around. For the name is Germanic. Is possibly add randomly position for treasures? Quote Link to comment Share on other sites More sharing options...
niektb Posted March 11, 2014 Author Report Share Posted March 11, 2014 I like, we have a map like the lake with a Island in middle and a forest around. For the name is Germanic.Is possibly add randomly position for treasures?Yes, though you should pick certain positions to prevent impossible to reach places. 1 Quote Link to comment Share on other sites More sharing options...
niektb Posted March 11, 2014 Author Report Share Posted March 11, 2014 I need some help with painting:I want to paint the watertexture but somehow it doesn't work:This is the painting code:var placer = new HeightPlacer (ByHeight[0].height, ByHeight[3].height);var painter = new LayeredPainter([tWater, aReeds], [4,2], paintClass(clWater));createArea(placer, painter);Also I used code to place paths through the forest but that does only work partially as it should avoid the water path (might be related to the problem above)createArea(placer, painter, avoidClasses(clHill,0 ,clWater, 4, clBaseResource, 4));I'm just curious on what that number does after clWater.Attached is the full code.Schwarzwald.zip Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 12, 2014 Report Share Posted March 12, 2014 When need ask a tutorial to perform real environments with atlas, like Michael. Some like quick tips. All my maps are good for gaming but not visual or realistic. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted March 12, 2014 Report Share Posted March 12, 2014 (edited) I need some help with painting:I want to paint the watertexture but somehow it doesn't work:screenshot0001.pngThis is the painting code:var placer = new HeightPlacer (ByHeight[0].height, ByHeight[3].height);var painter = new LayeredPainter([tWater, aReeds], [4,2], paintClass(clWater));createArea(placer, painter);Also I used code to place paths through the forest but that does only work partially as it should avoid the water path (might be related to the problem above)createArea(placer, painter, avoidClasses(clHill,0 ,clWater, 4, clBaseResource, 4));I'm just curious on what that number does after clWater.Attached is the full code.The water texture is not painted because the HeightPlacer() uses g_Map.height as heightmap while you modified myReliefmap and didn't apply it at the time you run the code.Apply it by:setReliefmap(myReliefmap);(That's one reason I don't want to add a library prematurely. It should be working simple with other libs code.)The path code does not generate the paths arround areas in avoidClasses(), the painter just doesn't paint it there (so it's interupted).The two maps you choose in fact use painter/placers/avoid very rarely. Perhaps you should also try to avoid them if you want to go with those two maps code as a basis.Or, if you want to use placers/painters/avoid you may want to use other heightmap manipulation functions that directly apply the changes to the heightmap (or you could just use setReliefmap(myReliefmap) simply every time you manipulate it). Edited March 12, 2014 by FeXoR Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 12, 2014 Report Share Posted March 12, 2014 can you add some surprises in the Island? I said before the treasures. Quote Link to comment Share on other sites More sharing options...
niektb Posted March 12, 2014 Author Report Share Posted March 12, 2014 (edited) can you add some surprises in the Island? I said before the treasures.Ah sorry, my sketch was a bit misleading, there is no island (not yet) because it is hard to do with the current terrain generation algorithm. It is an open space without trees and in the center is a lake.Maybe I will try to do so in future releases but it is not a priority yet. Edited March 12, 2014 by niektb Quote Link to comment Share on other sites More sharing options...
FeXoR Posted March 12, 2014 Report Share Posted March 12, 2014 (edited) There where some additional bugs:- My HeightPlacer() didn't work properly (I used [x, y] instead of [x][y] and if no constraint was given it failed)- You gave an actor to the painter but it only takes "terrains" and you don't want to add the actor to every tile (so I changed that)- The LayeredPainter() needs the "width" argument being an array of the length of the terrain array argument -1 (the center doesn't count. See: http://trac.wildfiregames.com/wiki/Rmgen_Library#Areapainters for an example)- The RandomTerrain() class argument has to be a string of a terrain and optionally, separated with a "|", an entity from 0ad/binaries/data/mods/public/simulation/templates and a subdirectory (like "medit_sand_wet|gaia/flora_tree_dead" so without the ".xml"). You cannot use actors (from 0ad/binaries/data/mods/public/art) or templates (0ad/binaries/data/mods/public/simulation/templates without a subdirectory).[This as a great inconvenience and one of the reasons why I try to avoid using the RandomTerrain() class and that includes painters etc.. Additionally doing simple things like adding a patch of terrain easily depends on 10 other functions/classes so it gets horrible to debug.]- Additionally you used the UPPER height limit of the lowest level as the LOWER height limit for the painter (same for the upper height limit). I changed this accordingly.Here's the map as far as possible working with your approach(Since actors cannot be used I placed trees representative but you should avoid placing trees in water. The unit AI can't handle them.):schwarzwald-fex_v1.zipAdditionally you should flatten the terrain where you place the paths (should be the SmoothElevationPainter()). Edited March 12, 2014 by FeXoR 3 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 12, 2014 Report Share Posted March 12, 2014 Is not like this? Quote Link to comment Share on other sites More sharing options...
FeXoR Posted March 12, 2014 Report Share Posted March 12, 2014 (edited) It was never like this...I don't intend to make this map, niektb does.I just help him to fix bugs. Edited March 12, 2014 by FeXoR Quote Link to comment Share on other sites More sharing options...
niektb Posted March 12, 2014 Author Report Share Posted March 12, 2014 Is not like this?I'm not sure what you mean with the brown color, but you should swap the green inner circle with the blue circle (what you see in center of the now green circle are actually waves ) That is what I meant in my sketch. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 12, 2014 Report Share Posted March 12, 2014 (edited) I'm not sure what you mean with the brown color, but you should swap the green inner circle with the blue circle (what you see in center of the now green circle are actually waves ) That is what I meant in my sketch. is a path Edited March 12, 2014 by Lion.Kanzen Quote Link to comment Share on other sites More sharing options...
niektb Posted March 13, 2014 Author Report Share Posted March 13, 2014 It seems to me that the Heightplacer still doesn't function correctly. [more info later] Quote Link to comment Share on other sites More sharing options...
niektb Posted March 13, 2014 Author Report Share Posted March 13, 2014 Here is the more info:Paths are still placed in water, same goes for trees.Some questions:- what are the numbers doing in the constraint of avoidClasses?- How do I optimize to make the map run more fluently? (It currently scores ~20fps max, while normally it runs at 50~80fps (At Alpine lake skirmish)- Currently there is an open space (near the edge) even though there doesn't run a path, how do I remove it?schwarzwald.zip Quote Link to comment Share on other sites More sharing options...
FeXoR Posted March 13, 2014 Report Share Posted March 13, 2014 (edited) @ first glance:- Trees in water: The tree placement function is from Deep Forest (AFAIK). It is based on a possibility derivation across the entire map and doesn't support constraints.- Constraints/avoid classes: http://trac.wildfiregames.com/wiki/Rmgen_Library#ControllingPlacement:Constraints- Framerate: The framerate is low due to the many trees. There's not much you can do about it. You can raise it a bit by only/mainly using low poly trees (e.g. gaia/flora_tree_pine) and avoid the higher poly ones (e.g. flora_tree_oak_large). It's the same with Deep Forest.- Open space: Just remove the possibility factor based on the map radius (in the possibility derivation mentioned before).General notes:- Make sure the order of things is correct. It matters (e.g. in Deep Forest paths "overrider" woods so they have to be placed later).- You use different concepts never meant to work with each other (Placers/Painters/Constraints/Avoids vs. Global tree density functionality vs. Height based placement). Maybe you should first get a concept of code in your mind ready, decide which one to use and then stick with it. Edited March 14, 2014 by FeXoR Quote Link to comment Share on other sites More sharing options...
niektb Posted March 16, 2014 Author Report Share Posted March 16, 2014 How do I create skyboxes myself? Quote Link to comment Share on other sites More sharing options...
Radagast. Posted March 16, 2014 Report Share Posted March 16, 2014 (edited) I think it's pretty cool to have some trees in a flooded region at some times. Sparked another idea for our ventures: floods and tsunamis, vulcanic eruptions and earth quakes. Not to forget the climates influence on the ground textures, so your green valley might become a desert over the centuries. Edit: Actually I think it's quite common for forests having glades? You two: rock on. This realism is amazing. Edited March 16, 2014 by Hephaestion 1 Quote Link to comment Share on other sites More sharing options...
FeXoR Posted March 17, 2014 Report Share Posted March 17, 2014 (edited) How do I create skyboxes myself?http://trac.wildfiregames.com/wiki/Rmgen_Library#EnvironmentHelpersHephaestion: Thx Edited March 17, 2014 by FeXoR 2 Quote Link to comment Share on other sites More sharing options...
niektb Posted March 17, 2014 Author Report Share Posted March 17, 2014 No, creating them, not setting them. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted March 17, 2014 Report Share Posted March 17, 2014 (edited) No, creating them, not setting them.Ah, k.They are placed in 0ad/binaries/data/mods/public/art/textures/skies/cirrus and the format is .dds.Gimp can convert images to .dds with a plugin.(Not sure if the existing ones are volume textures rather then plane images)Why do we use a Microsoft format? Isn't there an open format for such things?(Guess the specifications are open and Microsoft follows it for a change ^^ (?)) Edited March 17, 2014 by FeXoR Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted March 17, 2014 Report Share Posted March 17, 2014 Why do we use a Microsoft format? Isn't there an open format for such things? Those are old files and should get replaced some time. The new files are all in png format. Quote Link to comment Share on other sites More sharing options...
FeXoR Posted March 17, 2014 Report Share Posted March 17, 2014 Those are old files and should get replaced some time. The new files are all in png format.Kk, thx. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted March 17, 2014 Report Share Posted March 17, 2014 I want see a preview in zoom out from this one. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.