#author("2026-06-18T03:07:31+09:00","default:admin","admin") #author("2026-06-18T04:03:51+09:00","default:admin","admin") ''[[Beginner Tutorial INDEX:https://rpgbakin.com/pukiwiki_en/?RPG+Developer+Bakin+Beginner+Tutorial]]>>'' *Encounter Battle [#lbed92fa] ''We will make it so that a battle with enemies occurs with a certain probability while walking on the map.'' ***Encounter Battle Settings [#g64cb0eb] ''After selecting Map_2 in the [[Map List Palette]], open the [[Map Settings Palette]] and select the “Enemy Distribution” tab.'' In this tab, you can set the area on the map where, how often, and what kind of enemies to encounter. In the "Enemy Distribution" list, you can specify the areas where enemies may appear. You can set multiple areas, and for each one, you can adjust settings such as the encounter probability. Here, we will configure the default area, which covers the entire map. #ref(./Encounter Battle_1.jpg,40%) #br Scroll down to the bottom of the "Enemy Distribution" tab and click the "Add Monster" button under the "Enemies Generated within Distribution" section. In the Asset Picker that appears, select "Slime Lava" (the red slime) and click OK. #ref(./Encounter Battle_2.jpg,40%) #br Now, move the starting point to Map_2 and try a test play. After walking around for a while, a battle with Slime Lava should occur. Once the battle starts, you can end the test play. #ref(./Encounter Battle_3.jpg,40%) #br ***Battle Backgrounds [#k91dfb1d] ''Some users may have noticed that when a battle starts, parts of the map get in the way and make it difficult to see the enemies or allies clearly.'' To solve this, let’s create a special "battle background map." In the [[Map List Palette]], click the Add button to create Map_3. Click the map name in the map list and rename it to "BattleMap." #ref(./Encounter Battle_4.jpg,40%) #br Without making any changes to BattleMap, go back to the [[Map List Palette]] and select Map_2. Then open the "Enemy Distribution" tab in the [[Map Settings Palette]]. Scroll down to the "Selected Appearance Area Properties" section and click the arrow button next to "Battle Background." From the Asset Picker that appears, select "BattleMap." Once "BattleMap" has been assigned as the battle background, go to the top of the "Enemy Distribution" tab and click the "Battle Test" button. The Battle Test dialog will appear — click the "Test Play" button to begin the battle test. #ref(./Encounter Battle_5.jpg,40%) #br This time, there's nothing blocking the camera, and both the enemies and allies are clearly visible during battle. #ref(./Encounter Battle_3.jpg,40%) #br In Bakin, a special battle camera is used when entering combat. (We'll cover camera settings in another section.) Because of this, it's a good idea to create a separate map that works well as a battle background and doesn't interfere with the camera view. Before assigning a "Battle Background", battles were taking place directly on Map_2, so depending on how the map was built, parts of it could interfere with the camera. ***Battle Layout [#l8f1f538] ''Another important element related to the battle background is the Battle Layout.'' In Map_2, go to the "Enemy Distribution" tab and turn on the "Use Custom Battle Layout" switch. Then click "Battle Layout Settings." The "Placement Editor" dialog will open. In this dialog, you can do the following two things: "1) Set the central position for the placement of enemies and allies when battling on this background map. Red numbers represent enemies, and blue numbers represent allies." 2) Define the relative positions of enemies and allies during battle. This can be set separately depending on the number of enemies. #ref(./Encounter Battle_7.jpg,40%) #br The camera during battle is based on the center point of the enemy and ally placement — in other words, the central point of the battle. Because of this, the part of the battle background map that appears on screen will change depending on this center position. The default battle layout is set in Game Definition > [[Rules and Rendering]]. ***Battle Test [#n51e61ba] ''The Battle Test feature you used earlier is something you’ll likely use many times throughout development.'' Click the "Battle Test" button to open the Battle Test dialog. Click the "Add" button to add a character of your choice from the Asset Picker. Next, set "Number of Monsters" to 1, and then click the "Test Play" button. #ref(./Encounter Battle_8.jpg,40%) #br The battle will begin with two allies and one Slime Lava. Try attacking and defeating the slime. After the battle result screen appears, the battle will automatically restart using the same settings. ***Displaying Enemy Encounter Areas on the Map Editor [#o3de2da8] ''Let’s create a new area in the Enemy Distribution list.'' Click the "Add Area" button to add a new area, then click the arrow button next to the "Range" field. In the Range Selection Dialog that appears, drag on the map to specify the size and position of the area. Try setting which enemies appear in this area. You can customize the enemies that appear in each area, the number of enemies, and the background music during battles. #ref(./Encounter Battle_9.jpg,40%) #br After adding the area, turn on the "Enemy Encounter Areas" button at the bottom right of the Map Editor. The areas where enemies are set to appear will be displayed as colored zones on the Map Editor. You can toggle this button on or off as needed. #ref(./Encounter Battle_10.jpg,40%) #br ---- ''With this, you can now encounter enemies and start battles.'' ''Next, let’s try adjusting the strength of the enemies a little.'' ---- ''&size(16){Next: [[Setting Up Enemies:https://rpgbakin.com/pukiwiki_en/?Setting+Up+Enemies+%28Beginner+Tutorial%29]]};'' ''&size(16){Previous: [[Move between maps(Event templates):https://rpgbakin.com/pukiwiki_en/?Move+between+maps%EF%BC%88Event+templates%29+%28Beginner+Tutorial%29]]};'' ---- ''[[Beginner Tutorial INDEX:https://rpgbakin.com/pukiwiki_en/?RPG+Developer+Bakin+Beginner+Tutorial]]>>''