Statistics | We have 1675 registered users The newest registered user is dejo123
Our users have posted a total of 30851 messages in 1411 subjects
|
Who is online? | In total there are 12 users online :: 0 Registered, 0 Hidden and 12 Guests None Most users ever online was 443 on Sun Mar 17, 2013 5:41 pm |
Latest topics | » THIS FORUM IS NOW OBSOLETE by NickTheNick Sat Sep 26, 2015 10:26 pm
» To all the people who come here looking for thrive. by NickTheNick Sat Sep 26, 2015 10:22 pm
» Build Error Code::Blocks / CMake by crovea Tue Jul 28, 2015 5:28 pm
» Hello! I can translate in japanese by tjwhale Thu Jul 02, 2015 7:23 pm
» On Leave (Offline thread) by NickTheNick Wed Jul 01, 2015 12:20 am
» Devblog #14: A Brave New Forum by NickTheNick Mon Jun 29, 2015 4:49 am
» Application for Programmer by crovea Fri Jun 26, 2015 11:14 am
» Re-Reapplication by The Creator Thu Jun 25, 2015 10:57 pm
» Application (programming) by crovea Tue Jun 23, 2015 8:00 am
» Achieving Sapience by MitochondriaBox Sun Jun 21, 2015 7:03 pm
» Microbe Stage GDD by tjwhale Sat Jun 20, 2015 3:44 pm
» Application for Programmer/ Theorist by tjwhale Wed Jun 17, 2015 9:56 am
» Application for a 3D Modeler. by Kaiju4u Wed Jun 10, 2015 11:16 am
» Presentation by Othithu Tue Jun 02, 2015 10:38 am
» Application of Sorts by crovea Sun May 31, 2015 5:06 pm
» want to contribute by Renzope Sun May 31, 2015 12:58 pm
» Music List Thread (Post New Themes Here) by Oliveriver Thu May 28, 2015 1:06 pm
» Application: English-Spanish translator by Renzope Tue May 26, 2015 1:53 pm
» Want to be promoter or project manager by TheBudderBros Sun May 24, 2015 9:00 pm
» A new round of Forum Revamps! by Oliveriver Wed May 20, 2015 11:32 am
|
|
| Planetary coordinates | |
|
+3Invader Commander Keen roadkillguy 7 posters | |
Author | Message |
---|
~sciocont Overall Team Lead
Posts : 3406 Reputation : 138 Join date : 2010-07-06
| Subject: Re: Planetary coordinates Sun Sep 05, 2010 6:59 pm | |
| It's good to use for distance away fron the player, though, right? | |
| | | roadkillguy Experienced
Posts : 528 Reputation : 17 Join date : 2010-08-25 Age : 31 Location : Rhode Island
| Subject: Re: Planetary coordinates Sun Sep 05, 2010 7:09 pm | |
| Now that I re-read what uteen said, that would be much more suited by a blur effect. What I've written is for terrain in the distance.
Also, I've been able to put together a simple grid, I'm now working on the subdivisions. | |
| | | Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: Planetary coordinates Mon Sep 06, 2010 11:24 pm | |
| - roadkillguy wrote:
- For simplicity's sake I was thinking of something like the following:
Not necessarily like a quadtree, just sectioned LOD. It may prove to not work if the planet is VERY large, but for this game I was thinking spore sized planets or less.
It would work by having nodes that contain two-dimensional arrays. To get the vertices, we render the initial grid, and then add more vertices depending on the detail level.
It works in my head anyway
EDIT: Here's some pseudo-code.
- Spoiler:
Here's something I thought of: It's not quite a quadtree, but It's the same idea. We have nodes. Each node has a single 2D array. This array will contain vertex numbers for when we face the side of the cube. First, we create a two-dimensional array of vertices based on the number of nodes. (In this case 16x16) - Code:
-
0 1 2 3 4 + + + + + 5 6 7 8 9 + + + + +
+ + + + +
+ + + + +
+ + + + + We then set up the nodes. There will be 16, and they will share edges. - Code:
-
NodeList[0].vertices = [[0,1],[5,6]]; NodeList[1].vertices = [[1,2],[6,7]]; Sharing and caring Anyway, it proceeds like this untill all the nodes have their arrays updated. Then, we apply the subdivision levels. - Code:
-
1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + To update the vertices yet again, it will go something like this: - Code:
-
//PHP AND ACTIONSCRIPT HAHA. THIS WILL NOT WORK, BUT CONCEPTUALLY IT WILL -WE MAY HAVE TO USE LUA FOR THE SPLICES AND SUCH foreach(NodeList as index => i) { //SPLICE VALUES INTO THE TOP AND BOTTOM ROWS NodeList[0].vertices[0].splice(1, 0, 16); NodeList[0].vertices[1].splice(1, 0, 17); //SPLICE VALUES INTO THE MIDDLE -IN THIS CASE WE ONLY HAVE TO DO ONE ROW. NodeList[0].vertices.splice(1, 0, [18, 19, 20]); } This will be done for every node. We'll need someone to write a super-for-loop to do this well. The method by which we've updated the vertices should make facing the box very simple. We go through each node and generate faces like this: - Code:
-
+--+--+ |\ |\ | | \| \| +--+--+ |\ |\ | | \| \| +--+--+ (Node 0) It should be easy due to the two-dimensional array. Whe we face the vertices, we output them to a final array, and BAM. We have a LOD'd mesh.
I've been thinking about this quite a bit during lectures, and this is pretty much what we need. We need a base detail level for environmental simulations such as the discussion in another thread about water simulations and erosion and whatnot. You have a base detail level as an array, lets say, a meter by a meter squared, and then you interpolate that into a more detailed mesh. Otherwise when we get to implementing Navier-stokes, the whole world asplodes. Navier-stokes algorithms on a randomly detailed quadtree is INSANE. | |
| | | Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: Planetary coordinates Mon Sep 06, 2010 11:25 pm | |
| - Commander Keen wrote:
- Planets should be as scalabe as possible, because right now we can't just see what size will have the best gameplay/performance ratio. Limiting it to Spore size or less might lead us into problems later.
Yeah thats easy. Change the constant, change the planet size. | |
| | | Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: Planetary coordinates Mon Sep 06, 2010 11:26 pm | |
| - ~sciocont wrote:
- roadkillguy wrote:
- I'm sure it will work for what we're trying to do.
Again, experimentation is the best way to figure this out. AFAIK, that is what roadkillguy is doing now | |
| | | roadkillguy Experienced
Posts : 528 Reputation : 17 Join date : 2010-08-25 Age : 31 Location : Rhode Island
| Subject: Re: Planetary coordinates Mon Sep 06, 2010 11:31 pm | |
| Recently I've actually been thinking about using perlin noise to generate the terrain. Then, theoretically, we could get as detailed as we want letting the equation generate the terrain.
Navier–Stokes? Fluid dynamics right? That sounds pretty crazy... I have to admit I've never made or played a game where that was implemented.
| |
| | | Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: Planetary coordinates Mon Sep 06, 2010 11:41 pm | |
| - roadkillguy wrote:
- Recently I've actually been thinking about using perlin noise to generate the terrain. Then, theoretically, we could get as detailed as we want letting the equation generate the terrain.
Navier–Stokes? Fluid dynamics right? That sounds pretty crazy... I have to admit I've never made or played a game where that was implemented.
It's quite interesting. Okay, more detail: you have a set of base arrays: planetgrid[][] These are all cells of even size, say 1 metre. and take up a space of say 100 Metres. Then each 100 metre grid is stored on a bunch of nodes, which are attached to a node the size of the cube face, or something similar. We apply perlin noise to the grids we are working with, to get our planet layout. This grid is further subdivided to create our detailed mesh close up. For rendering far away, we simply take every second, fourth, or eight value and so on. This way we have a consistent size for the terrain simulations and we can still LOD to our heart's content. We could cut it a thousand ways, having only one grid for each cube face, and so on, but this is a general idea. We could also have 100metre grids stored on a quadtree that gets leafed with the average height of the game grid or something. P.S. wow. I accidentally edited your post. Still getting used to being a mod suddenly :/ | |
| | | Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: Planetary coordinates Mon Sep 06, 2010 11:45 pm | |
| See, the problem with generating top down if we want dynamic terrain is just that. you can't have dynamic terrain.
So... We can still generate procedurally, but we have to go bottom up. | |
| | | roadkillguy Experienced
Posts : 528 Reputation : 17 Join date : 2010-08-25 Age : 31 Location : Rhode Island
| Subject: Re: Planetary coordinates Tue Sep 07, 2010 12:16 am | |
| That's true, and it's actually coming along fairly well. I have an ogre head showing up, along with a nice grid of algorithmically generated faces.
The only thing I'm worried about is merging the two. If the current project is a spline editor, and I'm working on an entire planet It may be a while until we merge the two. | |
| | | Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: Planetary coordinates Tue Sep 07, 2010 12:32 am | |
| - roadkillguy wrote:
- That's true, and it's actually coming along fairly well. I have an ogre head showing up, along with a nice grid of algorithmically generated faces.
The only thing I'm worried about is merging the two. If the current project is a spline editor, and I'm working on an entire planet It may be a while until we merge the two. Not really. It's segregated quite a bit. most everything is implemented as a module. The renderer is part of the parent engine, so that we have to heavily modify. But the terrain output merely needs to be wrtitten into a module class, and implement the load unload enable disable and step functions, and bam you have a module. Modules work like this: a standard module that only implements load unload enable and disable functions can plug in as a dll (i'm currently working on the dll plugging code) and is managed automatically by the module manager within the parent engine. Any custom modules can be loaded manually from the engine and compiled directly into it. EDIT: CONTINUED: all modules get passed a pointer to an assetmanager class, which is where all assets (game resources, such as game objects, fonts, etc.) get stored. Ill include a versioning system as well so that any dll compiled with the assetmanager header will contain the assetmanager version, and when loading the dll the modulemanager will check for compatability with the current assetmanager and possibly providing an alternate interface in the case that there is a mismatch.
Last edited by Bashinerox on Tue Sep 07, 2010 4:55 am; edited 1 time in total | |
| | | Noitulove Regular
Posts : 237 Reputation : 0 Join date : 2010-07-09
| Subject: Re: Planetary coordinates Tue Sep 07, 2010 2:23 am | |
| Something-of-a-bump.
What I'm getting from this is that as you get closer to the planet, the grid gets smaller and smaller; thus, if you have a 4 x 4 grid that splits (quadtree), one of those four squares will have four squares inside it, and in essence the grid is getting smaller and more of the planet is being generated, or loaded, that is, if you've visited it before.
Getting warmer? | |
| | | Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: Planetary coordinates Tue Sep 07, 2010 4:49 am | |
| - Noitulove wrote:
- Something-of-a-bump.
What I'm getting from this is that as you get closer to the planet, the grid gets smaller and smaller; thus, if you have a 4 x 4 grid that splits (quadtree), one of those four squares will have four squares inside it, and in essence the grid is getting smaller and more of the planet is being generated, or loaded, that is, if you've visited it before.
Getting warmer? Spot on. | |
| | | roadkillguy Experienced
Posts : 528 Reputation : 17 Join date : 2010-08-25 Age : 31 Location : Rhode Island
| Subject: Re: Planetary coordinates Tue Sep 07, 2010 10:42 pm | |
| Something to that effect. This is how I thought the noise should work.
1. We create a nice subdivided cube.
2. We send the vertices through an equation to get a sphere.
3. We apply the noise to get the altitude.
While I wrote that I just realized that may not work if we don't want to re-render the entire cube/sphere at once.. In other words, if we only want to update the terrain we're near it would fail when subdividing.. I'm just worried it will flicker. | |
| | | Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: Planetary coordinates Tue Sep 07, 2010 10:48 pm | |
| - roadkillguy wrote:
- Something to that effect. This is how I thought the noise should work.
1. We create a nice subdivided cube.
2. We send the vertices through an equation to get a sphere.
3. We apply the noise to get the altitude.
While I wrote that I just realized that may not work if we don't want to re-render the entire cube/sphere at once.. In other words, if we only want to update the terrain we're near it would fail when subdividing.. I'm just worried it will flicker. You cull the vertex output, not the not the original data. | |
| | | roadkillguy Experienced
Posts : 528 Reputation : 17 Join date : 2010-08-25 Age : 31 Location : Rhode Island
| Subject: Re: Planetary coordinates Tue Sep 07, 2010 10:50 pm | |
| Well... Nevermind. I think I got it. I tend to go back and fourth a lot | |
| | | Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: Planetary coordinates Tue Sep 07, 2010 10:52 pm | |
| I need you to create a sourceforge account. Then i can give you a branch on svn, which we can merge to the trunk at regular intervals | |
| | | roadkillguy Experienced
Posts : 528 Reputation : 17 Join date : 2010-08-25 Age : 31 Location : Rhode Island
| Subject: Re: Planetary coordinates Tue Sep 07, 2010 10:57 pm | |
| Allright, I'm pretty sure that worked. I have the same name as I do here. | |
| | | Bashinerox Programming Team lead
Posts : 238 Reputation : 8 Join date : 2010-07-07 Age : 35 Location : Australia
| Subject: Re: Planetary coordinates Tue Sep 07, 2010 11:04 pm | |
| Okay, ill work on giving each of us (currently papergrape, yourself, and I) a separate branch to work on, with trunk merges reserved for agreed apon states of the branches. | |
| | | Sponsored content
| Subject: Re: Planetary coordinates | |
| |
| | | | Planetary coordinates | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |