Teaser: sloped blocks…

Some teaser screen shots of one of the new features that will be in this Monday’s weekly build.













Also, this Monday, a working world database… which is why I don’t mind investing time in a few decent buildings for screen caps. :slight_smile:

4 Likes

I didn’t know that blocks were … so powerful :slight_smile:

Oh my, that gives me an immediate role play vibe. Houses, out here? Who are in them? Are they friendly? Can I ask for a night of shelter before I continue my journey at dawn? Exciting!

Are the slopes variable or only 45 degree? And if variable, do you allow for angles bigger than 45 degree?

I had an idea that I think would be hard to implement and probably also take lots of fps. But I was thinking about some algorithm that made every block round based on the adjacent blocks.



Like in this image: http://i.imgur.com/yag0A.jpg

The game now looks like A. It would look really cool if the blocks were automatically smoothed like B. Or if it was like C it wouldn’t look like blocks anymore. But as i said it would be hard to program and take lots of fps.

@durnadal The blocks are only 45 degrees. If I wanted different angles, I would have to make different block types… or at least encode the slope into the index for the block type.



@WASD It’s not impossible but it would significantly increase the complexity of the geometry generation to do this automatically from hard-angled tiles. That being said, two weeks ago I would have told you it was impossible, but with each new pass through the generation code it gets smarter about the blocks around it. It seems simple enough to draw blocks that aren’t a full cube but I can tell you it is at least 10 times more complicated than straight cubes given the optimizations involved…

erlend_sh said:
Oh my, that gives me an immediate role play vibe. Houses, out here? Who are in them? Are they friendly? Can I ask for a night of shelter before I continue my journey at dawn? Exciting!


Yeah, now I built these by hand, of course but what I'm really doing is playing with different building styles to see what works and what doesn't or what parts can be interchanged from building to building. The ultimate goal is to have a set of templates that can be used to randomly generate places.

The neat thing is that inn has a kitchen on the first floor with space for a tavern, four private rooms on the second floor, and a common flop area (in the loft under the roof) inside it. I didn't snap pics of those because they look pretty lame without furniture and because it doesn't show off anything new. :)
1 Like

Oh… and endless terrain will be in Monday’s build as well. Just got that working and walked about a mile before getting tired.

1 Like

You say endless terrain, but i’m also reading that your terrain is in a database now. How do you bypass that seeming contradiction? Only storing changes?



Also the lights in the houses; I assume you’re using point lights, but wont the game slow to a standstill if player start putting down lights everywhere?



Nice work sofar :slight_smile:

durandal said:
You say endless terrain, but i'm also reading that your terrain is in a database now. How do you bypass that seeming contradiction? Only storing changes?

"Endless" can have multiple meanings.. Here I guess the real end is the capacity of the database and the detail of the actually discovered world. The more imminent problems with going into one direction for half a day is simply the accuracy of numbers in computers. So you cannot translate a spatial to an infinitely big location, you have to work out a way where you don't need too high values to describe the ongoings to the computer.

Great work pspeed, this really starts to remind me of lego.. But in a totally awesome unprecedented way :D

Terrain generation:

Without going into too much detail, the terrain is generated as needed using a stack of fractal equations. Basically, for any point on the “world”, I can determine elevation, stratification, etc… So, if I check the database and there is no terrain then I generate a block. Currently, generating a new block is still slightly faster than reading one from the DB (which only takes a millisecond or so on my machine)… so I only store the changes the user makes. (That also helps with testing tweaks to the generation.)



So you literally can pick a direction and walk in that direction until you run out of bits in the 32 bit coordinates… which by my math is about 2 billion meters. Which at 3 meters per second (current walking speed in the game) would take something like 22 years… in real life time. If you change a block every 32 meters then you’ll run out of disk space at some point. Though, even then that may only take 700 gig of space on disk or so given the current storage. While not “endless” in the purely literal sense, it is in the practical sense. :slight_smile:



All of that will get a little more complicated when the morphology is more than just trees (villages, castles, etc… and caves are currently giving me some trouble)… but not much, I think.



re: lighting

Again, without giving too much away, the light is not at all point lighting. Sunlight and ‘local light’ are baked into the world geometry. So the entire expense is placing the light because I have to propagate that light out through the cells of the world. However, once that’s done it’s free… well, as free as not having it at all. The shaders obviously do a little more work than a basic shader since they have to reconcile the lighting, but not much more.



The lighting was easily the single hardest thing to get right in the whole engine. Play with it. When it doesn’t mess up it’s pretty nifty… (and the current mess-ups are known limitations that I’m leaving in for a while for completely unrelated reasons.) It’s one of those tricks that looks even better than it actually is.



Hopefully that cleared some things up. :slight_smile:

be careful. floats do not have accuracy all the way till they end of their number set. in my testing it starts breaking down after the 6th or 7th decimal, cant remember. Might want to check that out so you dont get into too much trouble.

pspeed said:
So you literally can pick a direction and walk in that direction until you run out of bits in the 32 bit coordinates... which by my math is about 2 billion meters.

Wouldn't your physics simulation start to behave strange before that? (no nagging)
normen said:
Wouldn't your physics simulation start to behave strange before that? (no nagging)


It depends on which physics you are talking about.

...the player never really leaves the same 320x320x160 meter cube. The world moves around him. (which I think covers @Eggsworth's floating point issues, too... since world space is 'int' and only local space is done with floats.) I have some experience with whole earth databases down to the local centimeter or so and I'm starting to realize I've picked up a whole bag of tricks that I take for granted.

Now, the _rest_ of the world gets tricky to simulate once the player walks by it... presuming I were crazy enough never to 'despawn' anything. :) But I'll cross those lions, tigers, and villagers when I get to them. Got a handful of ideas just no world to put them in yet.

...not to mention that I suspect it will be pretty rare for the average player to explore more than a few square miles. That's a lot of ground to cover.

If you move the world around the player you won’t have floating point issues so fast. (I actually do the same in my space game, but instead of int’s I use doubles for all servercalculations, the client then handles the offset for rendering locally)

pspeed said:
I have some experience with whole earth databases down to the local centimeter or so and I'm starting to realize I've picked up a whole bag of tricks that I take for granted.

Yeah, the standard pitfalls seem to be nonexistent for you ;)
normen said:
Yeah, the standard pitfalls seem to be nonexistent for you ;)


Oh, they were there... when I first encountered them on previous projects. :):

It's all of the non-standard pitfalls waiting to pounce that concerns me now.

And to those who’ve bravely followed the discussion this far, I want to add that while I never save anything until the user modifies the world now that will likely (99% chance) change with random caves, castles, towns, and dungeons. These naturally cross-block elements will be nearly impossible to represent with any kind of formula, so when they are generated (haven’t decided what event triggers this yet) they will be stored.



Also, after working on mineral strata last night, the block generation is slow enough that I may start storing them upon creation even for tomorrow’s test build.

EmpirePhoenix said:
If you move the world around the player you won't have floating point issues so fast. (I actually do the same in my space game, but instead of int's I use doubles for all servercalculations, the client then handles the offset for rendering locally)


Yeah, it's one area where block-worlds are really convenient since the entire structure of the world is on whole numbers. They make up for it in other ways. ;)

This seems to bring more fun playing with. I will also let my kids to play this surely they like simple role playing games like this. It is actually similar to a game from http://www.igamesforgirls.com/seasonal which they always play.