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.

DarkBASIC Discussion / Gravitational Pull for cyberplanets

Author
Message
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 9th May 2005 02:22
Yes can anyone help me with this? I want my game to have cyberplanets rather than matrixes and I want both friendly and enemy vehicles and drivers/pilots to be able to drive all around the globes without them falling of or drivng around as if they are on a matrix the only thin as well is I wish to have spacplanes flying of the worlds and going to other worlds.

How do I do this? do I use the variable gravity=0? and how will it affect my spaceplane fighters?
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th May 2005 02:26
well, you could make the planets really big so that you dont see right to the horizon, then turning the actual planet, or something



"Well, if he dies, it'll teach him not to do it again." - Me
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 9th May 2005 02:28
I see yes that might be one way but how would I get some vehicles to stay glued to a planet and only alow them to jump certain places and let other vehicles fly offplanet?
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th May 2005 03:32
hmmmm, im not sure, but i think a better solution to that would be rather than making soheres and stuff as planets, actually make matrices or whatnot, then make the matrix shift, or go back to the other side of the matrix once you've gone too far...you know



"Well, if he dies, it'll teach him not to do it again." - Me
Pidgeon
20
Years of Service
User Offline
Joined: 7th May 2005
Location: Talax
Posted: 9th May 2005 05:36
That would just give a completely smooth planet, wouldn't it be better to make a map in some 3D terrain maker and load what would be visible to the player? Then when they reach the 'edge' of the map just wrap it around so it mimics a real planet.
ToyImp05
20
Years of Service
User Offline
Joined: 3rd May 2005
Location: Home
Posted: 9th May 2005 09:04
The wrapping could work but what about drawing what's on the other side of the matrix when your at the edge of the other side? I've been pondering this as well for an RPG that I'm starting to work on.

Making the huge sphere could work, and all you would have to do is use 3D Maths, such as radius, and then place the objects by angles from the center of the 'planet'. Or, you could use a 3D program, such as 3D Studio Max (or what ever you use, and please use purchased software and not stolen) to make the planet and the things on it one huge object. If you do the one object you can change the mesh in the 3D software to add craters and what not instead of the land being perfectly flat.

Just an idea though.

eat a beaver, save a tree.
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 9th May 2005 19:50
Hmmmm well @Pidgeon well I have several game idea's which will invole the use of cyberplanets and I want to have one of the first games that have cyberplanets, for a start , it would help with unlimited terrain.

Just that I would need the flying objects to be able to take off and land and I don't need the ground vehicles to take of and land at all but I don't want to get the ground vehicles working and the find out the aircraft won't get off the ground. The thing is I have all the vehicles ready (except thread tanks and movable turret hovertanks) so I am very clo0se to getting everything in place for a 1st level.
Pidgeon
20
Years of Service
User Offline
Joined: 7th May 2005
Location: Talax
Posted: 9th May 2005 20:17
I don't think the vehicles are a major concern at this point as it sounds like you don't yet have a game to put them into.

What do you mean by 'cyberplanets'? Most space borne games have planets and most land based games are on a planet... Also, planets don't have unlimited terrain. If you wanted that in your game you'd have to have a server (or if single player, just a computer) with unlimited resources OR randomly generate the terrain as the player moves, but that would make mapping a nightmare (unless you used a certain seed for the randomizing).

But, with vehicles, wouldn't it just be a case of altering the amount they're effected by gravity? Or you could mimic reality and have gravity as a constant but the effect decreases with altitude and the vehicle's engines determine whether it can fly or not.

ToyImp05, by wrapping around I ment drawing the terrain as well so it's one big continuous map. It is, basicly, how real maps are made.
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 9th May 2005 21:20 Edited at: 9th May 2005 21:22
vampyre,

It sounds that you are desiring to create a technically HUGE sphere, large enough to hold a world of objects around. However, there may be a slight performance hit in this doing. Unless you are wanting to create an emphasized world, where a vehicle may be .05% of the sphere's size, as to say rather large in comparison to the sphere(a cartoonish style type of sizing), I would consider going with the matrix.

I don't believe that any average pc could run a game in which you wish to make. But, do prove me wrong. I really would enjoy to see and play such a game, and do hope that you at least try this method. For, I could be completely disunderstanding of what you are wanting to create. In addition, I will run some tests of my own to figure how to code such program, effieciently.


+NanoBrain+
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 9th May 2005 22:48 Edited at: 12th May 2005 07:19
@ Nanobrain Well I have been thinging it dosen't have to be a massive ball I mean it could be a small or average ball with very very small scaled vehicles and humans, plus you would have the abilty to have spacecrusiers e.t.c. I hope I can get this going I have seen it sort of in a space game A Starwraith space game called Evochron but I am not doing it because of that I was really inspired by Mojoworld Editor as it can edit planets Earthsize but with very or no performance hit. I hope I can finish this game or at least a level so you can get to play it Nanobrain
http://www.pandromeda.com by the way I am not working for Pandromeda in anyway. Also I am looking for

@ Pidgeon I mean a proper ball or a sphere that is what I mean by a Cyberplanet not just dynamic flatland or a matrix I think that it doesn't have to be a massive world, some clever positioning of the camera (yes it will be a 1st person game ) would be needed for the player charector and the vehicles which the player and a.i. drivers / pilots will be able to get in and out of vehicles.( Which is another problem I am having with.)Also I am looking at 3D Worldbuilder which looks amazing and is made with Dark Basic.
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 19th May 2005 01:33
I was wondering Nanaobrain how your tests went?
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 22nd May 2005 08:56
vampyre,

Sorry, I've been a bit sidetracked from this subject due to a gaming contest I am working on. However, I am off from work today and tommorow, and will throw up some experiments on this post within then.


+NanoBrain+
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 28th May 2005 00:11
Thanks Nanabrain look forward to it
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 28th May 2005 08:27
vampyre,

Well, it has been a week since I last made a post here. The experiments have not been completed, and I desire to make you aware that I am not knocking this task away from me. Once again, I am off for the weekend, and one additional day...Memorial Day. Therefore, I 'should' have plenty of time to complete these experiments.


+NanoBrain+
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 30th May 2005 11:24
vampyre,

Well, the experiments are not going well. This is quite a tough assignment to get correct. I can't seem to figure the correct maths, in order to rotate an object around a sphere on all axis, according to a(the?) direction it is 'facing'. I will continue trying. Have you accomplished anything on this subject?


+NanoBrain+
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 18th Jun 2005 02:17 Edited at: 31st Aug 2017 12:39
Sorry Nanobrain I have had a few problems that is why it has taken me so long to reply.

Well first of all I will need to register my copy of Mojoworld 2.0 SE and see if it exports my vehicles are now all done and I can straffe both in the air and on the ground .

I will have to however start on getting the vehicles and pilots to stay on the globe and I have only got a vague clue on how to do that then there will be getting the globe to rotate around another and I have no idea how to do that but I shall try it out
qwe
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location: place
Posted: 22nd Jun 2005 09:12
i've tried this and the maths are hard. i didnt finish the experiment. i wanted to make a program where you can make your own world and then travel it and if i decide to do this again i wont use the giant cybersphere planet method

if i were you i would just use .x or matrix ground, make a cloudscape above, and when you leave hte atmosphere you unload the matrix or .x, turn the fog and backdrop to black and put stars around, and position yourself in a universe with smaller planets. when you go close to a planet you enter its atmosphere

Check out the DB Freebie Archive: http://lysergium.net/dbfree/ thanks to DARKGuy
Want your game hosted free and a forum for feedback, or want media hosted? Click the email button below
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 22nd Jun 2005 09:30 Edited at: 22nd Jun 2005 12:04
You could use a matrix for the whole world but not have the edge of the matrix be the edge of the world. Put the edge of the playable world somewhere near the edge of the matrix, where you can't see the edge and then position the player back to the beginning of the matrix once the player reaches that certain point.

In many rpgs that have worlds that do this, they make the edges of the world and matrix water so that it wraps easily.

Example Code:


You could design a matrix with my matrix editor which you can get off my website:

http://www.freewebs.com/neodragon64

geecee3
21
Years of Service
User Offline
Joined: 25th Feb 2004
Location: edinburgh.scotland.
Posted: 22nd Jun 2005 11:43
what you are asking is virtually impossible. pandromeda mojo world creations are not suitable for games and to have a game environment the size of a real planet would require massive amounts of ram. there has to be a transition point between being in space and being on a planet. look, they tried it with 3d mark, real mean coders at the cutting edge of development and they could not pull it off. if it could be done, we would already be playing games like that. unless you are a god with fractals and highly complex math and mabey a doctorate, then your really going to get nowhere at an alarming rate. try making a game you know you can handle. I'm at a complete loss as to how you are even going to map a spherecal environment of that size, and size is an illusion, it's the complexity of the world thats the problem. so if you make it small with tiny objects you really get nothing but a smaller world of the same complexity and detail. a totally unworkable concept in my eyes. there has to be a transition somewhere, or a bleeding in of detail which would pose it's own set of problems. Hell, I been trying to wrap my head around a simple graphics demo based on a spherecal world for ages and it's a hell of a lot tougher than you think, and all I want is a half convincing graphics demo.

how many games have you actually made? that people have played?
"I want to have the first game with cyber planets" a game of that size would require a development team of epic proportions. How long you been asking about this now? have you written any game engines lately? oh, and mojo world uses math the likes of which even the best coder here would stuggle to understand. and your asking wether gravity should be set to 0. I think you should just give up.

mmmm....computer....
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 22nd Jun 2005 12:29
geecee3,

You have come off rather strong here. Good words. However, not the best way to throw them at an individual.


+NanoBrain+
geecee3
21
Years of Service
User Offline
Joined: 25th Feb 2004
Location: edinburgh.scotland.
Posted: 22nd Jun 2005 21:22
sorry m8, I didn't mean to sound nasty. I have already tried to explain the problem to vamp, but he seems to shun the knowledge we are trying to share here thinking that this can be done in DBC, mabey it can, I sure as hell would like to know if it can be done. Put quite simple, this has been the dream of just about every software house since the beginning of time. I want to see it done, and i'm sorry if I have been overley strong with my comments. Moving to PRO might help a fair bit with managng the sheer complexity of the world. but DBC.... well.... I have been there as well.

thanks, grant.

PS. Sorry Vampyre.

mmmm....computer....
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 23rd Jun 2005 04:24
geecee3,

I know that this is succeedable on a smaller scale. For, there was one game I had played some time ago, that now I have forgotten its name, which inlcuded the player, in third person view, and the enemy as robots. The level was a miniture scale of a spherical world, which they roamed around , and their were destroyable buildings and objects of different sorts. The players had their free movement as in other games, but could tred the entire surface of the planet, while they fought, and shot missles and bullets.

However, as you stated geecee3, on a grand scale, for now, this is definitely not possible. At least not with the world and its objects being in memory at every instant. Though, if the sphere were broken up into seperate sections, and loaded in the manner of an rpg, then this type of game could be possible. But, the patterns and maths are still quite difficult to configure in one's mind.


+NanoBrain+
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 25th Jun 2005 10:36 Edited at: 25th Jun 2005 10:42
To geece3 forget about me giving up!!! that is not going to happen, besides I have managed to get a Pandromeda world into Dark Basic Classic(although it didn't retain the mountain and continental content) the thing is the sphere even when textured is very transparent and I cannot get it to recognise the collision commands in DBC so I think I will have to look at DBP to really do any games using Mojoworld but you do not need to chop up the shpere at all what you need to do is if you have and ground vehicles is tro make sure you they stick to the planet Surface which I admit I have no real clue how to do.

For flying vehicles you would need to create a variable where if the aircraft went in to fast and touche##s the planet surface it gets great damage or expoldes but if it lands at a certain speed it doesn't get that much damage.

as it would only be one planet per game lavel or a planet or the nearest couple of moons on each level then have lots of spheres should be too much of a problem , but it is very possible to do and you can have the sphere at Earth size scale which Mojoworld has I am using Mojoworld 2.0 S.E (Special Edition_) but you need to have Poser 3.0 4.0 or 5.0 to convert the planet and as I said it is going to be hard to keep the continents and mountain ranges. I will try to do a very mountainnous world and see if Poser and DBC can handle it.

But what I really wiish to know is how can I get the ground vehicles to keep to the planet suface .

P.S Apology accepted geeece3
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 25th Jun 2005 10:59
vampyre,

You're not on the same page as me. When I speak of breaking up the planet into sections, I speak of it for processor reasons. That, the sections which do not need to be calculated, due to them being off the screen, would not be drawn or calculated. Same should go for the objects.

As for keeping objects to the planet surface, is a matter of a distance calculation, such as the distance from a certain point on the ground of the planet to the center of the planet.

Distance =



+NanoBrain+
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 25th Jun 2005 11:39 Edited at: 25th Jun 2005 11:58
Oh I see sorry Nanobrain my mistake, I don't mind that as it would help performance on the CPU and besides I thimk most games are made that way whether flat terrain or planetoid,@geece3 my game wouldn't be the first with cyberplanet Lucas Arts made a 3d game like that way back in the 80's although I forget the name of it now but it was an early Star Wars game and there is supposed to be a game called Glyph which will be using Mojoworld Planets, anyway here is what I have worked on so far


the media will have to be got by yourselves but it works except that I just can't keep the vehicle on the planet I don't claim to be that good a programmer althouh I am nearly there with my game, aplogies for putting vehicle controls using a joystick but you can easily change these back using mouse and keyboard if are all better programmers than me
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 10th Oct 2005 16:44
Oh by the way nanobrain I just purchased the Beginners guide to Dark Basic Book I think you might find out about making planets turn around the sun in there I think someone did a kind of Solarium Solar System model and I think not sure so I will check but I think the source cosede for it is on the CD.

So you might be able to have a look at how they did things in there
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Oct 2005 00:43
I suggest you create a flat, never-ending matrix so you can go forever without reaching the edge.

If you think about it, even on Earth - which is a globe - you could go all the way around on the surface and end up at the same place. But when you do it, you don't see the curvature of the earth - it seems flat. So why create an enormous sphere and have all the associated problems with it?

In your program, you could set an altitude above the matrix at which you bring the fog values up (and maybe show an animation) and when it clears you are in orbit looking down on the planet.

When in space, if you get within a certain distance of the planet and are not going too fast, up comes the fog again and when it clears you are flying above the matrix. If too fast, you get damaged and bounce off the atmosphere or explode.

This sounds perfectly feasible to me in either DBC or DBPro.

Also, I posted the complete source and media for my Solar System Simulator on here a couple of weeks ago.

TDK_Man

vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 12th Oct 2005 03:33
I don't know TDK I just fancy using spheres instead of a flat matrix, something diffrent I suppose.

The thing is you don't need a massive sphere really but I have no idea why I can't get my spaceship to simply bounce of the ball and crash.

Still I shall keep working on it thanks TDK
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 13th Oct 2005 01:30
@ Neodragon sorry Neodragon ,thank you for the offer I will contact you soon about your Matrix Editor
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 14th Oct 2005 00:49
@Nanobrain I have the collisions I know you gave me an example of how to get the objeect to go over the surface of another but where would I put it in the program ? and how do I make sure the program knows what objects I am talking about?
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 14th Oct 2005 01:14
vampyre,

It has been a while. Will you show me the code, and I will refresh my memory to answer your question?



+NanoBrain+
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 14th Oct 2005 07:27 Edited at: 14th Oct 2005 07:28
Er .. Nanobrain , the code is iin ths thread, it is only a snippet, it's got distance then the code box around it

I think I should do it like this

pdist=


but I don't quite know where excatly to put it in this code

vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 15th Oct 2005 12:36 Edited at: 6th Apr 2006 17:01
Tell me would a distance check do? the thing is I don't want to use tilt objects for then it means more objects in the game for instance if I use tilt objects and I have 100 friendly A.I pilots with 100 vehicles if I put tile objects for each pilot and each vehicle if I put another 100 enemy pilots with 100 vehicles the vehicles will be neutral so (frindlies and enemies can get into any friendly or enemy vehicle if it is empty) that would be at least 800 objects and as I would like the game to run on low end systems I am not sure a lot of them can handle 800 objects in memeory(not on screen the objecta will be hidden.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 15th Oct 2005 14:14
So you want to use a planet, but you don't want to tilt it. So you want a game that when your vehicle is on the bottom of the planet, it will be "laying" on his back.
I think you should add tilting, though it'll be hard to code...

You are making a strategy-type of game right? So actually, it's just a matter of keeping the objects at the same distance to the center of planet...

Immunity and Annihalation makes Immunihalation...
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 15th Oct 2005 14:44
Yeah Sven B one is an R.T.S and one isn't, first of all though I am doing a series of tests just to see if I can get an object to drive around on the suface of a planet first and then the difficult stuff of in and out of vehicles using 3d models.

I have already seen code just using shapes but I want to know if you can do that using models only or is that also a case of tilt objects as well
Oh yes I get what you mean about "laying on its back" but I think there has to be a weak gravity field strong enough to make sure that if anything drops it drops onto the planet surface but you can still
fly a spaceplane into space from that point . I have the collisions for the spaceplanc to land and take of so that is one thing.
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 15th Oct 2005 22:41
vampyre,

This is a hard subject. Sorry for no replies. I am solely trying to figure out the math to enable an object to move around a sphere in all directions. I have not put much time into this thought though. I am quite busy.



+NanoBrain+
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 15th Oct 2005 23:40
Thanks for helping nanobrain and it's OK ,take your time as I am, well I have to I 'm not that good a programmer
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 18th Nov 2005 12:35
Hey Nanobrain did you manage to work out how to get one object to follow another's suface like a vehicle to run on a planet suface(sphere) ?
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Nov 2005 17:36
You might not be looking for this, but I thought it would be good additional information.

I have been thinking about a theory for gravity in 3D. And I came up with some math.

To keep the number of math calc low, I only used 2 dimensions. Here's what I've done:



I store the xvector in the xspeed var and yvector in the yspeed. (DBC doesn't have vectors, so I'll do it with vars).

step 1: Calculating the angle to the planet
using the atanfull command, you can determine the angle between 2 points.

step 2: Calculate distance
pythagoras: a^2 = b^2 + c^2 or a = sqrt( b^2 + c^2 )

step 3: calculate the pull of the planet
everyone knows that, the more far you go in space, the less gravity you get from a planet. We need 2 variables to calculate this pull: Range#, the point in space where the gravity will be 0, and SurfaceGravity# is the gravity on the surface.

step 4: Calculate vectors
We calculated the angle, and the pull. Wich means we can update the x and y vectors:
xspeed = xspeed + ( cos(Angle) * distance )
yspeed = yspeed + ( sin(Angle) * distance )

step 5: Get collision
The collision is simple in this case, when the distance is smaller than the radius of the planet, stop the object. With other words, the x and yvector have to be 0.
xspeed = 0
yspeed = 0

step 6: update position
the x and y vectors have to be added to the current position wich will cause the object to move.
posx = posx + xspeed
posy = posy + yspeed

Greets

Sven B

Immunity and Annihalation makes Immunihalation...
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 18th Nov 2005 18:19
Hey Sven B, that just might be the answer, although it might be a bit more difficult when you apply this to things like spaceships coming in to land on a planet or drop ships landing on a planet. I know the spaceship landing on a planet is possible because I have demo's of Evochron, Evochron II and Starwraith IV and in those games(which are made in DBC by the way) you can land and take off.

I have got the landing thing OK but the flying around the planet is a bit difficult , still this equation might just be the thing Sven B thanks thanks a lot I will test this out tonight.
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 18th Nov 2005 18:22
The x and y vetors should make the objcet move about on the planet? I see good, I will need a ittle help with the atanfull command though but I have the DB beginners gude book I will see if that has a way of using the commands
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 18th Nov 2005 18:31
Hey Sven B, that just might be the answer, although it might be a bit more difficult when you apply this to things like spaceships coming in to land on a planet or drop ships landing on a planet. I know the spaceship landing on a planet is possible because I have demo's of Evochron, Evochron II and Starwraith IV and in those games(which are made in DBC by the way) you can land and take off.

I have got the landing thing OK but the flying around the planet is a bit difficult , still this equation might just be the thing Sven B thanks thanks a lot I will test this out tonight.

Possibly need help with the ATANFULL commands also I think as I wish to have at least 100 vehicles for both Enemy and player vehicles and player and enemy a.i pilot , might be a bit difficult but as I also have the DB beginners book that might help me a lot I suspect I shall have to free the camera from the "set object to object orientation" to get everything working but now, if this equation you have done works Sven, it will be the getting in and out of objects or vehicles which will be one of the last hurdles
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 18th Nov 2005 18:58 Edited at: 18th Nov 2005 19:01
Did I hear you say you were getting dbp? I think I could do this in dbp but I dont know about classic. Does classic have the intersect object command? If not, then no clue.

in dbp a rough explination for my solution would be thus:

most spherical objects are centered on their x/y/z axis points, so the center of the sphere would be the objects position and handilly the center of the planet too. You can use an arc tangent calculation to get the angle between the player and the spheres position which will give you a rotational value to make sure the player is the right way up. After that it would be a simple case (assuming the planet is an object) of performing an intersection between the players position and the spheres position (remembering the spheres position is the center of your planet) and the distance intersect object returns will allow you to place the player at the right height.

But I dont think DBC has an intersect object command.. its theoretically possiable to write your own (i belive a dbc extension gives you memblocks so you could access vert data?) but the code for that IS beyond me.


EDIT - the previous suggestion is very good. But it doesnt account for uneven terrain (the radius of the planet would provide a smoothed circle and would ignore bumps in the terrain like valleys, etc) which an intersect object call could.

a very, very, dirty way to get the height accurate for bumps etc would be to position an object at the players position and move it towards the center of the sphere until it collides with it and then position your tank there - but thats so dirty i dont belive i suggested it

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Nov 2005 21:48
It is true that DBC doesn't have intersect object.

I'd suggest (if you have enhanced version) you use Sparky's collision DLL. It would fit perfect in this situation.

Immunity and Annihalation makes Immunihalation...
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 23rd Nov 2005 04:56 Edited at: 23rd Nov 2005 05:06
I ran that program Sven B and it works I would like to see this work in 3D I shall work on this and see what happens, Yes Sephnroth I did buy DBP but a problem has arisen with joysticks so I have to solve that problem(using interger commands makes the joystick move about and you can't control it as in DBC so need to find out how to get that working) I will investigate Sparky's dll oh yes and that tank suggestion sounds very dirty
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 8th Dec 2005 21:31
Ran the program Sven B and it works that just might come in handy for flight, as for making sure certain vehicles can't get off the ground without being loaded into a dropship, that might be handy too, pity I don't really know how to do that.

Still I have done the title music for both games so I inch closer and closer to completion.
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 5th Jan 2006 18:19 Edited at: 5th Jan 2006 18:26
Yes where can I get Sparky's collision DLL Sven B?
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th Jan 2006 10:55
Program Announcements > Useful TPC plugins.

For ease:
Here
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 18th Jan 2006 11:17
Thank you Sven
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 15th Apr 2006 06:38
By the way I managed to get the problem solved for me partically but I do get some problems with planetary models, in short loading them and getting the textures to get with them

Login to post a reply

Server time is: 2025-05-23 21:37:29
Your offset time is: 2025-05-23 21:37:29