Jump to content

FeXoR

WFG Retired
  • Posts

    1.426
  • Joined

  • Last visited

  • Days Won

    28

Posts posted by FeXoR

  1. Hephaestion:

    - "If" instead of "min" would not likely be faster here because the if condition would be the same calculation.

    - The "1 -" at the beginning is for the negative square function (before the "+") that should give a probability between 0 and 1. Similar the "- 1".

    - The "+ 1" in the second part (after the "+") is just to make sure the probability is never 0 (would do nothing).

    (ATM I go from the center to the edge of the window. Reversing that could remove some "+/- 1" but I would find that counterintuitive)

    (I could get rid of the "/ 2" by just halving both parts individually but the way it is it's simple to combime multiple windows functions. I like that.)

    - I don't plan walls on this map but I wrote the RMGEN wall_builder.js lib (where every wall element length is "hardcoded" again due to the lack of entity access which is bad ofc.).

    • Like 1
  2. 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 ^^ (?))

  3. What bugs me about the Atlas is that it tends to crash very often. For example if you have written an RMS with a little syntax error in it Atlas instantly crashes without error logs. The main game however loads the script, gives a few errors and then returns to the main menu as it should.

    What's more I like to see some kind of possibility to use scripts in Atlas. For example: I've just created some kind of heightmap inside Atlas. Now I want to use some scripts (like a erosion script) to give the hand painted version a more realistic look. Same goes for texturing: A general layout and the script takes care of the rest (of course you might have to code/edit these scripts yourselves to get something that exactly fits your needs)

    You can see the error in the mainlog.html.

    Sometimes however it's not very helping (like a missing vital ";").

  4. Hephaestion: Well, I learned something (at least for relevant for Python I use most of the time) ^^

    What I was mainly asking for is a fast well fitting function to replace the gaussian with.

    As a windows function I use a combination of a 2nd order polynomial and a trapeze (looks OK and is quite fast):

    var scaleX = (1 - (wx / dx - 1) * (wx / dx - 1) + min(min(3 * wx / dx, 3 * (2 * dx + 1 - wx) / dx), 1)) / 2;var scaleY = (1 - (wy / dy - 1) * (wy / dy - 1) + min(min(3 * wy / dy, 3 * (2 * dy + 1 - wy) / dy), 1)) / 2;

    (I could replace the "/ 2" with "* 0.5" but that's not the time consuming thing here anyways)

    The template information indeed would be very nice (though mainly for wall placement and debugging).

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

  6. I bet most of those users are just inactive, maybe - if you do a purge - send them an email that they need to reconfirm their account within x months.

    Plz don't. This will likely not prohibit any spammer activity because they likely generate a new account and then directly act. It will however annoy sanely acting members after a longer absence.

    If it's really helping, well, OK. But AFAIK it will not.

    • Like 2
  7. 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.zip

    Additionally you should flatten the terrain where you place the paths (should be the SmoothElevationPainter()).

    • Like 3
  8. I need some help with painting:

    I want to paint the watertexture but somehow it doesn't work:

    attachicon.gifscreenshot0001.png

    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.

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

  9. 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#entry274289

    This will generate a "slope" map.

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

    If you are generating a new map open a new topic for that. I'll answer there.

  11. Well limit the max number of healers then ;)

    PLZ don't limit anything (I'm already annoyed with limited towers/fortresses).

    Balance things instead, please.

    (even a population cap would become unneeded if we had some kind of "upkeep" system e.g. gather rate decreases with population/number of buildings to simulate payment and administration costs)

    • Like 2
  12. It thought of the following map:

    Schwarzwald

    This 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)

    LEWEDYA.png

    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.

    You can influence the general shape of the map by giving a rough initial heightmap (e.g. 3x3) like:

    initialReliefmap = [    [heightRange.max, (heightRange.max + heightRange.min) / 2, heightRange.max],    [heightRange.max, heightRange.min, heightRange.max],    [heightRange.max, (heightRange.max + heightRange.min) / 2, heightRange.max]];

    and then give it to getBaseTerrainDiamondSquare like:

    var myReliefmap = getBaseTerrainDiamondSquare(g_Map.size + 1, heightRange.min, heightRange.max, 0.5, initialReliefmap);

    You will have to apply the reliefmap to the g_Map if you finished manipulating it:

    setReliefmap(myReliefmap);

    So if you use the realistic terrain demo just add the initialReliefmap code (search for initialReliefmap to see where. the other preset initial heightmaps are documented out and will form islands).

    It then will look similar to this (tiny, 2 players, seed 1):

    post-14196-0-26872500-1394365980_thumb.j

    (The diagonal appearance comes from the start locations being added that way, not from the initialReliefmap. The right and left side medium height "valleys" however do.)

    The getBaseTerrainDiamondSquare function doubles the size until it's bigger then the needed size and then cuts the bottom left part of the needed size. That will change in the future so the center is used rather then the bottom left. So until now on some map sizes the lake will not be in the center of the map.

    Additionally keep in mind that the shape is most suitable for 2 players. You might want to make the initialReliefmap depend on the number of players here because it's not radial symmetric.

    Also you should change on which height the start locations are added and add more tree covered "height levels" (textueByHeight array).

    Hope I could help.

    (Could someone PLZ make the post editor stop adding/removing spaces tabs and newlines insanely?)

    • Like 2
  13. It would be possible to generate textures automatically but would also be lots of work (and would need changes many things already planned and implemented otherwise).

  14. I tried this:

    Reboot, directly start Atlas:

    Error:

    Much to our regret we must report the program has encountered an error.
    Please let us know at http://trac.wildfiregames.com/ and attach the crashlog.txt and crashlog.dmp files.

    Details: unhandled exception (Access violation reading 0x00000000)

    Location: unknown:0 (?)

    Call stack:

    (error while dumping stack: No stack frames found)

    errno = 0 (No error reported here)
    OS error = 0 (no error code was set)

    Click break:

    Error:

    Much to our regret we must report the program has encountered an error.
    Please let us know at http://trac.wildfiregames.com/ and attach the crashlog.txt and crashlog.dmp files.

    Details: unhandled exception (Breakpoint)

    Location: unknown:0 (?)

    Call stack:

    (error while dumping stack: No stack frames found)
    errno = 13 (Insufficient access rights to open file)
    OS error = 0 (no error code was set)

    After this Atlas stops reacting (Windows "waiting for program" window) and I have to kill it.

    crashlog.txt

    crashlog.dmp

    mainlog.html

    But that's not the same error. I'm trying to reproduce it...

×
×
  • Create New...