Terrax Lighting system

ImaginaryVillain

One With The Particle
Veteran
Joined
Jun 22, 2019
Messages
772
Reaction score
4,326
First Language
Absurdism
Primarily Uses
RMMV
Unfortunately Terrax didn't write it like that, the whole thing is written as one giant function with a "million" nested conditional statements. So checks for stuff are all over the place instead of localized to specific objects.

What you describe it actually kind of does now, except because it's not localized, it runs countless checks once a frame per event/player all throughout the code. Such as Terrax ABS having 104 references in the code or Mog's stuff having 51 references.

Could someone make it not do that to maintain all the functionality of the script? Of course. Though my main goals were just to speed it up for my game by removing so many extra checks for very specific stuff, and hopefully adapt it for PIXI5. Not really to rewrite the whole script. Goodness knows, I'd just make my own lighting system if I wanted to do that. :LZSwink:
 

KaYsEr

Koruldia
Veteran
Joined
Mar 14, 2014
Messages
266
Reaction score
482
First Language
French
Primarily Uses
RMMV
@ImaginaryVillain Thank you for cleaning the code.

I don't know if it's caused by my plugins-list order (Terrax needs to be almost at the very top of the list otherwise the game won't start) but for some reason, the plugin command "tint set" doesn't work anymore, it's pure darkness around the light sources no matter what.

Also noticed some "flickering" on some big UltraMode7 maps, like the "dark layer" is being turned OFF and ON quickly, something like that.
Other stuff like "light cycle" doesn't seem to work either.

So, if I understand well, now the performances should be way better? That would be amazing.
I didn't have the chance to try that one:

Is it similar/better? TBH, I was about to switch to another lighting plugin because indeed Terrax isn't very friendly with potato machines (easy to see when turning it OFF through the menu), so if you made it better, I would keep it. Hopefully you'll be able to make it work as it was before (yeah no need for useless weather stuff), if you make those commands (tint/cycle etc) work I'll check on a weak laptop and tell you if it's finally 60fps. :kaocry:
 

ImaginaryVillain

One With The Particle
Veteran
Joined
Jun 22, 2019
Messages
772
Reaction score
4,326
First Language
Absurdism
Primarily Uses
RMMV
I admit haven't done extensive tests with Ocram's Lighting plugin (it too is broken by PIXI5). Of course any lighting plugin is going to be constantly redrawing shapes every frame so the very nature of what they are is going to be computationally heavy, and thus not really potato friendly.

And that's really what I've done, because the script has to execute an absurd number of times every frame. By chopping out what I deemed an unnecessary 1200+ lines of code, that's 1200+ lines of code that isn't running with every execution of the script. I've managed to get it to where it runs on top of the game in my signature. Which as of the time of making that video it didn't (my next video will show it running on top of it).
But that's why it's faster, the trade off is losing some functionality (the time system) and compatibility with specific scripts. The upside is executing significantly less code with each frame.

I'll look into fixing set tint/cycling though, I hadn't meant to remove those since it offered the greatest ability to build one's own time system, and I figured I might want them in the future.

As for UltraMode7, that's a known problem before I ever messed with this script. If memory serves it's caused by the settings of the Far Clip Z and Fade Z End in UltraMode7. I admit I really just like to toss UltraMode7 occasionally into my project and play with as some kind of guilty pleasure. I'm no scholar with it. I always remove it later (because my game's soooooo not built for it), I just added the handful of code lines for it for my own convenience.

As for why Terrax Lighting needs to be at the top of the plugin order... It's almost certainly this code.
JavaScript:
Spriteset_Map.prototype.createLowerLayer = function() {
        Spriteset_Base.prototype.createLowerLayer.call(this);
        this.createParallax();
        this.createTilemap();
        this.createCharacters();
        this.createShadow();
        this.createDestination();
        this.createLightmask();
        this.createWeather();
    
    };
This is because instead of aliasing the function, it just overwrites it. This is the function plugins typically call to create additional layers. So the plugins in question are likely fighting over that.

Anyway I'll mess with it in a bit. I need it running as fast as possible because I use a lot of fluid motion in my game. Which is already demanding, so Terrax Lighting has to behave. :LZSskeptic:
 

KaYsEr

Koruldia
Veteran
Joined
Mar 14, 2014
Messages
266
Reaction score
482
First Language
French
Primarily Uses
RMMV
Let’s hope you’ll be able to bring those missing “plugin commands” back, having a cleaned-up version of that plugin is a really good thing. Tell us when it’s fixed, I’ll do some tests on a potato laptop and let you know how it goes, same if I find other “missing stuff” that are too important to be removed. Good luck! (Your project looks cool!) :)
 

ImaginaryVillain

One With The Particle
Veteran
Joined
Jun 22, 2019
Messages
772
Reaction score
4,326
First Language
Absurdism
Primarily Uses
RMMV
Whenever the thread is approved, I forked this over into "Community Lighting".
<link removed due to being incorrectly located>
With the intention of differentiating the edits I've made to this, but also inviting other community members to edit the plugin as well. Mostly so we don't all have to deal with restructuring this plugin's code alone. I have also fixed the Tint command not working. :LZSwink:
 
Last edited:

Ilias-Solo

Warper
Member
Joined
Jul 18, 2020
Messages
3
Reaction score
2
First Language
German
Primarily Uses
RMMV
is this Free to use Commercial? btw very nice plugin!
 
Joined
Sep 15, 2019
Messages
4
Reaction score
2
First Language
Dutch
Primarily Uses
RMMV
Hi, I need some help with a very specific issue i've been getting stuck on for a while now.
Terrax Lightning works wonders for the most parts, but I want my game to have;

A. HUD/Healthbar
B. Balloon Icons

These are however nearly impossible to see with my current set up, I can't find a way to overwrite the dark layer to a layer or two below. (Image priority, Say Hud = layer 1, Balloon = layer 2 and Terrax = layer 3)
At the moment, I can't see the healthbar in game, and the balloon icon barely stands out.
The Healthbar is a common event (parallel process), Using the ''Show Image'' command.

(EX1 is in-game, EX2 is how I want it)
Is there a way to change the priority of these images/animations so that they become visible?
Many thanks in advance!

Example1.pngExample2.png
 
Last edited:

joepmeloen

Veteran
Veteran
Joined
Feb 23, 2019
Messages
39
Reaction score
12
First Language
Dutch
Primarily Uses
RMMV
Hi, I need some help with a very specific issue i've been getting stuck on for a while now.
Terrax Lightning works wonders for the most parts, but I want my game to have;

A. HUD/Healthbar
B. Balloon Icons

These are however nearly impossible to see with my current set up, I can't find a way to overwrite the dark layer to a layer or two below. (Image priority, Say Hud = layer 1, Balloon = layer 2 and Terrax = layer 3)
At the moment, I can't see the healthbar in game, and the balloon icon barely stands out.
The Healthbar is a common event (parallel process), Using the ''Show Image'' command.

(EX1 is in-game, EX2 is how I want it)
Is there a way to change the priority of these images/animations so that they become visible?
Many thanks in advance!

View attachment 163051View attachment 163050
Maybe when the icon is triggered put an empty event above the players position and give it a light source and activete it through a paralel process.
 
Joined
Sep 15, 2019
Messages
4
Reaction score
2
First Language
Dutch
Primarily Uses
RMMV
Maybe when the icon is triggered put an empty event above the players position and give it a light source and activete it through a paralel process.
This actually worked pretty well for the balloon icons! Thank you for the suggestion.
I´ll see if I can find a similar way to make the healthbar stand out. If only you could move the Terrax radius a tile downwards.
 

KillerGin

Freddie
Veteran
Joined
Dec 18, 2015
Messages
449
Reaction score
351
First Language
English
Primarily Uses
N/A
I will check this out, This looks really promising! Thank you, Hopefully I won't have te re-do a lot of work.
This MV NovaLighting Plugin was designed to be backwards compatible with Terrax!

It also has a few new features:

1) Compatibility with Yanfly copy event
2) Compatibility with Yanfly spawn event
3) All events have a reference to their own ID, so you dont have to use an ID when saying "light off" or "light on" within an event. This is incredibly useful for many reasons especially if you use yanfly scripts.
4) and more.

Oh, and its performance is MUCH better.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Posts

Latest Profile Posts

Why is there so much month left at the end of money? D=
Hello humans! How goes your day in this journey of living? I hope it is good, for I am human like you, and I am feeling great! Worship the altar.
Sand is basically small rocks

Forum statistics

Threads
105,609
Messages
1,014,971
Members
137,273
Latest member
Parzival
Top