MV - [MV+MZ] FIXED v1.6! Optimized Lighting with Real-Time Shadows (new: saving system fixed!)

● ARCHIVED · READ-ONLY
Started by SebyDevDev 82 posts Page 1 of 5 View original ↗
  1. (I'm back, and I've fixed the saving issue!!!) :kaopride:

    (The help file has more detailed instructions, make sure to check it out!)

    GIFs






    Screenshots
    1631297348551.png
    1631019450826.png
    1631019509351.png1631019559245.png1631032770289.png

    Setup demonstration


    Download FREE (non-commercial, encrypted) or PRO (commercial): https://daedrakyne.itch.io/daes-lighting-system

    Hey there! :kaojoy:
    I've been working for a while now on a new lighting plugin for both MV and MZ.
    My reason for starting down this road was due to this post from about a month ago:
    MV - Khas UltraLighting Remake for Commercial Purposes
    I've researched the most efficient 2D-RTS lighting systems, and have decided to base mine on a pure-hardware (GPU) implementation.
    In its current state, without culling (meaning that for now every light in the scene is being rendered/updated, regardless of whether it's even on the screen or not), the game can handle ~650 lights (with shadows) in one scene without its fps dropping.

    For now, the plugin will be in beta, and will be posted here (ie: can be used for non-commercial projects, commercial version will be up on itch.io before the end of the month once enough features have been added for the inital version to be released publicly).
    If you could try it out, and leave your thoughts down in a reply below, I would really appreciate it! My goal is to make a plugin that is more diverse than khas' while still being optimised enough.

    Plugin commands (MV) (no need for MZ plugin command instructions):
    • dae_light setambientlight r g b
      • Sets the current ambient light to the specified color.
      • r, g and b are numbers from 0 to 255 that represent an rgb color.
      • Example: dae_light setambientlight 0 20 0
    • THE REST OF THE PLUGIN COMMANDS ARE THE SAME AS THE EVENT COMMENTS, BUT WITHOUT "[" AND "]"


    Event comments (run whenever event page changes):
    • [dae_light addlight uniqueID type]
      • Adds a new light and sets its position to that of the event. Light will follow the event wherever it goes
      • uniqueID can be either "null" or any word (letters, numbers and underscore). If set to null, the light will not be stored as a unique light (meaning that it won't be designable by other commands / comments)
      • type must be one of the light types from the plugin parameters. For example, "halogen". New light types can be created in the plugin parameters.
      • Example: [dae_light addlight halo2 halogen]
    • [dae_light setoffset uniqueID offsetX offsetY]
      • Sets a manual offset for the designed light, if it exists.
      • offsetX and offsetY are numbers.
      • Example: [dae_light setoffset halo2 0 24]
    • [dae_light setcolor uniqueID R G B]
      • Sets the color of the light
      • R, G and B are numbers between 0 and 255
      • Example: [dae_light setcolor uniqueID 255 0 255] (pink)
    • [dae_light setrotation uniqueID rotation]
      • Sets the rotation of the light
      • Rotation is an angle between 0 and 360
    • [dae_light setangle uniqueID angle]
      • Sets the angle wideness of the light.
      • Angle is between 0 (no light) and 360 (full light)
      • Example: an angle of 180 will create a semi-circle light
    • [dae_light setintensity uniqueID intensity]
      • Sets the intensity of the light.
      • Intensity is between 0 (no light) to 200 (bright light).
      • For some reason, the MZ plugin can't handle a single intense light, but works fine with multiple lights added together. Until this is fixed, you can overlap multiple lights together to create a bright light.
    • [dae_light setrotation/f uniqueID rotation]
      • Sets how much the light rotates every frame.
      • Rotation is any number, negative or positive, and with decimals allowed.
    Map notes:
    • <dae_light off> -- Disables lighting for that map
    • <dae_light shadowpicture picture_name> -- Uses the given picture as a shadow map for that map. The picture must be in the "img/shadows/" folder.
      • Example: <dae_light shadowpicture shopping_map_shadow>
      • Shadow maps can be easily created by saving a picture of a map (right-click on map -> save), going to a picture editor (I used piskelapp.com), and drawing black in a new layer wherever you want shadows to be.

    There is no current customization for RegionIDs (it is easily implementable, just wanted to get the demo out first), but you can currently use the regionID 17 to create a blue light, and regionIDs 4, 6 and 7 to create shadows. (4: full block shadow, 6: left wall shadow, 7: right wall shadow)


    Changelog:


    • v 1.6
      1. Fixed a bug where you wouldn't be able to save/load!
    • v 1.5
      1. Added support for light spritesheet animations.
      2. Added support for light custom animations (settings-based)
      3. Implemented customisability for Region Shadows and Region Lights.
      4. Implemented various performance optimisations.
      5. Implemented basic light-culling.
    • v1.3
      1. Added support for custom images for lights! (like khas' plugin)
      2. Added customisability support for custom-image lights (resizing, color tinting, + everything else)
      3. Added direction-based custom offset option for lights, useful when making flashlights
      4. Added plugin command for ambient light
    • v1.2
      1. In-game light modifications (color, intensity, rotation, angle, rotation/f, offset)
      2. Automatic offset change depending on the rotation of the light
      3. Automatic light rotations (rotating lights!!), with customizable speeds
      4. Light angle/wideness customization: you can now create flashlights, and beams!

    Current goals for the next version:
    - light / shadow heights
    - event shadows (you heard that right! events will be able to have shadows too)
  2. Alright! Finally satisfied enough with a demo to make it publicly available.
    I've added the link in the first post, but here you go! ^^
    DAE's Lighting System by SebyDevDev
    I've also updated the first post with details on how the plugin currently works, and what I'd like to add to it next
    Let me know your thoughts on it, and what you think would be most useful to add to the plugin!! :kaojoy:
  3. the images looks promising, but I cannot test it while there is no MV version
    or a version to test it on.

    while there are a couple of nice ones out there, I wonder which one run
    better and most compatable, purely on hardware is interesting, but would
    it also work better for lower system or does they have some more trouble
    running it or when playing it?
  4. ShadowDragon said:
    the images looks promising, but I cannot test it while there is no MV version
    or a version to test it on.

    while there are a couple of nice ones out there, I wonder which one run
    better and most compatable, purely on hardware is interesting, but would
    it also work better for lower system or does they have some more trouble
    running it or when playing it?
    Hey there! :kaothx:
    I've updated the MV version of the plugin to be up-to-date with the MZ version, and have now uploaded the MV demo project onto the link! ^^ Feel free to check it out and give me any feedback! :LZSsmile:
  5. thank you for the MV download version to test it out, but it
    doesn't answer the question I ask about the lower system,
    while I tested khas, ocram, community lightning, this one might
    work nice too, but I test around the demo.

    so, would it run better on hardware on lower system or when playing?
    if not, it could take some advantages, but I dont know if community Lighting
    is also hardware, never paid attention to that part, while it dont have images,
    I take the one that goes smoothly and outstanding.

    but keep up the nice work though :)
    it's probably a difficult job to put something like this together, but I adore
    all good coders and try to learn from everything :)
  6. ShadowDragon said:
    thank you for the MV download version to test it out, but it
    doesn't answer the question I ask about the lower system,
    while I tested khas, ocram, community lightning, this one might
    work nice too, but I test around the demo.

    so, would it run better on hardware on lower system or when playing?
    if not, it could take some advantages, but I dont know if community Lighting
    is also hardware, never paid attention to that part, while it dont have images,
    I take the one that goes smoothly and outstanding.

    but keep up the nice work though :)
    it's probably a difficult job to put something like this together, but I adore
    all good coders and try to learn from everything :)
    I've checked, community lighting seems to be software-based (as far as I can see, I might be wrong though).
    As for performance, as long as the computer can run PixiJS filters, there shouldn't be any issues :LZSjoy:
  7. it run smooth so far I test it, and the map of khas, with double shadow, it seems
    much smoother, so I hoper you can make it really nice, maybe some features
    combined in ocram or community lightning, so keep up the nice work.

    the light on the center is much brighter, so ideal for blinding things.
    I try to keep an eye on this one, you do a fine job :)
  8. ShadowDragon said:
    it run smooth so far I test it, and the map of khas, with double shadow, it seems
    much smoother, so I hoper you can make it really nice, maybe some features
    combined in ocram or community lightning, so keep up the nice work.

    the light on the center is much brighter, so ideal for blinding things.
    I try to keep an eye on this one, you do a fine job :)
    Thanks for the encouraging words! Ever since I fixed the last bug with the shadows, this plugin has been moving forward at a frightening speed tbh, which makes me really glad. :kaojoy:
    Do let me know if there are any features that you'd like to see added in particular!
  9. specially the rotating lights in either ocram or community light,
    and specially the corner wall lights in community lights.
    those are amazing :)

    but no rush, see if you can manage it make it really smooth from khas =)
  10. Why can this happen?

    1631048031514.png
    1631048050795.png
  11. ToshaAngel said:
    Why can this happen?

    Could you show me the console? You're showing me the "elements" right now, click on the "console" category right next to it
  12. DaedraTalos said:
    Не могли бы вы показать мне консоль? Вы показываете мне "элементы" прямо сейчас, нажмите на категорию "консоль" рядом с ней.
    1631048922363.png
  13. You'll need to add these two lines in pixi.js
    That should fix it ^^
    1631049267251.png
  14. ToshaAngel said:
    Thank you very much! It works perfectly!
    Great! Let me know if there's anything you'd like to see added to the plugin :kaopride:
  15. DaedraTalos said:
    Great! Let me know if there's anything you'd like to see added to the plugin :kaopride:
    I wanted to know if it is possible to make a lantern?
    For example, when equipping a lantern, the light around the character lights up, after removing the lantern, the light goes out.

    I tried to do it like this.
    But the effects of light are constantly superimposed on each other.
    1631097592546.png
  16. ToshaAngel said:
    I wanted to know if it is possible to make a lantern?
    For example, when equipping a lantern, the light around the character lights up, after removing the lantern, the light goes out.

    I tried to do it like this.
    But the effects of light are constantly superimposed on each other.
    View attachment 200736
    I'm working on the next update that I'll upload later today.
    I'll add a plugin command to it that allows you to remove a light ^^ you'll need to replace "null" by a name though, as you'll need to be able to specify which light you'll want to remove.

    For now however, you can use the script:
    "$lightSys.deleteLight(lightID, true);" (replace lightID with the id of the light ^^)

    For example:

    JavaScript:
    let light = new DAE.Lighting.Sprite_Light($gamePlayer, "playerLight1", "torch");
    $lightSys.addLight(light, "playerLight1");
    
    ......
    
    $lightSys.deleteLight("playerLight1", true);
  17. Все отлично работает !!!
    Спасибо!
  18. ToshaAngel said:
    Все отлично работает !!!
    Спасибо!
    Haha no problem! :LZSjoy:
  19. Not sure if I should spend some time figuring out a good system to make efficient plugin commands for this plugin, so for now, here's a poll!