Prowler Productions
  Dink Smallwood Forum
  Fnarking Shnite... no cool darkness technique after all (maybe)

Post New Topic  
profile | register | faq

Author Topic:   Fnarking Shnite... no cool darkness technique after all (maybe)
redink1 posted 08-12- 11:29 AM CT (US)   Click Here to See the Profile for redink1   Click Here to Email redink1  
Yeah, cane me all you want, the darkness technique (really a dumb hack) doesn't work after all. Well, it does work (kinda) but there is one tiny problem: it is processor dependant. Sort of like the problem with Dinkanoid; it don't work very well on fast computers.

It runs great on a K6-2 333mhz, ATI Rage Pro, etc. (my old computer), but try to use the darkness technique on my 1.4 GHZ Athlon, and it just does a cruddy fade_down(). Disappointing to say the least.

To find out how I did it, check out the following scripts. It doesn't really make any sense how it works (at least it didn't to me at first), but my theory is spawning a lot fo dark2.c makes dink.exe halt the fade_down process before it was completed (hence, semi-darkness). I discovered this while trying to spawn a lot of bombs while fading down; I streamlined it to the point where it worked without having to use bomb sprites or sounds.

//dark1.c - to be spawned from another script
//&darkness - global variable, defined before dark1.c is spawned
void main(void)
{
int &bcount = 0;
loop:
spawn("dark2");
&bcount += 1;
if (&bcount < &darkness) goto loop;
//Darkness is between 70-100. 70 really dark, 100 really light
fade_down();
kill_this_task();
}

//dark2.c - referenced to in dark1.c
void main(void )
{
wait(1);
kill_this_task();
}

One other option (perhaps) is to do something like this:

fade_down();
wait(50);
loop:
fade_up();
wait(1);
fade_down();
wait(1);
goto loop;

I haven't tested this (typing this on a non-Dink computer), but I think it could work. Though I thought I did something like that before and it didn't work (or something... I don't remember).

Chrispy1000000 posted 08-15- 11:20 AM CT (US)     Click Here to See the Profile for Chrispy1000000  Click Here to Email Chrispy1000000     
Do you remember in the Dink forever series how darkness took for me like 10 minuits? It was in the save machien/inventory screen. I don't really remember how I got there though. Well, I was thinking (suprise, suprise), If you could lengthin the amount of time the darkness takes it would give you more room to manover in... But then it could all be because I was running those d-mods on a 75mhz comp... But that was the only time I experianced a slowdown like that..
Chrispy.
Beuc posted 08-15- 01:35 PM CT (US)     Click Here to See the Profile for Beuc  Click Here to Email Beuc     
For your 2nd solution, RedInk1, it doesn't work because fade_[down|up](...) make the script pause.
Maybe if you spaw several times a script like this, instead of a loop...
redink1 posted 08-15- 03:03 PM CT (US)     Click Here to See the Profile for redink1  Click Here to Email redink1     
Yeah, I saw that the second doesn't work.

I did try something that kinda worked though (like you said, but I tried it a couple days ago).

//NEscript.c
fade_down();
wait(50);
spawn("fup");
spawn("fdn");

//fup.c
loop:
fade_up();
wait(1);
goto loop;

//fdn.c
loop:
fade_down();
wait(1);
goto loop;

But it gradually got darker as time went on (and wit as too flickery). Oh well... a lost cause I guess.

Chrispy1000000 posted 08-15- 05:34 PM CT (US)     Click Here to See the Profile for Chrispy1000000  Click Here to Email Chrispy1000000     
Well, at what rate did it get darker? If it was fairly slow, that would be the startings for a great day/night script.
WC posted 08-15- 11:52 PM CT (US)     Click Here to See the Profile for WC  Click Here to Email WC     
I think we need to hurt Seth for not releasing the source to dink so people like me that programm in direct x can make cool stuff like that.
WC posted 08-16- 09:01 PM CT (US)     Click Here to See the Profile for WC  Click Here to Email WC     
Humm, I could make a program that based on your processor speed will write the script to the appropriate wait(); time, you would run it like DEA (Dink Engine Add-on, a program in development By The WCNET). What do you Think Redink?
Chrispy1000000 posted 08-16- 11:21 PM CT (US)     Click Here to See the Profile for Chrispy1000000  Click Here to Email Chrispy1000000     
How will you calculate it? I can't be on prossessor speed because you might not have defraged your comp for over 2 years now like me... Or you could have a lot of programs running... Would you have it check the speed against the clock or what? Hmmm Just brainstorming outyping.
ManaUser posted 08-18- 01:11 AM CT (US)     Click Here to See the Profile for ManaUser  Click Here to Email ManaUser     
Couldn't you find the procesor speed from within the d-mod? Something like:

//speedtst.c
main ( void )
{
&speed = 0;
//&speed would be global.
int &script = spawn("tick");
wait(1000);
run_script_by_number(&script, "kill");
say("speed is &speed.", 1);
kill_this_task();
}

//tick.c
main ( void )
{
loop:
&speed += 1;
wait(1);
goto loop;
}

kill ( void )
{
kill_this_task();
}

I think that would give you some indication of computer speed, not just make &speed 1000 as the numbers would lead one to believe.

WC posted 08-18- 08:47 AM CT (US)     Click Here to See the Profile for WC  Click Here to Email WC     
If rigged right, you *might* be able to rig thta into a script the determins the speed and then uses that in a formula to set the darkness level.

--WC

redink1 posted 08-18- 04:38 PM CT (US)     Click Here to See the Profile for redink1  Click Here to Email redink1     
Neat script Paul. I'll do some tests and such...

Post New Topic  Post Reply
Hop to:


Contact Us | Prowler Productions

Powered by: Ultimate Bulletin Board, Freeware Version 5.10a
Purchase our Licensed Version- which adds many more features!
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.