Building construction method, device, storage medium and electronic equipment in game
By automatically determining the construction space and location relationships of buildings in the game, connectivity between buildings is achieved, solving the problems of complex construction process and difficult connectivity, and enriching the game experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2022-11-14
- Publication Date
- 2026-06-02
AI Technical Summary
The process of building structures in the game is complex, and once completed, they cannot be connected to surrounding buildings, resulting in a monotonous gameplay.
By responding to construction commands, the system determines the construction space and positional relationship of buildings in the game scene, automatically converting the first building into a connected state to connect with the second building, thus simplifying the construction process.
It enables automatic connectivity between buildings, enriching the gaming experience and simplifying the construction process.
Smart Images

Figure CN115888105B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more particularly to the field of game technology, specifically to a method, apparatus, storage medium, and electronic device for building construction in a game. Background Technology
[0002] Currently, the game's building mechanics require players to select building components (such as floors and walls) to construct structures, making the process complex. Furthermore, once completed, buildings cannot connect with surrounding structures, resulting in a limited gameplay experience. Summary of the Invention
[0003] This application provides a method, apparatus, storage medium, and electronic device for building in a game, which can realize automatic communication between buildings, enrich the game experience, and simplify the construction process.
[0004] This application embodiment provides a method for constructing a building in a game, wherein a first building is constructed in the game scene, and the method includes:
[0005] In response to a construction command for a second building, determine the construction space for the second building within the game scene;
[0006] Determine the positional relationship between the construction space and the first building;
[0007] When it is determined that the first building and the second building can be connected based on the positional relationship, the first building is changed from its current state to a connected state, and the second building in the connected state is acquired and constructed in the construction space so that the first building and the second building are connected.
[0008] This application embodiment also provides a building construction device for a game, wherein a first building is constructed in the game scene, and the device includes:
[0009] The first determining module is used to respond to a construction instruction for the second building and determine the construction space of the second building in the game scene;
[0010] The second determining module is used to determine the positional relationship between the construction space and the first building;
[0011] The construction module is used to, when it is determined from the positional relationship that the first building and the second building can be connected, change the first building from its current state to a connected state, acquire the second building in the connected state, and construct it in the construction space, so that the first building and the second building are connected.
[0012] This application also provides a computer-readable storage medium storing a computer program adapted for loading by a processor to perform steps in the building construction method in a game as described in any of the above embodiments.
[0013] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the steps in the building construction method in the game as described in any of the above embodiments by calling the computer program stored in the memory.
[0014] The game building construction method, apparatus, storage medium, and electronic device provided in this application respond to a construction command for a second building, determine the construction space of the second building in the game scene; determine the positional relationship between the construction space and the first building; when it is determined that the first building and the second building can be connected according to the positional relationship, the first building is changed from its current state to a connected state, the connected second building is obtained, and it is constructed at the construction space, so that the first building and the second building are connected. This application embodiment, when detecting that the second building to be constructed can be connected to the already constructed first building, directly constructs the second building that can be connected to the first building in the game scene, and changes the first building from its current state to a state that can be connected to the second building, thus enriching the game experience and simplifying the construction process by eliminating the need for players to use building components to construct buildings. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0016] Figure 1 This is a schematic diagram of a game building construction device provided in an embodiment of this application.
[0017] Figure 2 This is a flowchart illustrating a method for building structures in a game, as provided in an embodiment of this application.
[0018] Figure 3 This is a schematic diagram of an interface for a building construction method in a game, provided in an embodiment of this application.
[0019] Figure 4aThis is a schematic diagram of a non-connected wall in a building construction method in a game provided in this application embodiment.
[0020] Figure 4b This is a schematic diagram of a wall in a connected state in a building construction method in a game provided in an embodiment of this application.
[0021] Figure 5a This is a schematic diagram of a roof that is not connected in the game building construction method provided in the embodiments of this application.
[0022] Figure 5b This is a schematic diagram of a rooftop in a connected state in a building construction method in a game provided in an embodiment of this application.
[0023] Figure 5c This is a schematic diagram of a roof in a fitted state in a building construction method in a game provided in this application embodiment.
[0024] Figure 6a This is a schematic diagram of a non-connected floor in a building construction method in a game provided in an embodiment of this application.
[0025] Figure 6b This is a schematic diagram of a connected floor in a building construction method in a game provided in an embodiment of this application.
[0026] Figure 7 This is a schematic diagram of a first scene illustrating a building construction method in a game, as provided in an embodiment of this application.
[0027] Figure 8 This is a schematic diagram of a second scene illustrating the building construction method in a game provided in an embodiment of this application.
[0028] Figure 9 This is a schematic diagram of a third scene illustrating the building construction method in a game provided in this application embodiment.
[0029] Figure 10 This is a schematic diagram of the fourth scene of the building construction method in the game provided in the embodiments of this application.
[0030] Figure 11 This is a schematic diagram of the fifth scene of the building construction method in the game provided in the embodiments of this application.
[0031] Figure 12 This is another schematic diagram of the building construction method in the game provided in the embodiments of this application.
[0032] Figure 13 A schematic diagram of a building construction device in a game provided in this application embodiment.
[0033] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0034] 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.
[0035] This application provides a method, apparatus, storage medium, and electronic device for building structures in a game. Specifically, the method for building structures in a game according to this application can be executed by an electronic device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, touchscreen, game console, personal computer (PC), personal digital assistant (PDA), or other terminal device. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides 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.
[0036] For example, when the building construction method in the game is running on a terminal, the terminal device stores the game application and is used to display the virtual scene in the game screen. The terminal device is used to interact with the user through a graphical user interface, such as downloading, installing, and running the game application. The terminal device can provide the graphical user interface to the user in various ways, such as rendering it on the terminal device's display screen or presenting the graphical user interface through holographic projection. For example, the terminal device can include a touch screen and a processor. The touch screen is used to present the graphical user interface and receive operation commands generated by the user interacting with the graphical user interface, which includes game screens. The processor is used to run the game, generate the graphical user interface, respond to operation commands, and control the display of the graphical user interface on the touch screen.
[0037] For example, when the building construction method in a game runs on a server, it can be considered cloud gaming. Cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game application and the game screen presentation are separate. The storage and execution of skill control methods are completed on the cloud gaming server. The game screen presentation is completed on the cloud gaming client. The cloud gaming client is mainly used for receiving and sending game data and presenting the game screen. For example, the cloud gaming client can be a display device with data transmission capabilities close to the user, such as a mobile terminal, television, computer, PDA, personal digital assistant, etc. However, the terminal device for processing game data is the cloud gaming server in the cloud. When playing the game, the user operates the cloud gaming client to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the cloud gaming client through the network, and finally, the cloud gaming client decodes and outputs the game screen.
[0038] Please see Figure 1 , Figure 1 This is a schematic diagram of a building construction device in a game provided in an embodiment of this application. The system may include multiple terminals 1000, at least one server 2000, at least one database 3000, and a network 4000. A user-held terminal 1000 can connect to servers of different games via the network 4000. The terminal 1000 is any device with computing hardware capable of supporting and executing software products corresponding to the game. Additionally, the terminal 1000 has one or more multi-touch screens for sensing and obtaining input from touch or swipe operations performed by the user at multiple points on one or more touch displays. Furthermore, when the system includes multiple terminals 1000, multiple servers 2000, and multiple networks 4000, different terminals 1000 can be interconnected through different networks 4000 and different servers 2000. The network 4000 can be a wireless network or a wired network, such as a wireless local area network (WLAN), local area network (LAN), cellular network, 2G network, 3G network, 4G network, 5G network, etc. Furthermore, different terminals 1000 can connect to other terminals or servers using their own Bluetooth networks or hotspot networks. Additionally, the system can include multiple databases 3000, which are coupled to different servers 2000. Information related to the game environment can be continuously stored in the databases 3000 as different users engage in multiplayer online gaming.
[0039] The following detailed description is based on specific embodiments.
[0040] Please see Figure 2This is a flowchart illustrating a method for constructing buildings in a game according to an embodiment of this application. The method for constructing buildings in a game provided in this embodiment is applied to an electronic device, and the specific flow of the method is as follows:
[0041] Step 101: In response to the construction command for the second building, determine the construction space for the second building in the game scene.
[0042] In this embodiment, the electronic device provides a graphical user interface (GUI), which includes a game scene. The game scene is a virtual environment provided when the game runs on the electronic device. This virtual environment can be a simulation of the real world, a semi-simulated / semi-fictional three-dimensional environment, or a purely fictional three-dimensional environment. The game scene contains virtual characters, which are objects capable of moving within the game scene, such as virtual figures.
[0043] The game features a building mode. When the game switches to building mode, players can construct various buildings in the game scene, such as homes and shops. The first building is a pre-built structure in the game scene, while the second building is the structure the player is currently constructing. Both the first and second buildings can be complete rooms, including roofs, walls, and floors.
[0044] When the game is in build mode, players can construct a second building within the game scene. During construction, the type of the second building is first determined. Different building types result in different sizes and / or shapes for the second building. The type of the second building can be determined based on the player's selection. For example... Figure 3 As shown, the graphical user interface 10 displays a model area 11, which shows multiple building models, such as building model A, building model B, and building model C. These building models differ in size and / or shape. Players can select the desired building model from model area 11 to determine the building type of the second building, thereby determining its size and shape. The building type of the second building can be the same as or different from that of the first building; that is, the building model corresponding to the second building can be the same as or different from that corresponding to the first building.
[0045] Then, in response to the construction command for the second building, the construction space of the second building in the game scene can be determined. Specifically, determining the construction space of the second building in the game scene in step 101 includes: determining the construction position of the second building in the game scene; obtaining the space size of the second building; and determining the construction space of the second building in the game scene based on the space size and the construction position.
[0046] The construction space for the second building refers to the spatial location within the game scene where the second building can be constructed. This construction space corresponds to the size and shape of the second building. For example, if the second building is a cube, its construction space is a cube; if it's a cylinder, its construction space is a cylinder. The construction position of the second building refers to the planar position of its base, i.e., the bottom position of its construction space. This position can be determined based on the center of the current display screen, specifically the center of the screen when the construction command is triggered. Before triggering the construction command, the player can adjust the display view to adjust the current display screen and thus the construction position of the second building. It's important to note that the construction position is located in an area of the game scene where buildings can currently be constructed, such as the ground area where no buildings or other virtual objects have been constructed, or the top area of an existing building. In other words, the second building can be constructed to the side of or above the first building.
[0047] Construction commands can be triggered by the player. For example... Figure 3 As shown, the graphical user interface 10 has a building control 12. Players can trigger a building command by clicking the building control 12. Responding to the building command for the second building, the system determines the center position of the currently displayed screen as the building location for the second building and obtains the size of the second building based on its building type. Based on the building location and size of the second building, the building space 20 of the second building in the game scene can be determined. It should be noted that in actual applications, the building space 20 is not displayed in the graphical user interface 10. In this embodiment, for ease of subsequent explanation, the building space 20 is illustrated in the graphical user interface 10.
[0048] Step 102: Determine the positional relationship between the construction space and the first building.
[0049] In this embodiment, the positional relationship can include the relative position and distance between the first building and the construction space. The construction space can be located to the side (including the left, right, front, or rear) of the first building, or it can be located above the first building. Since the first building has already been built in the game scene, the construction space cannot be located below the first building. Figure 3 As shown, the construction space 20 is located to the side of the first building 1.
[0050] The positional relationship between the first building and the construction space can be determined by the coordinates of the first building and the construction space. The coordinates of the first building can include its leftmost, rightmost, foremost, rearmost, topmost, and bottommost coordinates. Similarly, the coordinates of the construction space can include its leftmost, rightmost, foremost, rearmost, topmost, and bottommost coordinates.
[0051] For example Figure 3 As shown, when the first building 1 is a hexahedron, its coordinates include the center coordinates of its upper surface (A1), lower surface (A2), right surface (A3), left surface (A4), front surface (A5), and rear surface (A6). When the construction space 20 is a hexahedron, its coordinates include the center coordinates of its upper surface (B1), lower surface (B2), right surface (B3), left surface (B4), front surface (B5), and rear surface (B6).
[0052] If the center coordinate A1 of the upper surface of the first building 1 overlaps with the center coordinate B2 of the lower surface of the construction space 20, it indicates that the construction space 20 is located above the first building 1, and the distance between the construction space 20 and the first building 1 is 0; if the center coordinate A3 of the right surface of the first building 1 overlaps with the center coordinate B4 of the left surface of the construction space 20, it indicates that the construction space 20 is located to the right of the first building 1, and the distance between the construction space 20 and the first building 1 is 0; if the center coordinate A4 of the left surface of the first building 1 overlaps with the center coordinate B3 of the right surface of the construction space 20, it indicates that... The construction space 20 is located to the left of the first building 1, and the distance between the construction space 20 and the first building 1 is 0. If the center coordinate A5 of the front surface of the first building 1 overlaps with the center coordinate B6 of the rear surface of the construction space 20, it indicates that the construction space 20 is located in front of the first building 1, and the distance between the construction space 20 and the first building 1 is 0. If the center coordinate A6 of the rear surface of the first building 1 overlaps with the center coordinate B5 of the front surface of the construction space 20, it indicates that the construction space 20 is located behind the first building 1, and the distance between the construction space 20 and the first building 1 is 0. If the vertical axis values of the center coordinates A3 on the right surface of the first building 1 and B4 on the left surface of the construction space 20 are the same, and the difference in their horizontal axis values is X1, it indicates that the construction space 20 is located to the right of the first building 1, and the distance between the construction space 20 and the first building 1 is X1; if the vertical axis values of the center coordinates A4 on the left surface of the first building 1 and B3 on the right surface of the construction space 20 are the same, and the difference in their horizontal axis values is X2, it indicates that the construction space 20 is located to the left of the first building 1, and the distance between the construction space 20 and the first building 1 is X2. If the vertical axis values of the center coordinates A5 of the front surface of the first building 1 and B6 of the center coordinates B6 of the rear surface of the construction space 20 are the same, and the difference in the horizontal axis values is X3, it indicates that the construction space 20 is located in front of the first building 1, and the distance between the construction space 20 and the first building 1 is X3; if the vertical axis values of the center coordinates A6 of the rear surface of the first building 1 and B5 of the center coordinates B5 of the front surface of the construction space 20 are the same, and the difference in the horizontal axis values is X4, it indicates that the construction space 20 is located behind the first building 1, and the distance between the construction space 20 and the first building 1 is X4. Figure 3 The construction space 20 is located to the right of the first building 1, and the distance between the construction space 20 and the first building 1 is X1.
[0053] After determining the positional relationship between the construction space and the first building, it can be determined whether the first and second buildings can be connected. Connectivity conditions can be pre-set to determine whether the first and second buildings can be connected by checking if the construction space and the first building meet these conditions. If the construction space and the first building meet the connectivity conditions, it is determined that the first and second buildings can be connected; if they do not meet the connectivity conditions, it is determined that the first and second buildings cannot be connected.
[0054] The connection conditions can differ depending on the positional relationship between the construction space and the first building. In one embodiment, the method further includes: when the construction space is determined to be located to the side of the first building based on the positional relationship, detecting whether the distance between the construction space and the first building is less than a preset distance; if so, determining that the first building and the second building can be connected; otherwise, determining that the first building and the second building cannot be connected.
[0055] When the construction space is located to the side of the first building, the connectivity condition may include the distance between the construction space and the first building being less than a preset distance. If the distance between the construction space and the first building is detected to be less than the preset distance, it indicates that the construction space and the first building meet the connectivity condition, and the first building and the second building can be connected; if the distance between the construction space and the first building is detected to be greater than the preset distance, it indicates that the construction space and the first building do not meet the connectivity condition, and the first building and the second building cannot be connected.
[0056] In another embodiment, the method further includes: when it is determined that the construction space is located above the first building based on the positional relationship, detecting whether the distance between the construction space and the first building is 0, and whether the first building has a specified component; if so, determining that the first building and the second building can communicate, otherwise determining that the first building and the second building cannot communicate.
[0057] When the construction space is located above the first building, connectivity conditions can include a distance of 0 between the construction space and the first building, and the first building containing a specified component. If a distance of 0 between the construction space and the first building is detected, and the first building contains the specified component, it indicates that the construction space and the first building meet the connectivity conditions, and the first building can be connected to the second building. If a distance greater than 0 between the construction space and the first building is detected, or the first building does not contain the specified component, it indicates that the construction space and the first building do not meet the connectivity conditions, and the first building cannot be connected to the second building. The specified component can be a ladder or other component that allows a virtual character to access the next floor from the current floor.
[0058] Step 103: When it is determined that the first building and the second building can be connected according to the positional relationship, the first building is changed from the current state to the connected state, the second building in the connected state is obtained and constructed in the construction space, so that the first building and the second building are connected.
[0059] In this embodiment, the buildings (including the first building and the second building) can be in a connected or disconnected state. A connected state refers to a state where the building can be connected to other buildings, such as having openings connecting to other buildings. A disconnected state refers to a state where the building cannot be connected to other buildings, such as not having openings connecting to other buildings. The different locations where the building connects to other buildings allow for various connected states. In this embodiment, the connected state of the first building refers to its ability to connect to the second building, and the connected state of the second building refers to its ability to connect to the first building.
[0060] The current state of the first building refers to its state in the game scene when the construction command is triggered. If the game scene only contains the first building, or if other buildings in the game scene are not connected to the first building, then the first building's current state is a disconnected state. Converting the first building's current state to a connected state means changing the first building from a disconnected state to a state where it can connect to the second building. If other buildings in the game scene are connected to the first building, then the first building's current state is a state where it is connected to other buildings but not to the second building. Converting the first building's current state to a connected state means changing the first building from its current state to a state where it is connected to both other buildings and the second building. For example... Figure 3 As shown, when the construction command is triggered, the current state of the first building 1 is a disconnected state.
[0061] A building can be divided into multiple building components, which can be detachable. Each building component can be either disconnected or connected; that is, each building component can correspond to one connected model and one disconnected model. When a building component is connected, it is generated based on its corresponding connected model, allowing the building to connect with other buildings through this component. When a building component is disconnected, it is generated based on its corresponding disconnected model, preventing the building from connecting with other buildings through this component.
[0062] Specifically, the first building includes multiple first building components, and the second building includes multiple second building components. Step 103, which involves converting the first building from its current state to a connected state, obtaining a connected second building, and constructing it at the construction space to connect the first and second buildings, includes: determining a first target building component from the multiple first building components, and determining a second target building component from the multiple second building components, wherein the current state of the first target building component is a non-connected state; converting the first target building component from a non-connected state to a connected state to convert the first building from its current state to a connected state; obtaining a connected second building and constructing it at the construction space, wherein the connected second building includes the connected second target building component and other non-connected second building components; and connecting the first and second buildings through the first target building component and the second target building component.
[0063] Multiple building components are located in different positions within the building to ensure that the building can connect with other buildings in different positions through these components. For example, a building may include six building components located in six positions (front, back, left, right, top, and bottom), such that these six components are the front wall, back wall, left wall, right wall, roof, and floor. By identifying a target building component from among the multiple building components and changing the connectivity state of the target component, the building can be connected to other buildings through the target component.
[0064] Specifically, multiple building components in the first building are located in multiple locations of the first building, and multiple second building components in the second building are located in multiple locations of the second building. The multiple locations of the second building correspond one-to-one with the multiple locations of the construction space, so that the multiple second building components in the second building correspond one-to-one with the multiple locations of the construction space.
[0065] The step of determining a first target building component from the plurality of first building components and a second target building component from the plurality of second building components includes: taking a first building component located at a first orientation of the first building as the first target building component, where the first orientation is the orientation of the construction space relative to the first building; and taking a second building component corresponding to a second orientation of the construction space as the second target building component, where the second orientation is the orientation of the first building relative to the construction space.
[0066] Since multiple first building components are located in different positions within the first building, the first target building component can be determined from among the multiple first building components based on the position of the construction space relative to the first building. That is, the position of the first target building component within the first building is the same as the position of the construction space relative to the first building; in other words, the first target building component within the first building is closest to the construction space. For example... Figure 3 As shown, the construction space 20 is located on the right side of the first building 1, so the right wall of the first building 1 is taken as the first target building component.
[0067] After identifying the first target building component, it is determined that the first building needs to be connected to the second building through the first target building component. Therefore, the first target building component needs to be changed from a disconnected state to a connected state. The first building does not need to be connected to the second building through other first building components, so the other first building components remain in their current state.
[0068] Since multiple second building components correspond to different orientations within the construction space, a second target building component can be identified from among the multiple second building components based on the orientation of the first building relative to the construction space. That is, the orientation of the second target building component within the second building is the same as the orientation of the first building relative to the construction space. For example... Figure 3 As shown, the first building 1 is located on the left side of the construction space 20, and the left wall of the second building 2 is used as the second target building component.
[0069] After identifying the second target building component, it is indicated that the second building needs to be connected to the first building through the second target building component. Therefore, the second target building component in a connected state is obtained. However, the second building does not need to be connected to the first building through other second building components. Therefore, other second building components in a non-connected state are obtained. The second target building component in a connected state and the other second building components in a non-connected state can constitute the second building in a connected state.
[0070] After acquiring the second building in a connected state, it is constructed in the construction space. The first and second buildings can then be connected via the first and second target building components in a connected state. The first and second target building components determined in this embodiment ensure that the distance connecting the first and second buildings is minimized. Furthermore, this embodiment allows for the direct acquisition and construction of the second building in a connected state within the construction space, eliminating the need for players to use building components to construct buildings, thus simplifying the construction process.
[0071] The spacing between the first and second buildings differs when they are connected, and the connectivity between the first and second target building components differs as well. When the construction space is located to the side of the first building, both the first and second target building components are walls. A non-connected state between the first and second target building components refers to a state where there are no connecting openings within the building components, such as... Figure 4a This is a schematic diagram of a wall in a non-connected state. The connection state of the first and second target building components has two possibilities: when the construction space is separated from the first building (i.e., the distance between the construction space and the first building is greater than 0), the connection state of the first and second target building components refers to the state where the building components have connecting openings, such as... Figure 4b This is a schematic diagram of walls that are in a connected state.
[0072] Since the construction space is separated from the first building, and the second building is built in the construction space, the second building is separated from the first building. Therefore, a connecting passage needs to be set up between the first building and the second building to ensure that the first building and the second building are connected.
[0073] Specifically, the method further includes: when it is determined that the first building and the second building can communicate, if it is detected that the construction space is separated from the first building, then a connection channel is obtained, and the connection channel is connected between the first target building component and the second target building component.
[0074] One end of the connecting channel matches an opening in the first target building component, and the other end matches an opening in the second target building component, ensuring that the connecting channel can connect the first and second target building components. Figure 7 As shown, the first building 1 and the second building 2 are connected by a connecting passage 3.
[0075] When the construction space is located to the side of the first building and there is no gap between the construction space and the first building, the connectivity between the first target building component and the second target building component means that the building component is in a hidden state. After the second building 2 is constructed, the first building 1 and the second building 2 are attached to each other and connected, and the wall between the first building 1 and the second building 2 is hidden. Figure 8 and Figure 9 As shown, Figure 8 This is an external schematic diagram of the connected first building 1 and second building 2. Figure 9 This is a schematic diagram of the interior of the first building 1 and the second building 2 that are connected.
[0076] When the construction space is located above the first building, the first target building component is the roof, and the second target building component is the floor. The non-connected state of the first and second target building components refers to a state where the building components do not have connecting openings, such as... Figure 5a A schematic diagram of a roof that is not connected, such as Figure 6a This is a schematic diagram of a floor in a non-connected state. The connected state of the first and second target building components refers to the state where the building components have connecting openings, such as... Figure 5b A schematic diagram of a roof in a connected state, such as Figure 6b This is a schematic diagram of a connected floor system. It should be noted that, to ensure the floor of the second building is completely flush with and connected to the roof of the first building, the connected roof can be identical to the connected floor; that is, the connected roof and the connected floor correspond to the same model. After the second building is constructed, the first building is flush with the second building, and the connecting opening in the roof of the first building corresponds to the connecting opening in the floor of the second building, thus achieving connectivity between the first and second buildings. Figure 10 This is a schematic diagram of the interior of the roof of the first building 1, which is in a connected state.
[0077] When the construction space is located above the first building, the method further includes: when it is determined that the first building and the second building cannot be connected, if it is detected that there is no gap between the construction space and the first building, the first target building component is changed from a non-connected state to a connected state.
[0078] When the building component is a roof, it can also be in a fitted state, meaning the roof can correspond to a fitted model. To ensure that the floor of the second building completely fits the roof of the first building, the fitted roof can be identical to the non-connected floor; that is, the fitted roof can correspond to the same model as the non-connected floor, such as... Figure 5c This is a schematic diagram of a roof in a fitted state.
[0079] When the distance between the construction space and the first building is 0, but the first building does not have the specified component, it is determined that the first building and the second building cannot be connected. However, after the second building is built in the construction space, the second building and the first building are attached together. The roof of the first building is changed from a non-connected state to an attached state to ensure that the roof of the first building and the floor of the second building are completely attached.
[0080] In addition, the method further includes: when it is determined that the first building and the second building cannot be connected, acquiring the second building which is in a non-connected state and constructing it in the construction space.
[0081] All components of the second building in the non-connected state are in a non-connected state. The second building in the non-connected state is built independently in the construction space of the game scene, that is, the second building is not connected to the first building.
[0082] After constructing the second building, other buildings can be constructed within the game scene. These other buildings can be connected to the first and / or second building. For example... Figure 11 As shown, there are seven buildings in the game scene: building 4a, building 4b, building 4c, building 4d, building 4e, building 4f, and building 4g. Among them, buildings 4a, 4b, 4c, and 4d are connected in sequence, and buildings 4e, 4f, and 4g are connected in sequence.
[0083] After constructing multiple interconnected buildings in the game scene, the virtual character can move directly between these interconnected buildings. The method further includes: when the virtual character enters a target building in the game scene, turning on the lights of the target building and surrounding buildings, wherein the surrounding buildings are connected to the target building, and the number of buildings separating the surrounding buildings from the target building does not exceed a preset number.
[0084] The target building is any one of a series of connected buildings. After the virtual character enters the target building, only the lights of the target building and its surrounding buildings are turned on, while the lights of other buildings in the game scene are turned off to achieve a good visual effect while maintaining low performance overhead. The number of buildings separating the target building from its surrounding buildings can be preset, for example, one or two. Figure 11 As shown, the preset number is one. After the virtual character enters building 4b, the lights of buildings 4b, 4a and 4c are turned on, and the lights of other buildings (i.e. buildings 4d, 4e, 4f and 4g) are turned off.
[0085] In addition, the method further includes: when the virtual character is detected to enter the target building in the game scene, enabling the post-processing effect of the display screen; and when the virtual character is detected to leave the target building, disabling the post-processing effect of the display screen.
[0086] Post-processing effects refer to adjusting the colors and other elements of the displayed image to create different visual effects. For example, in an underwater game scene where buildings are constructed underwater, the image needs to display water ripple effects when the virtual character is outside the buildings. After the virtual character enters the target building, the post-processing effects for that building are activated to remove the water ripple effects; after the virtual character leaves the target building, the post-processing effects are deactivated to display the water ripple effects.
[0087] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0088] The game building method provided in this application embodiment responds to a building command for a second building, determines the building space for the second building in the game scene, determines the positional relationship between the building space and the first building, and when it is determined that the first building and the second building can be connected based on the positional relationship, the first building is changed from its current state to a connected state, the connected second building is obtained and built at the building space, so that the first building and the second building are connected. This application embodiment, when detecting that the second building to be built can be connected to the already built first building, directly builds the second building that can be connected to the first building in the game scene, and changes the first building from its current state to a state that can be connected to the second building, thus enriching the game experience and simplifying the construction process by eliminating the need for players to use building components to construct buildings.
[0089] This application also provides a method for constructing buildings in a game, which can be executed by an electronic device. For example... Figure 12 As shown, the specific process of this method can be as follows:
[0090] Step 201: Respond to the construction command for the second building, determine the construction space of the second building in the game scene, and the first building is already built in the game scene.
[0091] Step 202: Determine the positional relationship between the construction space and the first building. If the positional relationship is that the construction space is located to the side of the first building, then proceed to step 203. If the positional relationship is that the construction space is located above the first building, then proceed to step 204.
[0092] Step 203: Check whether the distance between the construction space and the first building is less than the preset distance. If yes, proceed to step 205; otherwise, proceed to step 208.
[0093] Step 204: Check whether the distance between the construction space and the first building is 0, and whether the first building contains the specified component. If yes, proceed to step 205; otherwise, proceed to step 208.
[0094] Step 205: Determine the first target building component from among the multiple first building components of the first building, and change the first target building component from a non-connected state to a connected state, so as to change the first building from its current state to a connected state.
[0095] Step 206: Determine the second target building component from among the multiple second building components of the second building to obtain a second building in a connected state and construct it in the construction space. The second building in a connected state includes the second target building component in a connected state and other second building components in a non-connected state.
[0096] Step 207: Connect the first building and the second building through the first target building component and the second target building component.
[0097] Step 208: Obtain the second building, which is in a non-connected state, and construct it in the construction space.
[0098] The embodiments of this application enable the construction of interconnected first and second buildings in a game scene, enriching the gaming experience and simplifying the construction process by eliminating the need for players to use building components to construct buildings.
[0099] To facilitate better implementation of the game building construction method of this application embodiment, this application embodiment also provides a game building construction apparatus. Please refer to... Figure 13 , Figure 13 This is a schematic diagram of a building construction device in a game, provided in an embodiment of this application. The building construction device 300 is applied to an electronic device, and a first building is constructed in the game scene. The device includes:
[0100] The first determining module 301 is used to respond to a construction command for the second building and determine the construction space of the second building in the game scene;
[0101] The second determining module 302 is used to determine the positional relationship between the construction space and the first building;
[0102] The construction module 303 is used to convert the first building from its current state to a connected state when it is determined from the positional relationship that the first building and the second building can be connected, and to acquire the second building in the connected state and construct it in the construction space so that the first building and the second building are connected.
[0103] Optionally, the first determining module 301 is further configured to:
[0104] Determine the construction location of the second building within the game scene;
[0105] Obtain the spatial dimensions of the second building;
[0106] Based on the space size and the construction location, the construction space of the second building in the game scene is determined.
[0107] Optionally, the device further includes a first detection module, which is used for:
[0108] When it is determined that the construction space is located to the side of the first building based on the positional relationship, it is detected whether the distance between the construction space and the first building is less than a preset distance;
[0109] If so, then it is determined that the first building and the second building can be connected; otherwise, it is determined that the first building and the second building cannot be connected.
[0110] Optionally, the device further includes a second detection module, which is further used for:
[0111] When it is determined that the construction space is located above the first building based on the positional relationship, it is detected whether the distance between the construction space and the first building is 0, and whether the first building contains a specified component;
[0112] If so, then it is determined that the first building and the second building can be connected; otherwise, it is determined that the first building and the second building cannot be connected.
[0113] Optionally, the first building includes a plurality of first building components, the second building includes a plurality of second building components, and the construction module 303 is further configured to:
[0114] A first target building component is determined from the plurality of first building components, and a second target building component is determined from the plurality of second building components, wherein the current state of the first target building component is a non-connected state;
[0115] The first target building component is changed from a non-connected state to a connected state, so as to change the first building from its current state to a connected state;
[0116] A second building in a connected state is acquired and constructed at the construction space, the second building in a connected state comprising a second target building component in a connected state, and other second building components in a non-connected state;
[0117] The first building and the second building are connected by the first target building component and the second target building component.
[0118] Optionally, the plurality of first building components are located one-to-one with multiple locations of the first building, and the plurality of second building components correspond one-to-one with multiple locations of the construction space. The construction module 303 is further configured to:
[0119] The first building component located at a first position of the first building is taken as the first target building component, where the first position is the position of the construction space relative to the first building;
[0120] The second building component corresponding to the second orientation of the construction space is designated as the second target building component, where the second orientation is the orientation of the first building relative to the construction space.
[0121] Optionally, the connectivity state of the building component refers to the building component being in a hidden state or the building component having a connectivity opening.
[0122] Optionally, the device further includes a first acquisition module, the first acquisition module being used for:
[0123] When it is determined that the first building and the second building can be connected, if it is detected that the construction space is separated from the first building, a connection channel is obtained and the connection channel is connected between the first target building component and the second target building component.
[0124] Optionally, the device further includes a conversion module, which is used for:
[0125] If it is determined that the first building and the second building cannot be connected, and if it is detected that the construction space is not separated from the first building, then the first target building component is changed from a non-connected state to a connected state.
[0126] Optionally, the device further includes a second acquisition module, the second acquisition module being used for:
[0127] When it is determined that the first building and the second building cannot be connected, the second building, which is in a non-connected state, is acquired and constructed in the construction space.
[0128] Optionally, the game scene also includes virtual characters, and the device further includes an activation module, which is used for:
[0129] When the virtual character is detected to have entered the target building in the game scene, the lights of the target building and surrounding buildings are turned on. The surrounding buildings are connected to the target building, and the number of buildings between the surrounding buildings and the target building does not exceed a preset number.
[0130] Optionally, the game scene also includes virtual characters, and the device further includes a processing module, which is used for:
[0131] When the virtual character is detected entering the target building in the game scene, the post-processing effect of the display screen is turned on; when the virtual character is detected leaving the target building, the post-processing effect of the display screen is turned off.
[0132] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0133] The game building device provided in this application embodiment responds to a building command for a second building, determines the building space for the second building in the game scene, determines the positional relationship between the building space and the first building, and when it is determined that the first building and the second building can be connected based on the positional relationship, the first building is changed from its current state to a connected state, the connected second building is obtained and built at the building space, so that the first building and the second building are connected. This application embodiment, when detecting that the second building to be built can be connected to the already built first building, directly builds the second building that can be connected to the first building in the game scene, and changes the first building from its current state to a state that can be connected to the second building, thus enriching the game experience and simplifying the construction process by eliminating the need for players to use building components to construct buildings.
[0134] Accordingly, embodiments of this application also provide an electronic device, which can be a terminal or a server. The terminal can be a smartphone, tablet computer, laptop computer, touchscreen, game console, personal computer (PC), personal digital assistant (PDA), or other terminal device. Figure 14 As shown, Figure 14This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 400 includes a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, and a computer program stored in the memory 402 and executable on the processor. The processor 401 and the memory 402 are electrically connected. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0135] The processor 401 is the control center of the electronic device 400. It connects various parts of the electronic device 400 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it performs various functions of the electronic device 400 and processes data, thereby monitoring the electronic device 400 as a whole.
[0136] In this embodiment, the processor 401 in the electronic device 400 loads the instructions corresponding to the processes of one or more applications into the memory 402 according to the following steps, and the processor 401 runs the applications stored in the memory 402 to realize various functions:
[0137] In response to a construction command for a second building, determine the construction space for the second building within the game scene;
[0138] Determine the positional relationship between the construction space and the first building;
[0139] When it is determined that the first building and the second building can be connected based on the positional relationship, the first building is changed from its current state to a connected state, and the second building in the connected state is acquired and constructed in the construction space so that the first building and the second building are connected.
[0140] Optionally, determining the construction space of the second building in the game scene includes:
[0141] Determine the construction location of the second building within the game scene;
[0142] Obtain the spatial dimensions of the second building;
[0143] Based on the space size and the construction location, the construction space of the second building in the game scene is determined.
[0144] Optionally, the method further includes:
[0145] When it is determined that the construction space is located to the side of the first building based on the positional relationship, it is detected whether the distance between the construction space and the first building is less than a preset distance;
[0146] If so, then it is determined that the first building and the second building can be connected; otherwise, it is determined that the first building and the second building cannot be connected.
[0147] Optionally, the method further includes:
[0148] When it is determined that the construction space is located above the first building based on the positional relationship, it is detected whether the distance between the construction space and the first building is 0, and whether the first building contains a specified component;
[0149] If so, then it is determined that the first building and the second building can be connected; otherwise, it is determined that the first building and the second building cannot be connected.
[0150] Optionally, the first building includes a plurality of first building components, and the second building includes a plurality of second building components;
[0151] The step of converting the first building from its current state to a connected state, obtaining a second building in the connected state, and constructing it at the construction space to connect the first building and the second building includes:
[0152] A first target building component is determined from the plurality of first building components, and a second target building component is determined from the plurality of second building components, wherein the current state of the first target building component is a non-connected state;
[0153] The first target building component is changed from a non-connected state to a connected state, so as to change the first building from its current state to a connected state;
[0154] A second building in a connected state is acquired and constructed at the construction space, the second building in a connected state comprising a second target building component in a connected state, and other second building components in a non-connected state;
[0155] The first building and the second building are connected by the first target building component and the second target building component.
[0156] Optionally, the plurality of first building components are located in multiple locations of the first building, and the plurality of second building components correspond one-to-one with multiple locations of the construction space;
[0157] The step of determining a first target building component from the plurality of first building components and determining a second target building component from the plurality of second building components includes:
[0158] The first building component located at a first position of the first building is taken as the first target building component, where the first position is the position of the construction space relative to the first building;
[0159] The second building component corresponding to the second orientation of the construction space is designated as the second target building component, where the second orientation is the orientation of the first building relative to the construction space.
[0160] Optionally, the connectivity state of the building component refers to the building component being in a hidden state or the building component having a connectivity opening.
[0161] Optionally, the method further includes:
[0162] When it is determined that the first building and the second building can be connected, if it is detected that the construction space is separated from the first building, a connection channel is obtained and the connection channel is connected between the first target building component and the second target building component.
[0163] Optionally, the method further includes:
[0164] If it is determined that the first building and the second building cannot be connected, and if it is detected that the construction space is not separated from the first building, then the first target building component is changed from a non-connected state to a connected state.
[0165] Optionally, the method further includes:
[0166] When it is determined that the first building and the second building cannot be connected, the second building, which is in a non-connected state, is acquired and constructed in the construction space.
[0167] Optionally, the game scene also includes virtual characters, and the method further includes:
[0168] When the virtual character is detected to have entered the target building in the game scene, the lights of the target building and surrounding buildings are turned on. The surrounding buildings are connected to the target building, and the number of buildings between the surrounding buildings and the target building does not exceed a preset number.
[0169] Optionally, the game scene also includes virtual characters, and the method further includes:
[0170] When the virtual character is detected entering the target building in the game scene, the post-processing effect of the display screen is turned on; when the virtual character is detected leaving the target building, the post-processing effect of the display screen is turned off.
[0171] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0172] Optionally, such as Figure 14 As shown, the electronic device 400 also includes: a touch display screen 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. The processor 401 is electrically connected to the touch display screen 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407. Those skilled in the art will understand that... Figure 14 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0173] The touch display screen 403 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 403 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 401. It can also receive and execute commands from the processor 401. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 401 to determine the type of touch event. Subsequently, the processor 401 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 403 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 403 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 403 can also be used as part of the input unit 406 to achieve input functions.
[0174] In this embodiment, a road network generation software is executed by processor 401 to generate a graphical user interface on touch display screen 403. The touch display screen 403 is used to present the graphical user interface and receive operation commands generated by the user interacting with it.
[0175] The radio frequency circuit 404 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices, and to transmit and receive signals with network devices or other electronic devices.
[0176] Audio circuit 405 can be used to provide an audio interface between a user and an electronic device via a speaker and a microphone. Audio circuit 405 can convert received audio data into electrical signals and transmit them to the speaker, where the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuit 405, converted back into audio data, and then processed by processor 401 before being transmitted via radio frequency circuit 404 to, for example, another electronic device, or output to memory 402 for further processing. Audio circuit 405 may also include an earphone jack to provide communication between peripheral headphones and electronic devices.
[0177] The input unit 406 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0178] Power supply 407 is used to supply power to various components of electronic device 400. Optionally, power supply 407 can be logically connected to processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 407 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0179] although Figure 14 As not shown in the diagram, the electronic device 400 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.
[0180] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0181] As can be seen from the above, the electronic device provided in this embodiment responds to a construction command for a second building, determines the construction space of the second building in the game scene, determines the positional relationship between the construction space and the first building, and when it is determined that the first building and the second building can be connected according to the positional relationship, the first building is changed from its current state to a connected state, the connected second building is obtained and constructed at the construction space, so that the first building and the second building are connected. This embodiment, when detecting that the second building to be constructed can be connected to the already constructed first building, directly constructs the second building that can be connected to the first building in the game scene, and changes the first building from its current state to a state that can be connected to the second building, thus connecting the first building and the second building, enriching the game experience, and eliminating the need for players to use building components to construct buildings, simplifying the construction process.
[0182] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0183] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute steps in any of the building construction methods in a game provided by embodiments of this application. For example, the computer program can execute the following steps:
[0184] In response to a construction command for a second building, determine the construction space for the second building within the game scene;
[0185] Determine the positional relationship between the construction space and the first building;
[0186] When it is determined that the first building and the second building can be connected based on the positional relationship, the first building is changed from its current state to a connected state, and the second building in the connected state is acquired and constructed in the construction space so that the first building and the second building are connected.
[0187] Optionally, determining the construction space of the second building in the game scene includes:
[0188] Determine the construction location of the second building within the game scene;
[0189] Obtain the spatial dimensions of the second building;
[0190] Based on the space size and the construction location, the construction space of the second building in the game scene is determined.
[0191] Optionally, the method further includes:
[0192] When it is determined that the construction space is located to the side of the first building based on the positional relationship, it is detected whether the distance between the construction space and the first building is less than a preset distance;
[0193] If so, then it is determined that the first building and the second building can be connected; otherwise, it is determined that the first building and the second building cannot be connected.
[0194] Optionally, the method further includes:
[0195] When it is determined that the construction space is located above the first building based on the positional relationship, it is detected whether the distance between the construction space and the first building is 0, and whether the first building contains a specified component;
[0196] If so, then it is determined that the first building and the second building can be connected; otherwise, it is determined that the first building and the second building cannot be connected.
[0197] Optionally, the first building includes a plurality of first building components, and the second building includes a plurality of second building components;
[0198] The step of converting the first building from its current state to a connected state, obtaining a second building in the connected state, and constructing it at the construction space to connect the first building and the second building includes:
[0199] A first target building component is determined from the plurality of first building components, and a second target building component is determined from the plurality of second building components, wherein the current state of the first target building component is a non-connected state;
[0200] The first target building component is changed from a non-connected state to a connected state, so as to change the first building from its current state to a connected state;
[0201] A second building in a connected state is acquired and constructed at the construction space, the second building in a connected state comprising a second target building component in a connected state, and other second building components in a non-connected state;
[0202] The first building and the second building are connected by the first target building component and the second target building component.
[0203] Optionally, the plurality of first building components are located in multiple locations of the first building, and the plurality of second building components correspond one-to-one with multiple locations of the construction space;
[0204] The step of determining a first target building component from the plurality of first building components and determining a second target building component from the plurality of second building components includes:
[0205] The first building component located at a first position of the first building is taken as the first target building component, where the first position is the position of the construction space relative to the first building;
[0206] The second building component corresponding to the second orientation of the construction space is designated as the second target building component, where the second orientation is the orientation of the first building relative to the construction space.
[0207] Optionally, the connectivity state of the building component refers to the building component being in a hidden state or the building component having a connectivity opening.
[0208] Optionally, the method further includes:
[0209] When it is determined that the first building and the second building can be connected, if it is detected that the construction space is separated from the first building, a connection channel is obtained and the connection channel is connected between the first target building component and the second target building component.
[0210] Optionally, the method further includes:
[0211] If it is determined that the first building and the second building cannot be connected, and if it is detected that the construction space is not separated from the first building, then the first target building component is changed from a non-connected state to a connected state.
[0212] Optionally, the method further includes:
[0213] When it is determined that the first building and the second building cannot be connected, the second building, which is in a non-connected state, is acquired and constructed in the construction space.
[0214] Optionally, the game scene also includes virtual characters, and the method further includes:
[0215] When the virtual character is detected to have entered the target building in the game scene, the lights of the target building and surrounding buildings are turned on. The surrounding buildings are connected to the target building, and the number of buildings between the surrounding buildings and the target building does not exceed a preset number.
[0216] Optionally, the game scene also includes virtual characters, and the method further includes:
[0217] When the virtual character is detected entering the target building in the game scene, the post-processing effect of the display screen is turned on; when the virtual character is detected leaving the target building, the post-processing effect of the display screen is turned off.
[0218] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0219] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0220] Since the computer program stored in the storage medium can execute the steps in any of the building construction methods in the game provided in the embodiments of this application, the beneficial effects that any of the building construction methods in the game provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0221] The foregoing has provided a detailed description of a method, apparatus, storage medium, and electronic device for building in a game, as provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for constructing buildings in a game, characterized in that, The game scene of the game contains a first building, and the method includes: In response to a construction command for a second building, determine the construction space for the second building within the game scene; Determine the positional relationship between the construction space and the first building; When it is determined that the first building and the second building can be connected based on the positional relationship, the first building is changed from its current state to a connected state, the second building in the connected state is obtained and constructed in the construction space, so that the first building and the second building are connected. The first building includes multiple first building components, and the second building includes multiple second building components; The step of converting the first building from its current state to a connected state, obtaining a second building in the connected state, and constructing it at the construction space to connect the first building and the second building includes: A first target building component is determined from the plurality of first building components, and a second target building component is determined from the plurality of second building components, wherein the current state of the first target building component is a non-connected state; The first target building component is changed from a non-connected state to a connected state, so as to change the first building from its current state to a connected state; A second building in a connected state is acquired and constructed at the construction space, the second building in a connected state comprising a second target building component in a connected state, and other second building components in a non-connected state; The first building and the second building are connected by the first target building component and the second target building component.
2. The method for constructing buildings in a game according to claim 1, characterized in that, Determining the construction space of the second building in the game scene includes: Determine the construction location of the second building within the game scene; Obtain the spatial dimensions of the second building; Based on the space size and the construction location, the construction space of the second building in the game scene is determined.
3. The method for constructing buildings in a game according to claim 1, characterized in that, The method further includes: When it is determined that the construction space is located to the side of the first building based on the positional relationship, it is detected whether the distance between the construction space and the first building is less than a preset distance; If so, then it is determined that the first building and the second building can be connected; otherwise, it is determined that the first building and the second building cannot be connected.
4. The method for constructing buildings in a game according to claim 1, characterized in that, The method further includes: When it is determined that the construction space is located above the first building based on the positional relationship, it is detected whether the distance between the construction space and the first building is 0, and whether the first building has a specified component, wherein the specified component is a component that allows the virtual character to enter the upper floor from the current floor; If the spacing is 0 and the first building has a specified component, then it is determined that the first building and the second building can be connected; otherwise, it is determined that the first building and the second building cannot be connected.
5. The method for constructing buildings in a game according to claim 1, characterized in that, The plurality of first building components are located in a plurality of positions of the first building, and the plurality of second building components are located in a plurality of positions of the construction space. The step of determining a first target building component from the plurality of first building components and determining a second target building component from the plurality of second building components includes: The first building component located at a first position of the first building is taken as the first target building component, where the first position is the position of the construction space relative to the first building; The second building component corresponding to the second orientation of the construction space is designated as the second target building component, where the second orientation is the orientation of the first building relative to the construction space.
6. The method for constructing buildings in a game according to claim 1, characterized in that, The connectivity state of the building component refers to the state in which the building component is hidden or the state in which the building component has a connectivity opening.
7. The method for constructing buildings in a game according to claim 1, characterized in that, The method further includes: When it is determined that the first building and the second building can be connected, if it is detected that the construction space is separated from the first building, a connection channel is obtained and the connection channel is connected between the first target building component and the second target building component.
8. The method for constructing buildings in a game according to claim 1, characterized in that, The method further includes: If it is determined that the first building and the second building cannot be connected, and if it is detected that the construction space is not separated from the first building, then the first target building component is changed from a non-connected state to a connected state.
9. The method for constructing buildings in a game according to claim 1, characterized in that, The method further includes: When it is determined that the first building and the second building cannot be connected, the second building, which is in a non-connected state, is acquired and constructed in the construction space.
10. The method for constructing buildings in a game according to any one of claims 1-9, characterized in that, The game scene also includes virtual characters, and the method further includes: When the virtual character is detected to have entered the target building in the game scene, the lights of the target building and surrounding buildings are turned on. The surrounding buildings are connected to the target building, and the number of buildings between the surrounding buildings and the target building does not exceed a preset number.
11. The method for constructing buildings in a game according to any one of claims 1-9, characterized in that, The game scene also includes virtual characters, and the method further includes: When the virtual character is detected entering the target building in the game scene, the post-processing effect of the display screen is turned on; when the virtual character is detected leaving the target building, the post-processing effect of the display screen is turned off.
12. A building construction device for a game, characterized in that, The game scene of the game includes a first building, and the device includes: The first determining module is used to respond to a construction instruction for the second building and determine the construction space of the second building in the game scene; The second determining module is used to determine the positional relationship between the construction space and the first building; The construction module is used to convert the first building from its current state to a connected state when it is determined from the positional relationship that the first building and the second building can be connected, obtain the second building in the connected state and construct it at the construction space, so that the first building and the second building are connected. The first building includes multiple first building components, the second building includes multiple second building components, and the construction module is further used for: A first target building component is determined from the plurality of first building components, and a second target building component is determined from the plurality of second building components, wherein the current state of the first target building component is a non-connected state; The first target building component is changed from a non-connected state to a connected state, so as to change the first building from its current state to a connected state; A second building in a connected state is acquired and constructed at the construction space, the second building in a connected state comprising a second target building component in a connected state, and other second building components in a non-connected state; The first building and the second building are connected by the first target building component and the second target building component.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the steps of the building construction method in a game as described in any one of claims 1-11.
14. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores a computer program, and the processor executes the steps of the building construction method in the game as described in any one of claims 1-11 by calling the computer program stored in the memory.
Citation Information
Patent Citations
Construction method and device in game
CN111298431A
Three-dimensional model construction method and device, electronic equipment and storage medium
CN114863020A