Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Shadow Script V.4

sorry again i split up my huge map into 4 parts but i still have 175 events right now and my game runs at 2-4 FPS(frames per second) and without the shadow script it runs at normal.. well around 36-38 FPS.. Is there something I'm just not doing right?
 
Fenwick;202749 said:
Is there away to prevent the shadows from following you when the object is no longer on the screen? This only happens with objects, I understand that you stated that the script doesn't work so well with objects, but I was wondering if this is in the process of being fixed. Or if there is already a fix to prevent this?

Thanks for the help

Edit: What I mean is-- The object casting a shadow (treasure chest) was just checked, the Hero walks away and the object is no longer on the screen (becasue you walked far away from it). But, the shadow from that object (the treasure chest) is still on the screen and follows you around at the edge of the screen.
This has nothing to do with switching the shadow of that stationary object off, as it will always have that shadow on as it will always be near the light source (the treasure chest is a stationary object).
I hope this explains things alittle better.

Edit #2:

Light Source Comments:

Shadow|120|290|200 <-- Dynamic Shadows v4.0
Light Effects <-- Near Fantastica Date: 28.06.05 v3.0
RightLantern <--Near Fantastica Date: 28.06.05 v3.0


Objects Shadow Comments:

Comment: o
Comment: chest <-- Passability Mini Map by squall
30th of May 2006

Note: The above problem did not occure with the Old version of Dynamic Shadows (The version before v4.0 that is)

Also noticed: Shadows on objects will not carry through an event even if the opacity is set to 255. Pics below will show you what I mean.

Ok Fenwick, based on your pictures I think the reason the shadow is broken is because of the events you have in the path of the shadow. Try moving the event out of the way and see if the shadow is still broken.

What other scripts are you using? I had a similiar problem with my shadows... The shadow was supposed to stop processing, but for some reason it didn't. It wouldn't follow me unless I was moving up and down.

I found out that when i use the "New" Mode 7 script, the Mode 7 script has to be above the Shadow script or it screws up your shadow. I believe it had something to do with the fact that both scripts used a Spriteset [I believe they rewrite it, but I'm no scripter].

Maybe you can give your other scripts and we can find an order that will work for you.

xthexendxhasxcomex said:
sorry again i split up my huge map into 4 parts but i still have 175 events right now and my game runs at 2-4 FPS(frames per second) and without the shadow script it runs at normal.. well around 36-38 FPS.. Is there something I'm just not doing right?

HOLY CRAP!!! Thats a lot of events on one map. How many of those are Light sources? How many are Shadow producers? Did you try to turn off the shadow grow constant? Maybe you post an event so we can see how you have it set up.

I don't claim to be a scripter, so don't expect Sephirothspawn, Trickster, or Rataime type comments from me, but I can usually figure out fixes when I start troubleshooting.
 
I didn't see Fenwick's edits before... sorry !
Are the events "above" ? If not, I guess I never thought of this case. Will think of it.
As for the "following shadows", Firestalker5 is probably right : it must be an incompatibility. You should copy your project, and delete scripts one by one, so we can identify the culprit.

The shadows ARE lag inducing, because rmxp has to rotate and deform the sprites. Turn off the shadow grow constant, and see if it's better. I'll try to implement some other lag cuts, but there is a limit to what I can do. Sorry.
 
-this is how i have the script set(like it used to be).

SHADOWS_SOURCE_COMMENT_TRIGGER = 'begin shadow source'
SHADOWS_SOURCE_COMMENT_PATTERN = 'trigger|arg1|arg2|arg3'
SHADOWS_CHAR_COMMENT_TRIGGER = 'begin shadow'
SHADOWS_CHAR_COMMENT_PATTERN = 'trigger'

but then i also counted up how many shadow sources i have and i have the light effect script so i counted up how many light effects there are without the shadow source comment,
I have 17 events with the shadow source comment.
and I have 30 events with just light effects. LOL might be a bit much.
Oh and here is how I have my events set up
http://img341.imageshack.us/img341/6522/eventsetuphb3.png[/IMG]
and i took off the Shadow Gets Longer thing. it gave me about 2-3 FPS back. lol sorry, and thanx for helping

-Alright sorry, i edited my game a little bit so i took out some of the lights and shadows.. i only have 8 events with the shadow source comment and I have 10 with just the light effect.. without the shadow Gets Longer i get 8-9 FPS with it I get 7-8 FPS

-sorry to also bring this up i think there might be a bug here's a screenshot, when you stand behind a table or something like it the shadow is cut off..
http://img261.imageshack.us/img261/4301/tablebuguk1.png[/IMG]

and also i was wondering if you could help me make Near Fatastica's Squad Movement script compatible with this script, the other party members dont have shadows..
http://img512.imageshack.us/img512/957/squadfixni3.png[/IMG]
 
xthexendxhasxcomex;205167 said:
this is how i have the script set(like it used to be).

SHADOWS_SOURCE_COMMENT_TRIGGER = 'begin shadow source'
SHADOWS_SOURCE_COMMENT_PATTERN = 'trigger|arg1|arg2|arg3'
SHADOWS_CHAR_COMMENT_TRIGGER = 'begin shadow'
SHADOWS_CHAR_COMMENT_PATTERN = 'trigger'

but then i also counted up how many shadow sources i have and i have the light effect script so i counted up how many light effects there are without the shadow source comment,
I have 17 events with the shadow source comment.
and I have 30 events with just light effects. LOL might be a bit much.
Oh and here is how I have my events set up
http://img341.imageshack.us/img341/6522/eventsetuphb3.png[/IMG]
and i took off the Shadow Gets Longer thing. it gave me about 2-3 FPS back. lol sorry, and thanx for helping

Alright sorry, i edited my game a little bit so i took out some of the lights and shadows.. i only have 8 events with the shadow source comment and I have 10 with just the light effect.. without the shadow Gets Longer i get 8-9 FPS with it I get 7-8 FPS

Ok.... not being a scripter, but someone that has used the script, I would have to say that the way you have the event setup is the cause of the problem.

When you set up the event you didn't give a Distancemax arg [You didn't give an Anglemin and Anglemax either for that matter]. Without knowing how the script works exactly I would say the script is trying to make all the shadows at once... Which WILL kill your computer.

Try changing your event comments to something like :

Comment: begin shadow source|0|360|200

Here is how the comment is supposed to go:

Comment: Trigger | Anglemin | Anglemax | Distancemax

This basically tells the script that the light source emits light 360 degrees around which makes the shadow be produced at any angle from the light [Anglemin = 0, Anglemax = 360]

The last number tells the script how far away you have to be from the light before the shadow disappears [or appears if you're walking toward the light]. I remember Rataime saying that the script actually stops processing the shadow when the sprite is out of range. So what's probably happening is that you have no maximum distance and the script is calculateing a shadow from every light source at once.

Try the above comment and see if that helps.

EDIT: The Table thing is actually just a layer issue. The shadow has a tendency to go over certain layers, especially if they have low number [can't remember what it's called, but it's in the Database under Tilesets and it sets the "hieght" of the object].


EDIT2: Also are you commenting the light source to have shadows also? From your screenshots it looks that way. You might want to erase that, it cause a lot of lag in that the script is now processing a shadow for the source constantly. Just a suggestion.

The shadow for the source of light doesn't really help the look of the map, it's adding processes for the game to process.
 
oh i see how the comments are supposed to be now, thank you and yes it helped ALOT now I'm getting around 24 FPS which I think is pretty good.

and no I'm not commenting the light to have shadows too, i figured out that problem though.. because i had the shadow source comment trigger as "begin shadow source" and the shadows char comment trigger as "begin shadow" the source also has begin shadow in it so it was like both comments in one if that makes sense, so i changed the "begin shadow source" to "start shadow source" and it went away because "begin shadow" wasn't in it anymore..
 
Fenwick":1bw777xp said:
Is there away to prevent the shadows from following you when the object is no longer on the screen? This only happens with objects, I understand that you stated that the script doesn't work so well with objects, but I was wondering if this is in the process of being fixed. Or if there is already a fix to prevent this?

This same issue arises in Near Fantastica's Anti-Event Lag Script.

The cause is that once the events come off the screen, the event graphic is no longer updated, but isn't properly disposed of and the Garbage Collector never picks it up.

I imagine that Rataime felt that updating the shadows OFF the screen was a bad idea and lag inducing, and has it setup not to do that, but if you do that, it causes this issue. I am unaware of a fix offhand, but now that Rataime knows the cause he can probably find a solution.
 
rataime;205097 said:
I didn't see Fenwick's edits before... sorry !
Are the events "above" ? If not, I guess I never thought of this case. Will think of it.
As for the "following shadows", Firestalker5 is probably right : it must be an incompatibility. You should copy your project, and delete scripts one by one, so we can identify the culprit.

The shadows ARE lag inducing, because rmxp has to rotate and deform the sprites. Turn off the shadow grow constant, and see if it's better. I'll try to implement some other lag cuts, but there is a limit to what I can do. Sorry.

Rataime: No, the events are NOT above. Also, I believe that "Prexus" is right in his statement above, that the graphic is no longer being updated and that the event has left the screen.

Do you know of a way to fix this? If not, that is no problem. However, just some info, this was not the case with the version before v4.0 (oops, I think I mentioned that already, sorry :))

As for scripts, currently running 79, all working together and compatible, will try deleting to see if it helps.

Thanks again for the help
 
Good work, Firestalker5 :)

As for the sprites, Fenwick, do you use an anti-lag script ? Prexus is right, it might interfere with the shadows (I update the shadow when the event sprite is updated, so if the latter isn't, the former won't be either)... If you have one, tell me and I'll fix it.
 
rataime;206061 said:
Good work, Firestalker5 :)

As for the sprites, Fenwick, do you use an anti-lag script ? Prexus is right, it might interfere with the shadows (I update the shadow when the event sprite is updated, so if the latter isn't, the former won't be either)... If you have one, tell me and I'll fix it.

Rataime: Yup, you got me, I'm using an Anti-Lag Script

AntiLag Script
f0tz!baercthen
# 0.71
# 06.01.2007

I should have mentioned this in my first post, sorry about that.
I uploaded the Anti-Lag script for you to look at.

Thanks again.

Fenwick
 
is a sun shadow script for SDK 2.2 comming soon? i would like to have that awesome script :)

edit: im also waiting for a timed version of this script (Advance time script compatible)
Your scripts make the games look so cool :p
 
rataime;206061 said:
Good work, Firestalker5 :)

Wow! Praise from Rataime... I feel honored.

Ok.... glowing fading. Now on to the reason for the post.

Things that I would like to see updated in the Sun Effect Script and Reflection Script:

Sun Effect:

1. Better Compatibility with the "New" Mode 7 script.[It works, but the shadow only works for the hero not if you have an event though. The event gets smaller as you go farther away from it and the shadow stays the same size and well above the sprite, the shadow stays on the original plane not the new one. Possible fix: A constant that the user can change... Something like Mode_7 = false or the like. then the part of the script that runs that constant.]

2. Ability to adjust the position of the sun, angle of the shadow.[This will allow the people that use day and night event systems to add shadows to their systems if they so choose. Maybe you can also add compatibility for some of the newer day/night scripts out there as well. In order for this to work though you would have to add a "Call Script" or make it have the ability to gradually move to a position, like the real sun does. I have no possible fixes for this though.]

3. Make it able to be turned off by a switch or "Call Script" command.[Also a for those that make a day/night system. This way you can turn it off on the same map until it's needed. Like if it's night time and there is no lights around, or if you have a map that has lights, but they're not on yet. This is also something I thought of for the Shadow Script, but thought of it too late {like just now ':| }]

Reflection Script:

1. Tileset for all possible mirrors, water, and ice.[I noticed that you have a tileset for the mirrors and water in your demo. What if you got someone to make a tileset like that one, but for all the mirrors and then have the script look for the Tileset number with the special terrain tags. Make so it's not an addon, but a seperate tileset and the script looks for it. Then add new commands like Mirror_bl for a big mirror left side or something. Maybe this is too much, but it would make things easier for the user. Your call.]

---------------------------------

I'm still thinking up more so these are just a starting point. Ok... I think I'm done now.

Later,
Firestalker
 

CJF

Member

Hello, I've run into a bug with the Reflection script. The reflections work perfectly on a 20x15 sized map but whenever I increase the Height of the map beyond 16 the Reflections start messing up(They don't mess up when I increase how Wide the map is).

The mess ups are that on some of the water instead of the reflection smoothly coming up as the character steps next to the water, the reflection will just pop onto the water once the character has completed his step next to the water.

It also appears that the problem only starts on water tiles that are near the center line of the map. I made two new maps and the water near the top works, the water near the bottom works, but the water in the middle has this problem.

I have the following scripts also in place: SDK - Part I and II, Universal Message System and the Weather Script from the DynamicTime.

If you'd like, I can zip my game up and send it to you so you can see the bug for yourself. It's pretty small.

Thanks.

CJF;208412 said:
I have the following scripts also in place: SDK - Part I and II

Oops, that would be version 2.2.

CJF;208412 said:
The mess ups are that on some of the water instead of the reflection smoothly coming up as the character steps next to the water, the reflection will just pop onto the water once the character has completed his step next to the water.

Sorry about a third post, I don't see where the edit feature is.

EDIT: Now I see it in plain view. I swear it wasn't there before. :P

What I just noticed is that the water in near the center of the map only messes up when you're walking down onto the water, but walking from the side across it is still smooth. Hope that helps.

Thanks.
 
I haven't review the code for, like, 2 years, so I'm not going to answer now, but I eventually will. I've already solved a few bugs like that in the shadow script, so I might be able to solve those the same way.

And I haven't forgotten you, Fenwick, I just have a nice little script to finish...
 
rataime;208445 said:
I haven't review the code for, like, 2 years, so I'm not going to answer now, but I eventually will. I've already solved a few bugs like that in the shadow script, so I might be able to solve those the same way.

And I haven't forgotten you, Fenwick, I just have a nice little script to finish...

Rataime: "Okay, I've been standing in this empty room now for sometime...", just kidding... Any new insight on my problem listed above?

Thanks again,

Fenwick
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top