generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How is smooth terrain generated?

Previous Thread :: Next Thread 
Alkan is not online. Alkan
Joined: 04 Dec 2008
Total Posts: 907
15 Dec 2015 07:36 PM
I checked the wiki and can't figure out how people get their terrain to be made so smooth by script.



for x=1, 100 do
for y=x/2, -10, -.5 do
for z=1, 10 do
workspace.Terrain:SetCell(x, y+10, z, 1, 0, 0)
end
end
end


I'd like that to turn into a smooth ramp, but it turns into a staircase instead. Help?
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
15 Dec 2015 07:39 PM
I was playing around with the numbers a bit and I actually managed to do it:

for x=1, 100 do
for y=x/2, -10, -.5 do
for z=1, 10 do
workspace.Terrain:SetCell(x/2, y+10, z, 1, 0, 0)
end
end
end

I cut the X in half when the terrain was generated.
Report Abuse
Alkan is not online. Alkan
Joined: 04 Dec 2008
Total Posts: 907
15 Dec 2015 07:41 PM
No I mean making terrain smooth in any situation, my code was just an example. You undid the y iteration's x/2 with your x*2.
Report Abuse
Alkan is not online. Alkan
Joined: 04 Dec 2008
Total Posts: 907
15 Dec 2015 07:42 PM
I mean your x/2 made the ramp steeper, that's why it looked like a ramp instead of a staircase. Not exactly a fix.
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
15 Dec 2015 07:43 PM
Oh. If it isn't a slope of 1 I don't think it can be perfectly smooth.
Report Abuse
Alkan is not online. Alkan
Joined: 04 Dec 2008
Total Posts: 907
15 Dec 2015 07:45 PM
But then how is terrain generated smooth by plugins? I see large plains that have the slightest change in elevation and I have no idea how to do this with x,y,z integer setcell.
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
15 Dec 2015 07:48 PM
I actually crashed Studio trying to get that answer, it may take some time before I find out how. If you know an example of a game that did this please link me ^-^
Report Abuse
Alkan is not online. Alkan
Joined: 04 Dec 2008
Total Posts: 907
15 Dec 2015 07:50 PM
Just generate some terrain and see how it is smooth and not blocky with traditional setcell(x,y,z)
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
15 Dec 2015 07:55 PM
You're using whole integers which is probably positioning your terrain using a grid system, so you're getting static-y jump-y cell placement. ROBLOX's generation probably uses a bunch of float value to tween terrain to wear it wants. Even that isn't perfect (ROBLOX-generated mountains are jumpy like your terrain is).
Report Abuse
Alkan is not online. Alkan
Joined: 04 Dec 2008
Total Posts: 907
15 Dec 2015 08:00 PM
That makes sense. How do I make the terrain accept non-integers?
Report Abuse
OppaGagnamSta is not online. OppaGagnamSta
Joined: 24 Sep 2014
Total Posts: 603
15 Dec 2015 08:00 PM
the bottom script under "Procedual terrain generation" creates smooth terrain

how do it do that?

http://wiki.roblox.com/index.php?title=Smooth_terrain
Report Abuse
Alkan is not online. Alkan
Joined: 04 Dec 2008
Total Posts: 907
15 Dec 2015 08:08 PM
Thanks, that will work great for my project. I figured roblox didn't allow people to set more than individual cells by integer directly.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image