Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • Tutorials »
  • My CBS tut
« previous next »
  • Print
Pages: [1]

Author Topic: My CBS tut  (Read 4720 times)

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
My CBS tut
« on: March 11, 2005, 04:29:54 AM »
Well ever since I released a demo of my game, a bunch of people have asked me to make CBS's for their game. I'm taking on a few, but I don't have time to make them all. Anyway, I said I'd make a tutorial for the people who I couldn't actually make the real thing. Anyway I decided to post it up here for anyone interested. I was kind of tired when I wrote this, so there might be things that make no sence, so if you read through it, please tell me what needs to be improved in the tut so it can be more helpfull :)

Basics of a CBS:

0. Introduction
1. Algorithms
2. On map events
3. Common events
4. Putting it all together

0. I won’t tell you step for step how to make a battle system. This tutorial is meant to just give the basics of making a battle system so that you can build one yourself, customizing it for your game, and how you want it. This means some areas are going to be vague, you’ll have to fill in the gaps how you see fit for your own game. Before making a CBS, you should ask yourself “why”. If you’re making a CBS just to make a CBS, then there’s not much of a point in you making one, if you find you have some pretty good reasons for wanting to make one, then go for it. Also note that you should have some experience in RM2k/3 before attempting to make a CBS, you should have good knowledge in how to work switches and variables, how to use common events, and basic knowledge in creating a simple CMS. If not, keep working with rm2k/3 at your own pace and get more experience before attempting to make CBS.

1. Algorithms: The most important thing to any battle system are the algorithms. Algorithms are events that take values such as starts for the heroes and monsters, and turn them into values that are usable in a battle system. You’ll need algorithms to determine attack damage, magic damage, speed of characters (or the order in which they go), digit splitting, and anything else you feel needs to be added. Here’s an example of why algorithms are so important. If you were to display the whole thing at a time, you would need 10,000 fork conditions in the event, but with the number splitting algorithm, you only need for events with 10 forks in them. A great example of a damage algorithm is at blade2k.net in the tutorial sections, I believe its called “advanced  battle damage algorithm” (I could be wrong though). Please go through that and get familiar with that algorithm before proceeding.

You see in that algorithm, it calls values directly from the heroes stats. That’s fine and all, but for a full battle system, we can’t do that unless you want to make a new algorithm for each character and monster. This means you have to replace all the specific hero stats with regular variables. I’ll explain how to use/call them later on. You also want to make sure that all the algorithms are placed in the common events.

2. On map events: Although most of the events in a battle system should be located in the common events, there needs to be a number of events on the map where you plan to have your battle. These events are the events that will change from battle to battle, and include things such as the initiation event, monster stats, variable references for damage/healing numbers (assuming the monsters will be in different positions for different monsters), the ending event, and anything else that is specific to a certain battle or group of battles.
   A) Initiation Event: This is the event that will “start up” the entire battle. Its usually best if it’s a parallel process event that switches off when its done playing through. This event should contain the event that brings up the screen (for example, if you faded the screen out to black before the battle starts, this event will turn the screen back to normal), turns on all the switches needed to start the battle, sets all the variables needed for the battle.
   B) Monster Stats: Since different monsters don’t all have the same stats, this event needs to be on every battle map. This event could either be a parallel process event that switches off once its done playing through, or the better choice would be to have it be an “action key” event that is called by the initiation event. Normally the stats you need to include would be: HP, Strength, Defense, Agility, Intelligence, and possibly MP, and/or Monster Variable reference (a variable reference that basically would tell a different event somewhere down the line what specific monster it is).
   C) Variable reference for numbers: If you want difference monster groups to be in different positions, you’ll probably need an event that sets a variable reference for the x and y for each damage letter that can be displayed. To display damage numbers, you need to use the “digit splitting algorithm” and display a number picture file at the set variable references x and y positions. Its probably best to set each letter, although there are ways where you can have one x and one y for the entire battle damage number string, it is difficult. Basically you’d have to copy the value of that variable when displaying a picture with another variable, then add/subtract 7 or so from it before displaying it. If you didn’t understand what I just said, don’t worry about it.
   D) Ending Event: This event should start when all the monsters are dead, or when the battle should end. This event will determine the amount of experience your characters get, the amount of gold/items they get, and it will also “turn off” everything that the initiation event turned on.
   E) Character “Sprites: These events are blank, just set them where you want the monsters and heroes to be. Later on when you display animations, you can set it to be displayed on these events. For heroes you’re probably going to want to display their graphic (unless you want to display the heroes with pictures). You also might want to display the monster sprites if you’re not using pictures for them.
   F) Character Events: Make an on map event for each hero. This event calls all their moves. Make a different page for each move they can do. Have page one for attacking, page 2 for a magic skill, page 3 for the next magic skill, ect. Make a common event for each move a hero can do. Make sure this event is not an auto start or parallel process. Have page one call the attacking common event for the character in which the event resembles, remember you will need to make an event like this for every character. Have page 2 call the skill for the magic, page 3 for the next magic, ect. I’ll explain how to use them more in the “putting it all together” section of this tutorial.

3. Common Events: The majority of the events to that run a battle system should be located in the common events. Using common events allows you to easily change and modify stuff without having to edit every single battle you already made. It also reduces lag. It is best to make the common events parallel process, but have them need a switch to run. Turn on the switch when you want that event to run, and turn it off when you don’t want it to run. Here is a list of the things that are better to use in common events, what they do, and how they work.
   A) Menu Events: Most battle systems have menus in them such as a command menu that say “attack”, “skill”, “run” ect. I’ll assume that if you got this far in the tutorial, that you know a bit about CMS’s. I’ll quick go over how to make one, but I won’t get too detailed. (note: the way I’m explaining it is the easiest way I know how to make a CMS, it requires on map events.
      - Make an event that is a parallel process event. Make a key input process in it with the options up and down (side to side if you want to push the side buttons to move the menu instead), decision key, and escape key if needed. Make a fork condition for each possible outcome from the key input event. If you’re moving down, set a variable of your choice to “1“, and have a second page called if that variable reference is “1”. Also include the curser movement in that fork event. On page two make the exact same events, only instead of setting the variable to “1” set it to “2” and make a third page that is called when that variable is “2”. Also be sure to move the curser to the new location. When you’re moving something up, just set the variable to the page reference above it.
         Now that you have a page for each out come, make a fork event for if you push the decision key (if you haven’t already). In that fork, call the new menu or event that you want to be called from it.
   Back to a CBS’s menu system: Make a simple CMS with the choices that you want, I suggest Attack, Magic, Item, and Run, but they can be whatever you want. Now lets say you select attack, call a different event that determines what happens, this makes it easier than if you do it in the same event. I suggest using common events for this so it doesn’t lag as much (I didn't use common events in my battle system for stuff like this, and thus it lagged really bad in some parts. Anyway in that event you'll need to make something that selects the monster you wish to attack, make it like a CMS, but instead of having a background picture for the menu, just have a curser, and have the curser move to the different monsters. Make a variable that says what monster you picked, for example if you picked the first monster, set a variable for hero [whatever hero is currently selecting]'s monster to 1. Also set a variable hero [whatever hero is currently selecting]'s move to 1. 1 is for the attack, 2 is for a magic skill, 3 is for the next skill. You must have a separate number for each action a character can do. I’ll explain why you need to do this in the “putting it all together section”
   B) Algorithms: Like I said earlier, algorithms should be in the common events.
   C) Hero moves: You’re going to have to script out each characters moves in the common events. You’ll need to include battle animations, sound effects, magic damage if it’s a spell (not hero intelligence though) and to call the algorithms needed to make it work. Make a fork equal to the possible number of enemies on a map at a time. If monster one is selected (you should know this by a variable set when selecting a monster), then it displays the animation on monster number one. If two is selected then the animation will be displayed on monster number 2, ect..
   

4: Putting it all together: You know by this point what move your doing via variables connected with the battle systems CMS, and you have a page for each different attack, but now you need to put the two together. When your guy is ready to attack, make a fork condition for which hero is attacking. If its hero 1, branch so that you would call hero 1's event that calls his/her respected move. Have the page in that event determined by the variable [hero 1's move]. Since the variable reference for attacking is 1, it will call page one of that event, and thus call the common event that says what happens when hero one attacks. Put a fork somewhere in that common event for each monster you can attack, so if you had monster 1 selected, it will show a battle animation on monster 1. In the damage algorithm make another fork for each monster, so it knows which monster's life to subtract the life from.
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN

Offline InsaneJP

  • Certified Public Spriter
  • Exemplar
  • *
  • Posts: 1,280
  • video game fanatic and martial arts lover
(No subject)
« Reply #1 on: March 11, 2005, 04:32:25 AM »
Thats real nice i may use it in my next game! ;)  A+
Logged

Offline SleepAid

  • Anime made baby Jesus cry.
  • Zealot
  • *
  • Posts: 732
  • I uh... like sleeping?
(No subject)
« Reply #2 on: March 11, 2005, 07:37:01 AM »
I love you...
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #3 on: March 11, 2005, 06:17:31 PM »
 
Quote
I love you...


 :eyes: Me? Uhh, thanks :)

 :p
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN

Offline Darkfox

  • These spectacles do nothing
  • Staff
  • Over 9000!
  • *
  • Posts: 10,215
    • Chaos Realm - Home of the God Beasts
(No subject)
« Reply #4 on: March 11, 2005, 06:24:30 PM »
*Locks SleepAid away in a padded room*

There.
Logged



Offline SleepAid

  • Anime made baby Jesus cry.
  • Zealot
  • *
  • Posts: 732
  • I uh... like sleeping?
(No subject)
« Reply #5 on: March 11, 2005, 09:48:54 PM »
I was talking to my sandwich. Calm down. Oh, and, nice tut. That helped me so much...
Logged

Offline Bobb

  • is cool
  • Associate
  • *
  • Posts: 152
(No subject)
« Reply #6 on: March 12, 2005, 04:56:35 AM »
this is off topic but  where is a demo of your game, Droagonblaze?
Logged

Offline InsaneJP

  • Certified Public Spriter
  • Exemplar
  • *
  • Posts: 1,280
  • video game fanatic and martial arts lover
(No subject)
« Reply #7 on: March 12, 2005, 04:58:37 AM »
its in the games forum...but you really shouldnt go that much off topic just send him a private message
Logged

Offline DragonBlaze

  • A Wild DB Appeared!
  • Royal
  • *
  • Posts: 3,329
(No subject)
« Reply #8 on: March 12, 2005, 05:49:07 AM »
Quote
this is off topic but where is a demo of your game, Droagonblaze?


Lol, well my game topic is burried in the games forum, so heres the link to the download anyway :)

http://www.myriadcreations.net/dragonworld/DW.zip

If you have any further questions or comments, please just bring it to me in a PM instead :)
Logged
Hell Yeah! Just recovered all my old rm2k/3 games from my 10 year old, broken laptop hard drive that had been formatted and had a new OS installed on it. Oh, and I did all of this from my phone. WIN

Offline Bobb

  • is cool
  • Associate
  • *
  • Posts: 152
(No subject)
« Reply #9 on: March 12, 2005, 04:29:09 PM »
Sorry about that.  I'm new to this forum thing. :)
Logged

Offline Foo-Army

  • Member
  • Initiate
  • *
  • Posts: 5
  • ...
Kick!
« Reply #10 on: December 12, 2007, 01:22:42 PM »
Topic kick a of about 3 years lol


still awsome idea is it ready or will it be soon?
Logged

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
(No subject)
« Reply #11 on: December 12, 2007, 02:50:36 PM »
Quote
Originally posted by Foo-Army
Topic kick a of about 3 years lol


still awsome idea is it ready or will it be soon?
'

He would have said so if it was... Right? You Personal Message people about things like this. You don't kick the topic out off its peacefull grave...

So get the point with a rule that states that you shouldn't kick old topics unless it's your own and in some cases: a Sticky(this is only justified from time to time if you have a good reason to).
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • Tutorials »
  • My CBS tut
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum