设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 64|回复: 0

[制作教程] Making a game like "Binding of Isaac"

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    3 天前
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4551

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    23109
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    28554

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    Hello there,

    some of you guys probably only know me for asking a lot of questions in this forum, sometimes stupid questions as well.
    I have received a lot of help and only with that help was I able to build a setup for a rogue-like game kind of similar to Bindings of Isaac, where you can go from randomized room to randomized room, chest spawning by whatever chance you like them to at random locations, that you can chose yourself. The best and hardest part: It remembers the order of rooms you visited, so you can go all the way back and forth in your randomly generated dungeon.

    I am pretty bad at scripting and because of that this method doesnt need scripts at all, but for the room
    randomization it actually needs a tiny script-call TheoAllen showed and there are also other scripts that I would recommend you to use for a game like this.

    First off, I have to heavily recommend two scripts, because they will improve your game by a lot!
    1. I can really recommend an Action Battle System for making a sidescroller/roguelike game.
    But maybe you use these tricks to build random dungeons in your RPG, then it wouldn't be neccessary at all.
    2. I can really recommend using parallax mapping for making the room layout, you can individualize every room pretty easily later with Tiles and you would just need to make one image per dungeon. Floortiles repeat themselves over and over and with parallax you can get more irregular floors and walls.
    But I am not using any here and instead built a low effort room:




    (Picture 1)

    Yeah... sorry for the design, but this will be the room we are going to work with from now on.

    Index:

    1. Character Selection
    2. Random rooms
    3. Remembering the order of visited rooms
    4. Xtra rooms/Boss room
    5. Random Chest dropchance/locations

    Spoiler: 1. Character Selection:
    Of course there are simple ways with the RPG Maker to make a simple Character selection working with a few choices and conditional branches.
    But I want to show you how to make a nice one with pictures instead of the character sprites, which will give the selection a more professional looking touch.

    For the character selection, we first need to make a new map and keep it all blank. Then we put the player's starting position right into the middle:




    (Picture 2)

    Now we are going to "system" in the database and on the right side put a tick into "Transparent ON".
    This will make the sprite of your character transparent and since we let the starting-map all blank, we will just see a blackscreen over which we can install our character selection. If you want a picture as background for your character selection, just install a parallax background on this map.

    First thing to do: Make an Event anywhere in the map, set in on parallel process and flip on a switch. Here I called it "Back to Select". I will explain later why.
    Okay now lets install a new page on this event and give it the condition to only start, if the switch "back to select" is activated.
    This way, it will instantly open, since its switch had just been turned on by Eventpage 1.
    You can already copy all the commands that I put into this page, but we are gonna start from "Choose your character" and I will explain later what everything above does.




    (Picture 3)

    This is your character select window. Here the player can chose with which character he wants to play.
    Important: For the "choices", select "Dissalow cancel".
    Depending on which character the player selected, this Eventpage will again flip a switch, that will bring him to another event, which we are going to setup now.

    Sooo, let's make a new event anywhere on the map and remember to put all of them to "parallel process". In fact, make 4 of them!




    (Picture 4)

    These events are all kinda similar, they just differ on what switch they need to be activated and which character they select, etc.
    Here is the Layout:




    (Picture 5)

    When the character select starts, it turns off the switch "Back to Select" first. We might have to flip it on again, thats why we have to flip it off for now.
    After the player choses his/her character there will now appear a picture on the screen. You will need some pictures yourself and put it into the folder of your game into Graphics/Pictures. Their background should be transparent. With a photoediting software you can also add a little window with stats to your picture. You might have to adjust the X and Y axis in the "show picture" command settings.
    The player can chose yes or no if (s)he wants to select this character and if (s)he doesnt, the flip "back to select" gets switched on and now (s)he can select again.
    If yes is selected, there will be another flip activated for setting up the character and leaving the select.
    Let's call it: "Character 1 Selected". (Character 2 Selected, etc for every character)
    The event will self-switch itself to A, which is a blank page because it will not be needed anymore.

    Now we know why there were these weird commands above "chose your character" in Picture 3, they erase the picture for the chosen character, flip its switch off so it can be reactivated again and then let the player chose again. It is kind of a reset.

    Now put another 4 events somewhere on your map. This is the last time, I swear. They have to look like this:




    (Picture 6)

    If the switch "character 1 selected" is on, the game will first add the new character and then remove the old, since you can't have 0 Actors in your party you have to do it this way. The other events are the same, except for adding a different actor and needing a different switch.
    By turning the transparency off with a command your new player gets visible again and then transfers to your first dungeon-room.

    And its done! I thought... but it didnt work. But no problem, there is an easy fix for that.
    I dont know why "back to select" wasnt turned off after selection, but I simply fixed it by putting 4 new pages on the first event (Oops, now I did it again) and let them look like this:




    (Picture 7)

    just change the conditions-switch for each Character on the left side of the Eventpages.

    And now we're done!
    Just use "center" as origin in the "show picture" command and add a few numbers at x and y. Done!
    Your character select is ready to go! Now you could also add a little stat-window to your picture with a photo-editing software.
    Spoiler: 2. Random Rooms
    Okay in this chapter I will introduce you to the simplest form of teleporting to a random map, it is a rather short chapter.
    I copied the map with the walls (Picture 1) 3 times as examples. These will be our random maps. Now you can design them however you want them.
    Use as many different rooms as you wish for the player to potentially land in. In this project, they are now Map004-006, all a little different-looking.








    (Pictures 8,9 and 10)

    Now I went into "Common Events", because here we have to set a few variables that we are going to use a lot. Under the picture is a list of the variables we need and what they're for.




    (Picture 11)

    1: "Random Map": Generates a random number between 4 and 6, because these are the MapIDs of the rooms we want to TP to.
    2: "X Left": Sets the Variable to 0 because thats the x-value of the left exit/entry in the room.
    3: "X Right": Same, but this time for the right entry/exit. If you have a bigger or smaller room you have to adjust, you can see the x and y axis of each field by clicking on it and then look down at the bottom right corner of your RPG Maker Window.
    4: "Y": Sets the Y axis for both entries/exits (If they are parallel to each other).

    My maps are 20x 18y in size, so you have to set yours depending on your map-size.

    For "trigger", select parallel process. Now you can just name a switch "variables" and turn it on at the start of the game. Either in the character-select room or the room the player spawns to after select. It has to be on "parallel process" and turn itself off with a self-switch.
    Remember to select switch "Variables" as condition switch for your common event.

    Now for teleporting to your rooms at random, just put an event on each exit/entry and put it on "player touch".
    Now use a "transfer player" command and chose "Designation with variables". Put variable "Random Map" for Map ID, "X Left" for the right door and "X Right" for the left door (Since you TP from right to left) and "Y" for y (thx Cptn. obvious)
    Now you just need to copy and paste these events to the entries/exits of all your random rooms.
    This is easy to set up an could be a great tool to make your dungeons a little more interesting.
    But how do you let the game remember, which rooms you already visited, so that you can return to the rooms you have already been in?
    This part is a little more complicated and needs a tiny bit of script. We are going to tackle this in the next chapter.
    Spoiler: 3. Remembering Visited Random Room order
    Now if we want to build a game like "Binding of Isaac", or if you want to make a dungeon with random rooms/enemies/loot and then want the player to be able to return to the rooms he/she has been in before, you have to install something that lets the game remember which rooms you already visited.
    You can do this with a few variables and you will need a script-call as well.

    Thanks and Credits at this part to TheoAllen, who showed me how to do this!

    In our example project, we do have a room that we always start from. This is the room the player teleports to after champion select. This sadly makes everything a little more complicated, since this first map wont be in our pool of random maps and therefore will not be remembered by the script-call. That's why we have to be a little bit tricky, to still be able to return to room 1 if you go left in room 2.

    I edited the first room, so that the player can only go into 1 direction:




    (Picture 12)

    Now let's get started. Place a "parallel process" event into one of your random rooms. It doesnt matter which one, since you will always have to copy and paste every event into all of your other random rooms later.
    On the left side, set it's conditions to: If Switch "First TP" is ON. Now we need to setup a few variables here as well, but this time with a script-call. But first you need to name a few variables, just go into the "Control Variables" command and name 3 Variables with the following names:

    "Room Nr."
    "Pointer"
    "Current Map ID"

    Don't set them to anything, they just need to be named for your orientation. But most importantly you need to remember their ID (e.g: "0005: Room Nr."). Now setup your Eventpage like this:





    (Picture 13)

    [5] = The ID of your "Room Nr." Variable
    [4,5,6] = The Map ID's you want to shuffle
    p Blabla = The p is for print, this is how you can see the map-order in the console

    The console can be a pretty convenient tool for you as the developer to see if everything works as planed. You can activate it by going into "Game" and put a tick to "Show Console".
    Now every time you start your game and enter the second room, you should see the numbers [4,5,6] and under these numbers that again, in a random order in your console.
    The variable "Room Nr." has been assigned with the room IDs of your random maps, and then shuffled. But instead of just throwing you into random rooms over and over again, this time it remembers the new order.
    This event has the switch "First TP" as condition and the command "First TP" = OFF as the last command. This means, it only activates once when you enter the second room for the first time. We have already set the values for the common event "Variables", so we can switch it off here too.
    But there is still one important thing to do. Upon entering the second room for the first time, we want to save it's ID into a variable. For that, we need another Variable called "Second Room" and set it to "Map ID".




    (Picture 14)

    Now we just need to setup the right and left teleport commands, but they are also pretty stacked and also pretty different in their setup. Let's start with the easier one, the right entry/exit.
    Important: In the first room, the teleport settings are also different, so don't touch this yet.

    Right teleport command:




    (Picture 15)

    Important:
    I want the player to teleport to a bossroom after visiting 5 rooms, that's what the "conditional branch" is for. I will explain that further in the next chapter. For now, just copy everything under "else".

    First, add a new Variable and give it the name: "Room Counter". Now on the right side, give it +1 every time you teleport. This Variable is important for the game to remember where the second room has been.
    Before teleporting, also add +1 to "Pointer".
    This Variable will let you go left on your list of random room ID's instead of right by changing the third variable.
    Third Variable: Now under the one you just installed, enter another "control variable" command and select "Current Map ID". This time, use "Script" as Operand.
    Now enter:
    $game_variables[5][$game_variables[6]]

    Now since "$game_variables[5]" is your roomnumber and [$game_variables[6] is +1, we have "Room Nr. + 1".

    Now all we need is the "transfer Player" command. You'll have to chose "Designation with variables", chose "Current Map ID" as Map ID, and X Left and Y for the axis.

    Left side:




    (Picture 16)

    Now for the left side you are going to need a "conditional branch", because when we are back in room 2, we need a special teleport command to go to room 1.
    This is what the "Room Counter" Variable is for. If "Roomcounter" equals 2, you teleport directly to room 1.
    But before that, substract 1 from "Room Counter" and "Pointer" (-1) .
    Before teleporting, you also need to create and flip on another switch called "Back to room 1". We need it for the teleport event in room 1.
    In "Else" we are going to setup a return to Map 3,4 or 5(etc.):
    Again, subtract 1 here (-1) from "Room Counter" and "Pointer". Then you need to type in the Script-Call into "Current Map ID" again.
    (Control Variables: "Current Map ID": -> Script -> $game_variables[5][$game_variables[6]])
    Finally, Transfer to "Designation with Variables", select "Current Map ID" and "X Right" for x, "Y" for y and remember to copy/paste all events in your random room to every other random room.

    Now there is only one thing we need to do, we need to setup the teleport command in the first room. First, here is a picture of it to look at:




    (Picture 17)

    It starts with a "conditional branch" asking, if Switch "Back to room 1" is active (You can also do it with a second eventpage asking for that) and if yes, add "Room Counter" and "Pointer" +1 again. Now you need to teleport to a "Designation with Variable" and this time select "Second Room". That's the Map ID of the second room that we saved when entering it the first time. Also "X Left" and "Y" for the axis.
    Lastly, turn of the switch "Back to Room 1" OFF!
    Now to "Else":
    Again, add "Room Counter" and "Pointer" +1. Now you add "First TP = On", because this triggers only when going right first. Now you Transfer Player to a "Designation with "Variables" again, this time use "Random Map" from chapter 2.

    All it's all done! All rooms should now be in the same order as you leave them!
    Spoiler: 4. Xtra Rooms / Boss Rooms
    Now possibly, you want your player to have the chance to go to special rooms, in Bindings of Isaac there are Shops or arena rooms for example.
    Rooms that you maybe need a key or enough dollar for to enter them. You could add rooms like this to your map-shuffle:




    (Picture 18)

    Now this room could enable the visit of a shop, tavern, inn, boss room, mini boss, etc...

    Buuut, you also want, that if you go into this room and back, you still come back to the same dungeon with the same order of rooms. First, lets create a simple loot room:




    (Picture 19)

    I know it looks horrible, but I am lazy.

    Now if you know which room you wanna go to, you can set a direct designation. If you want to go to a random room, like either a shop- or a trap-room, you can also use a variable like "Random Map" with the desired Map ID's as targets.
    First, let's go back to the other room. There we also need to save, in which room we have been before entering the bonus room. To enter this room, just create a variable, I called it "Bonus Room exit" and Select "Game Data" -> "Map ID".




    (Picture 20)

    After this, you just need to set the transfer destination as "direct designation" into the bonus room, or to the Random Variable with your set of bonus rooms, and set the event to "player touch".
    In the bonusroom, put an event at the exit. Now you just need to select "Transfer Player", chose "Designation with variables" and for Map ID you need to pick "Bonus Room exit".
    You can add this entry room for the bonus rooms in the script call we used in chapter 3. To "$game_variables[5] = [4,5,6] just add the ID of that room as well. (e.g.: [4,5,6,7])
    Now you just need to set up new Variables for your X and Y axis in your "Variables" common event and you're good to go! (Call them "X Bonus" or "X Boss" and "Y" Bonus or "Y Boss" or whatevs)

    Maybe, like in the chapter before suggested, you also want to teleport to a bossroom everytime you already visited 5 random rooms. This can be easily done, since we already do have a Variable that counts the rooms for us.
    I tried to use the Variable "Pointer" first to count the Roomnumbers, but sadly it didn't work, that's why there is the other Variable, called "Room Counter".
    So basically, Picture 15 is already a finished setup for this. If you want to alter the amounts of visited rooms before entering the bossroom, just change the condition to higher or lower and select your Bossroom as Designation for your Teleport. If you do not want that to happen, just keep everything under "else".
    Spoiler: 5. Random Chest dropchance/locations
    Okay, off to the last chapter. I am not going to exlain, how to get random loot into your chests, there are a lot of other tutorials/scripts for that.
    I just want to show you how to make several chests at several locations and upon entering a new room, there will only appear 1 of them randomly or non at all. You can setup the probabilities yourself.

    First I am going to setup another Common Event and call it "Chests". In here I am going to set a variable with the name "chest selector". I want to have 3 chests and a chance of 50% to find no chest at all,
    that's why I put in on random with numbers between 1 and 6. If a 1,2 or 3 gets rolled, a chest appears, if 4,5,6 get rolled, no chest will appear.
    And the end of the common event, I will create a switch called "chest common event" and turn it OFF. I will also set this as the condition switch for the common event and put it on "parallel process".
    Then, on top of the common event, I want to make 3 other switches, call them "Chest 1", "Chest 2", Chest 3" and turn all of these OFF as well.
    This switches will be activated by the amount of our variable "Chest selector", and the common event will turn their switches off upon every entry of a new room so a new chest can appear again.





    To activate the common event, put a "control switch" into all your right teleport events and flip it on. Like this:





    Okay, now we only need to let the value of our variable "chest selector" to activate switches. You need to grow a little conditional branch tree for that, where depending on the value of variable "chest selector"
    the switches "Chest 1, 2 or 3" get activated.





    Now you just need to place 3 chests on your map, you can do that easily with "quick event creation" by rightclicking on the map. Now 1 chest needs the conditional switch If "chest 1" is on, and repeat that with the other
    chests. (If "chest 2" is on, etc.")





    Remember to copy and paste all events in all of your random rooms, they all have to have identical Events!

    And now you can adjust from here however you want, but the setup is done to build a roguelike game like Binding of Isaac or great Random Dungeons!

    Have fun with it and have a nice day!

    This is my first tutorial, tell me if I goofed somewhere and I will fix it! If something doesnt work, ask me and I will try to help and figure out the problem.


    本贴来自国际rpgmaker官方论坛作者:Tiregs处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/making-a-game-like-binding-of-isaac.117790/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-15 19:04 , Processed in 0.148190 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表