Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I have a lot of questions about this project. Do you have a discord?

I put the renderer in my room, but how do I set the darkness of the room? I also tried to set the daynight ambience script in the step event but it is not working. I tried to create a custom obj_light by using one of the presets as a parent, but it doesn't seem to allow me to adjust any of the variables such as light_radius. I also want to get the light to flash quickly and then destroy itself but I cannot seem to get that to occur as well. 

Did you get an answer on setting darkness levels?

(1 edit)

To make a room dark:

  1. Put one obj_nixfx_renderer in the room.
  2. Make a normal controller object for the room, for example obj_room_lighting_controller.
  3. Put this in the controller's Create event: lighting_setup_done = false;
  4. Put this in the controller's Step event:
if (!lighting_setup_done) {     var fx = nixfx_state();     if (fx.initialized) {         fx.ambient_color = make_colour_rgb(20, 24, 32); // dark blue-gray         fx.ambient_intensity = 0.10; // lower = darker         lighting_setup_done = true;     } }

ambient_intensity is the main darkness control, but changing the color also has a huge impact!

  • 0.05 = very dark
  • 0.10 to 0.20 = normal night/dark room
  • 0.30+ = brighter room

If you want a day/night cycle instead of one fixed darkness value, call the ambience function in Step every frame with a timer that changes over time.

Put this in the controller's Create event:

daynight_time = 0;

Put this in the controller's Step event:

var fx = nixfx_state(); if (fx.initialized) {     daynight_time += delta_time * 0.000001;     nixfx_apply_daynight_ambience(daynight_time, 120.0, "balanced", 1.0); }

That means:

  • daynight_time keeps increasing
  • 120.0 means a full cycle takes 120 seconds
  • "balanced" is the curve name
  • 1.0 means full strength

Available curve names are:

  • balanced
  • clear_day
  • moody

If day/night "does nothing", the usual cause is that the function was only called once, or the timer was not changing. It needs to run in Step, not just once in Create.

oh awesome thank you, one last thing im struggling to understand, im using foxy of the jungle post proccessing fx and cant seem to get the lighting to work underneath the fx. any advice?

(2 edits)

The lighting system renders on the draw_gui event (by default). PostProcessingFX can render on either the draw_gui or post draw event. I would make an object with a post draw event and put this in the event:

ppfx_id.Draw(application_surface, _pos[0], _pos[1], _pos[2]-_pos[0], _pos[3]-_pos[1], _view_width, _view_height);

That should draw the ppfx shaders after the lighting system effects are drawn.

Amazing.  Thanks

(2 edits)

Sorry I missed this question!

The renderer only turns NixFX on for the room. It does not set the room darkness by itself.

To make a room dark:

  1. Put one obj_nixfx_renderer in the room.
  2. Make a normal controller object for the room, for example obj_room_lighting_controller.
  3. Put this in the controller's Create event: lighting_setup_done = false;
  4. Put this in the controller's Step event:
if (!lighting_setup_done) {
    var fx = nixfx_state();
    if (fx.initialized) {
        fx.ambient_color = make_colour_rgb(20, 24, 32); // dark blue-gray
        fx.ambient_intensity = 0.10; // lower = darker
        lighting_setup_done = true;
    }
}

ambient_intensity is the main darkness control, but changing the color also has a huge impact!

  • 0.05 = very dark
  • 0.10 to 0.20 = normal night/dark room
  • 0.30+ = brighter room

If you want a day/night cycle instead of one fixed darkness value, call the ambience function in Step every frame with a timer that changes over time.

Put this in the controller's Create event:

daynight_time = 0;

Put this in the controller's Step event:

var fx = nixfx_state();
if (fx.initialized) {
    daynight_time += delta_time * 0.000001;
    nixfx_apply_daynight_ambience(daynight_time, 120.0, "balanced", 1.0);
}

That means:

  • daynight_time keeps increasing
  • 120.0 means a full cycle takes 120 seconds
  • "balanced" is the curve name
  • 1.0 means full strength

Available curve names are:

  • balanced
  • clear_day
  • moody

If day/night "does nothing", the usual cause is that the function was only called once, or the timer was not changing. It needs to run in Step, not just once in Create.

Thank you for replying. I was starting to feel like you weren't too interested in helping us. Haha! I'll test this out when I get an opportunity. Should I keep posting my questions here? Or do you have a discord?

I don't have a discord set up yet, but that's been on my bucket list for a while. I'll let you know when it's ready!

(1 edit)

Sounds good. In the meantime I'll just keep posting here for now.  I'm excited to finally get this working after all these days. Thank you so much!