View Full Version : Algorithm to generate landscapes
_Kilburn
23 Apr 2006, 22:43
Hi, I'm a member of a programming team, and we would like to make a Worms game in C++ on a calculator. The problem is we don't know which algorithm is used to generate landscapes. Do someone know?
What a shameless stealing of Kilburn (http://forum.team17.co.uk/member.php?u=199)'s nickname...
_Kilburn
24 Apr 2006, 00:06
I know, sorry, but before, I didn't know that this was the name of a Team17 programmer.... :o Where can I change the name? (if I can...) And finally, do someone know the algorithm?
CyberShadow
24 Apr 2006, 02:39
The landscapes are (or used to be) generated by Landgen.exe, which is included with W:A. It doesn't run on its own, but called from WA.exe (at least the old versions used to call it, it's possible it was merged with WA.exe in the later versions).
You probably could disasemble it and reverse-engineer the algorithm, but that would break a law or two.
P.S. What platform are you writing the game for?
evilworm2
24 Apr 2006, 04:49
What a shameless stealing of Kilburn (http://forum.team17.co.uk/member.php?u=199)'s nickname...
names are no property to anyone.
One thing that has changed with the beta updates (which I really want to come back), is the ability to enter a random string of characters and numbers and generate a unique map of it.
This has been in every main Worms game to date (W1, WR, WU, WDC, W2, W:A, WWP, W3D, WF, W4M), but is now missing in W:A.
(Also I sometimes have the feeling that the random maps are actually less random nowadays, but that might be subjective.)
names are no property to anyone.
Of course not. But if I see that a name "XXX" has already been registered, I come up with something different than "_XXX".
The landscapes are (or used to be) generated by Landgen.exe, which is included with W:A. It doesn't run on its own, but called from WA.exe (at least the old versions used to call it, it's possible it was merged with WA.exe in the later versions).Yes, it's true that new versions of WA do not use landgen.exe at all.
_Kilburn
24 Apr 2006, 09:51
P.S. What platform are you writing the game for?
We are writing games for Casio ClassPad 300, this is a very powerful calculator on which you can write programs in C++ and SH3 assembler.
The problem is that I don't know assembler, so, even if I try to disassemble landgen.exe, I'll understand nothing... Do you think I'll got an answer if I ask directly Team17?
Do you think I'll got an answer if I ask directly Team17?
Try and ask Kilburn (http://forum.team17.co.uk/member.php?u=199).
Tell him you like football, drinking & producing games.
HAHA! :D
_Kilburn
24 Apr 2006, 14:51
If you don't know the answer to my question, please don't say such stupid things, okay? I repeat that I didn't know that "Kilburn" was the nickname of a Team17 developper.
MrBunsy
24 Apr 2006, 16:19
If you don't know the answer to my question, please don't say such stupid things, okay? I repeat that I didn't know that "Kilburn" was the nickname of a Team17 developper.
Bonz wasn't being that stupid. If you did ask Kilburn and say that you'd probably get a reply.
evilworm2
24 Apr 2006, 17:06
A hint: think about your own algorithm.
Developing software is more than coding. It`s only 10% of the work. The other 90% are thinking, planning, testing.
Edit:
Article about software engineering (http://en.wikipedia.org/wiki/Software_engineering) on wikipedia
Plutonic
24 Apr 2006, 20:29
nah, thats only another 10%... most of it is debugging
nah, thats only another 10%... most of it is debugging
Still wrong.
Most of it is drinking beer.
AndrewTaylor
24 Apr 2006, 22:36
Still wrong.
Most of it is drinking beer.
No, you can't code when drunk.
In my experience it's more like 10% coding, 10% thinking, 10% debugging, 10% explaining problems you've been stuck on all day to other people and immediately solving them without their apparent input, 10% surreptitiously surfing the web, 10% commenting the code for the benefit of Other People, even though you hate them and with they'd stop meddling with your code, and 40% staring at the screen in a complete trance getting absolutely nothing at all done. But it needs doing.
thomasp
24 Apr 2006, 22:40
No, you can't code when drunk.
In my experience it's more like 10% coding, 10% thinking, 10% debugging, 10% explaining problems you've been stuck on all day to other people and immediately solving them without their apparent input, 10% surreptitiously surfing the web, 10% commenting the code for the benefit of Other People, even though you hate them and with they'd stop meddling with your code, and 40% staring at the screen in a complete trance getting absolutely nothing at all done. But it needs doing.
Not forgetting going to the computer the following day and trying to wonder what on Earth you wrote yesterday, and what it might do - I suppose that could be included in the "40% staring at your screen in a trance"
_Kilburn
24 Apr 2006, 23:57
Most of it is drinking beer.
See, he says only stupid and useless things.... :-/
I'll ask directly to Team17, here is not enough serious... Bye
evilworm2
25 Apr 2006, 10:01
See, he says only stupid and useless things....
... here is not enough serious... Bye
If you think this was stupid then i know that you never programmed for youself.
Coding IS drinking and thinking. And you got some serious answers.
The only stupid person here is YOU.
_Kilburn
25 Apr 2006, 13:13
Coding IS drinking and thinking.
Thinking... yes... Drinking... No thanks, I'm just 14...
Drinking... No thanks, I'm just 14...
Age doesn't matter. I'm over 14 and I don't drink.
evilworm2
25 Apr 2006, 17:00
Coding IS drinking and thinking.
Don`t fix drinking to coding. ;)
Just wanted to say that sometimes you need to do nothing but staring at your code and get your brain working in a different way. I know people who drink a lot of coffee, smoke some strange herbs, dance or have sex while coding.
This all may help.
And i didn`t want to insult you but you started this.
See, he says only stupid and useless things.... :-/
I'll ask directly to Team17, here is not enough serious... Bye
NO HE DOESN'T!
Bonz is a good and well respected forumer. Just atm he's being a bit... Silly...
AndrewTaylor
25 Apr 2006, 19:21
I know people who ... or have sex while coding.
No, you don't. Or if you do, they're really bad at both.
_Kilburn
25 Apr 2006, 21:07
And i didn`t want to insult you but you started this.
OK, "stupid" was exagerated for Bonz, I recognize. But, he is the first who answered to my question, and his answer was exacly what I didn't want do read. "Kilburn" has been my member name on many forums since I had Internet. And as I said, I didn't know that "Kilburn" already exists.
But let's forget that.
I just wanted to know if someone had an idea about the algorithm used to generate landscapes. If nobody knows, I'll try to ask Team17 (with a different name of course :D ), or we'll try to find an algorithm that gives a similar result ("we" because I'm not the only in my programming team).
We have already made a Tetris, and we are coding a Super Mario game, but I really would like to make a Worms game because I played the first Worms when I had about 5 and I find this is a really great game. :)
I know people who drink a lot of coffee, smoke some strange herbs, dance or have sex while coding.
I hate coffee, I don't smoke and dancing and having sex is not for 14 year-old guy. (I wonder how you can dance and write your program at the same time...)
But sometimes, while coding, I stop a moment and start playing Worms for some minutes. :D
(I'm French, so you could expect some mistakes :o )
Evil Bunny
25 Apr 2006, 23:26
Bla bla... and having sex is not for 14 year-old guy. Bla bla...
:eek: Who told you that! Cos whoever it is i'd stop taking advice from that person.
Cyclaws
26 Apr 2006, 00:04
(with a different name of course :D )
Don't sign up another name on the forum, it's against their rules and is bannable. Instead, just pop a little "PS." in the PM and explain it's your name on other forums, etc.
Plutonic
26 Apr 2006, 00:31
ok firstly, I have been known to drink while coding, although not anytime resently. (and I started drinking at about 14....).
That asside, you wont get the algorithm... deadcode is the person most likely to be able to help you but he's not around. You will most probably have to make your own.
I would suggest getting a vector spline/twine/whatever you feel happiest with and randomise its parameters, fixing the ends to the bottom corners. Then fill the lower half as land and convert to a bitmap. Should be a start towards a single island.... At least I assume it would work.
evilworm2
26 Apr 2006, 07:00
No, you don't. Or if you do, they're really bad at both.
They are really good at both.
AndrewTaylor
26 Apr 2006, 12:19
Don't sign up another name on the forum, it's against their rules and is bannable. Instead, just pop a little "PS." in the PM and explain it's your name on other forums, etc.
In fairness, lots of people were called Kilburn before Kilburn.
They are really good at both.
You're scaring me now, so I'm not going to press it any further. Please don't volunteer any information. I can delete it from the forum, but not from my brain (at least, not selectively).
evilworm2
26 Apr 2006, 18:34
Please don't volunteer any information. I can delete it from the forum, but not from my brain (at least, not selectively).
Aye aye, mon capitain. ;)
We have already made a Tetris, and we are coding a Super Mario game, but I really would like to make a Worms game because I played the first Worms when I had about 5 and I find this is a really great game. :)
First: Think about how you're going to code certain things, such as AI.
I'm the only T17 forumer that had a working worms game, and I've seen all the other worms games go horribly wrong from the start.
Remember, worms is actually one of the hardest 2D games to make well.
_Kilburn
26 Apr 2006, 21:54
For AI, I've someone in my team who know many complicated algorithms, and he told me that AI would not be a big problem. And I think he found how the landscapes are generated.
FutureWorm
28 Apr 2006, 04:11
I'm the only T17 forumer that had a working worms game, and I've seen all the other worms games go horribly wrong from the start.
Oh yeah. Worms Breakout, Star Worms... hoo. Those were miserable failures. :( Good thing we have you around to preserve fangame integrity.
Oh yeah. Worms Breakout, Star Worms... hoo. Those were miserable failures. :( Good thing we have you around to preserve fangame integrity.
I saw no topics for them...
I saw no topics for them...
Then go check those splendid fan games out:
http://www.anykeysoft.net/games.php
The first game is even hosted on the official W:A page...
http://wa.team17.com/main.html?page=good&area=brea
AndrewTaylor
28 Apr 2006, 20:00
I saw no topics for them...
...therefore they don't exist.
That's where you were going, right?
If I delete all your posts will you cease to exist?
...therefore they don't exist.
Sorry, I phrased my question wrong.
I meant "all the other worms games on this forum"
Pickleworm
28 Apr 2006, 22:40
"Worms Breakout" was on the forum. It came out a few months after I signed up, if I recall.
As for "Star Worms"/"Star Worms 2" I can only imagine were on the forum, since Worm Mad made them.
SuperBlob
28 Apr 2006, 22:44
I hate coffee, I don't smoke and dancing and having sex is not for 14 year-old guy.
Dunno why everyone hates coffee... :p
And what's wrong with dancing? I've danced (just slightly whilst tidying my room mind) to Primal Scream, and I'm only 14 :p Oh, and if headbanging counts, I'm all for it :p
"Worms Breakout" was on the forum. It came out a few months after I signed up, if I recall.
As for "Star Worms"/"Star Worms 2" I can only imagine were on the forum, since Worm Mad made them.
I did a search:
You're right.
I just didnt notice any other topics.
*scratches item off list*
could you use messengers like "icq", "msn", "xfire" for your little conversation?
ps: icq has a "multi-chat" function!!!
could you use messengers like "icq", "msn", "xfire" for your little conversation?
ps: icq has a "multi-chat" function!!!
Run! Run, before the others find out what you did!
Thinking... yes... Drinking... No thanks, I'm just 14...
Hey! You're 19 now.
Finally, you can enter the awesome realms of Coding & Drinking.
http://img74.imageshack.us/img74/2564/17beerseq7.gif
I like the way you bumped this thread just to point out that the OP is now old!
Besides, France doesn't actually have a minimum drinking age anymore!
_Kilburn
8 Oct 2010, 12:53
Oh god not this thread, NOT THIS THREAD! :eek:
And unfortunately I still don't like beer, but oh well, I guess it takes a while to get used to.
And after all those years, I still don't know how landscapes are generated in WA. :( I guess it involves fractal noise in some way, but I never managed to get anything that looks as nice.
While we're at it, I drank Guinness Extra Stout yesterday. It tasted like water.
Best bump i've seen in my life.
oh and hope you had a good birthday, bonz
Best bump i've seen in my life.
oh and hope you had a good birthday, bonz
A good birthday, Bonz? What? We were talking about Kilburn's age, not Bonz's! Geez, his birthday won't be for another...
*checks profile page*
361 days!
Also, FYI, mine is in two. Woo me, gimme prezzies!
Also also: the Calendar no longer goes past 2006 without changing the link address? When did this happen?
A good birthday, Bonz? What? We were talking about Kilburn's age, not Bonz's! Geez, his birthday won't be for another...
*checks profile page*
361 days!
Ehemm
hope you had a good birthday
That was on Monday. Now he's 29
you can't hide those bright texts from me ;)
Plutonic
15 Oct 2010, 00:15
And after all those years, I still don't know how landscapes are generated in WA. :( I guess it involves fractal noise in some way, but I never managed to get anything that looks as nice.
Nope, no idea how they actually do it, though I got some alright results playing dot-to-dot with a lot of heuristics for the mapgen maps.
Oh, nice idea there. You can play with girders a game of Dotso/Rooms whatever you want to call it.
CakeDoer
24 Oct 2010, 17:27
Have you tried drawing a good number of weird shapes and then making your generator put them together randomly? A gamemaker I know is making a Worms-like game and he says that's how he does it.
_Kilburn
7 Jun 2013, 18:46
Since this forum is going to close soon, I thought I'd announce that after no less than 7 years of intense and constant research, I've finally come up with an algorithm! :cool:
http://i43.tinypic.com/in7b4w.jpg
Smoothing phase could be better but hey, that's a start.
I still hate the taste of beer though, maybe that's why my algorithm isn't perfect yet. :(
So yeah, thought I'd assume my terrible past self and bump this thread for nostalgia purposes. I think I'll miss this place once it's gone. Love you all! :cool:
Alien King
7 Jun 2013, 23:26
Did you guess/replicate the algorithm?
Or did you flex you l33t musclez and disassemble landgen.exe?
(if the former, feel free to share somewhere ;) )
This is now a nostalgia thread!
I dont post here as much as I'd like to.....but I check these forums everyday since 6 years ago...this will be a HUGE loss for me :(
OnTopic: Awesome, It would be great if you could share the source, as a "gamedeveloper wannabe" I'm interested!
_Kilburn
8 Jun 2013, 14:52
Did you guess/replicate the algorithm?
Or did you flex you l33t musclez and disassemble landgen.exe?
(if the former, feel free to share somewhere ;) )
Heck, that took forever but here's how it works (http://kilburn.ftp.free.fr/land_algo.png).
It's rather slow because of all the intersection calculations you have to perform, and even then the smoothing phase might make the resulting shape intersect itself in some rare situations. Right now I'm using Catmull-Rom interpolation as a smoothing algorithm and it doesn't really give nice results.
Plutonic
9 Jun 2013, 20:33
Heck, that took forever but here's how it works (http://kilburn.ftp.free.fr/land_algo.png).
It's rather slow because of all the intersection calculations you have to perform, and even then the smoothing phase might make the resulting shape intersect itself in some rare situations. Right now I'm using Catmull-Rom interpolation as a smoothing algorithm and it doesn't really give nice results.
Hey, those are some nice results, well done. would you mind if I used so of those ideas in mapgen? the first half is pretty similato what i do, but the stuff for the randomising is pretty neat and I dont bother with it, would probably help slot with my sheeprace generator as well.
_Kilburn
9 Jun 2013, 22:16
Hey, those are some nice results, well done. would you mind if I used so of those ideas in mapgen? the first half is pretty similato what i do, but the stuff for the randomising is pretty neat and I dont bother with it, would probably help slot with my sheeprace generator as well.
Sure, go ahead. Also, what stuff for randomizing? Doesn't mapgen already generate randomized levels? :p
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.