ACS: APROP_BrightnessLevel and GetCurrentSector

Moderator: GZDoom Developers

Post Reply
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

ACS: APROP_BrightnessLevel and GetCurrentSector

Post by Skippy »

Simple in theory, this one - extentions to GetActorProperty which return the actor's current brightness (between 0 and 255) and the tag of the sector the actor is currently standing in (returning -1 if the sector in question has no tag assigned).

The only problem I can envisage with the first one is regarding GZDoom's dynamic lights. Perhaps in a case where an actor is partially lit by a dynamic light, some kind of average could be taken to determine the returned value?

I await your thoughts, and hopefully not an immediate [No]. :lol:

EDIT: finding the sector tag would probably be better suited to a separate function like GetCurrentSector or whatever, as it doesn't make much sense in the context of actor properties. Hmm.

EDIT #2: changed 'TID' to 'tag'. I was drunk when I posted this.
Last edited by Skippy on Fri Jan 05, 2007 2:44 am, edited 1 time in total.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

The light level of a sector can already be retreived with [wiki]GetSectorLightLevel[/wiki], so if GetCurrentSector were added you could simply do:

Code: Select all

GetSectorLightLevel(GetCurrentSector(TID));
The only problem is that it would not take dynamic or point lights into consideration, as you pointed out, however I don't see an easy fix for that.

I second the addition of GetCurrentSector. It could be used for a number of effects.
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Post by Skippy »

Thanks for your reply HotWax. I was aware of the GetSectorLightLevel function, however it would only become useful to me upon the implementation of the GetCurrentSector function. Even this would not be useful for what I require, though.

In short, I wish to extend the monster AI va a combination of custom states and ACS_ExecuteWithResult, and one of the effects I want to achieve is based on the 'visibility' of the player - a factor detemined by distance (already retreivable) and, hopefully, light level. And although I would love to see a GetCurrentSector function implemented (I'd love to see what you could do with it), it doesn't really fix my problem as I want to have my 'visibility check' acting across entire levels via a LOADACS lump, and the size/detail of the maps in question makes the tagging of each individual sector entirely prohibitive.

Okay, I'll admit, this is heading into Metal Gear/Splinter Cell territory, but I know that these suggestions would prove immensely useful outside of this scope. Anyone else got any ideas?
Last edited by Skippy on Fri Jan 05, 2007 2:45 am, edited 1 time in total.
User avatar
Grubber
Posts: 1031
Joined: Wed Oct 15, 2003 12:19 am
Location: Czech Republic
Contact:

Post by Grubber »

@HotWax: That would work only if every sector in the map had unique tag.
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Post by Skippy »

Oh yeah, for 'TID' read 'sector tag'. It was too early in the morning when I posted that. D'oh! :roll: [edits post]
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Grubber wrote:@HotWax: That would work only if every sector in the map had unique tag.
Why do they all have to be unique? What's wrong with returning 0 or even a tag that's used multiple times?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Yeah, there need only be enough tags as there are unique light levels in this case. Since people usually go by 8's on the light level, that means you only need 32 unique tags, not including sectors which need a unique tag for other effects.
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Post by Skippy »

Thanks for your suggestions guys.

I like the idea of grouping sectors under a single tag based on a light level. However, it would become problematic over a larger map due to sectors requiring unique effects such as coloured lighting (as HotWax pointed out). Also, it would fall short when trying to determine the brightness of an actor, which is what my original suggestion was, as it wouldn't account for things like fullbright sprites - like a Lost Soul in a 0-level light room, for example. And there's still the problem of GZDoom lights...

For my own purposes, I could hack around the fullbright problem by calling an ACS function from the actor's DECORATE which 'flags' it as having a light level of 255 where needed. All I need now is a big [Yes] to GetCurrentSector(tid), and I can go. :)

Thanks for taking an interest.
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

I could very much see some major use for GetCurrentSector. No spoilers or anything though. :P
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Post by Skippy »

I'm sure many people, including myself, would find it invaluable.

I'd love to hear the developers' opinion on these two suggestions.

EDIT: I've just realised you could probably get a pretty close approximation of Korax, complete with manipulation of the surrounding play area, working in DECORATE and ACS with GetCurrentSector. Better boss battles? Reason enough for inclusion in my book (then again, it's not my book :wink: )
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

I'd love to hear from randy/Graf on this issue. It's a very basic informational function that could be very useful for several different reasons.

Can you at least let us know if this has a chance of being implemented?
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”