HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Random Map Generator and Tree-by-Season Changer..

01-20-2006, 09:27 PM#1
agamemnus
OK, I've worked on this for a week.

Take a spin, I tried to comment it.
Don't steal it..

For Frozen Throne only.

Notes:
1) The functions aren't fully separatable as of yet.
2) Somewhat laggy, but can be improved with your input..
3) I plan to add a random-sloped height generation later.. (it wouldn't create trees on water..)... add random rivers/lakes if the conditions are right, etc.

Attached Files
File type: w3xrandommap_generator_gamtest13.w3x (45.1 KB)
01-20-2006, 09:54 PM#2
Taur
you might want to oh... I don't know, post some screenies, tell us what it does? something crazy like that
01-20-2006, 09:56 PM#3
agamemnus
It's a random map generator and tree-by-season changer, along with a surprise.

You could just open it and start it!
01-20-2006, 10:00 PM#4
Zandose
The map creates trees and terrain that slowly change to give the feel of different seasons. Like summer trees and grass will change to trees and terrain with snow.

What surprise?
01-20-2006, 10:02 PM#5
Taur
well many of us aren't at home, well I am but I'm sure some people aren't and others are just too lazy to open it (like me <_<)
01-20-2006, 10:04 PM#6
Zandose
Just out of curiosity, why was this made? and how do you plan on doing the water/rivers?
01-20-2006, 10:07 PM#7
agamemnus
>What surprise?

Try cutting some trees, or try waiting in a forest of trees and seeing what happens... closely. (or just read the trigger comments..)

>Just out of curiosity, why was this made?
I wanted a challenge...
I will also eventually make randomized start locations (properly placed of course)... and then maybe modify the unit settings to make it more like AoE1/2..
Also, randomly generated maps (dynamic-- in game) are a novelty in WC3, aren't they? :)
01-20-2006, 10:12 PM#8
Zandose
Yes...yes they are. Anyway's I don't have time right now to try the tree cutting I got to go.
01-20-2006, 10:13 PM#9
agamemnus
>and how do you plan on doing the water/rivers?

Mechanically or algorithmically?

Mechanically: Use permament deformations.
Algorithmically: Something like http://www.gameprogrammer.com/fractal.html, but it will be somewhat different since it will be 2D.
01-20-2006, 10:18 PM#10
Taur
okay I tried it, it is not a little laggy it IS laggy. This is just 1 system it would be nearly impossible to play should you actually make a game with it.

I tried cutting down 1 tree with like 3 peasants and it crashed. I'm not fully sure why but it did.

I suggest just making it random, growing trees is not needed and lags incredibly
01-20-2006, 10:25 PM#11
agamemnus
Not sure why it crashed for you. It was fine for me. Access violation? You have the latest WC3 version?

Tree growth is already randomly picked, if that's what you mean...

Is it laggy throughout or just at the start? It generates the map and related arrays during the first few seconds so it is laggy at that point. After that I don't have any lag, but I do have a fast system.

Anyhow I would appreciate code help to make it less laggy.

You can always reduce the trigger hit frequency, etc.
01-20-2006, 10:54 PM#12
Taur
it's laggy through out
01-20-2006, 11:04 PM#13
Vexorian
Thumbs up for generator.

HUGE lag is caused by the growth thing with current config 128/1.5 , each 1.5 it freezes for a pair of mili seconds. I don't really find LAG that easily in this comp when playing wc3 so it is a problem with it.

Instead I made it 1/0.1 and it fixed it completelly.

I can't find any good cause for the lag besides that removing and creating 128 destructables at once is overkill. It could also be that you call ExecuteFunc("test_nextseason") every single time a tree is modiffied.

Season change thing should change smaller portions of terrain each cycle. A Suddenly 3×3 snow portion does not look right.

Perhaps you could use some weather effects as in it shows snow falling from the sky before changing the terrain for example.

And I hate configuring things with globals, could you use constant functions?
01-20-2006, 11:17 PM#14
agamemnus
Vextorian,

>Thumbs up for generator.

Thanks!


>Lag issues:
Did you do the same with the other treechange, since it does the same thing? (in relation to destructables) Maybe I just need to code the growth function without using reals. Not sure how much slower they are. The problem with slow tree regeneration is that the trees don't regrow very quickly that way. (could be fixed by increasing initial health I suppose..)

I also tried to use the generic tree regrowth function at thehelper.net using DyingDestructable(), but I wasted a day on it and couldn't get it to work too well...

I could just get rid of growing trees ability and implement the DyingDestructable() function with it as well. (I think it didn't work because I'm constantly destroying destructables) I think it's a nice effect though so I'll keep working on it. :-D.


>Season change thing should change smaller portions of terrain each cycle. A Suddenly 3×3 snow portion does not look right. Perhaps you could use some weather effects as in it shows snow falling from the sky before changing the terrain for example.

Yes all good changes, but I'm still thinking about how to implement all of that.


>And I hate configuring things with globals, could you use constant functions?

You mean just set them to whatever and in a function and have comments with them? Or place constant definitions? That would be nice but I don't know how to add constants.. I'll look for it..
01-20-2006, 11:21 PM#15
Vexorian
You know
Collapse JASS:
constant function FrozenOrb_Damage takes integer level returns real
    return level*0.5+5
endfunction

A constant function.

SOmething I noted is that you should be using a destructable array instead of an integer array then return bug?