Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411509 Posts in 69375 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 11:23:58 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsTutorial: 2d Terrain generator for worms style game
Pages: [1]
Print
Author Topic: Tutorial: 2d Terrain generator for worms style game  (Read 17163 times)
Javilop
Level 2
**



View Profile
« on: March 29, 2007, 03:49:12 PM »

First of all, hello to everybody, It's my first post here but I've been reading you from long time ago!

I have just finished a tutorial about how to implement 2d randomly generated terrain similar to the ones of Worms games. The source code is in java, but It can be easly moved to other programming languages.

You can read it here:

http://www.indierover.com/ktb-tutorial-1-2d-randomly-generated-terrain-for-worms-style-game/

I hope it will be useful for some of you!

PD: Sorry for my bad english, any correction will be appreciated!
PPD: If you like it, please, post some comments in my blog, I really enjoy answering them!

Logged
FARTRON
Level 4
****


the last man in space


View Profile WWW
« Reply #1 on: March 30, 2007, 09:31:55 AM »

Minor English correction:  It's PS, not PD.  Stands for "Post Script".  Otherwise your English seems excellent.  Nice tutorial too.
Logged

Everything that was once directly lived has receded into a representation. - debord
moi
Level 10
*****


DILF SANTA


View Profile WWW
« Reply #2 on: March 30, 2007, 10:54:15 AM »

Post scriptum actually.
Logged

subsystems   subsystems   subsystems
Ryan
Level 1
*



View Profile
« Reply #3 on: March 31, 2007, 10:16:09 AM »

WOW! I just wanted to say thanks, this is exactly what I was looking for...  Shocked.
Logged
Javilop
Level 2
**



View Profile
« Reply #4 on: March 31, 2007, 11:41:31 AM »

PS! Ok! I will remember that (maybe...)! Thanks!

Ryan, happy that it's useful to you! Smiley Don't forget to show me your project once finished!
Logged
fish
DOOMERANG
Level 10
*


cant spell selfish without fish


View Profile WWW
« Reply #5 on: April 01, 2007, 06:51:12 PM »

guys, maybe he meant police department.
who are we to judge?
Logged

Javilop
Level 2
**



View Profile
« Reply #6 on: April 04, 2007, 07:24:16 AM »

In fact it was PD: Permanently Drunk  Cool
Logged
lowpoly
Level 4
****



View Profile WWW
« Reply #7 on: April 05, 2007, 04:07:29 PM »

alcoholism transcends all language barriers.  Grin
Logged

Javilop
Level 2
**



View Profile
« Reply #8 on: October 17, 2008, 12:21:52 AM »

Could you move this tutorial to the new tutorial subforum, please? Thanks!  Gentleman
Logged
J. Kyle Pittman
Level 6
*


PostCount++;


View Profile WWW
« Reply #9 on: October 17, 2008, 10:11:20 AM »

Great tutorial.  I had to solve a lot of these same problems a few years back when I was working on a Worms-like game.  I used a different method for generating the terrain, though.  I created a 2D Perlin Noise image and used a threshold value to set which pixels were solid and non-solid.  It gave me some pretty interesting organic shapes, although in retrospect, I probably should have done a second pass to clean up rough edges and small holes/islands.
Logged

Javilop
Level 2
**



View Profile
« Reply #10 on: October 19, 2008, 03:22:23 PM »

Thanks Kyle Smiley

Do you have a link to that game? I would like to play it!
Logged
J. Kyle Pittman
Level 6
*


PostCount++;


View Profile WWW
« Reply #11 on: October 20, 2008, 03:40:08 PM »

Thanks Kyle Smiley

Do you have a link to that game? I would like to play it!

http://www.j-kyle.com/knights_info.html

It's pretty prototype-ish.  It was a student project with a strict three month timeline, so I has to cut some features like AI for single player (it's hotseat multi only).  Also I blatantly stole the exploding livestock and holy hand grenade from Worms 2.  Embarrassed  But I guess they stole it from Monty Python, so it's cool. Tongue

Also apparently some of the screenshots got borked when I moved my website content to a new server and I didn't even notice it until now.  Whoops!
Logged

Eclipse
Level 10
*****


0xDEADC0DE


View Profile WWW
« Reply #12 on: October 21, 2008, 01:55:40 AM »


cool tutorial!

Minor English correction:  It's PS, not PD.  Stands for "Post Script".  Otherwise your English seems excellent.  Nice tutorial too.

as moi said is more latin than english Wink
Logged

<Powergloved_Andy> I once fapped to Dora the Explorer
Javilop
Level 2
**



View Profile
« Reply #13 on: October 24, 2008, 01:17:51 AM »

Thanks Eclipse!

Your game looks great, J. Kyle! The results are similar, but your terrain generator is better, I can see caves, etc. Good work!
Logged
nihilocrat
Level 10
*****


Full of stars.


View Profile WWW
« Reply #14 on: December 12, 2008, 07:50:22 AM »

Great tutorial! It makes everything sound so simple...

I might be able to figure out by looking in the code, but how can you get fast and relatively accurate collisions detection from the terrain you generated?
Logged

Javilop
Level 2
**



View Profile
« Reply #15 on: December 13, 2008, 08:02:35 AM »

Great that you liked it! I'm planning to create more tutorials using IndieLib and really helps me to know that someone is using my tutorials.

Quote
I might be able to figure out by looking in the code, but how can you get fast and relatively accurate collisions detection from the terrain you generated?

If you don't need real physics (something bouncing) is quite simple. I just check the position of the bomb in each frame and I make a "get_pixel" in order to get the color of the background in that position. If it is transparent, that means the granade is still in the air, if it isn't that means the granade is upon terrain, so there is a collision. And then I just draw a circle of transparent pixels in order to
 erase the terrain, simulating a explosion.

More complex physic, with bounces and that, is of course... more complex, Tongue

« Last Edit: December 13, 2008, 07:24:04 PM by Loover » Logged
Pyrofyr
Level 0
**


View Profile
« Reply #16 on: December 13, 2008, 07:59:22 PM »

Quote
First of all, hello everybody, It's my first post here, but I've been reading for a long time!

I have just finished a tutorial on how to implement randomly generated 2d terrain similar to the ones seem in Worms games. The source code is in Java, but it can be easily moved to other programming languages.

You can read it here:

http://www.indierover.com/ktb-tutorial-1-2d-randomly-generated-terrain-for-worms-style-game/

I hope it will be useful to some of you!

PS: Sorry for my bad English, any corrections will be appreciated!
PPS: If you like it, please, post some comments in my blog, I really enjoy answering them!

Fixed for you Tongue
I read about the Post Script/Permanently Drunk, but yeah...
Logged
Javilop
Level 2
**



View Profile
« Reply #17 on: December 14, 2008, 03:40:03 AM »

Hahaha! Thanks  Gentleman. If you see something wrong in the tutorial, tell me, please!
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic