Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 793 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Huge Space #81458
07/14/06 21:42
07/14/06 21:42
Joined: Apr 2004
Posts: 258
Canada, Nova Scotia
Damarus Offline OP
Member
Damarus  Offline OP
Member

Joined: Apr 2004
Posts: 258
Canada, Nova Scotia
Hi all,

maybe i already asked this before but i can't find the post right now so i ask again does anybody know how to program the space that it seems to be endless and that you never reach the end of the sphere. I still have no clue how to program it because i'm not really good at programming. Any help is appreciated. Thx in advance.

Re: Huge Space [Re: Damarus] #81459
07/14/06 23:29
07/14/06 23:29
Joined: Dec 2000
Posts: 4,608
mk_1 Offline

Expert
mk_1  Offline

Expert

Joined: Dec 2000
Posts: 4,608
Code:
action sky_sphere {
while(1) {
vec_set(my.x, camera.x);
wait(1);
}
}



Assign this one to your sky sphere.


Follow me on twitter
Re: Huge Space [Re: mk_1] #81460
07/15/06 18:43
07/15/06 18:43
Joined: Apr 2004
Posts: 258
Canada, Nova Scotia
Damarus Offline OP
Member
Damarus  Offline OP
Member

Joined: Apr 2004
Posts: 258
Canada, Nova Scotia
and with this code it seems to be endless? And thx for your help.

Re: Huge Space [Re: Damarus] #81461
07/15/06 23:17
07/15/06 23:17
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
one way is to reset the player position to the world origin every time he reaches the limits , the other is to move the world not the player , but I've only heard about this,never saw it in-game.


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Huge Space [Re: EpsiloN] #81462
07/16/06 14:37
07/16/06 14:37
Joined: Apr 2004
Posts: 258
Canada, Nova Scotia
Damarus Offline OP
Member
Damarus  Offline OP
Member

Joined: Apr 2004
Posts: 258
Canada, Nova Scotia
well thx for your help I will try that.

Re: Huge Space [Re: Damarus] #81463
07/16/06 16:14
07/16/06 16:14
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
You could also move the object at a slightly slower speed than the camera. This would allow for perspective effects, but instead of apparently being 65,536 quants diameter, you could simulate something over 1 million quants diameter by making it move 15/16 as fast as the camera:

Code:

my.x = camera.x/16;
my.y = camera.y/16;
my.z = camera.z/16;



So, rather than the object being 1024 quants away from moving 1024 quants, it'd only change by 64 quants from moving 1024 which gives the sense of a huge distance.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Huge Space [Re: ulillillia] #81464
07/16/06 21:03
07/16/06 21:03
Joined: Apr 2004
Posts: 258
Canada, Nova Scotia
Damarus Offline OP
Member
Damarus  Offline OP
Member

Joined: Apr 2004
Posts: 258
Canada, Nova Scotia
So if I understand this right the skysphere moves faster than the entity or is it the other way around? It still a bit complicated what your saying I just want to understand it. And doesn't this code need a action or function or do I have to put that code just in my main script? But thx anyways for your help.

Re: Huge Space [Re: Damarus] #81465
07/16/06 21:58
07/16/06 21:58
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
What this does is moves the entity at a speed slightly slower than that of the camera. With the camera at 65,536 as the position, the entity would've only moved 4096 quants from the start which isn't much at all. Increase the scaling, it would've only moved 1024 if the 64 was used instead of 16 making it seem 4 times further away.

Another example - if the camera was moving 64 quants per frame, the sky model would only move 4 quants per frame. You'd have the code like this to get it to work:

Code:

action move_with_camera
{
while(1)
{
my.x = camera.x/16; // play with the 16
my.y = camera.y/16;
my.z = camera.z/16;
wait(1);
}
}



Increasing the number being divided by makes the sky sphere seem bigger. 16 means 16 times bigger thus, if the sky sphere was 1024 quants in diameter, this would simulate a diameter of 16384 quants. Change the 16 to 64 and the same sky sphere would simulate a diameter of 65,536.

Edit: didn't properly copy/paste message from Notepad - stupid browser tabbing bug....

Last edited by ulillillia; 07/16/06 22:05.

"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Re: Huge Space [Re: ulillillia] #81466
07/17/06 12:14
07/17/06 12:14
Joined: Apr 2004
Posts: 258
Canada, Nova Scotia
Damarus Offline OP
Member
Damarus  Offline OP
Member

Joined: Apr 2004
Posts: 258
Canada, Nova Scotia
Really thx very much.:D This sounds really cool thx again! And another short question do I have to assign this to the sphere or the entity and do I need a entity for this or does it work with the sphere only?
And thx again for your help.

Re: Huge Space [Re: Damarus] #81467
07/17/06 16:57
07/17/06 16:57
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
ulillillia Offline
Senior Expert
ulillillia  Offline
Senior Expert

Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
It works with entities as well. I did something similar with my 3D game's clouds. Because I had an offset to get the clouds 2 miles high (I'd be level with them at 84,480 quants for the Z position), I had to make a few modifications, but this is the simplest it gets. You assign the action to the sky sphere. I suggest adding the scene flag to your sky sphere or strange things may happen.


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials
Page 1 of 3 1 2 3

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