Dynamic Lights Test for XP (brand new script)...

Started by Heretic86, May 20, 2016, 07:53:27 pm

Previous topic - Next topic

Heretic86

May 20, 2016, 07:53:27 pm Last Edit: November 19, 2016, 03:18:50 pm by Heretic86




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...
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.)

KK20

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 Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Heretic86

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.)

KK20

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 Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

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 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

Heretic86

Quote from: Blizzard on May 21, 2016, 12:24:21 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.)

KK20

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 Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

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 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

Heretic86

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.)

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

KK20


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Heretic86

May 27, 2016, 05:56:29 pm #11 Last Edit: May 27, 2016, 05:59:00 pm by Heretic86
Quote from: KK20 on May 27, 2016, 12:49:09 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.
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.)

KK20


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

... Excuse me, I'll just have to quickly go change my pants.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

schmoggi

May 28, 2016, 08:39:57 am #14 Last Edit: May 28, 2016, 08:44:35 am by schmoggi
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

Heretic86

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.)

KK20

That sounds extremely limiting. It's not hard to just make another method.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Heretic86

Quote from: KK20 on May 28, 2016, 07:56:26 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.)

Heretic86

*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.)

Heretic86

July 01, 2016, 07:20:10 am #19 Last Edit: July 01, 2016, 07:34:43 am by Heretic86
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?
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.)