Jump to content

Help with elevation code


badosu
 Share

Recommended Posts

Hello folks,

I want to recreate the slopes map from hidden cup on 0ad:

I am stuck on making the elevation to sides, which should be pretty simple though, I wondered if someone knows of any map that has a similar feature?

Link to comment
Share on other sites

3 hours ago, badosu said:

Hello folks,

I want to recreate the slopes map from hidden cup on 0ad:

I am stuck on making the elevation to sides, which should be pretty simple though, I wondered if someone knows of any map that has a similar feature?

well something could be found here https://trac.wildfiregames.com/search?q=elevation  https://trac.wildfiregames.com/wiki/Atlas_Manual_Starting  i will ping @FeXoR @vladislavbelov @elexis they could know more.

Link to comment
Share on other sites

Awesome! Unfortunately it seems the SmoothElevationPainter tries to return elevation to base creating a kind of a hill instead of a ramp, this was my attempt using it:

 

Spoiler

const heightTop = 20;
const lowlandsWidth = fractionToTiles(0.4);
const rampWidth = fractionToTiles(0.1);
const elevationPainter = new ElevationPainter(heightTop);
const rampPainters = [
  new TerrainPainter(tCliff),
  new SmoothElevationPainter(ELEVATION_SET, heightTop, 20),
  new TileClassPainter(clRamp)
];

createArea(
  new RectPlacer(new Vector2D(halfMapSize + lowlandsWidth / 2 + rampWidth, mapSize), new Vector2D(mapSize, 0)),
  elevationPainter);

createArea(
  new RectPlacer(new Vector2D(0, mapSize), new Vector2D(halfMapSize - lowlandsWidth / 2 - rampWidth, 0)),
  elevationPainter);

createArea(
  new RectPlacer(new Vector2D(halfMapSize + lowlandsWidth / 2, mapSize), new Vector2D(halfMapSize + lowlandsWidth / 2 + rampWidth, 0)),
  rampPainters
);

 

With createPassage I was able to obtain the desired result:

 

Spoiler

const heightTop = 20;
const lowlandsWidth = fractionToTiles(0.4);
const rampWidth = fractionToTiles(0.1);
const elevationPainter = new ElevationPainter(heightTop);
const rampPainters = [
  new TerrainPainter(tCliff),
  new SmoothElevationPainter(ELEVATION_SET, heightTop, 20),
  new TileClassPainter(clRamp)
];

createArea(
  new RectPlacer(new Vector2D(halfMapSize + lowlandsWidth / 2 + rampWidth, mapSize), new Vector2D(mapSize, 0)),
  elevationPainter);

createArea(
  new RectPlacer(new Vector2D(0, mapSize), new Vector2D(halfMapSize - lowlandsWidth / 2 - rampWidth, 0)),
  elevationPainter);

createPassage({
  "start": new Vector2D(halfMapSize + lowlandsWidth / 2, halfMapSize),
  "end": new Vector2D(halfMapSize + rampWidth + lowlandsWidth / 2, halfMapSize),
  "startWidth": mapSize,
  "endWidth": mapSize,
  "smoothWidth": 2,
  "tileClass": clRamp,
  "terrain": tHill,
  "edgeTerrain": tCliff
});

createPassage({
  "start": new Vector2D(halfMapSize - lowlandsWidth / 2, halfMapSize),
  "end": new Vector2D(halfMapSize - rampWidth - lowlandsWidth / 2, halfMapSize),
  "startWidth": mapSize,
  "endWidth": mapSize,
  "smoothWidth": 2,
  "tileClass": clRamp,
  "terrain": tHill,
  "edgeTerrain": tCliff
});

 

 

screenshot0008.png

screenshot0009.png

  • Like 1
Link to comment
Share on other sites

So, since it seems not possible to make elevated lake, I brought the land elevation down. If that happens though, everywhere gets flooded even if no tWater was placed.

Any ideas if what I want to do is feasible?

 

screenshot0011.png

Link to comment
Share on other sites

Well, for now I am using low elevation changes, unfortunately. It seems anything below 0 elevation it painted as water and anything above a certain elevation can't be painted as water. Is there any reason for this?

 

screenshot0013.png

  • Like 1
Link to comment
Share on other sites

  • 9 months 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
 Share

×
×
  • Create New...