Mythruna
April 19, 2024, 04:34:27 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Question about trees...  (Read 17167 times)
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« on: February 12, 2013, 11:11:18 PM »

I've been pondering some things and I come to a point where I may have to break a bit of backward compatibility.

Before I go too deeply... I'm not saying old worlds won't work.  Just that some of the "seamlessness" may be broken.  I'll explain.

Right now the actual generation of the world happens at the tile level.  So a 32x32 part of the world is generated that makes the actual blocks.  Some things like caves (and later towns, buildings, roads, etc.) have a set of descriptors at the 1024x1024 level and then the 32x32 tile sees what intersects it and just injects those parts in during the generation process.   This is nice for a few reasons... not the least of which is that plugins can specifically control what goes into a piece of land because generation of these features happens in two stages: 1) a 1024x1024 level descriptor is generated for a whole "node", 2) the individual 32x32 tiles just pull what they need to make the actual blocks.  Plugins can therefore add to the descriptor... I think I even demoed this once for caves by making a huge crater.

Most things are setup to work this way... except trees.  Trees are generated 100% as part of tile generation.

I don't know if any of you have ever noticed this, but there are places where you can stand and see an entire line of treeless land.  This is because when trees are generated they have to completely fit within the tile and cannot bridge over into the next tile.  In many cases, this is kind of hidden because trees from one tile can go right up to the border and the neighboring tile can also have the same.  But it's more likely that there is a gap... especially in the tree trunks which will never be closer than 3-4 blocks away from a tile border.

I want to move trees over to be more like the other things... where their placement is calculated at the node level (1024x1024 area).  This means that they will be able to fall between tiles and stuff... but it also means that I can a) use this info as part of other generation steps if I want, and b) someday have smarter tree placement based on the larger area.  Currently, the tile 10 meters away from the beach doesn't even know that it is 10 meters away from the beach.  That makes flora-variation a little trickier.

It also means that plugins would be able to add or remove trees as needed for whatever effect they desire.  Clearing an area and planting a grove there, etc..

Now the problem.

While the placement of trees is consistent, it is also random.  But that randomness is based on the specific order that the random was requested.  So if I go with the node-based approach, trees will end up in different places.  I could fix this but the calculation costs would be kind of high for what I get out of it and then we go back to having trees never cross a tile boundary, etc..

How will this look?

Well, for any existing world it may mean that when you go to an area you've never been before that you end up with just part of a tree.  Sometimes this might be a trunk sitting right at a tile boundary with just half of the tree there.  Other times it might be a bunch of leaves floating in the air.

I think this is a fairly small price to pay to bring the architecture in line.  But I thought I'd check with the community.

As I said, I can keep it backwards compatible with some extra time and effort but it hardly seems worth it to me.  Pretty soon there will be plenty of reasons to start new worlds anyway so the effect is minimal to me.

Thoughts?

P.S.: This is also what I need if I'm ever going to put trees in the "far terrain" views I've showed.
Logged
Moonkey
Hero Member
*****
Posts: 1587

This is probably a picture.


View Profile
« Reply #1 on: February 12, 2013, 11:38:44 PM »

This is for the better of Mythruna. Our creations don't last forever! So you get a thumbs-up from me. Creating things on a node grid sounds like fun Smiley (Or just seeing things on a grid)
Logged

Mythruna: Don't you dare read any posts I made before 2014.
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #2 on: February 13, 2013, 12:22:43 AM »

This is for the better of Mythruna. Our creations don't last forever! So you get a thumbs-up from me. Creating things on a node grid sounds like fun Smiley (Or just seeing things on a grid)

Well, they aren't actually created "on a grid".  It's just the area I generate at one time.

And for those of you who didn't notice the problem with the current trees, you probably won't see any difference except if you happen to see a floating tree part in an existing world.
Logged
FutureB
Donators
Hero Member
***
Posts: 512


RAWR


View Profile
« Reply #3 on: February 13, 2013, 01:46:46 AM »

i havnt been pedantic enough to notice this so im not sure if many other people will have... it sounds good paul so i say go and do it :p
Logged


Say the opposite of these words:
1)Always.
2)Coming.
3)From.
4)Take.
5)Me.
6)Down.
BigredRm
Donators
Sr. Member
***
Posts: 379


<-o Word up goes to that modern man o->


View Profile
« Reply #4 on: February 13, 2013, 06:40:58 AM »

Burn it all down. I will rebuild.
Logged

Visit Iron Island @ 1708,702
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #5 on: February 13, 2013, 06:52:35 AM »

Burn it all down. I will rebuild.

Funny you should put it that way since this is also the prerequisite for someday being able to chop down or burn down trees and have them fall over.
Logged
G1ZMO
Donators
Full Member
***
Posts: 135



View Profile WWW
« Reply #6 on: February 13, 2013, 11:46:23 AM »

Sounds fine to me Paul.

Maybe I'm missing the point but you mentioned that it could lead to partial trees in places e.g. leaves floating in the air. Wouldn’t the leaves just fall to the earth due to the new physics?

btw I wouldn’t be averse to starting from scratch again

Paul
Logged

Paul

Castle G1ZmO of Scotland @ -219:569
Castle GiZmODo @ -700:623
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #7 on: February 13, 2013, 01:02:19 PM »

Sounds fine to me Paul.

Maybe I'm missing the point but you mentioned that it could lead to partial trees in places e.g. leaves floating in the air. Wouldn’t the leaves just fall to the earth due to the new physics?

btw I wouldn’t be averse to starting from scratch again

Paul

Physics doesn't affect all blocks, just physical objects.  It would be overly expensive to try to find all floating blocks in the world.
Logged
BigredRm
Donators
Sr. Member
***
Posts: 379


<-o Word up goes to that modern man o->


View Profile
« Reply #8 on: February 13, 2013, 02:35:00 PM »

I was wondering what would happen to my airship ballon made out of sand with physics intigrated.
Logged

Visit Iron Island @ 1708,702
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #9 on: February 13, 2013, 03:37:25 PM »

*votes yes

I didn't notice that either, I don't care how the generation works much, I just like the game.
Do what you want, and I will enjoy.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #10 on: February 13, 2013, 04:24:02 PM »

I was wondering what would happen to my airship ballon made out of sand with physics intigrated.

Nothing.  Physics will only affect objects.  At some point there will be a way to convert your floating structures into big objects and they will adopt some physical properties during that conversion.

Any building-related physics I might add in the future would be calculated as you build.  I can't realistically examine the whole world for potential structural problems but I could add it to the building process, ie: as you place blocks I build a model.  I don't know that I will but that's how it would have to work if I did it.

That's kind of the reason switching the tree generation is important... since then I will know where each specific tree was placed and what type it was.  As it is now, if you start whacking a tree trunk block, I have no idea if it was a tree or just a block you placed... and even if I figure out it was a tree, I don't know what blocks above are part of that tree or the five right next to it.  Knowing where all of the trees were placed would give me that.

...also, I can more easily found and calculate forests for determining animal populations, wood cutting resources, etc..  It's a lot of win in the long run.
Logged
BenKenobiWan
Friendly Moderator
Donators
Hero Member
***
Posts: 674


Jesus loves you!


View Profile
« Reply #11 on: February 13, 2013, 05:48:44 PM »

So the only downside would be occasional floating trees? I don't think that's too much of a problem to me.
Logged
danny
Newbie
*
Posts: 5


View Profile
« Reply #12 on: February 13, 2013, 06:09:34 PM »

I vote don't worry about backward compatibility and make the change.

Is this a future plan for after the alpha release, or ate you looking at implementing this soon?  Frankly, I think working at backwards compatibility to make trees look perfect isn't worth your time.  For individual games, I think people will dismiss it.  On servers, well, I imagine most of the server world will have been viewed and determined anyways.  Eventually, the issue will be moot.
Logged
Moonkey
Hero Member
*****
Posts: 1587

This is probably a picture.


View Profile
« Reply #13 on: February 13, 2013, 11:05:19 PM »

I vote don't worry about backward compatibility and make the change.

Is this a future plan for after the alpha release, or ate you looking at implementing this soon?  Frankly, I think working at backwards compatibility to make trees look perfect isn't worth your time.  For individual games, I think people will dismiss it.  On servers, well, I imagine most of the server world will have been viewed and determined anyways.  Eventually, the issue will be moot.
I think sooner. Hey Paul, after this update, how far will Alpha be? 4 Months? *wink* Smiley
Logged

Mythruna: Don't you dare read any posts I made before 2014.
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #14 on: February 14, 2013, 02:13:22 PM »

I vote don't worry about backward compatibility and make the change.

Is this a future plan for after the alpha release, or ate you looking at implementing this soon?  Frankly, I think working at backwards compatibility to make trees look perfect isn't worth your time.  For individual games, I think people will dismiss it.  On servers, well, I imagine most of the server world will have been viewed and determined anyways.  Eventually, the issue will be moot.
I think sooner. Hey Paul, after this update, how far will Alpha be? 4 Months? *wink* Smiley
4 * 10 / 2 - 14.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!