NPC overhaul

Okay so the bug is in the map::draw function, specifically the value for lowlight_sight_range.
Initially this is set to

int lowlight_sight_range = std::max((int)g->light_level() / 2, natural_sight_range);

and is only modified inside the loop

else if (dist <= g->u.sight_range(g->natural_light_level())) { lowlight_sight_range = std::max(g_light_level, natural_sight_range); }

However as squares are processed in columns there becomes a point where [tt]dist[/tt] is <= to the sight range at which point the [tt]lowlight_sight_range [/tt] is altered. After that it has to get pretty dark before [tt]lowlight_sight_range[/tt] is less than [tt]dist[/tt] and so all generally in the day all remaining squares are lit. The reason it’s only the left hand side is because the column processor starts on that side.

The fix depends on how we want to game to render. The value for setting [tt]lowlight_sight_range[/tt] to [tt]g->light_level() / 2[/tt] appears to be so that sight radius was half lit and half dark, although with a normal daylight brightness that was off the screen view.

The easiest fix to make it all look the same and all look bright would be to remove lines 2491 to 2493 and alter 2466 to not divide by 2, however this also removed the lowlight creep you get as night falls.

To keep the creep we can leave the divide by 2 in however that means on resolutions with a “SEE” greater than about 20 (rather than 12) you’ll see the dark creep during the day if it’s just cloudy. Of course we could use a different modifier than 2 in that case. I also don’t see why lines 2491 to 2493 where added so I’m not yet sure what bug they were fixing, unless it was just to balance the larger view against the lowlight creep.

Don’t turrets fire automatically anyway?

Kevin made a lot of changes to the lighting code to optimize it and fix a few of the bugs, so he’d be the man to talk to about it.

On another note, do you reckon your NPC stuff is stable and complete enough to be merged in? Because it sounds pretty great so far.

I haven’t gotten it to crash so far, although there isn’t much you can do with the basecamp yet. I’d have said just go ahead and we’ll fix anything that causes problems later, it’ll certainly save me time with merges :slight_smile:

I dont think turrets on cars are automatic. i know that the item is.

I haven’t gotten it to crash so far, although there isn’t much you can do with the basecamp yet. I’d have said just go ahead and we’ll fix anything that causes problems later, it’ll certainly save me time with merges :)[/quote]
Schweet, toss up a pull request and I’ll merge it.

Done :slight_smile:

I do have to wonder how I’ve gotten this far and only just realised that the players (and npc etc…) posx and posy are relative to the active map and not world global…

Shades anyway you can tell me how you got your game to have such vivid colors ? O-o compared to mine, yours has this appeal to it that I’d very much like to play with (:

Pretty much I’m just running the normal game. It’s under Ubuntu 12.10 (64bit) if that makes a difference to what your running?

Pretty much I’m just running the normal game. It’s under Ubuntu 12.10 (64bit) if that makes a difference to what your running?[/quote]

Considering im running it on windows yes thats probably the difference.

This appears to have been merged into mainline :slight_smile:

I’ll have to go back to adding new things if I want to call it a mod I guess…

Hi, I’m new here this might seem like an akward question but, how’d you get your cataclysm to look that pretty?
:>

[quote=“Keyword22, post:31, topic:111”]Hi, I’m new here this might seem like an akward question but, how’d you get your cataclysm to look that pretty?
:>[/quote]
linux version

I see, so I can’t get it like that on windows…

On topic: This seems very promising. I like the part of them complaining about stuff, hopefully this will be introduced in the main branch :slight_smile:

See this topic http://www.cataclysmdda.com/smf/index.php?topic=3.0, under “Cygwin method”. The next best thing, I guess.