Author Topic: Dynamic Lights Test for XP (brand new script)...  (Read 2133 times)

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Dynamic Lights Test for XP (brand new script)...
« on: May 21, 2016, 01:53:27 AM »




New script for XP that Im working on now...

All the Light Sources are FULLY DYNAMIC!

I've played with a couple of Dynamic Light Scripts, and they all seemed to have either a lot of trouble or serious shortcomings.  The one I am working on now, so far, is running at a very high framerate as opposed to a couple that I have played with, and should be very easy to use!  There is still quite a bit to do with it before I reach a Release Candidate status tho.

- I dont have any intent of building in a feature like "Fog of War" however, just so you know.

- I dont have any intent of putting in "Dynamic Shadows" where the corners of buildings cast shadows.  Not doing anything that fancy...

- I do have the intent of putting in some different graphics so the Player can have a "Flashlight" if you will

Are there any "features" that anyone would like to have built in to the script as I continue working on this?

-----

Edit - Full Version Released for download and Demo here:
http://forum.chaos-project.com/index.php/topic,13682.0.html

I should have edited this post a while ago for anyone who is interested in the full functionality of this script.  Sorry for the delay...
« Last Edit: November 19, 2016, 10:18:50 PM by Heretic86 »
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2990
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #1 on: May 21, 2016, 02:07:18 AM »
Might as well incorporate some day-night system with it. Not sure how feasible it would be to work with other day-night systems that lack any dynamic lighting.

How about giving a list of scripts you have used and evaluate them?



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #2 on: May 21, 2016, 02:21:26 AM »
Day and Night, will do...

Others I've looked at and evaluated:

http://www.hbgames.org/forums/viewtopic.php?f=11&t=74494&sid=93da246f8bbf96ed64e3e51b5e96e2ac
- Trouble here is you cant move the Lights around dynamically

http://forum.chaos-project.com/index.php/topic,14284.0.html
- Fast enough but relies too much on parallel events so hard for many people to use

Ive seen a couple modifications to scripts, and they are either too difficult for the average RPG Maker user to use or suffer terrible frame rates!  I know Blizz worked on one that cast shadows, I dont plan on doing that tho...

Know of any others I can take a look at?
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2990
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #3 on: May 21, 2016, 02:45:53 AM »
Basically just check the script database. Also Moonpearl's, though I never tried it, probably not even dynamic either. Might help with the day/night.
http://moonpearl-gm.blogspot.fr/2013/12/daily-life-project-part-1-time-and.html

I mean, just google for it. It's a pretty common script people have done before.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19917
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #4 on: May 21, 2016, 06:24:21 AM »
Right, I once made a conversion from a VX script. I might be able to dig it out if you want.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #5 on: May 26, 2016, 03:50:48 AM »
Right, I once made a conversion from a VX script. I might be able to dig it out if you want.

I have a copy of it.  Conversion of Khas Awesome Lighting.  One cool thing was it had shadows.  Was that particularly difficult to do?

---

I've asked for assistance from ThallionDarkshine to create a dll that handles bitmap rotations since I cant use a sprite as a lightsource, and bitmaps only cache the original version.  Yes, Im still working on this, but it might take a week or two before I put out a demo...  Sad thing is that there are only like 5 things that need to be done to create a "dynamic shadowmap" and display it at a very high speed!
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2990
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #6 on: May 26, 2016, 08:25:48 AM »
You still haven't figured out how to make a DLL yet? I thought you were learning some years ago :huh:



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19917
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #7 on: May 26, 2016, 09:55:43 AM »
I put the whole source code with a Visual Studio project in my XPA_Window implementation. You can check it out there.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #8 on: May 27, 2016, 01:28:02 PM »
Im getting a lot closer to being done.  Still have some work to do, and have to do ALL the script commenting explaining how to use it.  Per KK20's advice, I added a Day / Night system and there are smooth transitions between day and night.  Also has a setting for "Indoor Lighting" which is not affected by time of day.  I added some stuff so that lights could fade in and out depending on day or night and everything in between even if an "Indoor Light" is used.





And it is still running very fast!  I dont think I am going to do dynamic shadows however, its too much work for the users!

Other than all that, how does this look so far, appearance wise?
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19917
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #9 on: May 27, 2016, 05:53:19 PM »
Looks pretty good.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2990
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #10 on: May 27, 2016, 06:49:09 PM »
Should GIF it for ultimate dynamic-ness



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #11 on: May 27, 2016, 11:56:29 PM »
Should GIF it for ultimate dynamic-ness



Animated! (give it a moment to fully load)

I made a variable to control how long a day lasts and set that to a really low number to make a very fast transition from day to night.  Normally the transition from day to night would take quite a bit longer, depending on how a user configures the options in the script.
« Last Edit: May 27, 2016, 11:59:00 PM by Heretic86 »
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2990
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #12 on: May 28, 2016, 12:08:52 AM »
Very smooth :) I like



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19917
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #13 on: May 28, 2016, 08:54:39 AM »
... Excuse me, I'll just have to quickly go change my pants.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline schmoggi

  • Trained Member
  • *
  • Posts: 37
  • LV: 1
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #14 on: May 28, 2016, 02:39:57 PM »
Oh my, didn't see that coming! That looks very nice, Heretic.
I have used the Light Script called Fabien 3.0 in the past and i was fine with it. But this looks very promising.
Probably i'll stick with it when it is released, i like to have most as possible from one Hand :). I've got one Question though:

Is the Day & Night System linked with the functionality of the Light System or is it free to decide using only the Light System or both?

I ask because while i was looking out there in the Past for some Light Scripts, i've always found some with inbuild Day & Night System which bothered me, to be honest.
Many People, like myself, like to use their own (Evented) Day & Night System or have already build one and do not like to drop it.
And that is the reason i like the Fabien 3.0 one so much because it can be used without some inbuild Day & Night.

Thanks for the Answer.

greetz
« Last Edit: May 28, 2016, 02:44:35 PM by schmoggi »

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #15 on: May 28, 2016, 11:38:42 PM »
A Time system has to be built in for less work for the end user.  There really isnt any way around it.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Lexima Warrior
  • ****
  • Posts: 2990
  • LV: 369
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #16 on: May 29, 2016, 01:56:26 AM »
That sounds extremely limiting. It's not hard to just make another method.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #17 on: May 29, 2016, 12:55:38 PM »
That sounds extremely limiting. It's not hard to just make another method.

I should explain better.

Matching a "Light" with the Day / Night / Indoor Light is a comment option for each event.  I used a game variable to know what time it is, and a game switch to go back and forth between indoor and outdoor lighting.  The time system isnt very robust, and isnt mandatory to be used.  Its a simple 24 hour clock, no days of the week, no solstices, no months, no calendar, etc.  In the end, Eventers have full control over everything, from script calls to comments. 

Im also taking a few days off for Memorial Day weekend seeing as I am a vet and all...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #18 on: June 01, 2016, 05:02:25 AM »
*bump* (Like its even needed)

Im being held back from progress on this script due to my lack of l33t sk1llz with .dll files.

I need a .dll file that can handle Bitmap Rotations.  I asked Thallion to take a crack at it, but he may be a bit busy.  I am hoping it will not be too difficult.  It will need to be fast, so I suspect GPU Rotation may be necessary.  This can not be done from a Sprite Rotation because stretch_blt is needed to draw the Bitmap of the Lightsource into a Shadowmap, which doesnt take Sprites, just Bitmaps, and the Bitmaps in RPG::Cache are unrotated versions of the Image.

Basically:

# Rotate the Cached Unrotated Bitmap Image if needed
light_bmp = rotate_bitmap(light_bmp, @light.angle) if @light.angle != 0

Center of Rotation needs be Center of Image.  Image Rect can change in size as much as needed so it doesnt need to change size.

Flipping Horizontal and Vertical may also be quite useful.  No other effects are needed.

Does anyone think they can help out with this?
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 733
  • LV: 29
    • View Profile
Re: Dynamic Lights Test for XP (brand new script)...
« Reply #19 on: July 01, 2016, 01:20:10 PM »
Ok, finally got .dll file for Bitmap Rotations finished and working very stable.

@KK20, it was simply a matter of changing transx> width to transx>=width for the .dll crashes.  :facepalm:

Anyway, now that I can Rotate Lights, and you've seen the Spotlight Effect, Im also working on Pendulum Lights!



The gif has a bit of a stutter, it is much smoother in game!  I also made the shadows quite a bit darker than I would normally set them to in order to make the Pendulum Light much easier to see.  The movement is also accelerated as normally pendulums would not swing quite that fast.

Now, for Pendulums, which is another script (already available in the Database), I had to put together TWO types.  One is shown above.  It tracks the bottom position of the Pendulum.  That is a Vertical Pendulum.  The other will display over flat ground.  Movement wont curve like it does above and is only a left and right pattern.  But I've also added other options so the light will fade out as it approaches Right Angles as well as increases in size.  The animated gif above is intended to show off Bitmap Rotations!  Woot!

Yes, I am still working on this.  I got a bit busy earlier this week and hadnt had much time to code. 

Yay for Holiday Weekends, right?

Im a lot closer to releasing this.  I think I need to put in a feature for Lightning.  Other requests are already fulfilled.  Dawn and Dusk can be called manually.  Lots of shortcuts to do as there are a bazillion commands going on that need to be simplified for users.

Can anyone think of what else a Dynamic Lighting script might need?
« Last Edit: July 01, 2016, 01:34:43 PM by Heretic86 »
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)