[SmartLight2D] 2D Lighting Engine For BlitzMax
BlitzMax Forums/BlitzMax Programming/[SmartLight2D] 2D Lighting Engine For BlitzMax
| ||
I am developing 2D lighting engine in blitzmax for a specific game. Recently realized that the system is quite universal and can be used in any kind of game. (Side-scrolling or top-down) I might release this module for free if there is enough of interest and support. I've worked a lot on this one. I wish I could get some benefits from it though : ) It's written in native OpenGL and DirectX9. Short overview of current 2D lighting version that is used in the game. * **Overview Video:** https://youtu.be/JvThngzeZP8 **Features:** * Side-Scrolling or Top-Down Game * Customizable Day & Night cycle * Occlusion * Dynamic Lighting * Tile system support * Mesh objects system support * Multiple lighting layers * Multiple collision layers * DirectX, OpenGL and great support for mobile devices * Fast lighting paricles * Lights based on given image (flashlights and so on) * I seriously consider implementing features that users might suggest Feel free to ask questions! Screenshots: * ![]() * ![]() * ![]() Regards, Simonas |
| ||
Looks pretty good ! Post the EXE or source or something and I'll play it. Props for HUD in the top-left. I always get lost in mapping. :) |
| ||
A test build for Windows: http://www.filedropper.com/smartlight2dtestv1 Controls: AWSD -> Move camera SPACE + Left Mouse -> Create a new lighting Left Sliders -> Change global lighting settings Right Mouse Button -> Create a box for the collisions I didn't prepared any good demo yet. This is just how I'm testing the features I implement at the moment. |
| ||
Trying it now. Your program is peaking my CPU at 50%, which is pretty high since I have a quad-core 64bit. I hit SPACE to bring up the controls. No sliders will work, I click and click and drag and they do not move. ... ?? Oh, I got it to work, you have to click the squares to the sides of the drag bar. You might allow the mouse to drag the bar left and right as this is normal with standard Window sliders. Might slow down the sliders a mite, they're pretty fast as it is. Checking ... your program does not enter sleep mode when the window is inactive (for instance, you return to Firefox). For final release of your game, that might be a good thing. Didn't see any options for Testplay. Adding particles of light should affect the existing shadows, much like you have the cursor light up an area on it's own. That's what I see so far. |
| ||
Look at the Frames Per Second in top left corner. That's why your CPU is peaking : ) Forgot Q - add particles. |
| ||
Oh ... Yeah, that's pretty high. Can you set it so there is a hotkey or something to snap to 60- or 30fps so I can see my CPU usage under those settings ? Particles are in fixed location, to test it ? Looks good, maybe have this player gets defeated. I like how you have the cursor bend its light and create new shadows around obstacles. Very good effect ! |
| ||
Thus, I told you this is not a public test for the engine. More like what I use for myself when developing it. This engine's performance is really fast. Fixed 60FPS build: http://www.filedropper.com/smartlighttestv2fixedframes I've noticed there are some glitches with light position delay due to the last updates I did. When moving lights, they look glitchy a little bit. Nothing serious though. |
| ||
That's pretty cool. Now, one more thing. A slider or key control that speeds up everything (except the sliders) while maintaining the low FPS you have it set to currently. Also, your sliders are moving a good speed now, not too fast, not too slow - just right. I've done a few particles myself. If you're interested I could show you. |
| ||
Do you have a Skype? Sliders were too fast because of fps speed. Of course. |
| ||
I had skype some years back. I'm - not sure sure, it's an audio chat program, right ? I have Yahoo Messenger that works. |
| ||
Ah, I'm not using Yahoo though. Well, I just don't want to use this thread as a chat. Well, I have everything I need. Actually, as a request I'm porting this lighting engine to Unity right now. |
| ||
How do you port a BlitzMAX program to Unity ? I have seen some Unity games in Newgrounds and was curious. |
| ||
I thought this engine would get more interest in this community as there are no proper 2D lighting engine for BlitzMax. My lighting engine methods programmed in native language. It's already working in Unity without majority of functions. ![]() |
| ||
It looks good. My initial question was though, how do you port a BlitzMAX to Unity ? |
| ||
I'm not sure what answer do you expect. I'm just rewriting all the algorithms for the shadows and lighting layers to C#. Unity has all the functions that I'm using in BlitzMax to display the shadows. |
| ||
Looks very nice :-) Do you think it would take much effort to support GLES 2? I'm only asking because I ported MonkeyX2's mojo2 engine to BlitzMax and it struggles a bit when you are processing 4 lights on screen. I wonder if your method is more efficient and better suited to a wider range of architectures? |
| ||
I'm not sure how much I can tell about this project. But this might happen to be official Unity 2D lighting feature. It updates/draws lights only if they are in screen. Yet I was able to put 30 moving lights and didn't see FPS drop. It's quite fast. Yet you can use any kind of texture for the light. So yeah, it's suited for wider range architectures. All you need is that drivers support frame buffers which is really old thing - OpenGL 3 and DX9 has them there for 10 years. With some effort I guess this could be ported to Monkey. |
| ||
good job! |
| ||
It does look very nice! And with plenty of options too. |
| ||
Well, that's fine, Simon. I just didn't know if there was some automatic BlitzMAX to Unity converter program out there. Sounds like their isn't so - it's a lot more work you've done and a lot more to be appreciated. Looking forward to seeing final release. |
| ||
With some effort I guess this could be ported to Monkey. I wouldn't bother :-p My BlitzMax NG targets GLES 2 (iOS, Android and RPi), so I'm interested in things like efficient lighting engines on mobile platforms as well as desktop :-) |
| ||
I wonder how many people would use it for their games? Hmm. Also I'll need some help with drivers. It seems I have an issue when having full screen and minimizing the application. Brucey, this works great for mobiles, but I'm not really sure if I will port this to monkey in my spare time. |
| ||
Well, I'm not interested in a Monkey build of it either. So you should forget I ever mentioned Monkey. ;-) When you minimise you'll want to stop drawing, probably. When the window is restored, you may need to re-create your context. |
| ||
Yeah, because it seems I use frame buffers while it's minimized and that causes serious crash. Only in DX9 + Windowed mode. |
| ||
Hi, I'm getting Oops! This link appears to be broken. Jim |
| ||
You mean filedopper links? Everything seems to work fine. |
| ||
Got it working. Needed to right click and open in new tab. |
| ||
Does this support normal maps? I would love to see bumpmaps, reflection maps etc. |
| ||
It does not, at least yet. It does not have priority as the performance and dynamic day and night cycle was something I intended to do from the beginning. |
| ||
I'm highly interested, your filedropper uploads are down. Can you please reupload those @SimonasQu? Would be much appretiated. |
| ||
You can download it here: http://www.filedropper.com/smartlightenginedemo If you are still about here:) CS2D current releases is using this engine and has a got implementation with flashlights, day and night cycle. |
| ||
Looks great! Have you released the lib? |
| ||
Well, working on Unity version of this engine. Since blitzmax version is very non-user friendly lib, I don't see much of a point to release it. Latest BlitzMax build is used by this game: https://www.blitzbasic.com/Community/posts.php?topic=108142 |
| ||
Since blitzmax version is very non-user friendly lib, I don't see much of a point to release it. Thanks ! |
| ||
Well, working on Unity version of this engine. Since blitzmax version is very non-user friendly lib That's like saying "I didn't want to cut myself shaving, so I blow-torched my face off instead". |
| ||
That's like saying "I didn't want to cut myself shaving, so I blow-torched my face off instead". Haha, Unity is that bad huh? I've always had the impression that the easier it is to make a game then the more wallies you'll get making crap, ALL of these 'game creator' softwares that aim at beginners ( read as asset flippers ) encourage more idiots than skilled craftsman to their table. @SimonasQu Don't be put off with 'quietness' and keep making noise about it yourself, old threads sink and there's nothing wrong with bubbling some good threads to the top again!. There are new comers that come around these parts, we're not all old timers hanging out on the porch in our rocking chairs sipping on whiskey :D Although I've not used it ( I don't make games ) I think it looks really cool and a great 2D engine! |
| ||
@SimonasQu I too would like to see a BlitzMax version. @col Haha, Unity is that bad huh? I'm always hearing how great Unity is, so I'm interested to hear what you have to say about it other than it being aimed at beginners. we're not all old timers hanging out on the porch in our rocking chairs sipping on whiskey :D Yep. :3 |
| ||
@Rooster Maybe you just have directed your question at Gfk as it was he that's caning Unity. I, on the other hand, have an issue with ALL game creators that make it too easy to click the 'generate my AAA game' button to produce a pile of poo. Maybe you've misunderstood my point. I don't mean that it's solely aimed at beginners. but it is designed for beginners to pick and produce something, no matter how crap it is. Give a beginner a programming language and they won't even know what a vector is let alone how to create 3D camera to view their game world. Make things too easy and you have all of the idiots turn up to the party and flood it with pissy booze every where. You don't need me to highlight the situation... just look for yourself. |
| ||
I'm always hearing how great Unity is, so I'm interested to hear what you have to say about it other than it being aimed at beginners. I don't think it's aimed at beginners. The price tag certainly isn't.I pre-ordered Unity 5 and played with Unity 4 for a while before that. In my time with Unity I've done exactly nothing of worth. Couple of crappy things to learn (that you'd never show to anybody), and half a Desert Strike remake which to be fair was shaping up quite nicely, and that's about it. ![]() I don't agree that because it's easy to churn out crap makes it bad - you can churn out crap with anything as I (for one) have ably proven over the years. The problem there is accepting their beginner skill as "it", and having no interest in bettering themselves. But again, that's not just Unity, is it? There's nothing really wrong with Unity - horses for courses. My biggest beef with Unity is the Asset Store which has a "no refunds" policy as you cannot evaluate anything without parting with cash. I've bought two things off there - TextMesh Pro, which was awesome, and some terrain editor thing, which was a complete and utter car crash. Never again. |
| ||
My biggest thing with Unity is the convoluted way it does things for example to get text to the screen you have to add a GUI layer THEN add a series of commands just to get it on the screen. With C++ I just use Print or my Engines equivalent which is Render.Print( X, Y, Text ) even Max has its DrawText which is simple. Yes Unity can be used for loads of wonderful games and things BUT there are loads of hoops to be jumping through and you will have to UNLEARN everything you learned with things like BlitzMax as Unity is a whole different beast. Its more like scripting everything compared to coding everything including the main loop. |