Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Logic behind Turn based combat

Archive: 10 posts


So does any know how to make the logic on how to do turn based combat like final fantasy 7 or X-Nobody-X's Little big fantasy Goddess war? like I want to know the following things
-make the game sense that its the player's turn
-make the game sense that its the enemy's turn
-after a party members turn is finish make it the other party member's turn
-random battles (not really, just like when you reach an area it goes to battle mode)
-go from *over the head view* to side scroll view when its time to fight
and if you know how to do it, can you please make it detailed?
2011-08-12 03:32:00

Author:
wait wtf
Posts: 853


-make the game sense that its the player's turn
-make the game sense that its the enemy's turn
-after a party members turn is finish make it the other party member's turn


And, presumably, making a group of enemies take turns the way the player group takes turns. And take into account that the size of both groups may vary for each fight and even during a fight (like when an enemy or a party member dies).

I'd base this on a 2-way selector to switch between enemy A.I. and user action to start with. Both enemies as party members could carry an 'active' tag (and ID's them as an enemy of a friend) and a tag (or impact) sensor that registers when it is their turn to make a move; now, you'd have a cursor object (I like to call them that), one for enemy, one for friends, that when activated by the first selector, searches and follows player/enemy 'active' tag and carries a tag itself that on impact with the player/enemy activates their turn; after a player/enemy's turn expires, they turn off their 'active' tag causing the cursor to move onto the next player/enemy. When no more 'active' tags found, it returns 'home' and causes the selector to cycle.

This method avoids hard coded logic for size and allows enemies (and players) generated (emitted) from a single template. With this you'd have to only create a type of enemy once and emit it in groups of variable sizes as you see fit.

As a side effect, you could make the sursor actually look like a circle or an arrow to indicate to players which party member or enemy is currently taking turn.



-random battles (not really, just like when you reach an area it goes to battle mode)


Event triggered by a randomizer. You will have to make the probability of such an even happening way lower than it not happening. Look into comphermc's video tutorials for that. It is easy.



-go from *over the head view* to side scroll view when its time to fight


Switch cameras between two parts of the level, of which one is the stage for battle; this stage would have logic to generate different backgrounds and enemies.



and if you know how to do it, can you please make it detailed?


You will have to work most of this out yourself. It will be very complex and unless you invest time and effort in gaining knowledge, experimenting and improving your skill it is likely that you will abandon this project for its complexity. Make yourself no illusions: only a few creators have come near to doing this and I bet one of them right now is working frantically on an RPG masterpiece, struggling with similar problems.

These questions above, interesting as they are, will not be your main problems; they might be your first concern, but the real deal comes with the size of an RPG, the generic logic systems it requires to keep it scalable, the thermo and last but not least: save-games and cross-level data transfer.

If you really want this, don't give up.
2011-08-12 07:35:00

Author:
Antikris
Posts: 1340


Probably already answered but what the heck

So does any know how to make the logic on how to do turn based combat like final fantasy 7 or X-Nobody-X's Little big fantasy Goddess war? like I want to know the following things
These are very diffferent systems as one is ATB and one is turned based. They are wired VERY differently, trust me.
-make the game sense that its the player's turn
For Atb: Have an actiopn gauge and make sure that it will not interfear with any other guages. When that guage is full have it activate a menu and have what I like to call "menu logic". Repeat for all allies. Enemies should attack at given intervales yet an enemies attack musn't intefear with an allies (it can be a mess). It's hard to state in detail, but if you find a way to do that then you sould have an active atb sys.
For Turn based: Have your "menu logic" like in the atb, but instead of a atb gauge, use a selector that will sense when the turn is over (ie: a tag or someting to activate the next turn. The enemy should have thier own turns , but no time intervals
-make the game sense that its the enemy's turn
Stated above
-after a party members turn is finish make it the other party member's turn
For Atb: for the guages, have the first guage to be filled be the domanant one. This can be done with a few "anti- or-gates" or not gates. iF you find a way to isolate the guages and make it so that 2 turns don't happen simaltainiously, your good on tis front.
For Turn-based: stated above
-random battles (not really, just like when you reach an area it goes to battle mode)
Either through:
- emition where the emited battle activates a tag sensor that causes your field character to stop moving.
- Buy activating the general "non-emited" battle and making it so that the other controlinators aren't functional.
-go from *over the head view* to side scroll view when its time to fight
These are 2 totally different things. The over head view is one part of the level, the side scroll is another. see above for how to transition. Use Movie cams and set to No disability of controller.
and if you know how to do it, can you please make it detailed?

In referance to this "menu logic" It is logic that can navigate a menu and click icons.
There are 2 ways of doing this (though these can have veriants)
- Cursor point
and
- selector point

Cursor point uses a specific cursor that moves with the analog stic or directional pad. It must have 2 tags to work: a click tag and a selection tag (to know what your are about select.
It is hard to keep this logic in a certain place and is clunky and a thermo-hog. I would notrecoment using this for an RPG.

Selector point uses 2 selectors aswell as "and gates" to work.
Have one selector for the vertical and one for the horisontal. have your sticks/ d-pad conect to it in corrispondance. have rows and collums of corrisponding and gates (ex 3 vertical and 3 horizontal= 9 and gates.)

For clicking, have another similar set of and gates. Hook the first and gates to the second ther hook an X-button "pulse generator" (a counter set to 1 and resets) to each of the and gates in the second set.

That's as far as i'mma go with this, so.... ya

Sorry if some of the stuff said is confusing. But here's some advise: Try what you can, and if it doesn't work, figure out the flaws and keep working. Trial and error
2011-08-12 08:44:00

Author:
a_mailbox
Posts: 416


And, presumably, making a group of enemies take turns the way the player group takes turns. And take into account that the size of both groups may vary for each fight and even during a fight (like when an enemy or a party member dies).
If you really want this, don't give up.

This is the most important advice you could get when attempting this. Turn based combat can get frustrating, but once you get the learning curve, they are very fun to make. Personally, I feel you want to stay away from FF VII's style ATB--for now. Presuming you want it like that, and not like FF X-2. A lot of people confuse those two ATBs and they are very different with the FF VII taking a way longer explanation.

Something like Nobody's rpg, may be easier considering its one on one Turnbased. Start small; dont make the same mistake i did and try to make something super complex starting off. It gets much easier to create more complex systems after you establish the basic player chip and enemy chip which can easily be duplicated to more party members and monsters, and experimenting with different variables for characters and enemies receiving turns is the second thing you have to learn. I call these battle chips. Its separate from the characters and enemies and controls the flow of battle( Turns, death, everything). So essentially you have to create Battle Logic and Menu Logic-- I think these guys have gave you all you need to know, for now--however, i would recommend having all of your logic, and menus controlled by tags.

The thermo is your worst enemy when making RPGs, and having a fully emitted battle system is essential to implementing random encounters. I could walk you through, but it would be an awful lot of text and it could get very confusing considering i am a rather bad teacher. Its better if you just get in there and start experimenting. Im not sure exactly what you are looking for with your battle system, but hopefully it turns out how you want it.

Those are two completely different style systems though and im not sure which you prefer. In fact, my first rpg was completely turnbased, and if you seen the logic on my main page--its going to be that much..in a party combat turnbased system. Death logic= a nightmare at first lol Im no pro though. You dont have to be a genius to make Turn based combat, and they arent as hard as people may think. It just takes will. Dont give up dude, it gets fun, trust me

---ATBs have easier Battle Chips and are easier to convert more party members

---Turn Based have more complex death logic and would require more restructuring to fit more party members. However, its way easier to keep clean than ATB.

Hopefully, that helps you decide which to do first.
2011-08-13 06:17:00

Author:
Rpg Maker
Posts: 877


okay im kinda getting git, but im still having trouble with the combat.Like when i press the attack button it will do the animation, like them holding a sword, running up to the enemy and do a couple of slashes and then running back2011-08-13 21:55:00

Author:
wait wtf
Posts: 853


okay im kinda getting git, but im still having trouble with the combat.Like when i press the attack button it will do the animation, like them holding a sword, running up to the enemy and do a couple of slashes and then running back

Well i can try to help you from here, i dont have no access to a ps3 currently...

Are you using followers or guides? Running up to enemies should not be a set animation, and even if it is, it should be guided.


Personally I use Followers, but you can do this by using Sackbot Logic as well. ( Followers allow faster characters like FF 7, Sackbot behaviors speeds only go up to 150, however, its easier to use)

First, establish the conditions for which the character receives an attack; As i mentioned, you have to choose between ATB or Turnbased. However, for the sake of time, i will assume you are doing something like Nobodies RPG.

This is one on one and the most basic form of turnbased combat, so this should be easy--theoretically. Some of the guys covered menus, so lets get you attacking.

I dont use selectors for one on one because they arent needed. I suppose a selector is the best way to explain though.

1. One on One battles
Have a Selector set to 2. The first Selector is the Player's turn and the second output is the enemies turn. Now, you want your command menu to be activated ONLY when the selector is on the players turn ( one). I would even delete it during the enemies turn( Remember, with random encounters, you want everything activated via tags, so you can emit them and delete them when they are necessary) Hook up a tag to each selector output and label it ( Command--or whatever you want) This will ready the character to respond to commands and activate your menu. ( Im assuming you created a menu)

Now Attack is traditionally the first thing on the menu in RPGs, so an attack tag should be activated on the battle character when the the player selects it

2. Guides and Followers
Now that you established what tells the character to attack, We want that tag to activate a follower, not an animation sequence. Set the Attack tag to activate a counter (set to one) that is hooked up to a follower/sackbot follow. This is make the character tun toward the enemy. Now what you do is set a different Tag that will activate the animation sequencer when the character is in range of the enemy( Thats up to you, but large enemies or complex ones should have hit boxes to avoid collisions.) AND reset the counter activating the follower. This can be the same label you use for the follower since it resets it.

Explanation for not using pre set running animations:
(It offers more flexibility and customization and just looks better than pre set animations. You can have them target enemies of all shapes, sizes and distances without having to make completely new animations sequencers. Adding more members and death logic, its essential to have and a more efficient way of controlling battles.)

Note: If you do use followers instead of sackbot "follow" behavior, disable up and down movement and enable layer change. You also want have the tag that activates attack to pulse an Anti Gravity tag or put it at the beginning of the animation. Of course, for more wild attack styles, you dont have to turn anti-gravity to maximum, but you would probably want the tag that activates the attack sequencer to be larger. Ultimately, this will avoid collisions and anti gravity tweaker is your best friend in that regard. I personally use Followers over Sackbot follow

3. Resetting the characters original position.
Now after the animation sequencer plays( This is whatever slash or combo you wanted), put a battery at the end of that animation sequencer. Much like before, this will activate a counter( also set to one) that activates a follower set to follow a tag that guides them back to their original position( I call it Reset). And of course resetting that counter when the characters are in range of that Reset tag and then you want to activate a tag that says that characters turn is up( I simply call it, End Turn)

4. Flow of Battle
Now this tag will be hooked to selector 2 INPUT, directly not cycle. However, it really doesnt matter in one vs one i suppose. When this End turn is activated, now its time to do the enemy.

Enemies of course do not wait for command entries, so they should just activate whatever attack you want after the player sends out his end turn. The tag you set to selectors 2 output is what will prompt the monster to attack.

You can duplicate the follower logic you used for the player and put it on the enemies. Of course, you will switch it to target enemies so it wont end up swinging on its self.

Once the enemy is in range( Stationary opponents wont need follower logic). As before, at the end of the enemies attack animation, you activate a battery to reset the enemies position and then end the turn. Now this tag the enemy activates will be set to the Selectors first INPUT ( the players turn).

Then you will see the characters bashing each other around in turn based fashion before long.

And...thats the basic of attacking in one on one fighting. If the Follower logic is confusing, you can use preset animations if you want, but I think its harder personally and find follower logic essential in more complex system, thus i would get used to using it if you were maybe planning something bigger and more complex.
2011-08-13 23:54:00

Author:
Rpg Maker
Posts: 877


Wait...were you already past attacking? You may have to be more specific....2011-08-14 00:00:00

Author:
Rpg Maker
Posts: 877


dam all this logic is making my avatar go crazy!

Wait...were you already past attacking? You may have to be more specific....

what do you mean that?
2011-08-14 01:32:00

Author:
wait wtf
Posts: 853


dam all this logic is making my avatar go crazy!


what do you mean that?

This is as best I can explain attacking--i misread your previous post so dis regard that. However, If you cant get it, then its probably better if someone else explains it. I dont see an easy way to describe a RPG battle system, as simple as this might be. Thats as simple as I can get it

Good luck dude
2011-08-14 03:29:00

Author:
Rpg Maker
Posts: 877


well already finished making the menu, now time for the mindbending work2011-08-14 04:21:00

Author:
wait wtf
Posts: 853


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.