Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, alibaba), 1,426 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 4
Page 2 of 3 1 2 3
Re: add more 'realism' to night scene with stars [Re: Lion_Ts] #55881
09/23/05 21:07
09/23/05 21:07
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline OP
Serious User
Lion_Ts  Offline OP
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
Another example.
We have same night and stars... Rain and moon...
Ok, add some more 'realism' - add flare to moon and change it when rain is on.
Code:

...
sky moon { //moon
type=<bmoon.tga>;
flags=visible,transparent;//,transparent,overlay;
alpha=100;
x=500; //play with this and all below
y=-130;
z=100;
scale_x=0.25;
scale_y=0.25;
scale_z=0.25;
layer=5;
}
sky moon_flare { //moon
type=<bmoonflare.tga>;
flags=visible,transparent;
alpha=100;
x=500; //pos to moon
y=-130;
z=110;
layer=10;
}
...
//somewhere in your code
...
while(1) {
while(RAIN==on) {
//your rain code here
...
if (moon.alpha > 50) { moon.alpha-=time; }
moon.alpha = max(moon.alpha,0);
if (moon_flare.alpha > 50) { moon_flare.alpha-=time; }
moon_flare.alpha = max(moon_flare.alpha,0);
wait(1);
}
if (moon.alpha < 100) { moon.alpha+=time; }
moon.alpha = min(moon.alpha,100);
if (moon_flare.alpha < 100) { moon_flare.alpha+=time; }
moon_flare.alpha = min(moon_flare.alpha,100);
wait(1);
}


What is this ?
When rain is on - flare around moon slightly 'muted'.
Try, you'll like it

Re: add more 'realism' to night scene with stars [Re: Lion_Ts] #55882
09/24/05 05:17
09/24/05 05:17
Joined: May 2002
Posts: 2,541
Berlin
EX Citer Offline
Expert
EX Citer  Offline
Expert

Joined: May 2002
Posts: 2,541
Berlin
You shoudlnīt use waitt because itīs ld code. I thought itīs already removed. I hope you are working with the latest update. Noobs who get an error message with waitt could think itīs a typing mistake you made and write wait instead what will work but be wrong.

sleep(0.5); ~ 0.5 seconds


:L
Re: add more 'realism' to night scene with stars [Re: EX Citer] #55883
09/24/05 15:57
09/24/05 15:57
Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
TripleX Offline
Expert
TripleX  Offline
Expert

Joined: Oct 2002
Posts: 4,753
Munich, Bavaria, South of Germ...
waitt will be removed within the next update. Use sleep instead.

Triple-X

Re: add more 'realism' to night scene with stars [Re: TripleX] #55884
09/24/05 17:30
09/24/05 17:30
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline OP
Serious User
Lion_Ts  Offline OP
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
Ok, i understand.
Thank you.

Re: add more 'realism' to night scene with stars [Re: Lion_Ts] #55885
09/25/05 17:56
09/25/05 17:56
Joined: Aug 2002
Posts: 2,692
California, USA
bupaje Offline
Expert
bupaje  Offline
Expert

Joined: Aug 2002
Posts: 2,692
California, USA
Thanks for the cool effects code. All those little details add to the realism of the scene.


Find me at: |Stormvisions| Twitter|
Re: add more 'realism' to night scene with stars [Re: bupaje] #55886
09/25/05 18:45
09/25/05 18:45
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline OP
Serious User
Lion_Ts  Offline OP
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
Thank you bupaje. Sorry for offtopic, but i have to say. Your photo(avatar)! This is me. This isn't a joke , my beard slightly smaller...
And I like beer. You are ?

Re: add more 'realism' to night scene with stars [Re: Lion_Ts] #55887
09/25/05 21:57
09/25/05 21:57
Joined: Aug 2002
Posts: 2,692
California, USA
bupaje Offline
Expert
bupaje  Offline
Expert

Joined: Aug 2002
Posts: 2,692
California, USA
Quote:

...i have to say. Your photo(avatar)! This is me. This isn't a joke , my beard slightly smaller...
And I like beer. You are ?




Well I don't have the red nose and I shaved the beard. Use to wear it when I lived in a colder place. In California just itchy and now it has too much gray. I no longer drink - was only a social drinker; gave it up about 15 years ago.

From the "Post Your Photograph" thread in Morbius you can see my current mug shot.

http://bfenter.com/burtstuff/slow_decline.jpg


Find me at: |Stormvisions| Twitter|
Re: add more 'realism' to night scene with stars [Re: Lion_Ts] #55888
09/25/05 22:01
09/25/05 22:01
Joined: Jan 2003
Posts: 4,305
Damocles Offline
Expert
Damocles  Offline
Expert

Joined: Jan 2003
Posts: 4,305
To the waitt:

It is much more useful to me than sleep,
since I do not know how precise sleep will be in really
small time fractions.
I dont see a sense in removing waitt...

Re: add more 'realism' to night scene with stars [Re: Damocles] #55889
09/25/05 22:27
09/25/05 22:27
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline OP
Serious User
Lion_Ts  Offline OP
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
Bupaje, I know now, how I'll looking after 10 years
To Damocles:
Well, you are right. sleep(0.005) ? May be try to measure sleep execution ?

Last edited by Lion_Ts; 09/25/05 22:29.
Re: add more 'realism' to night scene with stars [Re: Lion_Ts] #55890
09/26/05 05:50
09/26/05 05:50

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Depending on how fast a PC is, if FPS is 300, then in a loop, you game will go through the loop 200 times.

If you still want to use waitt(), consider this:

Since there are 16 ticks per second with the waitt function, what you can do is use sleep. If you want a 16-tick precision from a waitt function, divide 1 by 16. That gives you 0.0625. So you can do this in a while loop:

sleep(0.0625);

But, there's another way: using a time variable for wait function.

wait(16) * time;

Since you want to have 16 ticks per second, all you have to do is substitute 16 for wait and multiply by time.

However, since I've tried the wait(16)*time with fps_max, I get different results. Same with sleep, too, so it's not a good ideal to use fps_max as there can be users who wanted to have a faster frame rates per second (in other words, smooth game play).

I'm not sure if the wait(16) * time can be affected by the frame rate, so I only test it with a blank level (a very small hollow cube) and my fps is pretty high. So go ahead and test it:

string _level = <time.wmb>;

font myFont = "Tahoma", 1, 16;
var myVar = 0;

Code:

panel myPanel
{
digits = 20, 20, 2, myFont, 1, myVar;
flags = visible;
}

function main()
{
level_load(_level);;
while(1) // Once the myVar goes up to 16, reset to 0 ans start again.
{
while(myVar < 16)
{
myVar += 1;
sleep(0.0625); // This makes up 16 ticks.
}
myVar = 0;
}
}



Change the code if you like (the level name, for example).

Page 2 of 3 1 2 3

Moderated by  adoado, checkbutton, mk_1, Perro 

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