environnement Scale

Posted By: Hirogens

environnement Scale - 09/22/09 13:11

Hi,

My game is based on galaxy view.

My galaxy have between 6 000 to 10 000 stars (sun).
This galaxy must rotate slowly..

do you think it is possible to display completely?
Should I see 6000 or spheres are there some other method cheaper?

regards
Christophe
Posted By: Tai

Re: environnement Scale - 09/22/09 14:37

Depends on how close the player gets to the stars. You could probably use a skycube for high-performance.
Posted By: Rasch

Re: environnement Scale - 09/22/09 14:49

This is from the AUM 81.

First write this in your while loop of the playership or whatever you want to have the stars created around.

Code:
action player_ship()
{
   ... // whatever
   while(1)
   {
   star_pos.x = my.x - 500 + random(1000);
   star_pos.y = my.y - 500 + random(1000);
   star_pos.z = 0;
   effect(starfield, 1, star_pos.x, nullvector);

   wait(1);
   }
}



And add following functions to your script.

Code:
function starfield(PARTICLE *p)
{
       p.alpha = 5 + random(50);
       p.bmap = star_tga;
       p.size = 2 + random(1); // generate stars with random sizes
       p.flags |= (BRIGHT | TRANSLUCENT);
       p.event = fade_stars;
}

function fade_stars(PARTICLE *p)
{
       p.alpha -= 0.5 * time_step; // fade out the stars
       if (p.alpha < 0)
       {
               p.lifespan = 0;
       }
}



Now particles are created around the player. You can set the range of the particles also in the depth.

Just change star_pos.x, star_pos.y and star_pos.z to your wishes.

Dont forget if you want to chang the value random always needs the half of itself. Otherwise the stars would be more on one side than another.

Example:

500 + random(1000) // I want to increase the radius

2500 + random(5000) // Hell yeah! Thats some good radius!

Greets
Posted By: Hirogens

Re: environnement Scale - 09/22/09 14:50

Hi,

the player must click on the star so I can draw the planet system.

regards
Posted By: Rasch

Re: environnement Scale - 09/22/09 14:57

You could use sprites for example. Just pics not models. And give them the actions. Maybe this could work with thousands of entities.
Posted By: Hirogens

Re: environnement Scale - 09/22/09 18:45

Originally Posted By: Rasch
This is from the AUM 81.

First write this in your while loop of the playership or whatever you want to have the stars created around.

Code:
action player_ship()
{
   ... // whatever
   while(1)
   {
   star_pos.x = my.x - 500 + random(1000);
   star_pos.y = my.y - 500 + random(1000);
   star_pos.z = 0;
   effect(starfield, 1, star_pos.x, nullvector);

   wait(1);
   }
}



And add following functions to your script.

Code:
function starfield(PARTICLE *p)
{
       p.alpha = 5 + random(50);
       p.bmap = star_tga;
       p.size = 2 + random(1); // generate stars with random sizes
       p.flags |= (BRIGHT | TRANSLUCENT);
       p.event = fade_stars;
}

function fade_stars(PARTICLE *p)
{
       p.alpha -= 0.5 * time_step; // fade out the stars
       if (p.alpha < 0)
       {
               p.lifespan = 0;
       }
}



Now particles are created around the player. You can set the range of the particles also in the depth.

Just change star_pos.x, star_pos.y and star_pos.z to your wishes.

Dont forget if you want to chang the value random always needs the half of itself. Otherwise the stars would be more on one side than another.

Example:

500 + random(1000) // I want to increase the radius

2500 + random(5000) // Hell yeah! Thats some good radius!

Greets


thanks,

I go adapt this example
My galaxys are fixe coordinate and fixe magnitude.

regards
Posted By: Hirogens

Re: environnement Scale - 09/22/09 18:51


but I canit click on particle ???

regards
© 2024 lite-C Forums