Jump to content


Photo

Need help! Gameplay question


  • Please log in to reply
20 replies to this topic

#1 AdrienneMorrisa

AdrienneMorrisa

    GMC Member

  • New Member
  • 12 posts
  • Version:GM8

Posted 06 May 2012 - 02:27 AM

So I'm wanting to make an rpg that has all of my close friends as characters, but that means having 8 characters. I don't really have a set story line yet, so they probably won't all be playable, but if I wanted them to be playable, what would the best gameplay option be? This game is going to be a bit like Final Fantasy from what I know so far, so one option would be to have the ability to switch characters throughout the game. Another option would be to choose who you want the heroes to be from the beginning. The problem I have is that I'm an artist, not a programmer, so I don't really know what GM is capable of doing in terms of coding. Any suggestions?
  • 0

#2 The Furox

The Furox

    GMC Member

  • GMC Member
  • 36 posts
  • Version:Unknown

Posted 06 May 2012 - 03:01 AM

In RPG maker your party can be as large as you want but you can only "control" 4 of them. So I suggest you adopt a similar practice. Have a large party but allow the player to sub in and out characters.
  • 0

#3 Archaeaologist

Archaeaologist

    GMC Member

  • New Member
  • 111 posts
  • Version:Mac

Posted 06 May 2012 - 03:11 AM

In terms of gameplay balance, less tends to better. With putting in too many characters you open yourself up to larger scale battles where you have to think about the battlefield in larger terms than with one to four characters. It becomes a tactical game which, in turn, focuses the game more on gameplay than it does on the story. If you're more interested in story, which I imagine you are, then I suggest a three to four character party limit. It's easy enough to give the player options on party members, either choosing from the start, meeting them along the way and deciding you want to permanently switch out one party member for another, or having them congregate around somewhere so the player can switch out party members at any time. Just make sure that you share experience somehow (automatically level up party members that aren't being played) and you should be able to go any direction.

In terms of what GML can't do, there isn't a whole lot. Some things are harder than others, but Game Maker is a robust program. You just have to put the time and expertise into it. If you really wanted, you could have an eight person party. It'd require thinking about the gameplay a lot more if you wanted to have a quality game, but it still could be done.
  • 0

#4 dannyjenn

dannyjenn

    GMC Member

  • GMC Member
  • 2736 posts
  • Version:Mac

Posted 07 May 2012 - 12:40 AM

I'd have to agree... do a 4-character party (as opposed to 8 at once).
As for whether it should be like FFI (where all party members are selectable at the beginning and you only get 4) or some other game where you meet characters along the way... I'd choose the latter. For one thing, the player would get to experience all 8 characters throughout the game. The other thing is that it allows for more flexibility... you can give different characters different skills so that the player can choose to (or even be required to) switch party members over the course of the game.

As fo what GM can or can't do... just plan on making the game without worrying over technical limitations. Just about everything you can think of can be done... and that which can't be done could probably be altered in a way that can be done.

Just make sure that you share experience somehow (automatically level up party members that aren't being played) and you should be able to go any direction.

I have never seen this done in a game... generally I would think that that's a bad idea (although if done correctly, it may make sense. For example, if the story says that unused characters are out fighting or practiceing then it would make sense for their levels to increase, despite not being used).
It kind of takes away from the game though... for example, if one boss was immune to magic and the player's team was made up of magic-users, the player could just swap party members and they'd already be ready to fight the boss. There'd be no negative consequence to not have an unbalanced team, therefore no motivation for the player to want to balance his team). In other words... he'd have no real reason to level up any character that he doesn't want to use.
  • 0

#5 Takagi

Takagi

    GMC Member

  • GMC Elder
  • 4279 posts
  • Version:GM:Studio

Posted 07 May 2012 - 04:36 AM

Ah, I've always wanted to do something like this. I've realized that platform games where you can pick different characters, each with different abilities, is my favorite. It's easier to implement, and its also a lot of fun. I was a big Sonic fan, so playing through levels with Knuckles and being able to access areas that Sonic couldn't and vice-versa added a whole lot of depth to the game. But if you're sticking with an RPG, I'd say go with the Tales of Symphonia/Golden Sun method-- you have 8 people, but only 4 can be actively used to fight at one time.
  • 0

#6 AdrienneMorrisa

AdrienneMorrisa

    GMC Member

  • New Member
  • 12 posts
  • Version:GM8

Posted 07 May 2012 - 11:48 AM

Well, I certainly agree. I wasn't going to go with using all 8 characters at once. I was just trying to figure out which would be easier to do: Swap out characters like in FFX, or choose the four heroes from the beginning like in FFI. But the ruling seems to be swapping them out.

Now, another option that was mentioned among my friends is to have a message show up before the battle, saying, "You're about to fight (X) type of monster. Who would you like to participate in this battle?" And then you can choose from that screen who you want to use. I agreed that this would be a possible idea, because in most games, like in Dragon Age: Origins, it's assumed that all characters come with you, even though you can only control 4 at a time. And they all gain experience, even when you don't have them in the controllable party. I just don't know if this option would be a good gameplay element...
  • 0

#7 dannyjenn

dannyjenn

    GMC Member

  • GMC Member
  • 2736 posts
  • Version:Mac

Posted 07 May 2012 - 01:33 PM

Well, I certainly agree. I wasn't going to go with using all 8 characters at once. I was just trying to figure out which would be easier to do: Swap out characters like in FFX, or choose the four heroes from the beginning like in FFI. But the ruling seems to be swapping them out.

Now, another option that was mentioned among my friends is to have a message show up before the battle, saying, "You're about to fight (X) type of monster. Who would you like to participate in this battle?" And then you can choose from that screen who you want to use. I agreed that this would be a possible idea, because in most games, like in Dragon Age: Origins, it's assumed that all characters come with you, even though you can only control 4 at a time. And they all gain experience, even when you don't have them in the controllable party. I just don't know if this option would be a good gameplay element...

I've never played that game, but I don't really like that idea much. It removes the realism... if 8 people are travelling together then why would only 4 choose to fight? Unless it's an honour thing like "there are only 4 enemies, so only 4 of us will fight" (except that wouldn't be the case whenever there is a number other than 4 enemeies in the fight). Or if you can add a reason to the story why the others shouldn't be fighting (such as, a second group of enemies appears from behind and they must keep those other enemies occupied while you control 4 who fight the main enemies)... although that would get extremely awkwad if done in every single fight.

Another idea that you could do, although this would be changing the style completely, would be to make the fights one-on-one, but have all 8 characters travel with you. Then when one character is KO'd the next one takes his place. Like Pokémon... except instead of carrying 6 monsters with you and storing hundreds more in a PC then it's just the 8 characters, who all travel with you.
If you did that then the honour thing would make more sense... it's reasonable that all fights would traditionally be duels, done strictly one-on-one.

Edited by dannyjenn, 07 May 2012 - 01:35 PM.

  • 0

#8 Archaeaologist

Archaeaologist

    GMC Member

  • New Member
  • 111 posts
  • Version:Mac

Posted 07 May 2012 - 02:02 PM

When it comes to RPG party switching mechanisms, don't worry about realism. Most choices you can make are going to be unrealistic, but people who play RPGs understand that you can't always have it. Yes, you can lampshade it by either choosing your party members before the game starts or writing in legitimate reasons why one person would suddenly choose to not be in your party, but the latter can be a lot of work.

At any rate, any method you can devise for switching out characters will be unrealistic (can be lampshaded again by having multiple parties that are trying to accomplish some other task while your party is away, but why would they be willing to simply switch out willy-nilly; you'd have to make it so you can only switch party members at certain points). Thus, you need to worry more about gameplay and less about realism.

Personally, if you like the choose your members before a fight option, go with it. There is no right or wrong way, and the most common ways aren't necessarily the best. The reason a lot of games make it so you can switch by going to some location or something is simply as dannyjenny stated:

It kind of takes away from the game though... for example, if one boss was immune to magic and the player's team was made up of magic-users, the player could just swap party members and they'd already be ready to fight the boss. There'd be no negative consequence to not have an unbalanced team, therefore no motivation for the player to want to balance his team). In other words... he'd have no real reason to level up any character that he doesn't want to use.

That's a minor issue, though, in a game where the story matters much more than the balance mechanics, especially with the method you've devised (part of every battle would be trying to figure out the best characters to use in that particular situation)

Edited by Archaeaologist, 07 May 2012 - 02:02 PM.

  • 0

#9 AdrienneMorrisa

AdrienneMorrisa

    GMC Member

  • New Member
  • 12 posts
  • Version:GM8

Posted 07 May 2012 - 02:03 PM


Well, I certainly agree. I wasn't going to go with using all 8 characters at once. I was just trying to figure out which would be easier to do: Swap out characters like in FFX, or choose the four heroes from the beginning like in FFI. But the ruling seems to be swapping them out.

Now, another option that was mentioned among my friends is to have a message show up before the battle, saying, "You're about to fight (X) type of monster. Who would you like to participate in this battle?" And then you can choose from that screen who you want to use. I agreed that this would be a possible idea, because in most games, like in Dragon Age: Origins, it's assumed that all characters come with you, even though you can only control 4 at a time. And they all gain experience, even when you don't have them in the controllable party. I just don't know if this option would be a good gameplay element...

I've never played that game, but I don't really like that idea much. It removes the realism... if 8 people are travelling together then why would only 4 choose to fight? Unless it's an honour thing like "there are only 4 enemies, so only 4 of us will fight" (except that wouldn't be the case whenever there is a number other than 4 enemeies in the fight). Or if you can add a reason to the story why the others shouldn't be fighting (such as, a second group of enemies appears from behind and they must keep those other enemies occupied while you control 4 who fight the main enemies)... although that would get extremely awkwad if done in every single fight.

Another idea that you could do, although this would be changing the style completely, would be to make the fights one-on-one, but have all 8 characters travel with you. Then when one character is KO'd the next one takes his place. Like Pokémon... except instead of carrying 6 monsters with you and storing hundreds more in a PC then it's just the 8 characters, who all travel with you.
If you did that then the honour thing would make more sense... it's reasonable that all fights would traditionally be duels, done strictly one-on-one.

Hmm... Good point. In Final Fantasy 10, the only way the characters get experience is if they actually participate in the battle, which makes more sense to me than having everyone level up regardless of if they fought or not. The problem is, though, FFX only had six characters, and that was hard enough to keep track of. So if I used that option, I'd have EIGHT characters to keep track of, and that may be too difficult to handle for some players.

I could technically argue the other way of doing it, where everyone gets some amount of experience, by saying that they gain experience by observing. I could just make it to where they only get half the amount, or something like that.

I enjoy both ways of doing this. They both have merits.

Edited by _259259, 07 May 2012 - 02:05 PM.

  • 0

#10 AdrienneMorrisa

AdrienneMorrisa

    GMC Member

  • New Member
  • 12 posts
  • Version:GM8

Posted 08 May 2012 - 12:23 AM

Also, I just got a book on c# from my dad, and the coding seems pretty similar to gml. You think it'll help out, or would the two codes be too different?
  • 0

#11 dannyjenn

dannyjenn

    GMC Member

  • GMC Member
  • 2736 posts
  • Version:Mac

Posted 08 May 2012 - 01:47 AM

Also, I just got a book on c# from my dad, and the coding seems pretty similar to gml. You think it'll help out, or would the two codes be too different?

The book itself won't help, but it might help you to learn C# and knowing C# will help. Just about any C-based langauge (C, C++, C#, Java, JavaScript, whatever) uses extremely similar syntax to GML (so learning to do an if statement, a for loop, etc. in any language would help you to do one in GML). The main difference is that Game Maker is designed to make games... so it has a ton of stuff pre-coded (movement functions, collisions, etc.) and will save a ton of work.
Only thing to watch out for (and I'm not sure how this is in C#) is declaring and assigning variables. Some languages make you specify if the variable is an integer, boolean, string, whatever... GML does not. Other languages do not allow an int to be set as a string... GML is extremely flexible and does not care. GML will probably be easier to learn.
  • 0

#12 Yal

Yal

    Gun Princess

  • Global Moderators
  • 8625 posts
  • Version:GM:Studio

Posted 08 May 2012 - 10:27 AM

Hmmm... [many characters] goes well along with [tactics RPG] (aka chess with levelUp-able units) but they're harder to make than FF1-style games. Depending on how diverse abilities your friends have you might want to consider either of those styles or maybe merging them.

One thing you could consider would be to make a Fire Emblem-style game where all battles are duels, and you move around on a World Map/Battlefield mashup, being able to save anytime even when enemies are around, going to a village to buy new items or rest to restore HP, and so on.
Posted Image
When you go near an enemy, you can select "Attack" (or maybe "Engage" would be better in this case... keep on reading!) and attack it if you so desire, popping up a screen like this;
Posted Image
In Fire Emblem, the battle would be VERY non-interactable. You, on the other hand, should give the player some options. The battle should be ATB-based, so both units has an "initiative" meter and once it's full the unit does an attack (or tries to escape/pull out of battle). You can choose to Attack, and if you have multiple attacks choose with what weapon or spell you want to attack, use a healing spell or item if any using the Heal option, and finally choose Defend or Escape. When defending you might block an enemy attack, maybe even getting a counter-attack in its face.



Another thing you might consider would be to let the characters move around in groups of two (kinda like Mario Kart: Double Dash!!) so that the player only has 4 units to move around, and then have some ability to switch leader/sidekick in towns and so on (also trading characters between groups). In battle, the two units would take turns attacking. The enemy can attack either character of the pair. Also you should meet enemies in pairs sometimes, maybe even in larger groups that moves as one unit on the world map.
  • 0

#13 AdrienneMorrisa

AdrienneMorrisa

    GMC Member

  • New Member
  • 12 posts
  • Version:GM8

Posted 09 May 2012 - 02:15 AM


Also, I just got a book on c# from my dad, and the coding seems pretty similar to gml. You think it'll help out, or would the two codes be too different?

The book itself won't help, but it might help you to learn C# and knowing C# will help. Just about any C-based langauge (C, C++, C#, Java, JavaScript, whatever) uses extremely similar syntax to GML (so learning to do an if statement, a for loop, etc. in any language would help you to do one in GML). The main difference is that Game Maker is designed to make games... so it has a ton of stuff pre-coded (movement functions, collisions, etc.) and will save a ton of work.
Only thing to watch out for (and I'm not sure how this is in C#) is declaring and assigning variables. Some languages make you specify if the variable is an integer, boolean, string, whatever... GML does not. Other languages do not allow an int to be set as a string... GML is extremely flexible and does not care. GML will probably be easier to learn.

Okay, so another question, then. What if I wanted to do the game entirely with drag-and-drop functions? I know I wouldn't be able to do as much with it, but like I said, I'm not a programmer, I'm an artist. So do you know of a good tutorial that will either show me how to do drag-and-drop programming, or at least one that tells me what bits of code I need so that I don't have to spend so much time going through and learning the stuff I don't need?
  • 0

#14 dannyjenn

dannyjenn

    GMC Member

  • GMC Member
  • 2736 posts
  • Version:Mac

Posted 09 May 2012 - 04:34 AM



Also, I just got a book on c# from my dad, and the coding seems pretty similar to gml. You think it'll help out, or would the two codes be too different?

The book itself won't help, but it might help you to learn C# and knowing C# will help. Just about any C-based langauge (C, C++, C#, Java, JavaScript, whatever) uses extremely similar syntax to GML (so learning to do an if statement, a for loop, etc. in any language would help you to do one in GML). The main difference is that Game Maker is designed to make games... so it has a ton of stuff pre-coded (movement functions, collisions, etc.) and will save a ton of work.
Only thing to watch out for (and I'm not sure how this is in C#) is declaring and assigning variables. Some languages make you specify if the variable is an integer, boolean, string, whatever... GML does not. Other languages do not allow an int to be set as a string... GML is extremely flexible and does not care. GML will probably be easier to learn.

Okay, so another question, then. What if I wanted to do the game entirely with drag-and-drop functions? I know I wouldn't be able to do as much with it, but like I said, I'm not a programmer, I'm an artist. So do you know of a good tutorial that will either show me how to do drag-and-drop programming, or at least one that tells me what bits of code I need so that I don't have to spend so much time going through and learning the stuff I don't need?

Doing the whole game in Drag and Drop is a bad idea. Not only is it limiting (maybe even impossible for an RPG)... it's a real pain typing it in (you can't just copy and paste some code... you gotta click each action and go through the interface for everything). And people are less able / less willing to help you if you get stuck.
Unfortunately, there is no list of code with their equivalent Drag and Drop actions. There was once a program called the Action Decoder which gave you the code for every Drag and Drop action... but it was GM5 and he never released a new version (and since GM has changed drastically since then... most of it is pretty much useless now).
Sorry, I don't know of any tutorials. There's whole forum for that though... maybe you could make a post there.
My only suggestion is to find a programmer to do the work for you (make a post in the Team Request forum) if you don't want to code it yourself.
If you want to learn the code, I'd suggest first learning the basics, such as setting variables, arrays, for loops, if statements... all that stuff. And you'll probably want to look at a lot of the drawing functions, as they'll be needed a lot. Other than that, don't worry about any of the specifics until you need to use them... because like you said, you may end up wasting time learning stuff you don't need.

Edited by dannyjenn, 09 May 2012 - 04:35 AM.

  • 0

#15 Yal

Yal

    Gun Princess

  • Global Moderators
  • 8625 posts
  • Version:GM:Studio

Posted 09 May 2012 - 11:18 AM

I don't know how helpful it would be, but I've made (well, it's not 100% complete yet) an RPG engine called the SisEngine that might be helpful to check out. At least give it a look for inspiration. There's a link to it in my signature.

I'd say the Fire Emblem approach (outlined in my previous post, which you ceased to reply to) is the easiest RPG system to program since you essentially just need to roll a Hit/Evade check and then play out some attack animations for each round of battle. It's a bit complex to get the battle objects to change depending on what units you bring into battle but it's really simple to do with global variables.
  • 0

#16 AdrienneMorrisa

AdrienneMorrisa

    GMC Member

  • New Member
  • 12 posts
  • Version:GM8

Posted 11 May 2012 - 03:58 PM

I don't know how helpful it would be, but I've made (well, it's not 100% complete yet) an RPG engine called the SisEngine that might be helpful to check out. At least give it a look for inspiration. There's a link to it in my signature.

I'd say the Fire Emblem approach (outlined in my previous post, which you ceased to reply to) is the easiest RPG system to program since you essentially just need to roll a Hit/Evade check and then play out some attack animations for each round of battle. It's a bit complex to get the battle objects to change depending on what units you bring into battle but it's really simple to do with global variables.

Well, the only reason why I wouldn't want to do a tactical rpg is because I personally don't really like playing them. But I see your point. Having 8 characters would be a hassle to do it any other way. But I'll give your engine a look.

Also, three more questions. First off, I don't have a registered version of GM yet. I know that certain draw functions aren't available, but I'm wondering which ones? Like, can I draw text, but not sprites, or is it all unavailable? Also, are timelines available in the unregistered version?
And last but not least, what's the "standard" way of doing an rpg battle in terms of strength vs defense, adding weapon and armor stats to strength and defense, ect? How would you code GM to say, "His strength is greater than my defense, therefore he does X amount of damage, unless I manage to dodge in time" ect.?
  • 0

#17 dannyjenn

dannyjenn

    GMC Member

  • GMC Member
  • 2736 posts
  • Version:Mac

Posted 11 May 2012 - 08:52 PM

Also, three more questions. First off, I don't have a registered version of GM yet. I know that certain draw functions aren't available, but I'm wondering which ones? Like, can I draw text, but not sprites, or is it all unavailable? Also, are timelines available in the unregistered version?
And last but not least, what's the "standard" way of doing an rpg battle in terms of strength vs defense, adding weapon and armor stats to strength and defense, ect? How would you code GM to say, "His strength is greater than my defense, therefore he does X amount of damage, unless I manage to dodge in time" ect.?

First 2 I can't answer.
Last one can be done in a number of ways. I'd make some variables,
player_strength[0] = something;
player_defense[0] = something;
// do that for player_strength[1], player strength[2], and so on up unti player_strength[7]... the number in the []s is the player.  0–7 makes 8 of them.
// also do that for defense
player_hp[0] = something; // and again, repeat it 7 more times
Then I'd make some more variables,
player_weapon[0] = something;
player_armour[0] = something;
// etc.
Then make stats for the enemy as well... this can get even more detailed if you choose to give the enemy weapons / armour as well, although this is unnecessary since you can simply give him a hgher base number. So something like
enemy_strength[0] = something + something_else; // something being his attack strength, something_else being his weapon power-up
enemy_defense[0] = something + something_else; // same thing basically
enemy_hp[0] = something;
Dodging really depends on the wy you choose to do it... you can simply say "you have a 10% chance of dodging" or you can make it action-based like Paper Mario. Assuming you go for the random probability way, the code you'd use for calculating damage when the enemy attacks would be something like
dodge = .1;
success = random();
if(success>=dodge){
    if(enemy_strength[whatever_enemy_it_is]>(player_defense[whatever_player_he_chooses_to_attack]+player_armour[whatever_player_he_chooses_to_attack]){
        player_hp[whatever_player_he_chooses_to_attack]-=whatever_amount_of_damage_you_want_him_to_do;
    }
    else{
        // code to display a message saying the enemy's attack did no damage
    }
}
else{
    // code to display a message saying the enemy's attack missed
}

Edited by dannyjenn, 12 May 2012 - 03:41 AM.

  • 0

#18 AdrienneMorrisa

AdrienneMorrisa

    GMC Member

  • New Member
  • 12 posts
  • Version:GM8

Posted 13 May 2012 - 04:24 AM

Also, three more questions. First off, I don't have a registered version of GM yet. I know that certain draw functions aren't available, but I'm wondering which ones? Like, can I draw text, but not sprites, or is it all unavailable? Also, are timelines available in the unregistered version?
And last but not least, what's the "standard" way of doing an rpg battle in terms of strength vs defense, adding weapon and armor stats to strength and defense, ect? How would you code GM to say, "His strength is greater than my defense, therefore he does X amount of damage, unless I manage to dodge in time" ect.?

First 2 I can't answer.
Last one can be done in a number of ways. I'd make some variables,
player_strength[0] = something;
player_defense[0] = something;
// do that for player_strength[1], player strength[2], and so on up unti player_strength[7]... the number in the []s is the player.  07 makes 8 of them.
// also do that for defense
player_hp[0] = something; // and again, repeat it 7 more times
Then I'd make some more variables,
player_weapon[0] = something;
player_armour[0] = something;
// etc.
Then make stats for the enemy as well... this can get even more detailed if you choose to give the enemy weapons / armour as well, although this is unnecessary since you can simply give him a hgher base number. So something like
enemy_strength[0] = something + something_else; // something being his attack strength, something_else being his weapon power-up
enemy_defense[0] = something + something_else; // same thing basically
enemy_hp[0] = something;
Dodging really depends on the wy you choose to do it... you can simply say "you have a 10% chance of dodging" or you can make it action-based like Paper Mario. Assuming you go for the random probability way, the code you'd use for calculating damage when the enemy attacks would be something like
dodge = .1;
success = random();
if(success>=dodge){
    if(enemy_strength[whatever_enemy_it_is]>(player_defense[whatever_player_he_chooses_to_attack]+player_armour[whatever_player_he_chooses_to_attack]){
        player_hp[whatever_player_he_chooses_to_attack]-=whatever_amount_of_damage_you_want_him_to_do;
    }
    else{
        // code to display a message saying the enemy's attack did no damage
    }
}
else{
    // code to display a message saying the enemy's attack missed
}

Okay, I think I get it. But what if at one part of the game, I only have one person in my party, and then later, I have all four party members? I assume that would involve an if statement somewhere, but what would the code be? random, choose, switch...? (I found some GML tutorials online, so that's helping, but I'm still not sure what's used where.)
  • 0

#19 dannyjenn

dannyjenn

    GMC Member

  • GMC Member
  • 2736 posts
  • Version:Mac

Posted 13 May 2012 - 12:49 PM

Edit - changed the code a bit. I was forgetting something...

Okay, I think I get it. But what if at one part of the game, I only have one person in my party, and then later, I have all four party members? I assume that would involve an if statement somewhere, but what would the code be? random, choose, switch...? (I found some GML tutorials online, so that's helping, but I'm still not sure what's used where.)

An if statement is not really needed in this situation, as you can use variables / for loops to set all values at once raher than making separate statements setting them for each situation. Here's how I'd do it -- in the very beginning of the game I'd do something like this:
global.MAX_PLAYER = 7; // 7 because 0–7 makes 8 ... global.MAX_PLAYER never changes.  You could use a constant for this purpose, but I really don't know how to use them so I just use global variables.
global.MAX_PARTY = 3; // another "constant"... this is the number of characters able to be in your party at any one time.  Again, the number is one less than what would make sense because GM starts counting at 0.  So 3 is 4.
global.current_player = 0; // only 1 person in your party
globa.party[global.current_player] = some_string_or_number_to_identify_that_person;
for(a=0;a<=global.MAX_PARTY;a+=1){
    global.party[a] = noone; // noone is a built-in constant that returns -4... basically I'm using it to mean an empty slot in the array.  Since all slots are empty, no one is currently in the party
}
for(a=0;a<=global.MAX_PLAYER;a+=1){
    global.player_strength[a] = 0; // initialize the Strength stat of each possible party member
    global.player_defense[a] = 0; // initialize the Defense stat of each possible party member
    global.player_hp[a] = 0; // initialize the HP stat of each possible party member
}
global.player_strength[global.current_player] = whatever; // set the Strength stat of the only party member
global.player_defense[global.current_player] = whatever; // set the Defense stat of the only party member
global.player_hp[global.current_player] = whatever; // set the HP stat of the only party member
Then whenever a new guy joins the party
global.current_player += 1;
globa.party[global.current_player] = some_string_or_number_to_identify_him;
global.player_strength[global.current_player] = whatever; // set the Strength stat of the only party member
global.player_defense[global.current_player] = whatever; // set the Defense stat of the only party member
global.player_hp[global.current_player] = whatever; // set the HP stat of the only party member
That would work, assuming you only add party members one at a time and you don't add two at once or something (but if you do add two at once you can always just copy and paste that code a sceond time... or better, you could have the code in a script and just call the script a second time).
About the global variables -- I used global because they are easier for this purpose. Instance variables would also work but they should be in a controller object (in this case, a persistent object that is never destroyed).

So anyway, that code handles setting the values. During the battle, youll need to make comparisons between the correct variables. To do that, first you'll need two new variables (don't need to be global as long as they are in a controller object in the battle screen room)
enemy_target = determine_enemy_target(); // determine_enemy_target() being a function that you've written to choose which of your party members the enemy will attack.  You can simply determine it by doing floor(random()*(global.current_player+1)) or you can write some AI for him to make a strategic decision
player_target = whoever_you_want_to_attack; // being determined through the player's selection
And then just use code similar to what I mentioned before (with whatever_enemy_it_is being replaced by player_target and whatever_player_he_chooses_to_attack being replaced by enemy_target)

And then basically to switch characters that are not currently being used with the 4 that are in your party, just change the values in global.party[]. For example, if the starting character is "Bob", the second one to join is "John", the third to join is "Sue", the fourth to join is "Roger", and the fifth to join is "William" then only the first four would appear in the global.party[]. So just do something like global.party[0] = "William" to switch him with "Bob"... global.party[1] = "William" to switch him with "John", etc. You should probably also make a similar array for the inactive people, that way it would be easier to figure out who is available to switch to without using tons of if statements.

Edited by dannyjenn, 13 May 2012 - 08:10 PM.

  • 0

#20 AdrienneMorrisa

AdrienneMorrisa

    GMC Member

  • New Member
  • 12 posts
  • Version:GM8

Posted 14 May 2012 - 02:35 AM

Thanks so much for all your help! I still have a lot of questions, since I'm still new to programming, but I think those questions belong in a different section of the forums, and only after I've looked up some tutorials to see if my question has already been answered. lol.
  • 0

#21 Yal

Yal

    Gun Princess

  • Global Moderators
  • 8625 posts
  • Version:GM:Studio

Posted 14 May 2012 - 08:24 AM

Timelines are Lite, and as of GM'81 you can use draw_sprite_ext(), which lets you draw a sprite that's stretched AND angled. The main drawing thing not available in Lite is drawing color-blended (gradient) stuff, but it's not really vital for making the game look good. (I really like making my text look metal using gradient text drawing, but it's not really the selling point of GM Standard).

The one big thing that Pro offers are Data Structures, though, and the main good thing with those are that they're faster than arrays, especially if you're gonna do lots of maths with them since there's built-in area operations saving you from having to for-loop through them. But for a simple RPG, you can likely do without them.


As for formulas, I would use a system like this:
  • Each characters has the stats MAXHP, MAXSP, ATK, DEF, MAG, RES, HIT and EVA.
  • Each character also have eight more stats called BASEMAXHP, BASEMAXSP, BASEATK, BASEDEF, etc.
  • Each character starts out with all stats being equal to their base stats.
  • Whenever a character levels up, their stats gets increased with 0.5 times the appropriate base stat. This means that stats aren't integers most of the time, but don't worry about that. Just display the floor() of numbers in menus, it looks prettier than decimal numbers. HP gain is larger, though, you gain 2x your base stat of MAXHP each time you level up.
  • When you equip an item, it increases your normal stats and not your base stats. When you unequip it, all stats are decreased instead. (If you make an item equip script, give it another argument that lets you multiply all stat change values with either +1 or -1, that'll let you unequip stuff easily)
  • The damage formula should be something like this: damage = ((((player attack stat)*attack buff factor + attack bonuses)^2) / ((enemy defence stat + defence bonuses)*defence buff factor))*(elemental damage multiplier)*(all other damage multipliers)
    As you can see, ATK values grows quadtratically while DEF values grows linearly, which means that later in the game you have high numbers of damage while early in the game you have low numbers.
  • The hit formula should be something like this: HITBASE = (your HIT*(0.5*hitbonusmultiplier + random(0.5)))/(max(1,target EVA*(random(0.5) + 0.5*evadebonusmultiplier)))
    The chance to hit is 1 - exp(-HITBASE), so you could compare random(1) with 1 - exp(-HITBASE) and if the random value is smaller, the attack hit. As you can see, if HITBASE is near zero the chance to hit is around 1 - 1 which is zero, and for large values of HITBASE (where HIT is a lot larger than the enemy EVA, or if the enemy EVA is near zero) the chance to hit gets closer and closer to 1, but never actually reaching there.
    Specifically, if HITBASE is 1, the chance to hit is 1 - exp(-1) which is 1 - 1/e which is around 67% or two thirds.



Oh, and don't listen to DannyJenn about switching the values of the party characters altogether! It's much better to make one static array where you store player data, and then make another array for the party that just stores the index of the player data array where all the player data is.

Example:

global.party[0] = 6

we go to the playerdata array in position 6 and see:
global.name[6] = "Lucas"
global.sprite[6] = spr_lucas
global.hpmax[6] = 401
global.hp[6] = 325

...and so on. We now know enough to draw the status card for the first-place party member.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users