• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] [idea] generic map creation

Status
Not open for further replies.
Level 6
Joined
Feb 18, 2005
Messages
263
hi
i have asked about how to create doodads via trigger a few days before and now i've taken the next step,
i started thinking abotu a couple of functions that will create an entire map. From shaping the ground, placing the terrain, planting the trees and plants, to maybe even creating villages or at lesat some eremit houses.

i know it sounds fairly hard and at first glance it is. but i have thoguht about it a little longer and have noticed that there is only one mayor problem:
how the hell can one morph the terrain in a way that i looks realistic?
i know how i will place the terrain and the plants, and up to some degree even villages and eremit-huts. but i have not yet found any convincing way to morph the terrain that it'll look somewhat realistic.

i could simply take a point set it at random heigth and morph all points around it at +- some random value. Repeating this over the whole map.
but this would simply result in a random map, not in a random realistic map.

i would need some way to set up mountains, sees, rivers, lakes and maybe even swamps so that they are randomly created.
Thats the problem i have. i mean heck, i could simply take some random points on the map and defien them as see, lake or mountain, but that would simply result in some kind of chaos if not done properly and if existing points are not taken care of. and it does most definitly not work for rivers.

therefore i need a way to create rivers with this system. after the rivers are done, i could create mountains, lakes and sees, maybe even coasts for i do not have to take care of the entire river, just for the part beeing 'inRangeOf' the thing i want to create.

heck i'm already going to solve this in a monologue ^^
However, has anyone reading this any idea how i can create a landscape randomly?
i would apreciate any suggestions. Even ones that are not entirely thought throug (as long as they are ment honest)

- Raszul
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
Your taking on a very difficult task but is in theroy possible since it is done in many games.

Since You can not set the hight of terrain by adding clifs or water it makes the task a load harder.

You need to make a doodad that looks like water for water.

You must first define where the lake will be.
To do this pick a random point in the map you could put some conditions if you want to.

Get it to create water in a circular patern around the lake.

For rivers pick some locations preferably near the map edge using conditions.
Then create a deformation the length of the river from the lake to the end point
now create water in the deformation.

Adding a bit of randomness to the path of the river insted of a straight line would be more realistic.

I hope this helps you.
 
Level 6
Joined
Feb 18, 2005
Messages
263
Hi, i managed doing the placement of mountains and rivers. With real wc3-water.
But now another difficult task: i need to palce somewhat nice looking terain-tiles on the map. any suggestions? ( right now i have created my functions, so that they place some dummy-debug terrain in rivers and on mountains - so one could 'simply' get the terain already on the map and decide on the terain that should be palced by getting the distance to my rivers/mountains)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
Ok for diffrent areas like swamps, forests and jungles you need to first get it to randomly pick an area suitable for such.

And get it to randomly create sutiable terain and doodads with in the area you can then run fine triggers to create paths vilages and add little details to the terain.

You also need to make sure that in forests and such there is a path or else it might bug and your units will become stuck.

Also make sure that randomly created areas you dont want pathable are not pathable, espicaly if you make mountain rangs since it wount look nice seeing a unit walk up a 65° or so cliff like in dbz supreme if it generates any.
 
Level 6
Joined
Feb 18, 2005
Messages
263
i thought more about a function like

function do terrain takes nothing returns nothing
local array tiles[cold][dry]
for each field (terainfield) do
set dry = getDistanceToWater()
set cold = getHeight()

set cold = round(cold/50)
set dry = round(dry/100)

change terain(current field) = tiles[cold][dry]
endfor
endfunction

function seeds takes integer numberOfSeeds returns nothing
local array destructible plants[cold][dry]
local array real chance[cold][dry]

getRandomTile()

if (currentTile = empty)
dry = //as aboce
cold = //as above

if (random(1,100) <= chance[cold][dry]) then
create destructible (plants[cold][dry]) on currentTile
endif
endif

if (numberOfSeeds >1) then
call seeds( numberOfSeeds -1)
endif
endfunction

i know it's not gonna work that easy, but thats the basic idea i had when starting to create the map


do you have any idea how to write these functions? (or has anyone else any idea how to write them?)
 
Status
Not open for further replies.
Top