Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
world inside a sphere #95119
10/19/06 22:53
10/19/06 22:53
Joined: Oct 2006
Posts: 13
A
ArtoriusRex Offline OP
Newbie
ArtoriusRex  Offline OP
Newbie
A

Joined: Oct 2006
Posts: 13
has anyone ever tried making a spherical world so that you can go forever without hitting the edge?

Re: world inside a sphere [Re: ArtoriusRex] #95120
10/19/06 23:03
10/19/06 23:03
Joined: Apr 2004
Posts: 516
USA
Trooper119 Offline
User
Trooper119  Offline
User

Joined: Apr 2004
Posts: 516
USA
This is out of place, put it in new to gamestudio

To answer your question I'm not sure if anyone in 3DGS did this but it is possible definately. The problem with doing this though is that you would have to define a huge world in order to do this, if you didn't you could see the curvature of the ground around you, and I don't think this is a very realistic effect.


A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C
Re: world inside a sphere [Re: Trooper119] #95121
10/19/06 23:07
10/19/06 23:07
Joined: Oct 2006
Posts: 13
A
ArtoriusRex Offline OP
Newbie
ArtoriusRex  Offline OP
Newbie
A

Joined: Oct 2006
Posts: 13
thanks trooper. I'm not too concerned with realism inside the sphere.

If any moderators set eyes on this, please move it to the 'new to gamestudio' section, as the Trooper suggests.

Re: world inside a sphere [Re: ArtoriusRex] #95122
10/19/06 23:10
10/19/06 23:10
Joined: Apr 2004
Posts: 516
USA
Trooper119 Offline
User
Trooper119  Offline
User

Joined: Apr 2004
Posts: 516
USA
In that case, what do you have in mind? Maybe I can set you along the right path on how to get started. And if your keeping it under wraps do you have any other questions?


A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C
Re: world inside a sphere [Re: Trooper119] #95123
10/19/06 23:24
10/19/06 23:24
Joined: Oct 2006
Posts: 13
A
ArtoriusRex Offline OP
Newbie
ArtoriusRex  Offline OP
Newbie
A

Joined: Oct 2006
Posts: 13
Thank Trooper.

Basically, I have a boat, and I just need to be able to run around for pretty much ever. I've got a marina that the boat can dock at to end the game when ever they want. I figure the best way to do that is to have a sphere. Is there a way to just make a sphere of "water" with some islands on the inside and just make the boat move around on it like it's a car or something like that?

Re: world inside a sphere [Re: ArtoriusRex] #95124
10/20/06 00:32
10/20/06 00:32
Joined: Jun 2005
Posts: 656
G
Grafton Offline
User
Grafton  Offline
User
G

Joined: Jun 2005
Posts: 656
You can walk 360 on the outside or inside of a sphere or up/down walls like in prey pretty easily, here is an example.

A problem with the sphere approach is that if the sphere is too small, then the
transition between polygons will make the player model adjust somewhat abruptly
as it walks around it. You can minimize this by making a large sphere with a lot
of polygons, but this brings down the fps.

here is a demo of walking on walls / ceiling using curved ramps to smoothly transition like in the game Prey.



Not two, not one.
Re: world inside a sphere [Re: ArtoriusRex] #95125
10/20/06 00:43
10/20/06 00:43
Joined: Apr 2004
Posts: 516
USA
Trooper119 Offline
User
Trooper119  Offline
User

Joined: Apr 2004
Posts: 516
USA
Sounds like a great project to start off on. From what you've told me it seems like the one piece of code you might need is the keeping your boat at the correct angle according to the world. In this I can help you out. You have a couple of options depending on what is going on in your world. If your water is unmoving and at the angle your boat should more or less be then you can simply do something like the following
Code:
 action boat
{
var origionOfWorld[3] = {0,0,0}; //this is the origion of the level (or the center of your world)
var boatPos[3];
var sentinal = 1;

trace_mode = ignore_me; //ignores the boat when you look for the world surface position and angle under your boat
while(sentinal == 1) // continues forever, unless sentinal is changed
{
boatPos.x = my.x;
boatPos.y = my.y;
boatPos.z = my.z;
trace(boatPos, origionOfWorld); //or use c_trace if you have A6
my.x = target.x;
my.y = target.y;
my.z = target.z; //put boat dirrectly on the surface of the water
vec_to_angle(my.pan, normal);
vec_to_angle(my.roll, normal);
vec_to_angle(my.tilt, normal); //rotate the boat so it has the same angle as the water below it
wait(1);
}
}



And you would add that code to whatever you wish (such as a slight bobbing rotation back and forth on your boat as it moves) along with your controls (i.e. on_w = my.x+1;) <-bad example. Of course this is only a simple code snipet and will have to be improved in order to suit your needs, tell me if this helps

@Josiah, lol that was a pretty funny little demo, thanks for the input

Last edited by Trooper119; 10/20/06 00:47.

A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C
Re: world inside a sphere [Re: Trooper119] #95126
10/20/06 06:59
10/20/06 06:59
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline
Expert
Matt_Aufderheide  Offline
Expert
M

Joined: Oct 2003
Posts: 4,131
Quote:

This is out of place, put it in new to gamestudio




There is no reason to move this topic. Frankly this is something that interests me as well.

There is no reason is couldnt work, but you would have to make some basic changes to how movement and such is normally done.

Instead of gravity going down it would of course have to be a force towards the center of the sphere. And also you would have to apply a constant force to everything, not just the player. And then of course you nee to set the rotations correctly.

To really make it convincing you need to make the sky a sphere as well..and some kind of atmostphereic scatter effect would help as well.


Sphere Engine--the premier A6 graphics plugin.
Re: world inside a sphere [Re: Matt_Aufderheide] #95127
10/21/06 17:16
10/21/06 17:16
Joined: Oct 2006
Posts: 873
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
if you have a physics engine you may try rhis one
this will work only with one sphere and one obj attached to it
entity* sphere;
var gravity_ang[3];
var temp_gravity[3];
var gravity_force=300;//try changing this

function link_to_sphere()//the link function
{
vec_set(temp,sphere.x);
vec_sub(temp,my.x);
vec_to_angle(gravity_ang.pan,temp); // set gravity angle to the center of the sphere
vec_set(temp_gravity,nullvector);
temp_gravity.x=gravity_force;
vec_rotate(temp_gravity,gravity_ang);
vec_inverse(temp_gravity);
ph_setgravity(temp_gravity);
}

action g_sphere
{
sphere=my;
}

action boat
{
phent_settype( my,PH_RIGID, PH_BOX);
phent_setmass ( my, 100,PH_BOX);
phent_setdamping(my,100,100);
phent_setfriction(my,40);//play with this values
while(1)
{
link_to_sphere();
wait(1);
}
}
i haven't tryed this code so maybe there are errors in it
2 Josiah
nice demo, can you show the script?that code is just what i looked for!

Last edited by Shadow969; 10/21/06 17:37.
Re: world inside a sphere [Re: Shadow969] #95128
10/21/06 20:23
10/21/06 20:23
Joined: Apr 2004
Posts: 516
USA
Trooper119 Offline
User
Trooper119  Offline
User

Joined: Apr 2004
Posts: 516
USA
While a great idea Shadow, unless he is putting physics into his level, this is a bit over done, your doing to much than what needs to be done, if you put in calculations for gravity and things like that, that simply makes one more equation the computer has to do, while this is meaningless on the small scale, if you multiply this 100 fold with a complicated level and many entities going at once, you may lose one or two FPS. Quite simply be careful what you code, only do what needs to be done, games are insanely CPU intensive, so the more code you can take out of it the better.


A clever person solves a problem.
A wise person avoids it.
--Einstein

Currently Codeing: Free Lite-C
Page 1 of 2 1 2

Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1