Mythruna
March 28, 2024, 07:28:56 AM *
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 3 4
  Print  
Author Topic: Your whole world is off by one block in each direction...  (Read 34501 times)
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« on: February 20, 2013, 11:24:44 PM »

Strange but true.

A slight discrepancy in how the fractal was processed into tiles means the all existing worlds are technically off by one block to the south east.  Whatever block you are standing on, the fractal equations really gave me the block to the north west... and I added one.  This probably seems like a small thing... and indeed, up until now it has had absolutely no affect.

The funny thing is that I happened to notice it as I was copying the terrain generation over to the new engine.  I even put a comment in about it and how it doesn't cause any issues... and then promptly moved on and forgot about it.  It didn't seem like a big deal and fixing it would make all existing worlds off by one block to the north west... which "might" manifest itself as a noticeable duplication of exact tile patterns along some border.

For the curious, this happens because in the process of turning fractal heights into terrain types, I need to search the surrounding blocks.  So I ask for a portion of the fractal 2 bigger each way than I actually need, ie: I wanted an extra 1 block border all the way around and then I'd just ignore the border when generating the tile itself.  The problem is that I didn't offset what I was asking for from the fractal.  Where I should have asked for the range starting at (-1,-1) I was asking for (0,0).

Anyway.

As you know, recently I've been working on refactoring how the trees were generated.  The existing released engine (hence forth known as 'the old engine'), does this as a last step of terrain generation.  The terrain is already generated, caves are carved out, and grass and plantable blocks figured out... and then I just plop the trees down in the tile based on a selection algorithm.  As noted elsewhere, there were some problems with this approach... trees couldn't cross tile boundaries, I had no idea where I'd actually placed trees: useful information for other things, etc..

The new approach figures out where the trees should be for the whole "node" (1024x1024 space) and just selects the right ones for tile generation.  They can cross boundaries because that tree will just get rendered in both tiles.

This is trickier than it sounds because the trees need to know about the caves.  A height map and terrain classification isn't enough.  So I had to go back to my cave algorithm and create an intermediate form where it carves the surface caves and gorges out of the height map... now the trees know where they should properly go.  It also now takes a bit of time to generate a node but that was inevitable.  All of that stuff is cached anyway and mostly speeds up all other tile generation.  Towns, buildings, and roads should easily double the time it takes to generate node descriptors but should only minimally impact tile generation.

So, anyway, I refactored the caves accordingly, modified the tree generator to generate a node-wide descriptor of where all of the trees are (approximately 15,000 trees in a node, by the way) and I was working on the tile-level generation.  All of it was finally coming together.

Then I noticed some of my trees were floating in the air.

Investigating, it looked like it was always a case where there was a raised area to the west or north... more specifically, west and north.  My previous issue came back to haunt me.

So now the fractal is universally located across the board... that means your existing worlds may end up with a slight seam (if you happen to notice it) between already generated and ungenerated parts.  Hopefully that's the only other change other than the trees.  ("I am altering the deal.  Pray I don't alter it further." http://www.youtube.com/watch?v=jsW9MlYu31g)

As an aside, this also fixed a little glitch, one of those little details that only I might notice, where the far-horizon terrain occasionally seemed to be one block off from the paging in real terrain...
Logged
FutureB
Donators
Hero Member
***
Posts: 512


RAWR


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

Good work paul Tongue cant wait to have a play with the new engine :]
Logged


Say the opposite of these words:
1)Always.
2)Coming.
3)From.
4)Take.
5)Me.
6)Down.
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #2 on: February 21, 2013, 12:01:00 AM »

Good work paul Tongue cant wait to have a play with the new engine :]

I hope to have a "friends of mythruna" version ready to play with in a few days.  It won't be fully functional or anything but enough to play with the new menus and fly around worlds and stuff.  Mostly I'm interested in performance comparisons and whether the new shaders work.

I'd do it now but when loading a world for the first time there is a long pause... like long enough to think the game is broken... because I haven't put in a loading progress bar or anything yet.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #3 on: February 21, 2013, 12:03:31 AM »

Minor panic attack just now:
-ran game
-performance was pretty bad
-thinks me, "Crap... what could I have done to halve my performance?"
-thinks me, "Clip is only 128, right?"

...um... no.

So, interesting fact: the new version of the engine remembers your clip setting from one run to the next.

This would be less funny if I hadn't been hit by this exact same panic at least three times now. Tongue
Logged
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #4 on: February 21, 2013, 11:23:34 AM »

Great job, Paul, keep up the good work and don't scare yourself so much Wink
Logged
Moonkey
Hero Member
*****
Posts: 1587

This is probably a picture.


View Profile
« Reply #5 on: February 21, 2013, 02:21:43 PM »

Pray you don't alter your clip further.
Logged

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



View Profile
« Reply #6 on: February 21, 2013, 09:11:47 PM »

Will the game with the new engine have any conflicts with the old engines worlds, like say your servers world?
Logged

"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #7 on: February 21, 2013, 09:43:18 PM »

Will the game with the new engine have any conflicts with the old engines worlds, like say your servers world?

No, except newly generated areas will be one block "shifted" from already generated areas.  Mostly this will be unnoticeable.

I strive for backwards compatibility... indeed, I already have a 100 worlds of my own with various things I've built that I'd like to go back and extract some day.  Building ideas, ships, monkey tree houses, barns, etc..
Logged
belgariad87
Donators
Hero Member
***
Posts: 507


RPG player for life


View Profile
« Reply #8 on: February 22, 2013, 05:11:09 AM »

Thanks for the update. Make sure to leave some testing for us  Wink

I strive for backwards compatibility... indeed, I already have a 100 worlds of my own with various things I've built that I'd like to go back and extract some day.  Building ideas, ships, monkey tree houses, barns, etc..
monkey tree houses seem interestingly specific... and fun  Grin
Logged

Specs for future reference:
Windows 7 64bit ; Intel Quad Core ; 8GB RAM ; AMD Radeon HD 6800 ; TB HD
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #9 on: February 22, 2013, 01:55:23 PM »

monkey tree houses seem interestingly specific... and fun  Grin

I think I posted pictures of those a long time ago.  I was playing with building a simian style house in a tree... theory, architecture, etc..  Kind of neat looking I thought.
Logged
Moonkey
Hero Member
*****
Posts: 1587

This is probably a picture.


View Profile
« Reply #10 on: February 22, 2013, 06:09:44 PM »

Something similar to huts with bridges connecting them through the trees?
Logged

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



View Profile
« Reply #11 on: February 22, 2013, 07:04:06 PM »

I found the picture on the facebook photo feed.  Not the best pic, though.
Logged
Teknonick
Sr. Member
****
Posts: 438


View Profile
« Reply #12 on: February 23, 2013, 03:15:16 PM »

I found the picture on the facebook photo feed.  Not the best pic, though.

Oh wow. That would be neat for houses in areas with SMALL (Hint Hint Hint Hint Hint I SAID HINT!) trees. Hmm... Do you plan on (HINT!!!!!!) making (NOT A HINT!) bigger trees? Like ones that would be 2x2 or even 5x5 blocks around? THEN you could have these HUUUUGE trees! And if they were close enough together, then you could have whole CITIES on top of the trees! Oh, what about Thick Leaves? Thick enough for people to walk on and build on! Ohhh, so many ideas!
Logged
belgariad87
Donators
Hero Member
***
Posts: 507


RPG player for life


View Profile
« Reply #13 on: February 24, 2013, 08:27:05 AM »

Oh wow. That would be neat for houses in areas with SMALL (Hint Hint Hint Hint Hint I SAID HINT!) trees. Hmm... Do you plan on (HINT!!!!!!) making (NOT A HINT!) bigger trees? Like ones that would be 2x2 or even 5x5 blocks around? THEN you could have these HUUUUGE trees! And if they were close enough together, then you could have whole CITIES on top of the trees! Oh, what about Thick Leaves? Thick enough for people to walk on and build on! Ohhh, so many ideas!
[/quote]

i agree, this would just be absolutely stunning. maybe not a whole forest of 5x5's but maybe near the center of the 2x2 mega forest? and the 5x5 is the main tree where the simian nobility live. or, since your making a huge tree anyway, maybe make the nobility tree 20x20 and have it mostly hollowed out so that the nobility can live there, and the rooms in the tree will be the equivalent of mansions to us.

I think I posted pictures of those a long time ago.  I was playing with building a simian style house in a tree... theory, architecture, etc..  Kind of neat looking I thought.

once you start jumping back into lore and races you will see me a whole lot more on here  Wink i also think its a good idea to have a fan contest for a new race, and you can pick the best race of the entries to put into the game. i have seen it happen multiple times and this is the only game i reaaaally want to input some ideas!
Logged

Specs for future reference:
Windows 7 64bit ; Intel Quad Core ; 8GB RAM ; AMD Radeon HD 6800 ; TB HD
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #14 on: February 24, 2013, 10:06:39 AM »

The 8, I mean 7 races are kind of set in stone for the main game.  Maybe I'll feel differently about it when tons of money is rolling in and I have a team of artists... but as it is, a race represents many many months of work on its own.  And I haven't implemented even one yet.  Smiley

Thicker trees are hard because the geometry gets messy.  I want to do it on some level but there are a bunch of issues.  The new engine is more capable of doing it than the old was, though.
Logged
Pages: [1] 2 3 4
  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!