Author Topic: Changing Nighttime Light Levels  (Read 1587 times)

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Changing Nighttime Light Levels
« on: July 24, 2010, 11:59:33 PM »
I want to make nighttime pitch-black, so you can't see anything hiding in the dark.  Can I just modify some settings at some address, or would I have to change overlay graphics?
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Changing Nighttime Light Levels
« Reply #1 on: July 25, 2010, 02:12:31 AM »
That's a Hooman signal, right there. My untrained game hacking would think of looking for some constants in the graphics drawing part. What exactly to look for, I have no idea.

From back when I tried to locate the game's chat system, I got a good look at how the game manages ticks, and as far as I can remember, all the day/night managing done in that area only involves moving the band of light.

Then again, maybe looking into that part that changes the band of light's location can give some clues.


I'm sorry if I can't be of much help...
"Nothing from nowhere, I'm no one at all"

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Changing Nighttime Light Levels
« Reply #2 on: July 25, 2010, 03:06:47 AM »
You could check into how GameMap::SetInitialLightLevel works. It essentially takes a value, scaled in relation to the width of the map, and uses that to control where the band of day/night is. You could try moving it off the map, and then disable day/night. I did something like that in early versions of Hooville. (But people thought it was a bug). I believe there might have been small bands of not quite full night along the edges though. It also disables any sort of day/night transition.

Another approach might be to muck with the day/night color palettes. Each palette loaded by the game has a number of additional prescaled palettes used to darken the image as night falls. You could redarken them yourself to make the effects of night more pronounced. That would allow you to still have day/night transitions. I remember there was a subclass of a bitmap class that handled images that get darker when night falls. You can find some of the code marked under Bitmap:LightAdjustedBitmap in the OllyDbg comments file.