Virtual light self-adaptive adjustment method and device, storage medium and computer device
Patent Information
- Application Number
- CN202611169896.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-09-25
AI Technical Summary
[0070]本申请提供的虚拟灯光自适应调整方法、装置、存储介质及计算机设备,当监测到游戏进入虚拟夜间场景后,可以实时获取虚拟夜间场景的环境数据,用于为虚拟夜间场景中每一虚拟灯具生成灯光照射效果,以此搭建得到符合当前场景环境氛围的基础光照效果;若检测到虚拟夜间场景中触发了扰动事件,则可以采集与该扰动事件对应的扰动场景数据,作为该扰动事件光照需求的基础匹配数据;例如,本申请可以对采集到的扰动场景数据进行参数映射,生成与该扰动事件对应的灯光调整策略,并利用该策略自适应调整相应虚拟灯具的灯光照射效果,使灯光能够跟随不同扰动事件的触发而自然变化,从而烘托出符合当前游戏剧情与互动事件的场景氛围,提高游戏趣味性,大幅提升玩家在夜间场景游玩时的体验感和沉浸感。
Smart Images

Figure CN122806062A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of game technology, and in particular to a method, apparatus, storage medium and computer device for adaptive adjustment of virtual lighting. Background Technology
[0002] With the continuous iteration of game rendering technology, more and more open-world and immersive narrative games are introducing complete day-night cycle simulation systems, and nighttime scenes have become a core component for enhancing game realism and enriching the gameplay experience. In these scenes, virtual lighting, as a core visual element for maintaining visibility in nighttime scenes, enhancing the atmosphere, and supporting interactive experiences, is indispensable.
[0003] Currently, most mainstream virtual lighting settings involve several fixed lighting templates pre-set by the art team during game development. When the game runs, players can only switch the corresponding preset lighting effects based on the current time period or weather conditions determined by the system. This fixed lighting template mode makes the game less fun, resulting in a poor gaming experience and insufficient immersion for players. Summary of the Invention
[0004] The purpose of this application is to at least solve one of the aforementioned technical defects, particularly the technical defect that the existing virtual lighting settings are difficult to match the atmosphere requirements of different game plots and interactive events, resulting in insufficient user immersion in the game.
[0005] This application provides a virtual lighting adaptive adjustment method, the method comprising:
[0006] Real-time acquisition of environmental data for a virtual nighttime scene, and generation of lighting effects for each virtual lamp in the virtual nighttime scene based on the environmental data;
[0007] When a disturbance event is detected in the virtual night scene, disturbance scene data corresponding to the disturbance event is collected;
[0008] The disturbed scene data is mapped with parameters to generate a lighting adjustment strategy, and the lighting effect of the corresponding virtual lights is adjusted according to the lighting adjustment strategy.
[0009] Optionally, the step of acquiring environmental data of the virtual night scene in real time and generating lighting effects for each virtual lamp in the virtual night scene based on the environmental data includes:
[0010] Once the game detects that it has entered night mode, a virtual night scene is generated, and the scene type, time period type, and weather data of the virtual night scene are obtained in real time.
[0011] Collect virtual character activity data in the virtual night scene, and generate environmental data for the virtual night scene based on the scene type, the time period type, the weather data, and the virtual character activity data;
[0012] The lighting distribution data of the virtual nighttime scene is determined based on the scene type in the environmental data;
[0013] The target illumination level of the virtual nighttime scene is determined based on the time period type and weather data in the environmental data.
[0014] The regional lighting pattern of each functional area in the virtual night scene is determined based on the virtual character activity data in the environmental data.
[0015] The lighting effect of each virtual lamp in the virtual night scene is generated based on the lamp distribution data, the target illumination intensity, and the lighting patterns of each area.
[0016] Optionally, determining the target illumination of the virtual nighttime scene based on the time period type and weather data in the environmental data includes:
[0017] The baseline illumination intensity corresponding to the time period type in the environmental data is matched by a preset time period illumination mapping table, and the brightness compensation coefficient of the virtual night scene is determined according to the weather data in the environmental data.
[0018] The brightness of the reference illumination is adjusted using the illumination compensation coefficient to obtain the target illumination of the virtual night scene.
[0019] Optionally, determining the regional lighting pattern of each functional area in the virtual night scene based on the virtual character activity data in the environmental data includes:
[0020] The virtual night scene is divided into multiple functional areas according to its functional attributes, and the number of virtual characters in each functional area is determined by the virtual character activity data in the environmental data.
[0021] The character distribution density of each functional area is calculated based on the number of virtual characters in each functional area.
[0022] Collect behavioral interaction data of virtual characters in each functional area, and perform emotional state aggregation analysis on each behavioral interaction data to obtain the emotional state of the characters in each functional area.
[0023] Obtain preset lighting pattern mapping rules; the lighting pattern mapping rules include density mapping sub-rules and emotion mapping sub-rules;
[0024] For each functional area, a density influence factor corresponding to the role distribution density of that functional area is obtained by matching according to the density mapping sub-rule, and an emotion influence factor corresponding to the role emotional state of that functional area is obtained by matching according to the emotion mapping sub-rule.
[0025] The light requirements of the functional area are assessed based on the density influence factor and the emotion influence factor, and the regional light pattern corresponding to the light requirements is determined.
[0026] Optionally, generating the lighting effect of each virtual lamp in the virtual night scene based on the lamp distribution data, the target light intensity, and the lighting patterns of each area includes:
[0027] The location and type of lights in each functional area of the virtual night scene are determined based on the light distribution data;
[0028] Based on the location, type, and lighting pattern of the lights in each functional area, the illumination range and rotation direction of each virtual light in the virtual night scene are deduced.
[0029] The illumination intensity of each virtual lamp in the virtual night scene is determined based on the type of lamp in each functional area and the target illumination intensity.
[0030] Each virtual lamp is assigned a lighting effect based on its illumination range, rotation direction, and light intensity.
[0031] Optionally, the collection of disturbance scene data corresponding to the disturbance event includes:
[0032] The event type and triggering object of the disturbance event are determined, and at least one functional area affected by the event type is determined, and the status data of the triggering object is collected based on the event type;
[0033] Based on the event type, the triggering object, the at least one functional area, and the status data, disturbance scene data corresponding to the disturbance event is generated.
[0034] Optionally, the step of collecting the state data of the triggering object based on the event type includes:
[0035] When the event type is a first type event, real-time location data and movement trajectory data of the triggering object are collected to form status data;
[0036] When the event type is a second type of event, real-time location data and real-time interaction data of the triggering object are collected to form status data;
[0037] When the event type is a third type of event, real-time location data, real-time emotion data, and real-time behavior data of the triggering object are collected to form status data;
[0038] When the event type is a fourth type of event, real-time location data and patrol route data of the triggering object are collected to form status data;
[0039] When the event type is the fifth type, the real-time location data and facial orientation data of the triggering object are collected to form status data.
[0040] Optionally, the step of mapping parameters to the disturbed scene data to generate a lighting adjustment strategy includes:
[0041] The virtual lights in the at least one functional area are marked as target lights based on the real-time location data in the status data, and the initial illumination parameters of the target lights are determined based on the illumination effect of the target lights.
[0042] The target illumination mode of the event type is determined, and the initial illumination parameters are optimized using the triggering object and the state data according to the target illumination mode to generate a lighting adjustment strategy; wherein, the target illumination mode includes intensity mode, range mode and rotation mode.
[0043] Optionally, adjusting the lighting effect of the corresponding virtual lamps according to the lighting adjustment strategy includes:
[0044] The target luminaire to be adjusted and the adjustment execution parameters of the target luminaire are determined according to the lighting adjustment strategy; the adjustment execution parameters include light intensity parameters, light range parameters, and rotation direction parameters;
[0045] The light intensity of the target lamp is adjusted to the target intensity effect according to the light intensity parameter, the light range of the target lamp is adjusted to the target range effect according to the light range parameter, and the rotation direction of the target lamp is adjusted to the target direction effect according to the rotation direction parameter.
[0046] The lighting effect of the target luminaire is adjusted according to the target intensity effect, the target range effect, and the target direction effect.
[0047] Optionally, the step of controlling the light intensity of the target lamp to achieve the target intensity effect based on the light intensity parameter includes:
[0048] The intensity mode corresponding to the light intensity parameter is obtained through analysis; the intensity mode is either a strong light mode, a flicker mode, or a weak light mode.
[0049] When the intensity mode is high light mode, the target lamp is controlled to continuously output high brightness according to the light intensity parameter to obtain the target intensity effect;
[0050] When the target intensity mode is the strobe mode, the target lamp is controlled to periodically alternate between high brightness and low brightness according to the light intensity parameter to obtain the target intensity effect;
[0051] When the target intensity mode is low light mode, the target lamp is controlled to continuously output low brightness according to the light intensity parameter to obtain the target intensity effect.
[0052] Optionally, the step of controlling the illumination range of the target luminaire to adjust to the target range effect according to the illumination range parameter includes:
[0053] The triggering object of the disturbance event is determined based on the disturbance scene data, and the range mode corresponding to the illumination range parameter is obtained by parsing; the range mode is either a focus mode or a coverage mode.
[0054] When the range mode is the focus mode, the target lamp is controlled to perform low beam narrowing illumination on the triggered object according to the illumination range parameters to obtain the target range effect;
[0055] When the range mode is coverage mode, the target lamp is controlled to extend the high beam illumination to the affected area where the triggered object is located according to the illumination range parameters to obtain the target range effect.
[0056] Optionally, the step of controlling the rotation direction of the target lamp to achieve the target direction effect according to the rotation direction parameter includes:
[0057] The triggering object of the disturbance event is determined based on the disturbance scene data, and the rotation mode corresponding to the rotation direction parameter is obtained by parsing; the rotation mode is tracking mode, locking mode, accompanying mode or shaking mode;
[0058] When the rotation mode is the tracking mode, the target lamp is controlled to track and illuminate the movement trajectory of the triggered object according to the rotation direction parameter to obtain the target direction effect;
[0059] When the rotation mode is the locking mode, the target lamp is controlled to lock and illuminate the triggered object according to the rotation direction parameter to obtain the target direction effect;
[0060] When the rotation mode is the accompanying mode, after detecting that the triggering object enters the accompanying illumination range of the target lamp, the target lamp is controlled to light up according to the rotation direction parameter to obtain the target direction effect;
[0061] When the rotation mode is the shaking mode, the reference orientation angle of the rotation direction parameter is determined, and the target lamp is controlled to swing back and forth based on the reference orientation angle according to the preset shaking amplitude and preset shaking frequency to obtain the target direction effect.
[0062] This application also provides a virtual lighting adaptive adjustment device, including:
[0063] The lighting module is used to acquire environmental data of the virtual night scene in real time, and generate lighting effects for each virtual lamp in the virtual night scene based on the environmental data.
[0064] The event triggering module is used to respond to disturbance events triggered in the virtual night scene and collect disturbance scene data corresponding to the disturbance events;
[0065] The effect adjustment module is used to perform parameter mapping on the disturbed scene data, generate a lighting adjustment strategy, and adjust the lighting effect of the corresponding virtual lamps according to the lighting adjustment strategy.
[0066] This application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the virtual lighting adaptive adjustment method as described in any of the above embodiments.
[0067] This application also provides a computer device, including: one or more processors, and memory;
[0068] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the virtual lighting adaptive adjustment method as described in any of the above embodiments.
[0069] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0070] The virtual lighting adaptive adjustment method, apparatus, storage medium, and computer equipment provided in this application can acquire environmental data of the virtual night scene in real time after detecting that the game has entered a virtual night scene. This data is used to generate lighting effects for each virtual lamp in the virtual night scene, thereby building a basic lighting effect that matches the current scene's atmosphere. If a disturbance event is detected in the virtual night scene, disturbance scene data corresponding to the disturbance event can be collected as the basic matching data for the lighting requirements of the disturbance event. For example, this application can perform parameter mapping on the collected disturbance scene data to generate a lighting adjustment strategy corresponding to the disturbance event. This strategy is then used to adaptively adjust the lighting effects of the corresponding virtual lamps, allowing the lighting to change naturally with the triggering of different disturbance events. This creates a scene atmosphere that matches the current game plot and interactive events, enhancing the game's fun and significantly improving the player's experience and immersion when playing in a night scene. Attached Figure Description
[0071] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0072] Figure 1 A schematic diagram of an application architecture provided for an embodiment of this application;
[0073] Figure 2 A flowchart illustrating a virtual lighting adaptive adjustment method provided in an embodiment of this application;
[0074] Figure 3 An interface illustration of a virtual night scene provided for an embodiment of this application;
[0075] Figure 4 An interface illustration of a scene lighting mode provided in an embodiment of this application;
[0076] Figure 5 An interface illustration of a functional area division scenario provided in an embodiment of this application;
[0077] Figure 6 An interface illustration of a disturbance event triggering scenario provided in an embodiment of this application;
[0078] Figure 7 A pattern mapping diagram of a target illumination mode provided in an embodiment of this application;
[0079] Figure 8This is a flowchart illustrating a virtual lighting adaptive adjustment device provided in an embodiment of this application.
[0080] Figure 9 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0081] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0082] Currently, most mainstream virtual lighting settings involve several fixed lighting templates pre-set by the art team during game development. When the game runs, players can only switch the corresponding preset lighting effects based on the current time period or weather conditions determined by the system. This fixed lighting template mode makes the game less fun, resulting in a poor gaming experience and insufficient immersion for players.
[0083] Furthermore, before describing the specific implementation process of this application, the application environment of this application will first be described. Please refer to [link / reference needed]. Figure 1 , Figure 1 A schematic diagram of an application architecture provided for an embodiment of this application; Figure 1 The application architecture includes server 110 and client 120. Server 110 can be of various types, such as a game server or application server. It is used to store game data, process player requests, and execute the core logic for evaluating the effectiveness of virtual items. Server 110 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Client 120 can be a terminal device such as a smartphone, tablet, personal computer, or smartwatch. Players interact with the game system through the graphical user interface of client 120. Server 110 and client 120 establish a communication connection through a network to achieve real-time data transmission and synchronization.
[0084] It is understood that the above-mentioned virtual lighting adaptive adjustment method can run on personal mobile terminals, on server 110, or on third-party devices to provide virtual lighting adaptive adjustment. The specific virtual lighting adaptive adjustment method can run as a program on the above-mentioned devices, or as a system component of the above-mentioned devices, or as a cloud service program. The specific operating mode depends on the actual scenario and is not limited here.
[0085] The specific implementation methods of this application will be described in detail below. For ease of understanding, the virtual medicinal material collection method proposed in this application will be specifically explained in conjunction with the accompanying drawings. Please refer to them. Figure 2 , Figure 2 This is a flowchart illustrating a virtual lighting adaptive adjustment method provided in an embodiment of this application. The present application provides a virtual lighting adaptive adjustment method, specifically including the following:
[0086] S110: Acquires environmental data of the virtual night scene in real time, and generates lighting effects for each virtual lamp in the virtual night scene based on the environmental data.
[0087] In this step, when the game system detects that the game has entered a virtual night scene, it can obtain the environmental data of the virtual night scene in real time, which is used to generate lighting effects for each virtual lamp in the virtual night scene, thereby building a basic lighting effect that matches the current scene environment.
[0088] Specifically, environmental data refers to various scene parameters that can affect the basic lighting effects of virtual nighttime scenes, including but not limited to scene type, current game time, and current weather. Virtual lighting fixtures are programmable lighting components set up within the virtual nighttime scene, whose illumination effects can be adjusted. They can output differentiated lighting effects based on different parameter configurations to meet the lighting needs for scene atmosphere building and event atmosphere enhancement. Since the atmosphere of nighttime scenes varies in different environments, the game system of this application can generate lighting effects that adapt to the current scene atmosphere through virtual lighting fixtures, providing players with a basic visual experience that is more in line with the scene setting.
[0089] Furthermore, after generating the lighting effects for each virtual light fixture, the game system can drive the virtual lights in the scene to render in real time according to these effects, thereby building a basic lighting effect that matches the current virtual nighttime scene environment. Moreover, this basic lighting effect is not static. When environmental data within the scene changes, such as weather changes or changes in time of day, the game system can synchronously update the lighting effects of each virtual light fixture, ensuring that the scene lighting always dynamically matches the current environmental state. This provides an initial state benchmark for lighting adjustments triggered by subsequent disturbances.
[0090] S120: When a disturbance event is detected in the virtual night scene, collect the disturbance scene data corresponding to the disturbance event.
[0091] In this step, after generating the lighting effect of the virtual night scene through step S110, if a disturbance event is detected in the virtual night scene, the game system can collect the disturbance scene data corresponding to the disturbance event as the basic matching data for the lighting requirements of the disturbance event.
[0092] Disturbance events refer to sudden events that occur in the current scene, deviating from the normal operating state, potentially disrupting the current scene's lighting balance, and requiring coordinated lighting responses. Examples include chase events, combat events, patrol events, and alert events. These sudden events will impose special lighting requirements on the scene's atmosphere, which cannot be matched by fixed template-based basic lighting effects. Therefore, it is necessary to collect specific scene data for disturbance events to provide data support for subsequent lighting adjustments.
[0093] Specifically, after detecting a disturbance event, the game system can collect the corresponding disturbance scene data, such as the triggering object, the location of occurrence, the range of influence, and the object's state. It should be noted that the relevant data to be collected differs for different types of disturbance events to ensure that the collected disturbance scene data comprehensively covers the lighting requirements of the event, providing a sufficiently accurate data foundation for subsequent parameter optimization and lighting adjustments.
[0094] Furthermore, the data acquisition for the disturbance scene in this application is a real-time and continuous process. During the duration of the disturbance event, the system can continuously acquire and update the disturbance scene data according to a preset sampling frequency to ensure that the acquired data accurately reflects the development and changes of the disturbance event. For example, when the movement trajectory of the fleeing object changes during a personnel escape event, the game system can synchronously update the acquired real-time location data and movement trajectory data, ensuring that subsequent lighting adjustments remain synchronized with the actual development of the disturbance event. When the disturbance event ends, the system can stop acquiring the disturbance scene data corresponding to that event and clear the corresponding data cache to prepare for the triggering of the next disturbance event.
[0095] S130: Perform parameter mapping on the disturbed scene data, generate a lighting adjustment strategy, and adjust the lighting effect of the corresponding virtual lights according to the lighting adjustment strategy.
[0096] In this step, after collecting the disturbance scene data through step S120, the game system can perform parameter mapping on the collected disturbance scene data, generate a lighting adjustment strategy corresponding to the disturbance event, and use the strategy to adaptively adjust the lighting effect of the corresponding virtual lights, so that the lights can change naturally with the triggering of different disturbance events, thereby creating a scene atmosphere that matches the current game plot and interactive events, improving the game's fun, and greatly enhancing the player's experience and immersion when playing in night scenes.
[0097] Specifically, parameter mapping essentially transforms various non-parametric scene information collected from disturbed scene data into control parameters that can be directly used to control the output of virtual lighting fixtures. Based on these converted control parameters, a corresponding lighting adjustment strategy is then generated. During parameter mapping, the game system first maps each scene information in the disturbed scene data into corresponding control parameters according to preset parameter mapping rules. Then, the mapped control parameters are integrated to generate a complete lighting adjustment strategy that can be directly parsed and executed by the lighting execution system. This strategy defines the set of target lighting fixtures to be adjusted, the execution sequence of each target lighting fixture, and the target parameter values to be adjusted. Once the lighting adjustment strategy is generated, the game system can also distribute it to the corresponding virtual lighting fixtures, controlling them to adjust their light intensity, illumination range, or illumination direction according to the parameter values defined in the strategy. This allows the lighting effects in the scene to adaptively adjust as the disturbed events occur, develop, and change.
[0098] Understandably, this application can utilize the mapping relationship between disturbed scene data and lighting parameters to achieve adaptive lighting adjustments for different disturbance events. This allows virtual lighting to move beyond fixed times or fixed scene templates and dynamically respond to real-time event changes during gameplay. Furthermore, because the lighting adjustment strategy can be dynamically generated for different disturbance events, it can create differentiated scene atmospheres under various unexpected events, thereby enhancing the expressiveness and fun of virtual nighttime scenes and significantly improving players' immersion and interactive experience in nighttime gaming environments.
[0099] In the above embodiments, when the game detects that it has entered a virtual night scene, the environmental data of the virtual night scene can be acquired in real time to generate lighting effects for each virtual lamp in the virtual night scene, thereby building a basic lighting effect that matches the current scene environment. If a disturbance event is detected in the virtual night scene, the disturbance scene data corresponding to the disturbance event can be collected as the basic matching data for the lighting requirements of the disturbance event. For example, this application can perform parameter mapping on the collected disturbance scene data to generate a lighting adjustment strategy corresponding to the disturbance event, and use the strategy to adaptively adjust the lighting effects of the corresponding virtual lamps, so that the lighting can change naturally with the triggering of different disturbance events, thereby creating a scene atmosphere that matches the current game plot and interactive events, improving the game's fun, and greatly enhancing the player's experience and immersion when playing in a night scene.
[0100] In one embodiment, the process of acquiring environmental data of the virtual night scene in real time in step S110 may include:
[0101] S111: After detecting that the game time has entered night mode, generate a virtual night scene and obtain the scene type, time period type and weather data of the virtual night scene in real time.
[0102] S112: Collect virtual character activity data in the virtual night scene, and generate environmental data for the virtual night scene based on scene type, time period type, weather data, and virtual character activity data.
[0103] In this embodiment, after the game system detects that the game time has entered night mode, it can switch the game to a virtual night scene and start to acquire the scene type, time period type and weather data corresponding to the scene in real time. Then, it can also collect the activity data of virtual characters in the virtual night scene, and then generate environmental data of the virtual night scene based on the scene type, time period type, weather data and virtual character activity data, as data support for the generation of lighting effects in the virtual night scene.
[0104] Understandably, the game system has a pre-set timeline, which is divided into daytime mode and nighttime mode. Therefore, when the game system detects that the game time has changed from daytime mode to nighttime mode, it can generate a corresponding virtual nighttime scene based on the current game scene and initiate a real-time environmental data acquisition process for this virtual nighttime scene, including scene type, time period type, weather data, and virtual character activity data, which can then be combined to generate the environmental data for the virtual nighttime scene.
[0105] The "Scene Type" refers to the functional category of the current virtual nighttime scene. Different scene types have different spatial structures and lighting distributions, such as commercial streets, city gates, indoor prisons, and rural roads. The "Time Period Type" refers to the specific time stage of the current nighttime, with different time periods corresponding to different baseline lighting requirements, such as dusk, late night, and early morning. "Weather Data" refers to the current weather conditions of the scene; different weather conditions have different impacts on the propagation and perception of light, such as sunny weather, light rain, and heavy fog. "Virtual Character Activity Data" refers to the location distribution and behavioral status of virtual characters in the current scene, reflecting the activity level and atmosphere requirements of different areas within the scene.
[0106] Indicatively, such as Figure 3 As shown, Figure 3 An interface illustration of a virtual night scene provided for an embodiment of this application; Figure 3 In the virtual nighttime scene, the scene type is a commercial street, the weather is light rain, the time period is late at night, and there are only a few scattered virtual characters in the scene, mainly concentrated at the entrance of the street.
[0107] Furthermore, after collecting data from various dimensions, the game system can perform format standardization and time-series alignment processing to integrate it into structured environmental data for subsequent processing stages. During the virtual nighttime scene, the system can continuously acquire the latest scene type and time period type status, constantly updated weather data, and real-time changing virtual character activity data according to a preset update frequency, and synchronously update the generated environmental data to ensure that the environmental data always reflects the actual state of the current scene.
[0108] For example, in a nighttime scene of a commercial district, the game system can obtain relevant data about the scene through the game scene generator. This includes the scene type being a commercial district, the time period being late at night, and the weather data being light rain. Simultaneously, it can collect activity data of virtual characters within the scene, such as the distribution of NPCs on the street, the player character's current location, and the ongoing actions of some NPCs. Using this data, the game system can generate complete environmental data for the virtual nighttime scene. During the duration of the nighttime scene, if the weather changes from light rain to dense fog, or if the time period shifts from late night to early morning, the game system can synchronously update the corresponding sleep data in the aforementioned environmental data, ensuring that the environmental data remains consistent with the actual state of the scene.
[0109] In one embodiment, the process of generating lighting effects for each virtual lamp in the virtual night scene based on environmental data in step S110 may include:
[0110] S113: Determine the lighting distribution data for the virtual nighttime scene based on the scene type in the environmental data.
[0111] S114: Determine the target illumination level of the virtual night scene based on the time period type and weather data in the environmental data.
[0112] S115: Determine the regional lighting mode for each functional area in the virtual night scene based on the virtual character activity data in the environmental data.
[0113] S116: Generate the lighting effect of each virtual lamp in the virtual night scene based on lamp distribution data, target illumination intensity, and lighting patterns of each area.
[0114] In this embodiment, the game system can generate the lighting effect of each virtual lamp based on environmental data. For example, the game system can determine the lamp distribution data of the virtual night scene based on the scene type in the environmental data, determine the target illumination of the virtual night scene based on the time period type and weather data in the environmental data, and determine the regional lighting mode of each functional area in the virtual night scene based on the virtual character activity data in the environmental data. Then, based on the lamp distribution data, target illumination, and regional lighting modes, the game system can generate the lighting effect of each virtual lamp in the virtual night scene.
[0115] The lighting distribution data refers to the spatial layout information of each virtual lighting fixture in the current scene, including the specific coordinates of each fixture and its type, such as outdoor streetlights, store sign lights, indoor ceiling lights, and walkway sensor lights. Different types of lighting fixtures have different ranges of illumination parameters and are suitable for different application scenarios. Target illumination refers to the baseline level of illumination output that the current scene needs to achieve. It is mainly determined by the current time of day and weather conditions. For example, the target illumination in a foggy night is generally lower than in a clear evening. Functional areas refer to different sub-areas divided according to the scene's functions. Different functional areas require different lighting modes to adapt to their lighting needs due to the different game functions and character activity states they support.
[0116] Specifically, the game system can determine the distribution data of lighting fixtures corresponding to the virtual nighttime scene based on the scene type in the environmental data. For example, a commercial street scene corresponds to different types of virtual lighting fixtures such as outdoor streetlights arranged at intervals along the street, sign lights on the outside of stores, and motion-sensor spotlights at store entrances, while a wilderness road scene only has a small number of streetlights arranged at intervals along both sides of the road, without any additional functional lighting fixtures.
[0117] Furthermore, since time period type can reflect the natural brightness variation trend in the current nighttime environment, and weather data can reflect the influencing factors in the process of ambient light propagation, the game system can also determine the target illumination level corresponding to the virtual nighttime scene based on the time period type and weather data. For example, when it is detected that the current period is late at night and the weather is clear, the game system can set a lower target illumination level to simulate the effect of weak nighttime lighting in a natural environment; when it is detected that the current period is late at night and the weather is cloudy, rainy, or foggy, due to the reduced environmental visibility, the game system can increase the target illumination level to ensure the visual clarity of the virtual scene.
[0118] Subsequently, the game system can determine the regional lighting mode for each functional area in the virtual nighttime scene based on the virtual character activity data in the environmental data. Since the distribution of virtual characters varies within different scene types, the resulting functional areas differ, and therefore the requirements for regional lighting modes also differ. For example, when a high density of virtual character activity is detected in a certain area, the game system can increase the brightness and coverage of the lights to enhance the visual effects during character interactions; when a low-activity state is detected in a certain area, the game system can reduce the brightness of the lights in that area to create a more natural nighttime environment.
[0119] Furthermore, based on the distribution data of lighting fixtures, the brightness of target illumination, and the lighting patterns of various areas, the game system can generate targeted lighting effects for different virtual lighting fixtures. This ensures that the illumination effect of each virtual lighting fixture can simultaneously meet the needs of scene structure, time changes, weather conditions, and character activities. This can further enhance the visual guidance effect and interactive atmosphere during the game, improve the game's fun, and enhance the player's immersive experience in the virtual night scene.
[0120] In one embodiment, the process of determining the target illumination of the virtual nighttime scene based on the time period type and weather data in the environmental data in step S114 may include:
[0121] S1141: Match the baseline illumination intensity corresponding to the time period type in the environmental data with the preset time period illumination mapping table, and determine the brightness compensation coefficient of the virtual night scene based on the weather data in the environmental data.
[0122] S1142: Adjust the brightness of the reference illumination using the illumination compensation coefficient to obtain the target illumination of the virtual night scene.
[0123] In this embodiment, when determining the target illumination, the game system can first match the reference illumination corresponding to the time period type in the environmental data through a preset time period illumination mapping table, and determine the brightness compensation coefficient of the virtual night scene according to the weather data in the environmental data. Then, the brightness of the reference illumination can be adjusted using the illumination compensation coefficient to obtain the target illumination of the virtual night scene.
[0124] The game system includes a pre-configured time-period lighting map, which records the correspondence between different time-period types and baseline lighting levels. The time-period types primarily represent the specific time stage of the night. Different time periods have different lighting requirements. For example, during dusk, there is still some afterglow, so the baseline brightness is relatively high; during late night, the ambient light is extremely weak, so the baseline brightness is low; and during early morning, the sky is gradually brightening, so the baseline brightness is between the two.
[0125] Specifically, by analyzing the time period type in the environmental data, the game system can match the baseline illumination level corresponding to that time period type from the time period illumination mapping table. This baseline illumination level characterizes the basic intensity level of scene illumination during that time period. Simultaneously, the game system can also extract weather data from the environmental data. Since different weather conditions have varying effects on light transmission, reflection, and scattering—for example, on sunny days, ambient light transmission is good with minimal brightness attenuation, while on cloudy or overcast days, ambient light transmission is obstructed, resulting in some brightness attenuation; and in rainy, snowy, or foggy weather, ambient light scattering is severe, leading to significant brightness attenuation—the game system can determine the brightness compensation coefficient for the current virtual night scene based on this weather data. This coefficient is used to correct the baseline illumination level to adapt to the actual illumination perception requirements under the current weather conditions. In other words, after determining the brightness compensation coefficient, the game system can use this coefficient to adjust the baseline illumination level, that is, to perform calculations between the baseline illumination level and the brightness compensation coefficient to obtain the final target illumination level for the virtual night scene.
[0126] For example, in a commercial street scene, the current time period is late at night, and the weather is light rain. By querying the time period lighting map, the game system can match the baseline illumination for late night to 200 lux. Since light penetration is obstructed in light rain, the brightness is reduced by 30%, thus determining a brightness compensation coefficient of 0.7. The game system can then use this brightness compensation coefficient of 0.7 to adjust the baseline illumination of 200 lux, calculating the final target illumination for the scene to be 140 lux. If the weather changes from light rain to heavy fog, the game system can simultaneously update the brightness compensation coefficient to 0.5 and adjust the target illumination accordingly to 100 lux, ensuring that the scene lighting always matches the current weather conditions.
[0127] In one embodiment, step S115, which involves determining the area illumination mode of each functional area in the virtual night scene based on the virtual character activity data in the environmental data, may include:
[0128] S1151: Identify the character distribution density and emotional state of each functional area in the virtual night scene by using virtual character activity data in the environmental data.
[0129] S1152: Based on the preset lighting pattern mapping rules, the character distribution density and character emotional state of each functional area are comprehensively mapped to obtain the regional lighting pattern of each functional area.
[0130] In this embodiment, when determining the regional lighting mode, the game system can first identify the character distribution density and character emotional state of each functional area in the virtual night scene through the virtual character activity data in the environmental data. Then, according to the preset lighting mode mapping rules, the character distribution density and character emotional state of each functional area are comprehensively mapped to obtain the regional lighting mode of each functional area.
[0131] Specifically, by analyzing and identifying virtual character activity data, the game system can obtain the character distribution density and emotional state of each functional area. Character distribution density characterizes the degree of virtual character aggregation within a functional area, reflecting the current popularity and activity level of that area. For example, when a large number of virtual characters are clustered in an area, it can be determined that the area has high popularity and activity; when the number of virtual characters in an area is small or there is no continuous activity, it can be determined that the area has low popularity and activity. Character emotional state characterizes the overall emotional tendency of virtual characters within a functional area, reflecting the current emotional atmosphere of that area, such as positive, calm, tense, excited, or depressed states.
[0132] Understandably, different character distribution densities and emotional states require different lighting atmospheres. For example, regarding character distribution density, higher density indicates a more lively and active area, requiring brighter or more vibrant lighting; lower density indicates a quieter and more deserted area, requiring softer or dimmer lighting. Regarding emotional states, joyful emotions tend towards bright, warm tones, tense emotions towards high-contrast or alarming tones, and calm emotions towards soft, soothing tones. Based on this, the game system pre-defines lighting pattern mapping rules, defining the correspondence between different distribution density levels and emotional state types and lighting patterns. Therefore, the game system can use these mapping rules to match the appropriate regional lighting pattern for each functional area.
[0133] For example, such as Figure 4 As shown, Figure 4 An interface illustration of a scene lighting mode provided in an embodiment of this application; Figure 4 In the example commercial district scene, the game system recognizes that there are a large number of NPCs and players gathered in the main street area, the character distribution density is high, and the overall character emotional state is happy and excited. Therefore, the lighting mode of this area can be lively and bright. In contrast, in the alley area, there are only a few NPCs passing by occasionally, the character distribution density is low, and the overall character emotional state is calm and indifferent. Therefore, the lighting mode of this area can be quiet and dim.
[0134] In one embodiment, the process of identifying the character distribution density and character emotional state of each functional area in a virtual nighttime scene through virtual character activity data in environmental data in step S1151 may include:
[0135] S1511: Divide the virtual night scene into multiple functional areas according to functional attributes, and determine the number of virtual characters in each functional area through virtual character activity data in the environmental data.
[0136] S1512: Calculate the character distribution density of each functional area based on the number of virtual characters in each functional area.
[0137] S1513: Collect behavioral interaction data of virtual characters in each functional area, and perform emotional state aggregation analysis on each behavioral interaction data to obtain the emotional state of the characters in each functional area.
[0138] In this embodiment, when identifying virtual character activity data, the game system can first divide the virtual night scene into multiple functional areas according to functional attributes, and determine the number of virtual characters in each functional area through the virtual character activity data in the environmental data. Then, the character distribution density of each functional area can be calculated based on the number of virtual characters in each functional area. In addition, the game system can also collect the behavioral interaction data of virtual characters in each functional area, and perform emotional state aggregation analysis on each behavioral interaction data to obtain the character emotional state of each functional area.
[0139] Indicatively, such as Figure 5 As shown, Figure 5 An interface illustration of a functional area division scenario provided in an embodiment of this application; Figure 5In this game, functional areas can be divided according to the game functions that different areas in the scene serve. For example, a commercial street can be divided into main road areas, shop areas, plaza areas, alley areas, etc. Different functional areas have different game functions, resulting in differences in character distribution patterns and behavior patterns. After completing the functional area division, the game system can extract the identity identifiers and location information of virtual characters in each functional area from the virtual character activity data. By counting the number of virtual characters in each functional area and combining this with the spatial area of that functional area, the number of characters per unit area can be calculated, serving as a quantitative indicator of character distribution density for that functional area.
[0140] Furthermore, when identifying a character's emotional state, the game system can collect behavioral interaction data of virtual characters in various functional areas, including dialogue text, actions, and facial expressions. For each functional area, the game system can use all collected behavioral interaction data as input and process it comprehensively through a preset emotional state aggregation analysis algorithm to extract emotional features from the multi-dimensional behavioral data and aggregate these features into the overall emotional state of the character in that functional area. It should be noted that the emotional state aggregation analysis here can be based on rule matching or machine learning models; there are no restrictions here.
[0141] In one embodiment, the process of comprehensively mapping the character distribution density and character emotional state of each functional area according to a preset lighting pattern mapping rule to obtain the regional lighting pattern of each functional area may include:
[0142] S1521: Obtain the preset lighting pattern mapping rules; the lighting pattern mapping rules include density mapping sub-rules and emotion mapping sub-rules.
[0143] S1522: For each functional area, the density influence factor corresponding to the role distribution density of the functional area is obtained by matching according to the density mapping sub-rule, and the emotion influence factor corresponding to the role emotion state of the functional area is obtained by matching according to the emotion mapping sub-rule.
[0144] S1523: Based on the density influence factor and the emotion influence factor, the light demand in this functional area is assessed, and the regional light pattern corresponding to the light demand is determined.
[0145] In this embodiment, when determining the regional lighting pattern, the computer device can first obtain a preset lighting pattern mapping rule, including a density mapping sub-rule and an emotion mapping sub-rule. Then, for each functional area, the density influence factor corresponding to the character distribution density of the functional area is matched according to the density mapping sub-rule, and the emotion influence factor corresponding to the character's emotional state of the functional area is matched according to the emotion mapping sub-rule. Thus, the density influence factor corresponding to the character distribution density of the functional area is matched according to the density mapping sub-rule, and the emotion influence factor corresponding to the character's emotional state of the functional area is matched according to the emotion mapping sub-rule.
[0146] It should be noted that the lighting pattern mapping rules of this application may include density mapping sub-rules and emotion mapping sub-rules. The density mapping sub-rules are mainly used to define the correspondence between different character distribution density levels and density influence factors. These density influence factors can characterize the contribution weight or tendency direction of the character's aggregation degree to the area's lighting demand. For example, a high density level corresponds to a higher density influence factor, and the mapping result tends towards a brighter lighting pattern; a low density level corresponds to a lower density influence factor, and the mapping result tends towards a softer lighting pattern. The emotion mapping sub-rules are mainly used to define the correspondence between different character emotion state types and emotion influence factors. These emotion influence factors can characterize the contribution weight or tendency direction of the character's emotional tendency to the area's lighting demand. For example, positive emotions such as pleasure and excitement correspond to a tendency towards a bright emotion influence factor; neutral emotions such as calm and indifference correspond to a tendency towards a soft emotion influence factor; and negative emotions such as tension and fear correspond to a tendency towards a high-contrast emotion influence factor.
[0147] Specifically, the game system can obtain the character distribution density corresponding to the current functional area and perform matching processing on this character distribution density based on density mapping sub-rules to determine the density influence factor corresponding to the functional area. Simultaneously, the game system can also obtain the character's emotional state corresponding to the current functional area and perform matching processing on this character's emotional state based on emotion mapping sub-rules to determine the emotion influence factor corresponding to the functional area. After obtaining the density influence factor and emotion influence factor, the game system can perform a comprehensive calculation on the two influence factors, such as weighted summation or vector synthesis, to obtain a comprehensive lighting requirement assessment value for the functional area, reflecting the synergistic influence of both the number of characters and their emotions on lighting. Subsequently, based on this comprehensive assessment value, the game system can match and determine the most suitable one from a variety of preset regional lighting modes, which will be the final regional lighting mode for the functional area.
[0148] In one embodiment, step S116, which generates the lighting effect of each virtual lamp in the virtual night scene based on lamp distribution data, target light intensity, and lighting patterns of each area, may include:
[0149] S1161: Determine the location and type of lights in each functional area of the virtual night scene based on the lighting distribution data.
[0150] S1162: Based on the location, type, and lighting pattern of the lights in each functional area, the illumination range and rotation direction of each virtual light in the virtual night scene are derived.
[0151] S1163: Determine the illumination intensity of each virtual lamp in the virtual night scene based on the lamp type and target illumination intensity of each functional area.
[0152] S1164: Generate lighting effects for the illumination range, rotation direction, and illumination intensity of each virtual lamp.
[0153] In this embodiment, the lighting effect is mainly composed of the lighting range, rotation direction, and lighting intensity. Therefore, when generating the lighting effect, the game system can first determine the position and type of the lights in each functional area of the virtual night scene based on the distribution data of the lights. Then, based on the position, type, and lighting mode of the lights in each functional area, the lighting range and rotation direction of each virtual light in the virtual night scene can be deduced. At the same time, the lighting intensity of each virtual light in the virtual night scene can be determined based on the type and target illumination of the lights in each functional area.
[0154] Among them, the illumination range refers to the size of the area covered by the light emitted by the virtual lamp. This parameter is mainly used to limit the effective illumination area of the lamp; the rotation direction refers to the spatial angle of the virtual lamp's illumination direction in three-dimensional space. This parameter is mainly used to adjust the illumination point of the lamp's light; the illuminance refers to the luminous flux output by the virtual lamp, that is, the quantitative value of the lamp's luminous brightness. This parameter is mainly used to determine the overall luminous brightness level of the lamp.
[0155] Specifically, the lighting distribution data records the spatial distribution information of all virtual lights in each functional area of the scene, including the position coordinates of each light in the scene coordinate system and the type identifier of the light. Different light types correspond to different physical properties of the light source. For example, a point light source emits light uniformly in all directions, a spotlight has directionality and the light is concentrated within a specific cone angle range, and a surface light source radiates light outward from a specific plane. The regional lighting mode defines the overall lighting style tone of the functional area. Therefore, after the game system determines the position and type of each virtual light through the lighting distribution data, it can deduce the lighting range that each virtual light should cover in the current mode and the direction of rotation that it should point to, based on the specific requirements of the regional lighting mode corresponding to the functional area and the position and type of each virtual light, through a preset light propagation model.
[0156] Meanwhile, the game system can also use different intensity calculation methods to calculate the light intensity based on the type of lighting fixture. Different types of lighting fixtures have different luminous efficiency and power characteristics, resulting in different light intensity values required by different fixtures under the same target illumination requirements. Based on this, the game system can use the intensity calculation method corresponding to each type of lighting fixture to map the overall target illumination of the scene to the light intensity required by each individual lighting fixture. Subsequently, the illumination range, rotation direction, and light intensity of each virtual lighting fixture can be integrated into the complete lighting effect of that fixture, that is, a set of multi-dimensional parameter combinations including spatial coverage, illumination direction, and brightness output.
[0157] In one embodiment, the process of collecting disturbance scene data corresponding to the disturbance event in step S120 may include:
[0158] S121: Determine the event type and triggering object of the disturbance event, determine at least one functional area affected by the event type, and collect the status data of the triggering object based on the event type.
[0159] S122: Generate disturbance scene data corresponding to the disturbance event based on the event type, triggering object, at least one functional area, and status data.
[0160] In this embodiment, when collecting disturbance scene data, the game system can first confirm the event type and triggering object of the disturbance event, determine at least one functional area affected by the event type, and collect the status data of the triggering object based on the event type. Thus, disturbance scene data corresponding to the disturbance event can be generated based on the event type, triggering object, at least one functional area, and status data.
[0161] The event type refers to the category of the disturbance event. Different types of events have different lighting requirements. For example, movement events require lights to follow the moving target, alert events require lights to lock onto specific objects, and atmosphere events require lights to enhance the mood. The triggering object refers to the core participant in the disturbance event, which can be one or more virtual characters or an interactive object in the scene; there are no restrictions on this.
[0162] Specifically, after detecting a disturbance event within a virtual nighttime scene, the game system can first classify and identify the event to determine its type, and then locate the event trigger source as the trigger object. Subsequently, the game system can first obtain the pre-set or dynamically calculated influence range of the event type, and then determine at least one functional area involved within that influence range. Simultaneously, the game system can employ matching data collection strategies based on the event type to acquire the state data of the trigger object. The core state data to focus on differs for different event types; for example, movement events require a focus on location and trajectory data, while interactive events require additional attention to interactive behavior data. After collecting various types of information, the game system can integrate and encapsulate them according to a pre-set data structure to generate structured disturbance scene data. This data fully records the core characteristics of the current disturbance event, thus providing a comprehensive information foundation for subsequent parameter mapping and lighting adjustment strategies.
[0163] In one embodiment, the process of collecting the state data of the triggering object based on the event type in step S121 may include:
[0164] S1211: When the event type is a first-class event, collect the real-time location data and movement trajectory data of the triggering object to form status data.
[0165] S1212: When the event type is the second type, collect the real-time location data and real-time interaction data of the triggering object to form status data.
[0166] S1213: When the event type is a third type of event, collect the real-time location data, real-time emotion data and real-time behavior data of the triggering object to form state data.
[0167] S1214: When the event type is the fourth type, collect the real-time location data and patrol route data of the triggering object to form status data.
[0168] S1215: When the event type is the fifth type, collect the real-time location data and facial orientation data of the triggering object to form status data.
[0169] In this embodiment, since different types of disturbance events have fundamental differences in game mechanics and interaction modes, their requirements for reference data dimensions for lighting adjustments also vary. Therefore, during the data acquisition process, the game system can adopt a data acquisition strategy that matches the event type described by the current disturbance event to collect the core data of its triggering object in different dimensions, thereby forming structured state data.
[0170] Specifically, the event types in this application can include at least five categories, and each category has a corresponding data collection strategy. Of course, if other types of disturbance events exist during actual development or application, the corresponding data collection rules can also be set with reference to the logic of this embodiment, and this application does not limit this.
[0171] When the event type is Category 1, the game system can collect real-time position and movement trajectory data of the triggering object to form state data. Category 1 events can include events with movement as their core characteristic, such as chase events and escape events. In these events, the position information and movement trajectory of the triggering object are key references for determining the lighting tracking and following effects. Therefore, the game system can continuously record the sequence of coordinate changes of the triggering object in space, providing accurate position input for subsequent lighting adjustments and ensuring that the lighting always covers the triggering object.
[0172] When the event type is Category II, the game system can collect real-time location and interaction data of the triggering object to form state data. Category II events can include combat events, gathering events, and other events with interaction as their core feature. In these events, in addition to the triggering object's location information, its ongoing interactive behaviors, such as attack actions and gathering actions, directly affect the timing and presentation of lighting adjustments. Therefore, the game system needs to synchronously collect real-time interaction data such as the action state, interaction type, and interaction intensity during the interaction process as a reference for dynamically adjusting lighting effects.
[0173] When the event type is the third category, the game system can collect real-time location data, real-time emotion data, and real-time behavior data of the triggering object to form state data. The third category of events can include events with atmosphere as a core characteristic, such as dramatic speeches and emotional breakdowns. In these events, the triggering object's emotional state and behavior jointly determine the atmosphere to be presented by the lighting. Therefore, the game system can simultaneously acquire data on both emotional state and behavioral patterns to support the subsequent generation of lighting adjustments that can regulate emotions.
[0174] When the event type is Category 4, the game system can collect real-time location data and patrol route data of the triggering object to form status data. Category 4 events can include activities with fixed-route movement as their core characteristic, such as area patrols and guard post shift changes. In these events, the triggering object's patrol route is a crucial reference for lighting accompaniment and coverage illumination. Therefore, the game system needs to obtain the triggering object's preset patrol path and its current progress position on that path to support subsequent lighting adjustment strategies for generating accompanying modes.
[0175] When the event type is the fifth category, the game system can collect real-time position data and facial orientation data of the triggering object to form state data. The fifth category of events can include interrogation dialogues, wary stares, and other events with gaze direction as a core feature. In these events, the triggering object's facial orientation determines its attention direction and potential interaction objects. The system needs to obtain the triggering object's orientation angle data to support subsequent generation of spotlight and lock-on lighting adjustment strategies.
[0176] For example, such as Figure 6 As shown, Figure 6 An interface illustration of a disturbance event triggering scenario provided in an embodiment of this application; Figure 6 In the example commercial street scene, when the game system detects that a virtual character is moving quickly toward the street corner and chasing another virtual character who is running away, it can identify that the event belongs to the first type of event. Then, it continuously collects the real-time coordinates of the two characters and records the movement trajectory sequence, integrates and generates corresponding disturbance scene data, so that the lighting can be adjusted based on the data to make the spotlight follow the movement of the characters and enhance the visual expressiveness of the chase process.
[0177] In one embodiment, the process of parameter mapping of the disturbed scene data and generating a lighting adjustment strategy in step S130 may include:
[0178] S131: Mark virtual lamps in at least one functional area as target lamps based on real-time location data in the status data, and determine the initial illumination parameters of the target lamps based on the illumination effect of the target lamps.
[0179] S132: Determine the target illumination mode of the event type, and optimize the initial illumination parameters according to the target illumination mode using the triggering object and state data to generate a lighting adjustment strategy; wherein, the target illumination mode includes intensity mode, range mode and rotation mode.
[0180] In this embodiment, when generating the strategy, the game system can first mark the target lights that need to be adjusted from the virtual lights in at least one affected functional area based on the real-time position data in the state data, and determine the initial lighting parameters of the target lights based on the lighting effect of the target lights. At the same time, it can determine the target lighting mode of the event type, and optimize the initial lighting parameters according to the target lighting mode using the triggering object and state data to generate a lighting adjustment strategy that includes three dimensions of optimization parameters: intensity mode, range mode, and rotation mode.
[0181] Specifically, the disturbance scene data contains the real-time position coordinates of the triggering object. Therefore, the game system can use these position coordinates as the center, combined with the boundary of the functional area determined in the disturbance scene data, to traverse and filter all virtual lights within that functional area. Virtual lights whose position coordinates fall within or intersect with that functional area are marked as target lights. After marking the target lights, the game system can read the current lighting effects of these target lights from the game engine's lighting management module, extracting the current light intensity value, lighting range parameters, and rotation direction angle of each light as initial lighting parameters for subsequent optimization and adjustment.
[0182] Simultaneously, the game system can determine the target illumination pattern matching the event type based on the event type identifier in the disturbed scene data, using a preset illumination pattern mapping table. This target illumination pattern consists of three independent dimensions: intensity mode, range mode, and rotation mode, which respectively limit the adjustment direction of the light in terms of brightness output, spatial coverage, and illumination direction. After determining the target illumination pattern, the game system can use the real-time status data of the triggering object as the basis for optimization, performing dimension-by-dimensional optimization calculations on the initial illumination parameters.
[0183] Specifically, in terms of intensity, the game system can adjust the target value and variation pattern of brightness output based on the dynamic characteristics of the triggered object; in terms of range, the game system can adjust the target area and boundaries of the illumination coverage based on the location distribution and movement characteristics of the triggered object; and in terms of rotation, the game system can adjust the target angle of the lamp illumination based on the orientation or movement direction of the triggered object. After parameter optimization in these three dimensions, the game system integrates each optimized parameter into a complete lighting adjustment strategy, which is used to define the specific adjustments and target values that each target lamp needs to perform.
[0184] For example, in a commercial district scene, when the game system detects a virtual character rapidly moving towards a street corner and chasing another fleeing virtual character, it can include multiple functional areas along the path of the chase within its influence range. Then, it marks all virtual lights within a preset range around the path as target lights and reads the initial lighting parameters currently being applied to these lights. Since the chase event is a type of movement event, its corresponding target illumination mode is a dynamic follow mode prioritizing rotation. Therefore, the game system can optimize and adjust the rotation direction parameters of each target light frame-by-frame based on the real-time positions and movement trajectories of the two characters. Simultaneously, it can appropriately increase the light intensity of lights within the target area while shrinking the illumination range to a preset range centered on the player. This ultimately generates a lighting adjustment strategy that includes frame-by-frame updates, used for subsequent dynamic adjustments to the lighting in that area. This ensures that the lights remain precisely focused on the two characters throughout the chase, enhancing the tense atmosphere of the chase scene.
[0185] In one embodiment, such as Figure 7 As shown, Figure 7 A pattern mapping diagram of a target illumination mode provided in an embodiment of this application; Figure 7 In step S132, the process of determining the target illumination mode of the event type may include:
[0186] S1321: When the event type is a first-class event, determine the intensity mode of the event type as strong light mode, the range mode as focus mode, and the rotation mode as tracking mode.
[0187] S1322: When the event type is a second type of event, determine the intensity mode of the event type as strobe mode, the range mode as focus mode, and the rotation mode as lock mode.
[0188] S1323: When the event type is a third type of event, determine the intensity mode of the event type as strong light mode, the range mode as focus mode, and the rotation mode as lock mode.
[0189] S1324: When the event type is a fourth type of event, determine the intensity mode of the event type as weak light mode, the range mode as coverage mode, and the rotation mode as accompanying mode.
[0190] S1325: When the event type is a fifth type of event, determine the intensity mode of the event type as strong light mode, the range mode as focus mode, and the rotation mode as shaking mode.
[0191] In this embodiment, when determining the target illumination mode of an event type, the game system can determine the specific categories of intensity mode, range mode, and rotation mode corresponding to the event type based on the event type identifier of the current disturbance event and through the preset correspondence between event type and illumination mode, thereby forming a complete target illumination mode.
[0192] Specifically, the game system pre-configures a mapping table between event types and illumination modes. This mapping table assigns a corresponding mode category in three dimensions—intensity, range, and rotation—to each type of disturbance event. Since different types of disturbance events differ significantly in their interaction characteristics, duration, spatial dynamics, and atmospheric requirements, their lighting adjustment needs also vary. Therefore, the game system can match corresponding illumination mode combinations based on the event type.
[0193] For the first type of event, which is characterized by movement, the game system can determine its intensity mode as strong light mode, which provides high-brightness lighting to highlight moving targets; range mode as focus mode, which concentrates the light in a small area around the target to avoid light scattering and weakening the visual focus effect; and rotation mode as tracking mode, which makes the light follow the target's movement trajectory and rotate synchronously to ensure that the target is always in the center of the light.
[0194] For the second type of event, which is characterized by interaction, the game system can determine its intensity mode as a strobe mode, which is used to create a tense or warning atmosphere through the periodic alternation of light brightness, in line with the rhythm of the interactive behavior; the range mode is a focus mode, which is used to concentrate the light on the specific location where the interactive behavior occurs; and the rotation mode is a lock mode, which is used to keep the light stably pointing to the fixed position of the triggering object, unaffected by other dynamic factors around it.
[0195] For the third type of event, which is characterized by emotion, the game system can determine its intensity mode as strong light mode, which is used to highlight the emotional expression of the triggering object through high-brightness concentrated lighting; range mode as focus mode, which is used to make the triggering object the visual focus by narrowing the illumination range; and rotation mode as lock mode, which is used to stably lock the light on the triggering object, strengthening its central position in the entire scene.
[0196] For the fourth type of event, which is characterized by patrolling, the game system can determine its intensity mode as low light mode, which is used to complement the low-profile nature of patrolling behavior with low-brightness lighting; the range mode as coverage mode, which is used to cover a wider area where the triggering object is located, so as to achieve the patrolling effect; and the rotation mode as accompanying mode, which is used to make the light follow the patrolling movement of the triggering object and light up synchronously, so as to maintain continuous illumination of its movement path.
[0197] For the fifth type of event, which is characterized by gaze, the game system can determine its intensity mode as strong light mode, which is used to highlight the location of the object being gazed at through high-brightness concentrated lighting; range mode as focus mode, which is used to accurately point the light at the spatial position corresponding to the gaze direction; and rotation mode as shaking mode, which is used to make the light swing back and forth in a regular manner to simulate the dynamic effect of gaze search or vigilance.
[0198] In one embodiment, the process of adjusting the lighting effect of the corresponding virtual lamps according to the lighting adjustment strategy in step S130 may include:
[0199] S133: Determine the target luminaire to be adjusted and the adjustment execution parameters of the target luminaire according to the lighting adjustment strategy; the adjustment execution parameters include the light intensity parameter, the light range parameter, and the rotation direction parameter.
[0200] S134: Adjust the light intensity of the target luminaire to the target intensity based on the light intensity parameter, adjust the light range of the target luminaire to the target range based on the light range parameter, and adjust the rotation direction of the target luminaire to the target direction based on the rotation direction parameter.
[0201] S135: Based on the target intensity effect, target range effect, and target direction effect, based on the lighting effect of the target luminaire.
[0202] In this embodiment, after generating the lighting adjustment strategy, the game system can parse the target lights to be adjusted from the strategy and extract the corresponding adjustment execution parameters for each target light, including the light intensity parameter, the light range parameter, and the rotation direction parameter. Subsequently, the game system can control the light intensity of the target lights to adjust to the target intensity effect according to the light intensity parameter, control the light range of the target lights to adjust to the target range effect according to the light range parameter, and control the rotation direction of the target lights to adjust to the target direction effect according to the rotation direction parameter, thereby forming a complete lighting effect for the target lights and driving the target lights to perform actual lighting output according to the effect.
[0203] Specifically, the illumination intensity parameter includes the target brightness value that the target luminaire should achieve and the transition method to achieve that target value; the illumination range parameter includes the size of the spatial range that the target luminaire should cover and the configuration information of the light focusing degree; the rotation direction parameter includes the spatial angle that the target luminaire should point to and the dynamic change law of this angle during the adjustment process. Based on these three dimensions of parameters, the game system can independently execute adjustment operations according to their respective control logic. For example, in terms of illumination intensity adjustment, the game system can control the light source power output of the luminaire according to the illumination intensity parameter, so that the real-time brightness of the luminaire is adjusted according to the target value and change mode specified by the parameter; in terms of illumination range adjustment, the game system can control the cone angle, illumination distance, or radiation radius of the luminaire according to the illumination range parameter, so that the illumination coverage area of the luminaire is scaled up or expanded according to the target range specified by the parameter; in terms of rotation direction adjustment, the game system can control the rotation angle of the luminaire in the horizontal and vertical directions according to the rotation direction parameter, so that the illumination direction of the luminaire rotates according to the target angle specified by the parameter.
[0204] Understandably, by adjusting parameters in three dimensions—light intensity, light range, and rotation direction—the game system can summarize the results of these adjustments into a complete lighting effect for the target luminaire after the update. This allows the game engine's rendering pipeline to recalculate and output the target luminaire's lighting based on this effect, thus achieving a complete closed loop from strategy analysis to effect implementation.
[0205] In one embodiment, the process of adjusting the light intensity of the target lamp to the target intensity effect according to the light intensity parameter in step S134 may include:
[0206] S3411: Analyze the intensity mode corresponding to the light intensity parameter; the intensity mode is either strong light mode, flicker mode, or weak light mode.
[0207] S3412: When the intensity mode is high light mode, the target lamp is controlled to continuously output high brightness according to the light intensity parameters to obtain the target intensity effect.
[0208] S3413: When the target intensity mode is strobe mode, the target lamp is controlled to periodically alternate between high brightness and low brightness output according to the light intensity parameter to obtain the target intensity effect.
[0209] S3414: When the target intensity mode is low light mode, the target lamp is controlled to continuously output low brightness according to the light intensity parameter to obtain the target intensity effect.
[0210] In this embodiment, the intensity mode of the light intensity can include three types: high light mode, flicker mode, and low light mode. When the intensity mode is high light mode, the game system can control the target lamp to continuously output high brightness according to the light intensity parameters to obtain the target intensity effect; when the intensity mode is flicker mode, the game system can control the target lamp to periodically alternate between high brightness and low brightness according to the light intensity parameters to obtain the target intensity effect; when the intensity mode is low light mode, the game system can control the target lamp to continuously output low brightness according to the light intensity parameters to obtain the target intensity effect.
[0211] Specifically, the Intense Light Mode refers to a mode where virtual lights continuously and stably output brightness levels higher than the current scene's baseline. Its core function is to provide concentrated, high-intensity illumination to highlight specific targets or areas. In Intense Light Mode, the game system increases the brightness of the virtual lights to the target level and then maintains a constant, unfluctuating brightness, ensuring the light remains at a consistently high intensity.
[0212] Strobe mode refers to a mode in which virtual lights alternate between predetermined high and low brightness states at a certain frequency. Its core function is to create a periodic change in light intensity. In strobe mode, the game system can simultaneously obtain the target upper and lower limits of brightness change, as well as the alternating frequency parameter, and control the lights to transition back and forth between these limits according to this frequency value. It is typically used to create tense, warning, rhythmic, or sudden atmospheres.
[0213] Low-light mode refers to a mode where virtual lights continuously and stably output light at a level lower than the current scene's baseline brightness. Its core purpose is to provide a soft, low-key lighting effect to avoid overly bright light interfering with the tranquil atmosphere of the scene or the concealment of patrol activities. In low-light mode, the game system can reduce the brightness of the lights to the target brightness and then maintain it constant, without fluctuations, ensuring the light remains in a consistently low-intensity, soft output state.
[0214] For example, in a chase event, the game system can use a high-brightness mode, controlling the target streetlights to maintain a stable output of 1500 lumens, keeping the chase route bright and clear and enhancing target visibility. In a battle event, the game system can use a strobe mode, controlling the plaza spotlights to alternate between 1200 lumens and 300 lumens twice per second, creating a warning flashing effect that adds tension to the battle. In a patrol event, the game system can use a low-brightness mode, controlling the streetlights along the route to maintain a stable output of 300 lumens, keeping the light soft and low-key to avoid excessively disturbing the surrounding environment.
[0215] In one embodiment, the process of adjusting the illumination range of the target luminaire to the target range effect according to the illumination range parameter in step S134 may include:
[0216] S3421: Determine the triggering object of the disturbance event based on the disturbance scene data, and parse the range mode corresponding to the illumination range parameter; the range mode is either focus mode or coverage mode.
[0217] S3422: When the range mode is focused mode, the target lamp is controlled to perform low beam narrowing illumination on the triggered object according to the illumination range parameter to obtain the target range effect.
[0218] S3423: When the range mode is coverage mode, the target lamp is controlled to extend the high beam illumination to the affected area where the triggered object is located according to the illumination range parameter to obtain the target range effect.
[0219] In this embodiment, the illumination range mode can include two types: focus mode and coverage mode. When the range mode is focus mode, the game system can control the target light fixture to apply low-beam narrowing illumination to the triggered object according to the illumination range parameters to obtain the target range effect; when the range mode is coverage mode, the game system can control the target light fixture to apply high-beam extended illumination to the affected area where the triggered object is located according to the illumination range parameters to obtain the target range effect.
[0220] Specifically, the Focus Mode refers to a mode where virtual lights concentrate light into a small space around the triggering object, enhancing the local lighting effect by narrowing the illumination range. In Focus Mode, the game system can control the light fixture to shorten the illumination distance or narrow the cone angle based on the shrinkage radius or cone angle reduction in the illumination range parameters. This causes the illumination range to shrink from its current state towards a local area centered on the triggering object's location. The edge of the light clearly converges near the triggering object, and the brightness outside the area quickly decays to a negligible level. This mode is mainly used in scenes that need to highlight a single target or a small interactive area, guiding the player's visual attention by focusing the light.
[0221] Coverage mode refers to a mode where virtual lights extend their light over a wider area of influence where the triggered object is located, achieving overall regional illumination by expanding the illumination range. In coverage mode, the game system can control the lighting distance of the lights to be extended or the cone angle to be widened based on the expansion radius or cone angle amplification in the illumination range parameters. This allows the illumination range to expand from its current state to cover the entire influence area, ensuring that all space within the area receives effective illumination. This mode is mainly used in scenes that need to illuminate a large area, ensuring visibility and environmental perception within the area through broad illumination coverage.
[0222] For example, in a chase scenario, the game system can use a focus mode, controlling the streetlights in the main street area to narrow their beams to illuminate the chasing parties. This reduces the illumination range of each streetlight from an initial radius of 4 meters to a radius of 2 meters centered on the current positions of the chasing parties, creating a strong visual focus effect. The surrounding areas remain relatively dark, further enhancing the tension and target orientation of the chase. In a patrol scenario, the game system can use an coverage mode, controlling the streetlights along the route to extend their beams to illuminate the area of influence of the patrol team. This expands the illumination range of each streetlight from an initial radius of 4 meters to a radius of 8 meters, covering a wider area of the patrol route. This ensures effective lighting along the patrol team's path and in the surrounding area, guaranteeing overall visibility and a sense of security in the area.
[0223] In one embodiment, step S134, which involves controlling the rotation direction of the target lamp according to the rotation direction parameter to achieve the target direction effect, may include:
[0224] S3431: Determine the triggering object of the disturbance event based on the disturbance scene data, and parse the rotation mode corresponding to the rotation direction parameter; the rotation mode is tracking mode, locking mode, accompanying mode or shaking mode.
[0225] S3432: When the rotation mode is tracking mode, the target lamp is controlled to track and illuminate the movement trajectory of the triggered object according to the rotation direction parameter to obtain the target direction effect.
[0226] S3433: When the rotation mode is locked, the target lamp is controlled to lock and illuminate the triggered object according to the rotation direction parameter to obtain the target direction effect.
[0227] S3434: When the rotation mode is the accompanying mode, after detecting that the triggered object has entered the accompanying illumination range of the target lamp, the target lamp is controlled to light up according to the rotation direction parameter to obtain the target direction effect.
[0228] S3435: When the rotation mode is the shaking mode, determine the reference orientation angle of the rotation direction parameter, and control the target lamp to swing back and forth based on the reference orientation angle according to the preset shaking amplitude and preset shaking frequency to obtain the target direction effect.
[0229] In this embodiment, the rotation mode can be categorized into four types: tracking mode, locking mode, accompanying mode, and shaking mode. When the rotation mode is tracking mode, the game system can control the target light fixture to track and illuminate the movement trajectory of the triggered object based on the rotation direction parameters, thus achieving a target direction effect. When the rotation mode is locking mode, the game system can control the target light fixture to lock and illuminate the triggered object based on the rotation direction parameters, thus achieving a target direction effect. When the rotation mode is accompanying mode, after detecting that the triggered object has entered the accompanying illumination range of the target light fixture, the game system can control the target light fixture to illuminate the object based on the rotation direction parameters, thus achieving a target direction effect. When the rotation mode is shaking mode, the game system can determine the reference orientation angle of the rotation direction parameters and control the target light fixture to swing back and forth based on the reference orientation angle according to a preset shaking amplitude and preset shaking frequency, thus achieving a target direction effect.
[0230] Specifically, tracking mode refers to a mode where the virtual light fixture's illumination direction continuously rotates to follow the movement of the triggered object, always centering the light on the triggered object. In tracking mode, the game system continuously acquires the real-time position coordinates of the triggered object at a preset sampling frequency, calculates the target angle the light fixture should currently be pointing at based on these coordinates, and drives the horizontal and vertical rotation components of the virtual light fixture to rotate according to the calculated target angle, ensuring that the main direction of the light is always aligned with the current position of the triggered object. As the triggered object moves, the game system can update the target angle in real time and drive the light fixture to rotate synchronously, achieving continuous tracking of the illumination direction to the movement trajectory.
[0231] Locked mode refers to a mode where the virtual light fixture's beam direction is fixed to the location of the trigger object. It can also update the locked target synchronously when the trigger object's position changes. In locked mode, the game system obtains the current coordinates of the trigger object, calculates the target pointing angle of the virtual light fixture, drives the virtual light fixture to rotate to that angle, and maintains the lock, ensuring the light stably points at the trigger object. When the trigger object shifts, the game system can recalculate the target angle and drive the light fixture to the new locked position to maintain continuous pointing at the trigger object.
[0232] The accompanying mode refers to a mode where virtual lights only illuminate after a triggered object enters a preset accompanying lighting range and turn off after the triggered object leaves the accompanying lighting range. In accompanying mode, the game system can continuously monitor the position information of the triggered object and compare it with the accompanying lighting range of each target light. It should be noted that the accompanying lighting range of virtual lights is relatively large, and each location area in the virtual night scene can overlap with the accompanying lighting range of multiple virtual lights. Therefore, when the triggered object moves, it will enter the accompanying lighting range of different target lights one after another. The game system only needs to issue a lighting command to the target lights within the range and an off command to the target lights after the triggered object has left the range. This ensures that as the triggered object moves forward, the virtual lights in front of it light up sequentially, and the virtual lights behind it turn off sequentially, forming a continuous accompanying lighting effect.
[0233] The wobbling mode refers to a mode in which the virtual light fixture oscillates back and forth around a reference angle according to a preset wobbling amplitude and frequency. In wobbling mode, the system first determines the reference angle in the rotation direction parameters, which can typically be the initial position pointing to the trigger object or the warning direction. Then, according to the preset wobbling amplitude and preset wobbling frequency, the system controls the virtual light fixture to oscillate periodically around the reference angle in the horizontal or vertical direction, simulating the dynamic effect of line-of-sight search or warning scan.
[0234] For example, in chase events, the game system can use a tracking mode, controlling the horizontal rotation components of streetlights in the main street area to continuously rotate, ensuring the light is always aimed at the current positions of the chasing parties. When the chasing parties move from the main street area to the alley area, the game system can synchronously update the target angle of each streetlight, allowing the light to continuously track and illuminate along their movement trajectory, ensuring that the chasing parties are always in the center of the light. In combat events, the game system can use a lock-on mode, controlling the lights in the combat area to fix the direction of illumination towards the two characters engaged in combat, ensuring the light is stably focused on that area, highlighting the core scene of the conflict. In patrol events, the game system can use an accompanying mode, controlling the streetlights along the route to only turn on after the patrol team enters their respective accompanying lighting range. As the patrol team moves, the streetlights turn on sequentially, creating a sequential lighting effect. During alert events, the game system can use a shaking mode. First, determine the reference angle as the alert direction, and then control the nearby lights to swing back and forth at a shaking amplitude of 15° to the left and right and a shaking frequency of 2 times per second around the reference angle in that direction, to simulate the dynamic line of sight of the guard scanning and searching.
[0235] In one embodiment, the method may further include:
[0236] S140: After the disturbance event is detected to have ended, restore the lighting effect of each virtual light fixture in the virtual night scene to the initial state before the disturbance event was triggered.
[0237] In this embodiment, after a disturbance event is triggered, the game system can continuously monitor the status of the disturbance event to determine whether the event has ended. When the game system detects that the disturbance event has ended, it can trigger a lighting restoration process to restore the lighting effect of each virtual light fixture in the virtual night scene to its initial state before the disturbance event was triggered, so that the scene lighting returns to the basic atmosphere of normal night mode.
[0238] Specifically, the game system can determine whether a disturbance event has ended by actively sending an end signal through the event management system, or by periodically checking the event's status field in the event management system. Once the game system confirms the disturbance event has ended, it can retrieve a snapshot of the initial lighting effect of each virtual light fixture saved before the disturbance event occurred. This snapshot records complete lighting parameter information for each virtual light fixture, including its intensity, range, and rotation direction, just before the disturbance event. Using this parameter information, the game system can control each light fixture to smoothly transition from its current state to its initial state according to a preset recovery speed.
[0239] It's important to note that the restoration of lighting effects is not an instantaneous switch, but rather a gradual transition according to a preset restoration rate. This is to avoid sudden changes in lighting that could interfere with the player's visual experience. During the restoration process, the game system continuously updates the lighting parameters of each light fixture at a preset update frequency until all virtual light fixture parameters are restored to the values recorded in the initial snapshot. At this point, the lighting effects of the virtual night scene completely return to the state before the disturbance event was triggered, thus entering the basic lighting state of normal night mode, awaiting the next disturbance event.
[0240] The virtual lighting adaptive adjustment device provided in the embodiments of this application is described below. The virtual lighting adaptive adjustment device described below can be referred to in correspondence with the virtual lighting adaptive adjustment method described above.
[0241] In one embodiment, such as Figure 8 As shown, Figure 8 This application provides a flowchart illustrating a virtual adaptive lighting adjustment device according to an embodiment of the present application. The present application also provides a virtual adaptive lighting adjustment device, including a lighting module 210, an event triggering module 220, and an effect adjustment module 230, specifically comprising the following:
[0242] The lighting module 210 is used to acquire environmental data of the virtual night scene in real time and generate lighting effects for each virtual lamp in the virtual night scene based on the environmental data.
[0243] The event triggering module 220 is used to respond to disturbance events triggered in the virtual night scene and collect disturbance scene data corresponding to the disturbance events.
[0244] The effect adjustment module 230 is used to perform parameter mapping on the disturbed scene data, generate a lighting adjustment strategy, and adjust the lighting effect of the corresponding virtual lamps according to the lighting adjustment strategy.
[0245] In the above embodiments, when the game detects that it has entered a virtual night scene, the environmental data of the virtual night scene can be acquired in real time to generate lighting effects for each virtual lamp in the virtual night scene, thereby building a basic lighting effect that matches the current scene environment. If a disturbance event is detected in the virtual night scene, the disturbance scene data corresponding to the disturbance event can be collected as the basic matching data for the lighting requirements of the disturbance event. For example, this application can perform parameter mapping on the collected disturbance scene data to generate a lighting adjustment strategy corresponding to the disturbance event, and use the strategy to adaptively adjust the lighting effects of the corresponding virtual lamps, so that the lighting can change naturally with the triggering of different disturbance events, thereby creating a scene atmosphere that matches the current game plot and interactive events, improving the game's fun, and greatly enhancing the player's experience and immersion when playing in a night scene.
[0246] In one embodiment, the light illumination module 210 may include:
[0247] The data acquisition submodule is used to detect when the game enters night mode, generate a virtual night scene, and acquire the scene type, time period type, and weather data of the virtual night scene in real time.
[0248] The data integration submodule is used to collect virtual character activity data in virtual nighttime scenes and generate environmental data for virtual nighttime scenes based on scene type, time period type, weather data, and virtual character activity data.
[0249] In one embodiment, the light illumination module 210 may further include:
[0250] The distribution determination submodule is used to determine the lighting distribution data of the virtual nighttime scene based on the scene type in the environmental data.
[0251] The brightness determination submodule is used to determine the target illumination of the virtual night scene based on the time period type and weather data in the environmental data.
[0252] The mode determination submodule is used to determine the regional lighting mode of each functional area in the virtual night scene based on the virtual character activity data in the environmental data.
[0253] The effects generation submodule is used to generate the lighting effects of each virtual lamp in the virtual night scene based on lamp distribution data, target illumination intensity, and lighting patterns of each area.
[0254] In one embodiment, the brightness determination submodule may include:
[0255] The coefficient determination unit is used to match the baseline illumination intensity corresponding to the time period type in the environmental data with a preset time period illumination mapping table, and to determine the brightness compensation coefficient of the virtual night scene based on the weather data in the environmental data.
[0256] The brightness adjustment unit is used to adjust the brightness of the reference illumination using the illumination compensation coefficient to obtain the target illumination of the virtual night scene.
[0257] In one embodiment, the pattern determination submodule may include:
[0258] The character recognition unit is used to identify the character distribution density and emotional state of each functional area in the virtual night scene by using virtual character activity data in the environmental data.
[0259] The data mapping unit is used to comprehensively map the character distribution density and character emotional state of each functional area according to the preset lighting pattern mapping rules, so as to obtain the regional lighting pattern of each functional area.
[0260] In one embodiment, the role recognition unit may include:
[0261] The area division sub-unit is used to divide the virtual night scene into multiple functional areas according to functional attributes, and to determine the number of virtual characters in each functional area through virtual character activity data in the environmental data.
[0262] The density calculation subunit is used to calculate the character distribution density of each functional area based on the number of virtual characters in each functional area.
[0263] The state analysis subunit is used to collect behavioral interaction data of virtual characters in each functional area, and to perform emotional state aggregation analysis on each behavioral interaction data to obtain the emotional state of the characters in each functional area.
[0264] In one embodiment, the data mapping unit may include:
[0265] The rule acquisition sub-unit is used to acquire preset lighting pattern mapping rules; the lighting pattern mapping rules include density mapping sub-rules and emotion mapping sub-rules.
[0266] The rule matching subunit is used to obtain the density influence factor corresponding to the role distribution density of the functional area based on the density mapping subrule, and to obtain the emotion influence factor corresponding to the role emotion state of the functional area based on the emotion mapping subrule.
[0267] The demand assessment subunit is used to assess the lighting demand in the functional area based on the density influence factor and the emotion influence factor, and to determine the regional lighting pattern corresponding to the lighting demand.
[0268] In one embodiment, the effects generation submodule may include:
[0269] The lighting fixture determination unit is used to determine the location and type of lighting fixtures in each functional area of the virtual night scene based on the lighting fixture distribution data.
[0270] The illumination simulation unit is used to deduce the illumination range and rotation direction of each virtual lamp in the virtual night scene based on the lamp position, lamp type and regional illumination mode of each functional area.
[0271] The intensity determination unit is used to determine the illumination intensity of each virtual lamp in the virtual night scene based on the type of lamp and the target illumination intensity of each functional area.
[0272] The effects generation unit is used to generate lighting effects for the illumination range, rotation direction, and light intensity of each virtual lamp.
[0273] In one embodiment, the event triggering module 220 may include:
[0274] The data acquisition submodule is used to determine the event type and triggering object of the disturbance event, determine at least one functional area affected by the event type, and acquire the status data of the triggering object based on the event type.
[0275] The data synthesis submodule is used to generate disturbance scene data corresponding to the disturbance event based on the event type, triggering object, at least one functional area, and status data.
[0276] In one embodiment, the data acquisition submodule may include:
[0277] The first acquisition unit is used to acquire real-time location data and movement trajectory data of the triggering object when the event type is the first type of event, and form status data.
[0278] The second acquisition unit is used to acquire real-time location data and real-time interaction data of the triggering object when the event type is the second type of event, and form status data.
[0279] The third acquisition unit is used to collect real-time location data, real-time emotion data, and real-time behavior data of the triggering object when the event type is a third type of event, forming status data.
[0280] The fourth acquisition unit is used to acquire real-time location data and patrol route data of the triggering object when the event type is the fourth type of event, and form status data.
[0281] The fifth acquisition unit is used to acquire real-time location data and facial orientation data of the triggering object when the event type is the fifth type of event, and form status data.
[0282] In one embodiment, the effect adjustment module 230 may include:
[0283] The lamp marking submodule is used to mark virtual lamps in at least one functional area as target lamps based on real-time location data in the status data, and to determine the initial illumination parameters of the target lamps based on the lighting effect of the target lamps.
[0284] The strategy generation submodule is used to determine the target illumination mode of the event type, and optimize the initial illumination parameters according to the target illumination mode using the triggering object and state data to generate a lighting adjustment strategy; wherein, the target illumination mode includes intensity mode, range mode and rotation mode.
[0285] In one embodiment, the policy generation submodule may include:
[0286] The first type determination unit is used to determine the intensity mode of the event type as strong light mode, the range mode as focus mode, and the rotation mode as tracking mode when the event type is the first type of event.
[0287] The second type determination unit is used to determine the intensity mode of the event type as strobe mode, the range mode as focus mode, and the rotation mode as lock mode when the event type is the second type of event.
[0288] The third type determination unit is used to determine the intensity mode of the event type as strong light mode, the range mode as focus mode, and the rotation mode as lock mode when the event type is a third type event.
[0289] The fourth type determination unit is used to determine the intensity mode of the event type as weak light mode, the range mode as coverage mode, and the rotation mode as accompanying mode when the event type is the fourth type of event.
[0290] The fifth type determination unit is used to determine the intensity mode of the event type as strong light mode, the range mode as focus mode, and the rotation mode as shaking mode when the event type is the fifth type of event.
[0291] In one embodiment, the effect adjustment module 230 may further include:
[0292] The execution parameter determination submodule is used to determine the target luminaire to be adjusted and the adjustment execution parameters of the target luminaire according to the lighting adjustment strategy; the adjustment execution parameters include light intensity parameters, light range parameters, and rotation direction parameters.
[0293] The parameter adjustment submodule is used to control the light intensity of the target lamp to the target intensity effect according to the light intensity parameter, to control the light range of the target lamp to the target range effect according to the light range parameter, and to control the rotation direction of the target lamp to the target direction effect according to the rotation direction parameter.
[0294] The Effect Update submodule is used to adjust the lighting effect of the target luminaire based on the target intensity effect, target range effect, and target direction effect.
[0295] In one embodiment, the parameter adjustment submodule may include:
[0296] The intensity resolution unit is used to resolve the intensity mode corresponding to the light intensity parameters; the intensity mode is either a strong light mode, a flicker mode, or a weak light mode.
[0297] The high-intensity mode unit is used to control the target lamp to continuously output high brightness according to the light intensity parameters when the intensity mode is high-intensity mode, so as to obtain the target intensity effect.
[0298] The strobe mode unit is used to control the target lamp to periodically alternate between high and low brightness output according to the light intensity parameters when the target intensity mode is strobe mode, so as to obtain the target intensity effect.
[0299] The low-light mode unit is used to control the target lamp to continuously output low brightness according to the light intensity parameters when the target intensity mode is low-light mode, so as to obtain the target intensity effect.
[0300] In one embodiment, the parameter adjustment submodule may further include:
[0301] The range parsing unit is used to determine the triggering object of the disturbance event based on the disturbance scene data, and to parse the range mode corresponding to the illumination range parameter; the range mode is either focus mode or coverage mode.
[0302] The focus mode unit is used to control the target lamp to perform low beam narrowing illumination on the triggered object according to the illumination range parameters when the range mode is focus mode, so as to obtain the target range effect.
[0303] The coverage mode unit is used to control the target luminaire to extend the high beam illumination to the affected area where the triggered object is located, based on the illumination range parameters, when the range mode is coverage mode, so as to obtain the target range effect.
[0304] In one embodiment, the parameter adjustment submodule may further include:
[0305] The rotation analysis unit is used to determine the triggering object of the disturbance event based on the disturbance scene data, and to parse the rotation mode corresponding to the rotation direction parameter; the rotation mode is tracking mode, locking mode, accompanying mode or shaking mode.
[0306] The tracking mode unit is used to control the target lamp to track and illuminate the movement trajectory of the triggered object according to the rotation direction parameter when the rotation mode is tracking mode, so as to obtain the target direction effect.
[0307] The locking mode unit is used to control the target lamp to lock and illuminate the triggered object according to the rotation direction parameter when the rotation mode is locked, so as to obtain the target direction effect.
[0308] The accompanying mode unit is used to control the target lamp to illuminate the target lamp according to the rotation direction parameters after detecting that the triggered object has entered the accompanying illumination range of the target lamp when the rotation mode is accompanying mode, so as to obtain the target direction effect.
[0309] The swaying mode unit is used to determine the reference orientation angle of the rotation direction parameter when the rotation mode is swaying mode, and to control the target lamp to oscillate back and forth based on the reference orientation angle according to the preset swaying amplitude and preset swaying frequency to obtain the target direction effect.
[0310] In one embodiment, the apparatus may further include:
[0311] The effect restoration module is used to restore the lighting effect of each virtual light fixture in the virtual night scene to the initial state before the disturbance event was triggered after the disturbance event is detected and the event has ended.
[0312] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the virtual lighting adaptive adjustment method as described in any of the above embodiments.
[0313] In one embodiment, this application also provides a computer device storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the virtual lighting adaptive adjustment method as described in any of the above embodiments.
[0314] Indicatively, such as Figure 9 As shown, Figure 9 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 9 The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the virtual lighting adaptive adjustment method of any of the above embodiments.
[0315] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0316] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0317] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0318] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0319] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A virtual lighting adaptive adjustment method, characterized in that, The method includes: Real-time acquisition of environmental data for a virtual nighttime scene, and generation of lighting effects for each virtual lamp in the virtual nighttime scene based on the environmental data; When a disturbance event is detected in the virtual night scene, disturbance scene data corresponding to the disturbance event is collected; The disturbed scene data is mapped with parameters to generate a lighting adjustment strategy, and the lighting effect of the corresponding virtual lights is adjusted according to the lighting adjustment strategy.
2. The virtual lighting adaptive adjustment method according to claim 1, characterized in that, The step of acquiring environmental data of the virtual night scene in real time and generating lighting effects for each virtual light fixture in the virtual night scene based on the environmental data includes: Once the game enters night mode, a virtual night scene is generated, and the scene type, time period type, and weather data of the virtual night scene are obtained in real time. Collect virtual character activity data in the virtual night scene, and generate environmental data for the virtual night scene based on the scene type, the time period type, the weather data, and the virtual character activity data; The lighting distribution data of the virtual nighttime scene is determined based on the scene type in the environmental data; The target illumination level of the virtual nighttime scene is determined based on the time period type and weather data in the environmental data. The regional lighting pattern of each functional area in the virtual night scene is determined based on the virtual character activity data in the environmental data. The lighting effect of each virtual lamp in the virtual night scene is generated based on the lamp distribution data, the target illumination intensity, and the lighting patterns of each area.
3. The virtual lighting adaptive adjustment method according to claim 2, characterized in that, Determining the target illumination of the virtual nighttime scene based on the time period type and weather data in the environmental data includes: The baseline illumination intensity corresponding to the time period type in the environmental data is matched by a preset time period illumination mapping table, and the brightness compensation coefficient of the virtual night scene is determined according to the weather data in the environmental data. The brightness of the reference illumination is adjusted using the illumination compensation coefficient to obtain the target illumination of the virtual night scene.
4. The virtual lighting adaptive adjustment method according to claim 2, characterized in that, The step of determining the regional lighting mode of each functional area in the virtual night scene based on the virtual character activity data in the environmental data includes: The virtual night scene is divided into multiple functional areas according to its functional attributes, and the number of virtual characters in each functional area is determined by the virtual character activity data in the environmental data. The character distribution density of each functional area is calculated based on the number of virtual characters in each functional area. Collect behavioral interaction data of virtual characters in each functional area, and perform emotional state aggregation analysis on each behavioral interaction data to obtain the emotional state of the characters in each functional area. Obtain a preset lighting pattern mapping rule; the lighting pattern mapping rule includes a density mapping sub-rule and a mood mapping sub-rule; For each functional area, a density influence factor corresponding to the role distribution density of that functional area is obtained by matching according to the density mapping sub-rule, and an emotion influence factor corresponding to the role emotional state of that functional area is obtained by matching according to the emotion mapping sub-rule. The light requirements of the functional area are assessed based on the density influence factor and the emotion influence factor, and the regional light pattern corresponding to the light requirements is determined.
5. The virtual lighting adaptive adjustment method according to claim 2, characterized in that, The process of generating the lighting effect for each virtual lamp in the virtual night scene based on the lamp distribution data, the target light intensity, and the lighting patterns of each area includes: The location and type of lights in each functional area of the virtual night scene are determined based on the light distribution data; Based on the location, type, and lighting pattern of the lights in each functional area, the illumination range and rotation direction of each virtual light in the virtual night scene are deduced. The illumination intensity of each virtual lamp in the virtual night scene is determined based on the type of lamp in each functional area and the target illumination intensity. Each virtual lamp is assigned a lighting effect based on its illumination range, rotation direction, and light intensity.
6. The virtual lighting adaptive adjustment method according to claim 1, characterized in that, The collection of disturbance scene data corresponding to the disturbance event includes: The event type and triggering object of the disturbance event are determined, and at least one functional area affected by the event type is determined, and the status data of the triggering object is collected based on the event type; Based on the event type, the triggering object, the at least one functional area, and the status data, disturbance scene data corresponding to the disturbance event is generated.
7. The virtual lighting adaptive adjustment method according to claim 6, characterized in that, The process of collecting the status data of the triggering object based on the event type includes: When the event type is a first type event, real-time location data and movement trajectory data of the triggering object are collected to form status data; When the event type is a second type of event, real-time location data and real-time interaction data of the triggering object are collected to form status data; When the event type is a third type of event, real-time location data, real-time emotion data, and real-time behavior data of the triggering object are collected to form status data; When the event type is a fourth type of event, real-time location data and patrol route data of the triggering object are collected to form status data; When the event type is the fifth type, the real-time location data and facial orientation data of the triggering object are collected to form status data.
8. The virtual lighting adaptive adjustment method according to claim 7, characterized in that, The step of mapping parameters to the disturbed scene data and generating a lighting adjustment strategy includes: The virtual lights in the at least one functional area are marked as target lights based on the real-time location data in the status data, and the initial illumination parameters of the target lights are determined based on the illumination effect of the target lights. The target illumination mode of the event type is determined, and the initial illumination parameters are optimized using the triggering object and the state data according to the target illumination mode to generate a lighting adjustment strategy; wherein, the target illumination mode includes intensity mode, range mode and rotation mode.
9. The virtual lighting adaptive adjustment method according to claim 1, characterized in that, The step of adjusting the lighting effect of the corresponding virtual lamps according to the lighting adjustment strategy includes: The target luminaire to be adjusted and the adjustment execution parameters of the target luminaire are determined according to the lighting adjustment strategy; the adjustment execution parameters include light intensity parameters, light range parameters, and rotation direction parameters; The light intensity of the target lamp is adjusted to the target intensity effect according to the light intensity parameter, the light range of the target lamp is adjusted to the target range effect according to the light range parameter, and the rotation direction of the target lamp is adjusted to the target direction effect according to the rotation direction parameter. The lighting effect of the target luminaire is adjusted according to the target intensity effect, the target range effect, and the target direction effect.
10. The virtual lighting adaptive adjustment method according to claim 9, characterized in that, The step of controlling the light intensity of the target lamp to achieve the target intensity effect based on the light intensity parameter includes: The intensity mode corresponding to the light intensity parameter is obtained through analysis; the intensity mode is either a strong light mode, a flicker mode, or a weak light mode. When the intensity mode is high light mode, the target lamp is controlled to continuously output high brightness according to the light intensity parameter to obtain the target intensity effect; When the target intensity mode is the strobe mode, the target lamp is controlled to periodically alternate between high brightness and low brightness according to the light intensity parameter to obtain the target intensity effect; When the target intensity mode is low light mode, the target lamp is controlled to continuously output low brightness according to the light intensity parameter to obtain the target intensity effect.
11. The virtual lighting adaptive adjustment method according to claim 9, characterized in that, The step of controlling the illumination range of the target lamp to adjust to the target range according to the illumination range parameters includes: The triggering object of the disturbance event is determined based on the disturbance scene data, and the range mode corresponding to the illumination range parameter is obtained by parsing; the range mode is either a focus mode or a coverage mode. When the range mode is the focus mode, the target lamp is controlled to perform low beam narrowing illumination on the triggered object according to the illumination range parameters to obtain the target range effect; When the range mode is coverage mode, the target lamp is controlled to extend the high beam illumination to the affected area where the triggered object is located according to the illumination range parameter, so as to obtain the target range effect.
12. The virtual lighting adaptive adjustment method according to claim 9, characterized in that, The step of controlling the rotation direction of the target lamp to achieve the target direction effect according to the rotation direction parameter includes: The triggering object of the disturbance event is determined based on the disturbance scene data, and the rotation mode corresponding to the rotation direction parameter is obtained by parsing; the rotation mode is tracking mode, locking mode, accompanying mode or shaking mode; When the rotation mode is the tracking mode, the target lamp is controlled to track and illuminate the movement trajectory of the triggered object according to the rotation direction parameter to obtain the target direction effect; When the rotation mode is the locking mode, the target lamp is controlled to lock and illuminate the triggered object according to the rotation direction parameter to obtain the target direction effect; When the rotation mode is the accompanying mode, after detecting that the triggering object enters the accompanying illumination range of the target lamp, the target lamp is controlled to light up according to the rotation direction parameter to obtain the target direction effect; When the rotation mode is the shaking mode, the reference orientation angle of the rotation direction parameter is determined, and the target lamp is controlled to swing back and forth based on the reference orientation angle according to the preset shaking amplitude and preset shaking frequency to obtain the target direction effect.
13. A virtual lighting adaptive adjustment device, characterized in that, include: The lighting module is used to acquire environmental data of the virtual night scene in real time, and generate lighting effects for each virtual lamp in the virtual night scene based on the environmental data. The event triggering module is used to respond to disturbance events triggered in the virtual night scene and collect disturbance scene data corresponding to the disturbance events; The effect adjustment module is used to perform parameter mapping on the disturbed scene data, generate a lighting adjustment strategy, and adjust the lighting effect of the corresponding virtual lamps according to the lighting adjustment strategy.
14. A storage medium, characterized in that: The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the virtual lighting adaptive adjustment method as described in any one of claims 1 to 12.
15. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions that, when executed by the one or more processors, perform the steps of the virtual lighting adaptive adjustment method as described in any one of claims 1 to 12.