Sujet: Re: CBNA SmartLight - Moteur de lumière Mer 27 Mar 2013 - 17:52
Hi, one question from me again I've noticed that the shadows position is slightly off, a offset like X+4 and Y+4 Why? And is it something that could be fixed ?
Google translate:
Salut, Une question de moi encore une fois: P J'ai remarqué que la position des ombres est légèrement décalé, un? Compensée comme X +4 et Y +4 Pourquoi Et est-ce quelque chose qui pourrait être fixé ?
Bast Administrateur
Messages : 20021 Localisation : Alsace
Sujet: Re: CBNA SmartLight - Moteur de lumière Mer 27 Mar 2013 - 18:00
Could you take a screenshot of it? The regular non-GMS version of the engine doesn't seem to have this problem.
supersauce Nouveau
Messages : 5
Sujet: Re: CBNA SmartLight - Moteur de lumière Mer 27 Mar 2013 - 19:09
Bast a écrit:
Could you take a screenshot of it? The regular non-GMS version of the engine doesn't seem to have this problem.
Here you go, I'm using Game Maker Studio and my view size is currently 1920px x 1080px. The objects Origin / Pivot point is in center as well
supersauce Nouveau
Messages : 5
Sujet: Re: CBNA SmartLight - Moteur de lumière Mer 3 Avr 2013 - 14:16
Why no reply yet ?! This problem really need to be fixed!
Sylvain-Womos Débutant
Messages : 15 Localisation : Paris Projet Actuel : Womos MMORPG, en grosse pause. www.womos.fr
Sujet: Re: CBNA SmartLight - Moteur de lumière Mar 9 Avr 2013 - 22:06
Bonjour. Mon post ne va pas servir à grand chose mais voilà ce que j'ai à dire :
Ce que tu as réalisé, Bast, est vraiment extraordinaire, la vidéo de présentation fait rêver, vraiment ! C'est quelque chose de magique que de pouvoir utiliser ce moteur de lumière dans un jeu codé sous GM.
En un mot : Merci.
Nickeau Utilisateur confirmé: Rang *
Messages : 175 Projet Actuel : Cruma Forest
Sujet: Re: CBNA SmartLight - Moteur de lumière Mer 10 Avr 2013 - 0:48
Perso je n'arrive toujours pas à l'utiliser snif
Sylvain-Womos Débutant
Messages : 15 Localisation : Paris Projet Actuel : Womos MMORPG, en grosse pause. www.womos.fr
@supersauce: Try to manually correct the offset by changing the x and y coordinates:
sl_light_x = x - 3; sl_light_y = y - 3;
Again, not an elegant solution; but I don't own Game Maker: Studio and can only provide in-depth support for the GM7/GM8 versions. And sorry for the late reply.
molbal Nouveau
Messages : 2
Sujet: Merci Jeu 13 Juin 2013 - 0:51
Merci beaucoup, c'est un merveilleux moteur!
Too bad, I still couldn't learn French. I love the engine, but it when I compile to HTML5 or Win8 (Js or Native, does not matter) it always crashes, even the example00. Have anybody found a solution?
Merci, Balint
M@d_Doc Modérateur
Messages : 6600 Localisation : 47°44'8.04 Projet Actuel : aucun
Sujet: Re: CBNA SmartLight - Moteur de lumière Jeu 13 Juin 2013 - 8:54
I'm not sure the engine will ever be able to work with JS (seems a bit too evolved and ressource-consuming for web apps). But could you send us the build log/the error message? And btw, are you using the GMS Version?
molbal Nouveau
Messages : 2
Sujet: Re: CBNA SmartLight - Moteur de lumière Jeu 13 Juin 2013 - 12:11
Yes, downloaded those. I'll show the log files of Win8 native. At compilation, it says "Error: Your app was launched during the build phase"
But if I try to compile it in debug mode, it compiles, then launches the Win8 app and exits without even starting to run the code in obj_engine create.
Edit: My GMS can't even compile an empty room for win8 native, there must be a problem with my system. I'll try to fix it and then post the results
Bast Administrateur
Messages : 20021 Localisation : Alsace
Sujet: Re: CBNA SmartLight - Moteur de lumière Sam 17 Aoû 2013 - 1:08
Suite à l'annonce de l'abandon de Game Maker 7/8 par YoYo Games, j'ai décidé de débourser les 11.99$ nécessaires et de porter une bonne fois pour toutes SmartLight sous Game Maker: Studio. À part quelques détails, l'ensemble du système et de ses fonctionnalités est maintenant pleinement compatible avec GMS.
Les détails en question consistent en des ombres un peu moins fines que sous GM7/8, un léger décalage des ombres projetées par les lumières, et des ombres du soleil qui sautillent quand elles changent de direction. Ces problèmes étaient déjà présents dans le port que Alpha avait conçu, mais sont maintenant moins visibles suite à quelques modifications que j'ai apporté aux méthodes de rendu. Ils sont causés par la nouvelle manière dont GMS gère les surfaces, qui est beaucoup moins précise et fine que dans les précédentes versions de GM. Il faudra donc attendre d'éventuels patchs pour GMS avant de voir ces problèmes disparaître.
Screenshots de la démo, sous GM8 à gauche, sous GMS à droite.
Sujet: Re: CBNA SmartLight - Moteur de lumière Mer 11 Sep 2013 - 7:43
Bast, I really love your engine! It's perfect, so helpful and it gives an amazing ambiance to rooms. I however ran into a bit of a problem. When I try and change rooms I get an error regarding "SL_buffer_sync" and "SL_timespeed".
Any ideas? I'd greatly appreciate your help.
It's obviously something to do with the room transition, because if I launch the room I wish to transition to it works fine. How did you do room transitions in the tech demo?
Salvakiya Nouveau
Messages : 2
Sujet: Re: CBNA SmartLight - Moteur de lumière Dim 27 Oct 2013 - 5:18
Holy cow... I finally navigated the forums to find a means of communication to Bast XD(i dont speak french).
I do have a question for you bast. I have been trying to reconfigure CBNA to work on my project. I am leaving the Phoenix L3s engine due to performance issues.
My project is a top down shooter called Radiated. I have been working on it for a long time but until recently have not had a light engine show enough promise for me to achieve what I wanted with it. CBNASmartLight has encouraged me to take a second look at continuing development.
After taking apart the engine into various parts I was able to determine a little but I still have a long way to go before I completely understand how it works.
I want a little more control of the engine than it currently gives(this I understand is due to the ease of use. Easiest engine to use so far)
here is some of the other features I was trying to add
1 - if there is a building in the center of the map with no lights.. the inside of that building will be dark. even during the daytime. Doing so without changing rooms. 2 - light z values(like in Phoenix l3s) where you can rise and lower the light and that would effect how the shadow is cast from the object. 3 - a limited view like in the Darkwood engine. where the character has a FOV(field of view) and anything that is lit up by a light but is not in the players FOV appears in black and white. Npc's and Enemies are not visible while outside the FOV. example: 4 - inability to see through thin walls. Doing so without changing the shadow sharpness
I want to expand on the engine and have put in alot of time figuring out the basics... However if you could share some of your knowlege on the engine I would appreciate it.
thanks!
Bast Administrateur
Messages : 20021 Localisation : Alsace
Sujet: Re: CBNA SmartLight - Moteur de lumière Dim 27 Oct 2013 - 15:42
This is the first time I ever heard of someone picking up my engine because of its seemingly better performances; usually it is quite the other way around (i.e: it's too slow). Well, thank you for your interest, and I hope it will give you satisfaction. :)
1 - There are two ways to do this. The first one is to use the function SL_draw_sprite_shadow(layer,sprite,subimg,x,y,xscale,yxscale,rot,alpha) to draw a shadow texture in the desired area, as demonstrated in the tech demo. You can see in this screenshot that the inside of the "building" is not affected by direct sunlight, the only direct light source being the white light in the center. This will however only make the shadowed area as dark as the sun shadows themselves. The second method consists of adding a few lines to the script SL_engine_render. Here's how to do it. This will allow you to create areas that receive absolutely no sunlight but can still be lit by regular lights.
2 - The engine, for simplicity's sake but mostly for optimization purposes, is not really fit for simulating z depth. The variable global.sl_z[obj_id] can be used to simulate objects hovering above the ground, but it will only work with sun shadows. As for the dynamic lights, the objects will always appear to be laying on the floor, but the variable sl_light_shadowlength can be modified to make the light itself appear lower or higher from the floor.
3 - As is, my engine can only change the color and brightness of what is already on the screen. To do like in the video, you will have to draw the world twice; once in color with all the enemies, and a second time in black and white with only the decor, using the FOV of the player as a mask. What my engine can do though, is provide the said mask. Every single dynamic light has its own surface stored in the variable sl_light_surface: by using the flashlight of the player or a dedicated light source as a mask for the black and white world, you could obtain a similar effect as the one in the video. The real hard part would be to get the black and white effect itself, as Game Maker's blend modes are rather limited and can slow things down quite easily.
4 - In SmartLight, the rendering of shadows is based on samples repetition (drawing the same texture multiple times at different scales), as opposed to most lighting engines that use vectors. This technique allows for better shadows smoothing and makes the system easier to use, but it also makes the correct shading of very thin surfaces more difficult. To make this work you will have to increase the number of samples used, by lowering the value of sl_light_shadowfactor.
Edit: Regarding the MP you sent me, here is a quick explanation of how the shadows are made (click to enlarge the image):
The core of the method is that a light projects only a single shadow for all the objects around it, and that the projection itself is optimized by duplicating the already projected sample at every new iteration, thus only needing 3 to 4 iterations to project shadows that cover the entire radius of the light.
@reketh: Make sure that your object engine is set as persistent, and only created once during the game. You may also want to check that all the scripts are executed in the correct order. Sorry for the almost two months late reply. :(
Salvakiya Nouveau
Messages : 2
Sujet: Re: CBNA SmartLight - Moteur de lumière Lun 28 Oct 2013 - 1:30
Hey thanks Bast!
I appreciate you getting back to me so quickly. I am also glad you took the time to explain how it works. I never even noticed that the building at the bottom right of the tech demo had that same feature I was asking about XD.
I will let you know if I have any other questions. And if I figure out anything real cool I will be sure to let you know.
Happy coding! Cheers!
paladin33 Plutôt bien
Messages : 43
Sujet: Re: CBNA SmartLight - Moteur de lumière Mar 29 Oct 2013 - 14:44
je fais un up sur la page, j'ai voulu ouvrir a nouveau hier soir ce que j'avais fait et plus rien ne semble marcher! GMS a surement été mis à jour et des fonctions semblent ne plus être valides...
J'ai pu cependant voir avec surprise que le CBNA à été mis à jour pour GMS, et je t'en remercie grandement. C'est du beau boulot.
Asu Utilisateur confirmé: Rang ****
Messages : 895
Sujet: Re: CBNA SmartLight - Moteur de lumière Ven 1 Nov 2013 - 13:16
paladin33 a écrit:
je fais un up sur la page, j'ai voulu ouvrir a nouveau hier soir ce que j'avais fait et plus rien ne semble marcher! GMS a surement été mis à jour et des fonctions semblent ne plus être valides...
Presque personne ici n'a GM:S ( Et on a raison surtout par rapport aux prix ), tu peux nous montrer TOUTES les erreurs envoyées par le compilateur?
Bonjour, et tout d'abord, un immense merci pour ce boulot dingue et mit à la disposition de façon libre et gratuite. C'est vraiment un bonheur de bosser avec moteur d'une telle simplicité et aussi efficace!
Par contre, après quelques jours d'utilisation, j'ai une petite question que je n'arrive pas à résoudre avec la doc. Est-il possible d'exclure un objet de l'engine? (j'entend pas là que celui-ci échapperai aux règles globales de lumière et serait éclairé de façon normal, comme si il n'y avait pas de moteur). J'ai tenté de placer l'objet au dessus de l'engine au niveau des profondeur de couches, mais rien n'y fait, et je ne vois pas de variable particulière pour exclure un objet particulier.
Est-ce que cela est faisable simplement?
Merci par avance pour votre réponse, et merci encore et surtout pour ce boulot génialissime!
EDIT: ok, après des heures de recherches, j'ai remarqué que j'avais déclaré ma depth au niveau de l'instanciation des mes objets... Je pouvais toujours mettre ce que je voulais dans le paramètre de mes objets, c'était la profondeur de l'instance qui avait la priorité. Je suis un boulet total... Donc ça marche bien, pour exclure un objet du moteur, il suffit de lui indiquer une profondeur supérieur à celui du moteur. Désolé pour ma question débile du coup. Mais ça n'enlève en rien mes félicitation pour ce merveilleu moteur par contre!
Bast Administrateur
Messages : 20021 Localisation : Alsace
Sujet: Re: CBNA SmartLight - Moteur de lumière Mar 3 Déc 2013 - 17:45
Bon bah finalement je reviens car j'ai une grosse erreur, et je n'arrive pas du tout à comprendre à quoi cela est dût.
En fait, l'erreur vient apparemment du script SL_engine_draw. Elle intervient lorsque je change de room. Pour être exact, j'ai un escalier, et lorsque le joueur entre en contact avec celui-ci, il est envoyé à la room suivante. Le soucis est que, lorsque cette action s'effectue, j'ai une grosse erreur qui s'affiche, dont voici le contenu:
Code:
___________________________________________ ############################################################################################ FATAL ERROR in action number 1 of Draw Event for object obj_engine:
Push :: Execution Error - Variable Get -1.sl_buffer_sync(100110, -1) at gml_Script_SL_engine_draw (line 5) - if sl_buffer_sync ############################################################################################ -------------------------------------------------------------------------------------------- stack frame is gml_Script_SL_engine_draw (line 5) called from - gml_Object_obj_engine_DrawEvent_1 (line 2) - SL_engine_draw();
J'avoue que le contenu de ce script dépasse largement mes compétences... :/
Dude Nouveau
Messages : 1
Sujet: Rotating views? Lun 6 Jan 2014 - 3:25
Hello Bast and others!
I realy like this engine, it fits my needs and lights looks very nice. I would like to use this engine in my game, but some questions.
as final target would be great to have my "game" for Windows, Mac and Linux. I hope CBNA is compatibile, can you confirm please?
I read other posts and I know, that CBNA not supporting rotated views. Maybe you have some plans to improve it?
I tried to rotate it with my views system, bad result for now. I have view rotated not in center, but ~1/3 of y. It working nice, but problems with CBNA of course
I'm new in Game Maker and probably this is reason of problem, but I'm trying hard ;)On my example, I can rotate correctly surface with general daylight - means surface bright daily, black nightly. It rotating as should and work. But problem is with rest of engine. It looks like rotating point is oposing to my general, view rotating point, axis, and I can't find where to change it in engine... Here screen from my game prototype:
Blue mark is my Player and view rotating origin. Green/lime mark is suspected origin of engine rotating. Surface with daylight (darker and smaller) is smaller here only to show, how it rotating and following views - is good. As you can see, all other shadows and lights are shifted
I will be very happy with your or others help! :)I can provide more info if needed of course.
Rest of documentation is clear enough for me and good done. Thank you!
here goes script for rotating my view, maybe it can help:
Code:
// This script adjusts the view position so that it rotates around the specified position. // argument0 = view number (0-7) // (argument1, argument2) = coordinates of the origin of rotation in the room // (argument3, argument4) = coordinates of the origion within viewport var vx, vy, xx, yy, t; // First, calculate the relative coordinates of the center of view port // (taking acccount of scaling.) vx = (view_wport[argument0]/2 - argument3) * view_wview[argument0]/view_wport[argument0]; vy = (view_hport[argument0]/2 - argument4) * view_hview[argument0]/view_hport[argument0]; // Rotate it around the origin in the opposite way to view. t = -view_angle[argument0]; xx = argument1 + lengthdir_x(vx, t) - lengthdir_y(vy, t); yy = argument2 + lengthdir_y(vx, t) + lengthdir_x(vy, t); // Then move the view so that the point comes at the center. view_xview[argument0] = xx - view_wview[argument0]/2; view_yview[argument0] = yy - view_hview[argument0]/2;
X-Law Débutant
Messages : 10 Localisation : spain Projet Actuel : 7H
Sujet: Re: CBNA SmartLight - Moteur de lumière Sam 18 Jan 2014 - 14:14
Hello First of all; sorry to speak in english in here but i really need a help on this This system is the best i've ever seen in GM I'm planning to use it on a game made in GMS and got a strange behaviour. Let me explain: -Using it in a AMD QC @ 3.60GHz with 8GB RAM it works cool at constant 60 fps But that's the only pc that i can get it working at full speed... -Tested on another PC Intel QC @2.40GHz with 4GB RAM all i get is 37/38 fps (in the smartlight demo with the first map i can only get a max of 22 fps) If the room is 640x480 it can get up to 60fps but being just a few pixels bigger drops it to 37/38. I think that both pcs have the capacity to run it at full speed.
I could think of that pc being old enough to get those fps but the weird thing is that this only happen with the GMS version... testing with the GM8- versions i get 60 fps with no problem :/ So could this be any kind of error in the code for GMS that makes it more consuming? just wondering
Thanks for your time and hope i can reach a working solution because i really want to use this (the best) system ^^
Sujet: Re: CBNA SmartLight - Moteur de lumière Sam 18 Jan 2014 - 14:49
The fps of this engine not dépend of the processor speed, but of the graphic card.
For the oldest graphics card, the engine have many functions for decrease the buffers size, and get more speed against a lower quality.
X-Law Débutant
Messages : 10 Localisation : spain Projet Actuel : 7H
Sujet: Re: CBNA SmartLight - Moteur de lumière Sam 18 Jan 2014 - 14:56
Thanks for your answer ^^ Nvidia GeForce GT610 - i don't think that gfx card it's to old to handle this besides the weird thing is that it's on full speed with the gm8/7 versions but not with GMS. Even with the 'newly' added feature, the shaders in GMS it's working at fulll speed with that gfx card
Asu Utilisateur confirmé: Rang ****
Messages : 895
Sujet: Re: CBNA SmartLight - Moteur de lumière Dim 19 Jan 2014 - 19:02
X-Law a écrit:
Thanks for your answer ^^ Nvidia GeForce GT610 - i don't think that gfx card it's to old to handle this besides the weird thing is that it's on full speed with the gm8/7 versions but not with GMS. Even with the 'newly' added feature, the shaders in GMS it's working at fulll speed with that gfx card
GT610 is not a old card, just a low-end one. Also I'm not sure if GM:S improves graphic card sided functions speed.
X-Law Débutant
Messages : 10 Localisation : spain Projet Actuel : 7H
Sujet: Re: CBNA SmartLight - Moteur de lumière Mar 21 Jan 2014 - 13:02
More than improving it i think they made it worse if it's yoyo's mistake
vojtas Nouveau
Messages : 7
Sujet: Re: CBNA SmartLight - Moteur de lumière Mer 22 Jan 2014 - 13:30
I'm creating a top-down rpg myself and I'm also using CBNA SmartLight. I have few questions about engine: - Can You tell me how I'm able to run fullscreen with CBNA SmartLight? Whenever I try to jump to full-screen(alt+enter), the game just crushes. - Can I use engine starting object of CBNA (obj_engine, by default) later then on first room? Right now every time I'm trying to do that, I get an error:
___________________________________________ ############################################################################################ FATAL ERROR in action number 1 of Step Event1 for object obj_engine:
Push :: Execution Error - Variable Get -7.rl(100126, -1) at gml_Script_SL_engine_render (line 116) - sl_xx = lengthdir_x(rl/sl_sunshadows_texturesize,sl_sunshadows_direction); ############################################################################################ -------------------------------------------------------------------------------------------- stack frame is gml_Script_SL_engine_render (line 116) called from - gml_Object_obj_engine_StepBeginEvent_1 (line 1) - SL_engine_render();
X-Law Débutant
Messages : 10 Localisation : spain Projet Actuel : 7H
Sujet: Re: CBNA SmartLight - Moteur de lumière Mer 22 Jan 2014 - 13:43
@vojtas The fullscreen problem looks like a surface problem... Whenever you change your screen mode, every surface get destroyed and you have to recreate it. when you do it, you get any specific error? The other error is more like you just disabled the initialization process instead of deleting the obj_engine and setting it in the room you want. Even if you use obj_lights with no obj_engine you shouldn't get any error that's why it' really weird that 'fatal error' you get.