0 Members and 1 Guest are viewing this topic.

#### ACagliano

• Posts: 919
• Rating: +32/-2
« on: June 03, 2014, 12:53:52 pm »
I am thinking about rebooting an old game I was working on a while back, and as I was thinking about it, something very ingenious came to me. Let's say for a minute that the game's map is done in 3/4 level greyscale. I was wondering if it would be possible to have, at some point in the game, a timer to start running, and as that timer elapses, the map actually starts to darken (i.e. the greyscale slowly becoming darker until eventually the whole map is just black). If I could do this, then how hard would it be to have the effect not occur within a certain radius around a moving player?

#### Matrefeytontias

• Axe roxxor (kinda)
• LV10 31337 u53r (Next: 2000)
• Posts: 1982
• Rating: +310/-12
• Axe roxxor
« Reply #1 on: June 03, 2014, 12:56:25 pm »
For the whole screen, just play with the contrast. It's not possible with only a part of the screen, except by successively lowering the gray level of the screen (ie making white pixels light-gray, light-gray pixels dark-gray etc), which is a very cheap solution anyway.

#### ACagliano

• Posts: 919
• Rating: +32/-2
« Reply #2 on: June 03, 2014, 01:00:43 pm »
I'm gonna Pm you my idea... the contrast wouldn't work...

#### Matrefeytontias

• Axe roxxor (kinda)
• LV10 31337 u53r (Next: 2000)
• Posts: 1982
• Rating: +310/-12
• Axe roxxor
« Reply #3 on: June 03, 2014, 01:04:58 pm »
Why not just posting it here ?

#### ACagliano

• Posts: 919
• Rating: +32/-2
« Reply #4 on: June 03, 2014, 01:05:57 pm »
Well i kinda wanted the reboot to be a secret, but here it is:

Idea... Zelda reboot. Once you hit a certain point in the game, you get a message telling you darkness is spreading from wherever and you need to hurry or you'll lose the light. From that point on, the world darkens slowly. But, along the way you learn a light giving spell that can remove that effect within a certain area around you.

How difficult is this to do? Also, for this to be most effective, should it be 3 or 4 level grey?
« Last Edit: June 03, 2014, 01:17:54 pm by ACagliano »

#### Sorunome

• Fox Fox Fox Fox Fox Fox Fox!
• Support Staff
• LV13 Extreme Addict (Next: 9001)
• Posts: 7920
• Rating: +374/-13
• Derpy Hooves
« Reply #5 on: June 03, 2014, 01:24:49 pm »
You could add more and more black pixels all over the screen until only the character is left.
 THE GAMEAlso, check out my websiteIf OmnomIRC is screwed up, blame me!Click here to give me an internet!

#### ACagliano

• Posts: 919
• Rating: +32/-2
« Reply #6 on: June 03, 2014, 01:30:05 pm »
You could add more and more black pixels all over the screen until only the character is left.

I was wondering about some sort of bit-masking... but I'm really not knowledgeable of the concepts involved.

#### Eiyeron

• Urist McEiyolobster
• LV10 31337 u53r (Next: 2000)
• Posts: 1430
• Rating: +130/-10
• (-_(//));
« Reply #7 on: June 03, 2014, 04:51:58 pm »
Here, you have a byte
Code: [Select]
XXXX XXXXbit-masking is taking only some of these bits by using a bit mask and using binary AND
Code: [Select]
_XXXX XXXX&1111 0000=XXXX 0000Here, you should use OR to only turn bits to 1 if you want to darken the screen.

#### Runer112

• Moderator
• LV11 Super Veteran (Next: 3000)
• Posts: 2289
• Rating: +639/-31
« Reply #8 on: June 03, 2014, 06:29:51 pm »
One rather cheaty way to do it that would cost no rendering time (barring a one-time cost when changing the palette) would be to place a copy of all graphics in RAM, and when changing the palette, repopulate all the graphics data from the originals, but with palette adjustments made. Due to the potentially large RAM requirement, this may not be ideal/feasible.

A more traditional way would be to alter the perceived palette in the drawing code. If you use 3-level grayscale, you might do something like this:

Code: [Select]
Lbl Light 0→DReturnLbl Dark 1→D Fill(L₃,768,-1)ReturnLbl PtOff Pt-Off(r₁,r₂,r₃) !If D  Pt-Off(r₁,r₂,r₃+8)ʳ  Return End Pt-On(r₁,r₂,r₃+8)Return
4-level grayscale is a bit trickier, but it could look something like this:

Code: [Select]
Lbl Light 0→DReturnLbl Med1→DReturnLbl Dark 2→D Fill(L₆,768,-1)ReturnLbl PtOff !If D  Pt-Off(r₁,r₂,r₃)  Pt-Off(r₁,r₂,r₃+8)ʳ  Return End !If -1  Pt-Off(r₁,r₂,r₃)  Pt-On(r₁,r₂,r₃+8)  Pt-Off(r₁,r₂,[FFFFFFFFFFFFFFFF])ʳ  Pt-Change(r₁,r₂,r₃+8)ʳ  Pt-On(r₁,r₂,r₃)ʳ  Return End Pt-Off(r₁,r₂,r₃)ʳ Pt-On(r₁,r₂,r₃+8)ʳReturn
As you can see, the medium darkness logic is sort of tricky, and that may cause a noticeable slowdown in your program. I haven't looked into the other sprite drawing variants, but they'd probably have their own logical complications.

If it can be done without making them take substantially more time, the ultimate solution would be to go beyond Axe and to write a variant of the grayscale display routine for each palette. This would require no change in how graphics are drawn and little to no cost in rendering speed.
« Last Edit: June 03, 2014, 06:31:32 pm by Runer112 »

#### DJ Omnimaga

• Clacualters are teh gr33t
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55931
• Rating: +3153/-232
• CodeWalrus founder & retired Omnimaga founder
« Reply #9 on: June 04, 2014, 01:46:52 am »
I normally just change the contrast, but that cause issues with HUDs not being as visible.

Also at first from the Fade to Black part of the title I thought this would be a Metallica-themed calculator project.

#### ACagliano

• Posts: 919
• Rating: +32/-2
« Reply #10 on: June 04, 2014, 01:55:15 pm »
I normally just change the contrast, but that cause issues with HUDs not being as visible.

Also at first from the Fade to Black part of the title I thought this would be a Metallica-themed calculator project.

Yeah, contrast changing would be easier, but it has the drawback of making the HUDS not visible and also i can't do the sphere of the effect-removing spell.

Is there anyone here with some experience making RPG's of this style with some spare time? I have the project hosted on Bitbucket and I'd be more than happy to have anyone who wants to contribute, even just a little, help.