Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 25th Sep 2007 00:26
I am trying to create a 3D game that involves walking around a planet. I have the code which allows me to walk aroudn the planet and everything but...

is there any possible way of adding terrain to a planet? e.g. hills, mountains, gorges.

I looked on the forum and found something that surgested I use meshes but I'm not sure how I would go about doing that.

ps: I recently updated from DBC to DBP
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 25th Sep 2007 00:28
I tried, now El Go0rf is trying... we'll get there! (Eventually)

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
El Goorf
18
Years of Service
User Offline
Joined: 17th Sep 2006
Location: Uni: Manchester, Home: Dunstable
Posted: 25th Sep 2007 00:34 Edited at: 25th Sep 2007 00:36
hahah yeh.. anyone fancy teaming up for this project? all im trying to do is a random world generator on a sphere.

lord einstein, depends what you mean. you could make a scrolling terrain where the edges match up, so you can keep going across it givng the illusion that you're going around a sphere.

though im guessing what you're actually after, like me, is a populus type world, ie you see the whole planet in its circular form. what you wanna do is use a geosphere. now, if you want a premade world, use a 3d modeller, if you want to have the world made on-the-fly, ie for a world editor or for random world generation (like me), then it suddenly gets very complicated as you have to learn to use memblock meshes (considering yu've just made the switch to dbp), and then work out the maths to program a geosphere and manipulate the vertices. this is the bit im stuck on. i have a thread on the go i started earlier:

http://forum.thegamecreators.com/?m=forum_view&t=114927&b=1

you could, of course, try with a regular sphere, but geospheres have the polygons better arranged for rough shapes (ie geography on a planets surface), hence the name GEOsphere

http://notmybase.com
All my base are not belong to anyone.
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 25th Sep 2007 00:37
I would love to team up on such a project but I'm not sure I would be much help.

I have a thought of something in the last ten minuites however.

Could one stick spheres to the planet surface and then use distance calculations to decide how far the player shoudl be moved from the center of the planet?
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 25th Sep 2007 00:39
I will team. I have tried twice and failed. This time, my ultimate Spore competitor will not fail!

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
kbyoyoa
18
Years of Service
User Offline
Joined: 30th Apr 2007
Location: Minnesota
Posted: 25th Sep 2007 00:41
I'm new to this stuff, but i'd say load a model of the world... with all the hill and mountains and stuff and use that as an object. Then use intersect object from the center of the planet to the your position (and use some 3d trig transformation to calculate this).
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 25th Sep 2007 00:44
But loaded models are boring! Random planets are all the craze now lol. Get with the times man!

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 25th Sep 2007 00:44
That is one way - although there would still be many problems to overcome.

What we really want to achieve (at the end) is a random planet generator.
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 25th Sep 2007 00:46
I think I have a better shape for the mesh than the one on the other thread. Look at the pic - if it works.
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 25th Sep 2007 00:50
That's just a smoothed cube

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 25th Sep 2007 00:51
yea - might work better than a tecahidron (can't spell)
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 25th Sep 2007 00:57
...

You may have a point.

This way, you would need 6 heightmaps, which could be generated to be seamless, and then applied to one of these.

I think it would be better if it was actually generated in DBP though and then the actual rounded coords could easily be found using some simple trig.

Anyone up for a try? I, personally, am not very experienced with generating new objects.

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 25th Sep 2007 01:02
I need to sleep at the moment so sorry (I'm in a different time zone).
El Goorf
18
Years of Service
User Offline
Joined: 17th Sep 2006
Location: Uni: Manchester, Home: Dunstable
Posted: 25th Sep 2007 01:06
Quote: "I think I have a better shape for the mesh than the one on the other thread. Look at the pic - if it works."


i disagree, purely because you're not dealing with regular sides. it's so much simpler if all the sides are of even proportion, ie the geosphere, where all the sides are equalateral triangles.

http://notmybase.com
All my base are not belong to anyone.
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 25th Sep 2007 18:37
How about this for the planet terrain. I have created loads of spheres and added them to the planet surface to create land. The planet terrain is very undetailed and kind of looks like somethign out of mario.

Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 25th Sep 2007 18:42
That's pretty neat, but not very efficient, and doesn't give you very good features, but, it might just be what you're looking for

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 25th Sep 2007 18:50
One could use this sort of terrain (with textures of course) and then make more high detail versions as the player got closer.
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 25th Sep 2007 19:52
I posted a semi-working version of mine in this thread:
http://forum.thegamecreators.com/?m=forum_view&t=114927&b=1&p=0

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 25th Sep 2007 20:43
dose not seem to work on my computer. Could you post a screen shot?
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Sep 2007 21:15
I've only seen one game that has the Fly in Space - land on planet - and walk around - and frankly - the guy had big dreams - worked alone - and the end result stunk.

I think the Idea of you guys teaming up for this one is a really good idea because of the scope of what you are (I think) trying to achieve!

You basically might consider that what you really have are TWO MAIN game engines (And posibly some fancy glue) . Free Space (Newtonian Physics) on one hand, a rentry/blastoff "transitional" piece (the fancy glue) - and Atmosphere+Newtonian physics for the on "planet" stuff.

ONE planet - random or not - if it was to be such that you could put down a penny on a hill - and then walk around the whole planet - and come back to that very same hil (with the penny still there) would imply a lot of data.

Also - there is the fact that the type of terrain (perhaps via bumpmapping) seen from space would need to at be sorta close in color and terrain in the "On Planet" realm... walking or flying.

I Know I don't know what you're trying to achieve exactly - but generally speaking - SPACE flight/Gfx are a different animal than walking. Got to run - Sorry...

calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 25th Sep 2007 22:50
On the geosphere page I have posted 5 models of smoothed platonic solids:

Tetrahedron
Cube
Octahedron
Dodecahedron
Icosahedron

In ascending order of number of surfaces. They all look spherical.

"I don't like it, and I'm sorry I ever had anything to do with it" - Erwin Schrodinger
Green7
19
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: Switzerland
Posted: 25th Sep 2007 23:26
maybe... if you look how a football is made. there are a lot of single patches, put together to a whole shape. if you make those patches out of plains, matrices, somehow a bit rounded so it does not look edgy, it could work. maths could be difficult for this, and its theory, but why not try.

Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 25th Sep 2007 23:29
jason p sage:

We (at least me) want to create a sphere which you can walk around and go over the poles and everything. We don't really want to make life size planets because that is way too much data. Instead we want to make tiny planets that can be circled on foot in less than a hour. With these planets you will be able to see the curvature of the planet as you walk around and if you zoom out you can easily see that you are infact on a real planet.

We could make a game with 2 engines (a planet and space one) with so "fancy glue" but we really want to do it the real way with no glue.

http://www.youtube.com/watch?v=DCzDKj3hjOE

This is the sort of thing that what we want to achieve finally. Although we would never get graphics as good as this.
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 26th Sep 2007 01:31
WOW.. I'll hush now - that looked AWESOME.

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 28th Sep 2007 20:14
How about this for a basis?

It would look better if you load a geosphere rather than using the sphere the code created.

jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 29th Sep 2007 02:14
That is one ugly ball... Cool code snippet .... one ugly ball! My wife walked in and I asked her what it looked like to her - she said a bit of pollen magnified 100,000 times or something under an electron microscope!

I can definately see how a routine like that could be expanded to make a "small" planet with terrain of sorts. Though - that demo (you tube thing posted above) I saw recently was CRAZY! I personally think the creators have a way of taking a terrain mesh and wrapping it around the globe.

Does anyone else think they did that? I mean it seemed like the planets was a base object and terrain detail(s) was "put on" after...

Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Sep 2007 02:24
It could have been the fault method which I use, or, it might possibly be like in Spore were there are 6 heightmaps, and each is applied onto each side of the sphere.

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 29th Sep 2007 02:38
Zotoaster - and others here - How do you guys map your "planet systems"? Do you approximate - or use some sort of editor (home brew or otherwise)?

I only ask because I happen to be writing a terrain loader for T.Ed and it has a pretty cool way of placing objects in a "level" and the way the EPR (propritary file format - made of text - not to hard to read) format is, it would make it easy to load only object placements - and ignore the "terrain" meshs - allowing you to place space ships, (scale them - even put in custom info you can optionally parse - like how much health perhaps a ship should start with etc). I was just thinking - that if I was to do a planet/space game - I would probably use the terrain editor's placement to place ships, planets, power up, frieght, asteroids whatever.

Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 29th Sep 2007 19:25
This is one of the thing that we are tryign to work towards
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Sep 2007 19:47
I'm not too sure what you mean Jason.

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 29th Sep 2007 20:44
Lol! I wasn't suggesting that was a finished planet. As I said, use a geosphere. Also, the use of a heightmap or a smoothing function and the addition of textures would improve it greatly.

jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 29th Sep 2007 21:50
@Lord Einstein -
Quote: "This is one of the thing that we are tryign to work towards"
That would be cool if you get there! (You will - everything just takes to long!)

@Zotoaster -
Quote: "I'm not too sure what you mean Jason."
No problem. I mean that I bought T.Ed - the terrain editor that is sold here on TGC - and it is like any terrain generator - it makes a ground mesh - you raise and lower the ground height - some texturing tools etc... like any terrain editor should - BUT like some of the better editors - you can place objects around the "terrain" you are editting. So you can put a truck here, a tree there etc. It has the tools to load your "Props", Scale them, spin them this way or that, set lighting and fog parameters, and basically do a lot of the stuff you might do in DBPro code to populate a First person shooter level for example.

This program has a way to "export" your level - and this basically means in your "work directory" you get all the textures you need, and a very import text file named yourlevel.epr. It also saves the Ground Meshs as object in this directory.

Now think outer space, forget the Terrain - add instead of trucks - spaceships, instead of buildings - maybe planets and big space stations. You can place your "items anywhere you want in the level - at any scale and/or orientation. I know - you end up with a terrain with a much of space stuff hovering over the ground. But my point is you can LOAD this "terrain" map in your db program - and it has all the locations where you placed your "props" (Spaceships etc). So if you just make your code not load the sky box and the ground - you have a cool way to design a space sector - and save it and recall it in DBPro! (You don't have to place props on the "ground" you can place them anywhere you want in 3d space.


@TEH_CODERER
Quote: "Lol! I wasn't suggesting that was a finished planet. As I said, use a geosphere. Also, the use of a heightmap or a smoothing function and the addition of textures would improve it greatly."
I know! It was funny - I loaded up the code - and ran it - and I was like - um - what is that! But I knew you were just giving an example - and it is a good at that! I liked the vertex calls.

Question - How does Getting the "Normals" via zn#=get vertexdata normals z(v) help you manipulate the object by only setting set vertexdata position v,x#,y#,z# after adjusting X#,Y#,Z# ??

This has me a little stumped. I recently asked for a description of normals in the DarkGDK thread. Could you shed a little light here - and if it would be a hijack - could you email me? I'm really curious about this one! Thanx in advance. I understand if you're to busy.



x#=x#+(xn#*h#)

Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 29th Sep 2007 22:03
Ok - I think I have my terrain version working. The terrain is really simple (just spheres glued onto a large sphere) but it works and with a little bit of inmprovement it could be really effective.
P/S: you can get stuck on the planet's poles so betware.



Sorry it took so long I was busy playign Halo3
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 29th Sep 2007 23:21
@jason p sage - The normal will be a float value between -1.0 and 1.0. The normal refers to the angle at which, in this case, the vertex points. By moving them dependent on the normal, the vertex will move out from the center of the sphere.

jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Sep 2007 01:44
@Lord Einstein-Spectacular!

@TEH_CODERER - Thank You very much. That helps alot.

Excellent - I kinda have an idea the direction you guys are going. I like it. I see how traversing "smaller" planets and hopping planet to planet - would be really neat game play!


Gotta go to this house warming party - just when I was making good progress on my code! (Might be fun )

Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 30th Sep 2007 14:08
I have slightly improved my code but I think it is important because this version is much better than the last.

Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Sep 2007 14:21
That's really cool Lord Einstein. I updated it a bit to give some better colors, and also I put the sync rate up to 60. It's excellent



"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 30th Sep 2007 16:31
I am trying to add clouds but on the dark side of the planet they appear light and vice versa. This is because of where the light is. I want to know if there is a way of allowing the planet to block light.
RiiDii
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 30th Sep 2007 18:01
Quote: "I am trying to add clouds but on the dark side of the planet they appear light and vice versa."


Try inverting the scale of the cloud object(s);
Scale Object n,-100,-100,-100

This will also invert the normals.


Open MMORPG: It's your game!
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 30th Sep 2007 18:08
thanks thats quite effective
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Sep 2007 18:12
That is quite impressive - a good base for sure! (And the house warning party turned out to be awesome - glad I went!)

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 30th Sep 2007 18:49
Well I've tried a slightly different approach. Take a look if you want. Again, it would be better with a geosphere.



I will attach the height map to this post and the color map to the next.

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 30th Sep 2007 18:50
Color map as promised.

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 30th Sep 2007 18:52
Sorry for triple post but here is a screen of what it should look like.

Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 30th Sep 2007 22:10
Thats quite cool - even if a too little exagerated. Have you got walking it so you can walk on that sort of planet. If so its much better than mine.
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Sep 2007 22:13
The problem with TEH_CODERER's is that it's not randomly generated, but, if you can generate a heightmap (which is relativelly simple given known techniques), you can use it to generate a colormap, and then you're flying

Lord Einstein,

Have you considered rather than just spheres you could load in premade meshes, and then placing random ones about the place just like you have there, and scale them and rotate them about so it's all pretty random?

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 30th Sep 2007 22:15
I was thinking about that and forgot about it. Thanks for reminding me. That could help to make my planet hundreds of times better and even speed it up slightly.
Lord Einstein
19
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 30th Sep 2007 22:59 Edited at: 30th Sep 2007 22:59
Here is a screeny of the planet now I have used terrain objects made in my 3D modeling program. I can rotate them, position them and use many different types to create random planets.

Sorry about the lines on the terrain I textured it really quickly and badly
Game pro
21
Years of Service
User Offline
Joined: 21st Mar 2004
Location: Usa
Posted: 30th Sep 2007 23:06
Awesome work bro! Keep it up.

I have nothing to say to the likes of you.
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Sep 2007 23:09
That's turned out even better than I expected it to! Amazing work!

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers

Login to post a reply

Server time is: 2025-08-09 01:40:44
Your offset time is: 2025-08-09 01:40:44