Lord Ba'al
Supreme Deity
Posts: 6,260
Pledge level: Half a Partner
I like: Cats; single malt Scotch; Stargate; Amiga; fried potatoes; retro gaming; cheese; snickers; sticky tape.
I don't like: Dimples in the bottom of scotch bottles; Facebook games masquerading as godgames.
Steam: stonelesscutter
GOG: stonelesscutter
|
Post by Lord Ba'al on Feb 28, 2014 23:06:24 GMT
So my plan is to try to make a game world where everything is made from lego. It seems like a good idea to start with the terrain. Now I was thinking, what if I wanted to make an Earth sized world relative to the lego size, how many tiles would I need.
I measured the height of a lego doll which turns out to be 40,6 millimeters. Taking an estimated average human height of about 180 centimeters and dividing that by 40,6 I arrived at the conclusion that 1 millimeter in lego world corresponds to about 4,43 centimeters in the real world. In other words the scale is about 1 : 44,3. But since I made an estimate for the average height of a human being let's say it's 4,5 centimeters. A 1x1 tile measures about 8 by 8 millimeters which then equates to 36 by 36 centimeters or 0,1296 square meters in the real world.
Wikipedia gives the surface area of the earth to be about 510072000 square kilometers. That would be 510072000000000 square meters. The amount of lx1 lego tiles needed to represent an earth sized planet in lego world would then be 510072000000000 divided by 0,1296. The answer to that equation is 3935740740740741 tiles. Almost 4 quadrillion. And that is just the surface area. Nevermind considering emulating a piece of the Earth's crust.
I foresee a slight problem with my plan.
|
|
Lord Ba'al
Supreme Deity
Posts: 6,260
Pledge level: Half a Partner
I like: Cats; single malt Scotch; Stargate; Amiga; fried potatoes; retro gaming; cheese; snickers; sticky tape.
I don't like: Dimples in the bottom of scotch bottles; Facebook games masquerading as godgames.
Steam: stonelesscutter
GOG: stonelesscutter
|
Post by Lord Ba'al on Feb 28, 2014 23:19:58 GMT
Furthermore, considering the Earth's highest and lowest points are at about 8 kilometers above and 10 kilometers below sealevel, there is an 18 kilometer difference between them. The height of a flat lego tile ( like the one I rendered in a different thread) equates to about 14,4 centimeters in the real world. This means that to be able to emulate the Earth's differences in altitude in lego world you would have to have 125000 distinct height values at your disposal. In other words, if you start in the lego Mariana Trench you would have to stack 125000 tiles on top of eachother to reach the same altitude as the top of the lego Mount Everest. A usual way to model altitude differences in a game is by way of a heightmap. Often this is a greyscale image where each shade of grey is matched to a specific altitude. Generally there are 256 shades of grey possible in such an image. Although it should be possible to use a different method of implementing a heightmap that has more potential values, once again I detect a problem.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Mar 1, 2014 0:58:42 GMT
125000 is close to 128000 that is basicly 128^1000 which is 256*500 that means, for each 1 value in greyscale, you can have 500 blocks. With a bit of noise, and having a certain Xx,Yy,Zz format per greyscale level, it's not impossible.
As for surface area, that's all you need in a game. Generally, you don't put blocks under your 'top soil'. It doesn't get rendered anyway. At at the places it does, you 'cheat' your engine, by only stopping the surface, and place a model. (That's how almost ALL games do caves, holes, ect.)
And it's not like you have the game render those four quadrillion bits at the same time, generally you use LoD to group things together, or have a view distance.
It's more about choices, do you find it important, to place each block yourself, or are you fine in having an engine do it for you, based on images, bump-mapping, tessellation, and other 'cheats'.
You're basicly trying to create a minecraft world, but then lego.
|
|
Lord Ba'al
Supreme Deity
Posts: 6,260
Pledge level: Half a Partner
I like: Cats; single malt Scotch; Stargate; Amiga; fried potatoes; retro gaming; cheese; snickers; sticky tape.
I don't like: Dimples in the bottom of scotch bottles; Facebook games masquerading as godgames.
Steam: stonelesscutter
GOG: stonelesscutter
|
Post by Lord Ba'al on Mar 1, 2014 1:48:17 GMT
Indeed I am. Right now I'm considering storing Tile objects in a 3 dimensional array. I am thinking about procedurally generating the world (which will proof to be a huge challenge no doubt) and storing the whole thing in said array. Then I would render only the top layer plus some tiles that are underneath the ones that are next to ones where the difference in height is more than one tile.
From those that I mentioned I would only have to render the ones that are actually on screen. But when I pan or scroll around or zoom out the engine would have to be fast enough to retrieve the necessary information from the array. I don't yet know if I will run into trouble here but I expect it won't be easy. At this point it is all still ideas in my head so I'm still a loooong way away from getting to that point.
I think in Java the array should be defined as...
Tile[][][] coordsArray = new Tile[x][y][z];
...x, y and z being the maximum dimensions that the coordinates will reach.
I have no idea if it is even possible to create an array of 62735482 by 62735482 by 125000 but that is apparently what it would take in order to be able to emulate an Earth sized world. And that is assuming you don't want to go down into the Mariana Trench and start digging because you would end up at negative z coordinates and that would be a problem for the array. Also I would have to find a way to store the array on disc somehow so it would be possible to save and load it. That would probably be a challenge as well.
The solution may lie in creating a lot of smaller arrays that together combine into the larger world as needed. But as I said these are all just thoughts spinning through my head right now. I would love to hear from people who have any thoughts on this stuff. In fact right now I'm starting to wonder how all this relates to the way Godus is built up. If ever I had a question for the devs it would be what they thought of all that stuff I just said.
|
|
jmoz
Wannabe
Posts: 22
|
Post by jmoz on Mar 1, 2014 5:23:11 GMT
Don't know much about programming but I think umbralite is saying, you can't expect to be able to define the whole world all at once. Instead you should designate, with respect to what you're doing which is an array, the array to only be defined for the world visible from a character' point of view in the game. This is gonna be badly worded and just read this loosely:
Say a character's field of vision is 10x10x10, so you should designate the array to be that size and redefine values in the array when the character moves so that it's a new 10x10x10 cell. Essentially allocating enough array elements (designating enough space) as needed for the purpose of the game internal "eye"/"vision" rather than trying to predefine the entirety of the world.
|
|
Lord Ba'al
Supreme Deity
Posts: 6,260
Pledge level: Half a Partner
I like: Cats; single malt Scotch; Stargate; Amiga; fried potatoes; retro gaming; cheese; snickers; sticky tape.
I don't like: Dimples in the bottom of scotch bottles; Facebook games masquerading as godgames.
Steam: stonelesscutter
GOG: stonelesscutter
|
Post by Lord Ba'al on Mar 1, 2014 5:45:50 GMT
Don't know much about programming but I think umbralite is saying, you can't expect to be able to define the whole world all at once. Instead you should designate, with respect to what you're doing which is an array, the array to only be defined for the world visible from a character' point of view in the game. This is gonna be badly worded and just read this loosely: Say a character's field of vision is 10x10x10, so you should designate the array to be that size and redefine values in the array when the character moves so that it's a new 10x10x10 cell. Essentially allocating enough array elements (designating enough space) as needed for the purpose of the game internal "eye"/"vision" rather than trying to predefine the entirety of the world. Yes I agree with that but the thing is in my opinion the whole world has to be predefined beforehand. You can't just generate a new 10 by 10 by 10 block on the fly. What if the character moves forward so a new block is generated, then moves backwards only to find the place he just came from is gone and has been replaced with something entirely new.
|
|
jmoz
Wannabe
Posts: 22
|
Post by jmoz on Mar 1, 2014 6:02:19 GMT
Put it into a form that takes less space, into some text file maybe? And have some retrieval process that retrieves the appropriate block and unpacks it to have the appropriate meaning. And storing old blocks as well, or blocks you've moved on from the current 'field of vision', so to speak.
|
|
Lord Ba'al
Supreme Deity
Posts: 6,260
Pledge level: Half a Partner
I like: Cats; single malt Scotch; Stargate; Amiga; fried potatoes; retro gaming; cheese; snickers; sticky tape.
I don't like: Dimples in the bottom of scotch bottles; Facebook games masquerading as godgames.
Steam: stonelesscutter
GOG: stonelesscutter
|
Post by Lord Ba'al on Mar 1, 2014 6:24:49 GMT
Well I think you would want to have a larger field in active memory than just what can be seen on screen. Otherwise the number of read operations would probably slow down the process significantly. I guess it all comes down to finding the right balance.
|
|
Dawnreaver
Junior Apprentice
Diablo III - Reaper of Souls, Monster Hunter 3 Ultimate, Thief
Posts: 66
Pledge level: Partner
|
Post by Dawnreaver on Mar 1, 2014 8:31:05 GMT
Hm ... well you can have the whole world is pre defined you can have the numbers in the background and just display what is shown on the screen ... OR you work with absolute massive amounts of LOD ... literally
|
|
Lord Ba'al
Supreme Deity
Posts: 6,260
Pledge level: Half a Partner
I like: Cats; single malt Scotch; Stargate; Amiga; fried potatoes; retro gaming; cheese; snickers; sticky tape.
I don't like: Dimples in the bottom of scotch bottles; Facebook games masquerading as godgames.
Steam: stonelesscutter
GOG: stonelesscutter
|
Post by Lord Ba'al on Mar 1, 2014 12:28:17 GMT
I've seen this LOD thing pass by several times now. Can someone please explain that part? Yeah I know, Google. But I'm lazy. Plus I just woke up after a very very, very short night.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Mar 1, 2014 13:07:00 GMT
|
|
Lord Ba'al
Supreme Deity
Posts: 6,260
Pledge level: Half a Partner
I like: Cats; single malt Scotch; Stargate; Amiga; fried potatoes; retro gaming; cheese; snickers; sticky tape.
I don't like: Dimples in the bottom of scotch bottles; Facebook games masquerading as godgames.
Steam: stonelesscutter
GOG: stonelesscutter
|
Post by Lord Ba'al on Mar 1, 2014 13:19:43 GMT
Ah off course! Well then here's a question. How many vertices can one have on the screen at once and still have a smooth experience when considering for instance the average present day tablet?
|
|
Dawnreaver
Junior Apprentice
Diablo III - Reaper of Souls, Monster Hunter 3 Ultimate, Thief
Posts: 66
Pledge level: Partner
|
Post by Dawnreaver on Mar 1, 2014 14:32:02 GMT
Well We are working with Unity 3D. For mobile platforms of the current generation (excluding the quad core models that came out recently) you are looking on about 50.000 - 60.000 Vertecies. But the biggest issues really are draw calls. If you have someone who has the know how for mobile optimization you should be good though On the other hand, the first Unreal Engine Techdemo for iPhone "Unreal Citadel" had about 120.000 vertecies on one of the scnenes ... but then again there wasn't a lot going on ... so yeah ... it's a bit of a specialized issue to deal with
|
|
|
Post by julians on Mar 3, 2014 6:57:21 GMT
You also should think about how big the smallest object will be. If you're an average human, will you really want to manipulate 1x1 lego blocks at a time? Will you be able to see a difference between 1 and 2 blocks? That's one tiny object for a game. I think anything smaller than a coke can is too small and even that might be too small.
|
|
Lord Ba'al
Supreme Deity
Posts: 6,260
Pledge level: Half a Partner
I like: Cats; single malt Scotch; Stargate; Amiga; fried potatoes; retro gaming; cheese; snickers; sticky tape.
I don't like: Dimples in the bottom of scotch bottles; Facebook games masquerading as godgames.
Steam: stonelesscutter
GOG: stonelesscutter
|
Post by Lord Ba'al on Mar 3, 2014 14:04:30 GMT
You also should think about how big the smallest object will be. If you're an average human, will you really want to manipulate 1x1 lego blocks at a time? Will you be able to see a difference between 1 and 2 blocks? That's one tiny object for a game. I think anything smaller than a coke can is too small and even that might be too small. I made some calculations which led me to conclude that a 1x1 flat lego tile would measure about 36 by 36 by 14,4 centimeters if it where scaled up into the real world. So that is significantly larger than a coke can. I estimated a scale factor 1:45. This is not to say that the 1x1 lego piece would be the smallest object in the game. But since it is the smallest lego piece that you can use to build things with I chose that to represent a terrain tile.
|
|
Dawnreaver
Junior Apprentice
Diablo III - Reaper of Souls, Monster Hunter 3 Ultimate, Thief
Posts: 66
Pledge level: Partner
|
Post by Dawnreaver on Mar 3, 2014 15:43:08 GMT
|
|
Lord Ba'al
Supreme Deity
Posts: 6,260
Pledge level: Half a Partner
I like: Cats; single malt Scotch; Stargate; Amiga; fried potatoes; retro gaming; cheese; snickers; sticky tape.
I don't like: Dimples in the bottom of scotch bottles; Facebook games masquerading as godgames.
Steam: stonelesscutter
GOG: stonelesscutter
|
Post by Lord Ba'al on Mar 3, 2014 16:30:58 GMT
Yes, like I said, a flat 1x1. I guess I didn't consider the round ones. Little polygon munchers they'd be.
|
|
Dawnreaver
Junior Apprentice
Diablo III - Reaper of Souls, Monster Hunter 3 Ultimate, Thief
Posts: 66
Pledge level: Partner
|
Post by Dawnreaver on Mar 3, 2014 16:51:31 GMT
I do beg your pardon good Sir! My dazed mind escaped this detail...
|
|
Lord Ba'al
Supreme Deity
Posts: 6,260
Pledge level: Half a Partner
I like: Cats; single malt Scotch; Stargate; Amiga; fried potatoes; retro gaming; cheese; snickers; sticky tape.
I don't like: Dimples in the bottom of scotch bottles; Facebook games masquerading as godgames.
Steam: stonelesscutter
GOG: stonelesscutter
|
Post by Lord Ba'al on Mar 3, 2014 16:52:34 GMT
No worries. That round piece might actually give me ideas.
|
|
ghosrath
Rookie
Posts: 40
Pledge level: none (thankfully)
I like: Games: RTS, RPG, CityBuilders, Ingress (true enlightenment)
Music: Metal
|
Post by ghosrath on Mar 18, 2014 18:42:51 GMT
Take a good look at minecraft. Chunks of land are the way to go
Verstuurd vanaf mijn GT-N7100 met Tapatalk
|
|