How to add ambient color so it blends the character in?

  • #1, by madisongeronimoFriday, 02. June 2017, 10:55 8 years ago
    This might be a particle system thing. but I am just wandering if I could add an ambience and color so that my character can blend in with the backgroud.



    I have no idea how to use particles and other questions i have found or tutorials don't help or exist anymore. I would like some help please. smile

    Newbie

    33 Posts


  • #2, by afrlmeFriday, 02. June 2017, 11:18 8 years ago
    A'llo smile

    I believe the built in lightmap system should do the trick. The lightmap is essentially an image (1 per scene) that you add color tones into. You assign each scenes lightmap into the properties section of each scene, which the game engine then uses to calculate the tint of the character as their position changes throughout the scene.

    Quick note: you can downscale the final lightmap image to 25% or maybe even less of the actual scene size for better optimization as the engine automatically scales it up when the game is running.

    Have you checked out the downloads section of the website? I'm pretty sure Fantasy Quest or one of the other available demo games will have some examples of lightmaps being used in them.

    P.S: lightmaps aren't as sophisticated as normal maps, as normal maps can generate both light & shadow tints on a character, whereas lightmaps just tint the whole character a specific color. I'm not sure if @SimonS has implemented support for normal maps into the engine yet though.

    P.P.S: you actually have to create the lighting lower down to compensate for the fact that it's the characters position that determines which tint from the lightmap it will use - the characters position is the character animation center you specify for each of your characters animations & is usually somewhere near the feet of your character.

    Imperator

    7285 Posts

  • #3, by ke4Friday, 02. June 2017, 14:17 8 years ago
    Alternatively you can add tint directly to character.

    Characters["character_name"].Tint = 0x00FF00 --green tint

    Lightmaps are great, hovewer they wouldn't probably work if you need something like atmospheric perspetive. To get the character tinted when is futher away.

    Then you could adjust the tint based on the character's ScaleFactor or Size, don't know what's the difference now.

    Key Killer

    810 Posts

  • #4, by afrlmeFriday, 02. June 2017, 14:26 8 years ago
    Alternatively you can add tint directly to character.

    Characters["character_name"].Tint = 0x00FF00 --green tint

    Lightmaps are great, hovewer they wouldn't probably work if you need something like atmospheric perspetive. To get the character tinted when is futher away.

    Then you could adjust the tint based on the character's ScaleFactor or Size, don't know what's the difference now.
    I believe you can add gradients to the lightmap images? The tint is based on the position of the character in relation to the lightmap, so if you for example added a vertical gradient from a lighter blue to a dark blue, then in theory the character should start tinting darker the higher they go into the scene - I think it's just about calculating exactly where you need to create the tint colors in the lightmap image to be able to get it to display as you want during runtime.

    The Lua script alternative, while it would work, would likely require some complex scripting to calculate & transition between different tints (probably need a mainLoop event handler). You would also need some way of determing different tint areas of the scene, which would likely require tables to store rect (rectangle area) to check if the character is inside of any specific sections of the scene. I think it would be a lot of hassle, unless each scene has fairly simple lighting.

    Imperator

    7285 Posts

  • #5, by ke4Friday, 02. June 2017, 14:32 8 years ago
    True, it's harder for the system. Basically you can't send the character to the distance without moving it on the x/y oses by atleast a few pixels anyway.

    Key Killer

    810 Posts