Hey, what are you using as a level editor?
Dynamic lighting camera system
Oct 02 2019 09:50 PM
What approach did you settle on for watching and propagating state changes?
I've been pondering some kind of function, maybe a clone() method for non-group display objects, that would make a new object with all its current Corona-side state replicated. The use cases I had in mind were motion-blur images, mirrors and other reflections, maybe shadows. Of course one can make multiple objects at creation time, but taking an existing object and incorporating it into an effect on demand is another matter. I think I know some of what needs changing in the source but it would touch a lot of objects, so haven't been brave enough to attempt it yet.
Vlad mentioned a while ago, on Slack I believe, that uniforms are pretty much set at this point, so should be fine to use.
- basiliogerman likes this
@sporkfin, Sure! I developed the editor myself! The project started out years ago and was used for other games, but i decided to polish it until it was more comfortable to work with. Made with Corona too!
@StarCrunch for transforms, some sort of monitoring: intercept x, y, etc. property changes on a new metatable, update the clone object values, and then pass it to the default metatable, effectively updating itself and its clone part. For physics bodies, the only way was to add them to the camera for manual update in an enterFrame, as the physics engine skips the metatable completely.
This can also be done with functions, so you can intercept insert and removeSelf for example, and return a new insert/removeSelf function that inside calls the default one, like extending the default function implementation with some sort of function inheritance. This can be done without metatables even (Just saving a reference to default insert, and replace .insert) then use the inserted object's .path property to recreate a new untextured object, for example. Just try it and see what happens! Git is your friend hehe.
Regarding the uniforms, that's awesome!
New progress, and some cool features!
Fixed the iOS crash problem faster than anticipated!
Optimized light drawing, added light culling, which greatly improves performance on heavy levels, next improvement to try is some sort of pooling, but will leave it as it is as performance is good, still have to test on low end devices.
Was getting an error 256 trying to build for android but fixed it today as well. All i had to do was remove the corona and corona simulator directories in the ~/Library/ folder. So next week there will be android testing.
Since touch listener objects now have a forwarder object, this object can be manipulated directly, for example to create a bigger touch area than the object itself, without resorting to bigger alpha or tricks:
Screen Shot 2019-10-26 at 1.45.47 AM.jpg 86.04KB 0 downloads
The alpha circle area is the touch area, debug is set to true, so we can view it. This effectively forwards all events from the larger circle to the smaller one. This is all i had to do achieve the above result (touch related result):
playerMarble:addEventListener("touch", touchMarble) display.newCircle(playerMarble.touchArea, 0, 0, MARBLE_TOUCH_RADIUS)
Where playerMarble is the smaller circle, the .touchArea group is added automatically after adding the event listener, by the light engine.
Tiny update, i've been busy with other stuff, but decided to do a small update to the plugin. Added more error handling and testing to make sure nothing breaks, and something extra that can be done with the plugin:
Right now framerate is divided between cameras which means that in the video each camera gets 30 frames per second. This is by design as Corona only lets me get so far while trading performance for some features. uncapped/higher FPS possible in the future? As a note, camera canvases can have any shape:
More Android testing needs to be done in regards to texture handling.
- StarCrunch, sporkfin and pixec like this
Hi everyone, it has been a while. I already had everything up and running to distribute this as a plugin a while ago, but i've changed my mind. I will be releasing this as open source, but i only need one piece of advice, what license should i use? I want to keep it simple, so my guess is to use the MIT license. Anything else i might be missing?
- StarCrunch likes this
MIT is the safest for you, as it frees you from all responsibilities, and it is one of the most common software licenses so potential users will likely know what it is they are agreeing to without having to read the license and understand some weird legalese.
What made you decide to change to open source?
@sporkfin The level editor and the game, not yet. I had to pause them to focus on other stuff. These i work on my "free time" even though its more of a "now and then" thing.
@XeduR This way i can sort of add features based on what you guys need, and you can also see how it works under the hood. I also want to share some other libraries and ways of organizing projects so i'll be sharing that too, soon.
As to what made me change my mind, well... i've been sitting on this project for a while now, you might as well start using it even if i'm not. Make it for all of us and not just me will add the MIT license and release the repo links tomorrow
Alright, here are the links, which should be pretty self-explanatory
Please note that this structure uses my way of using dependencies with a command line tool, which was not intended for LUA or Corona in any way. The project also showcases my other library
Which is like a require shortener, useful for tons of dependencies on a single folder and cross library referencing, using pure LUA, i'm sure it will come in handy.
Please read the instructions carefully, if anything comes up i'll be around, send me a message or post here? Anyway, test it out and tell me what you think of it. Enjoy, and happy coding!
I'm using Corona Version 2019.3542 (2019.10.24) so it must work with that and up
- StarCrunch, sporkfin and w967 like this