Okay, so for about a couple months now I've been working on a turn based RPG. Now, there is a little more to it than just that. There are some real-time elements mixed in to make a little more (I doubt anyone likes a game where everything is based on RNG). Instead, every attack is based on the player's skill to execute (or dodge) the attack. I'd show you photos of a battle, but that is pretty hard at the moment due to a major flaw:
I can't figure out for the life of me how the attacks are supposed to go back and forth between the player and the enemy. I've made almost every attack for the first area (and the menu while attacking), but I just can't seem to figure it out. I'm probably missing something simple here, but I would like some help, and/or a /very/ simple example I can learn from. XDOn to the second question (more of an aesthetics thing). I've been trying to make the overworld, but my levels look a little messy. It's 3D at a 45 degree angle (fake 3D), and I put walls and stuff up, but they sometimes block the view. Should I just change the room layouts and make the front walls invisible?The code to determine what order the enemies and player(s) attack in. Work in progress
speed=999
while (done!=6)
{
speed-=1
if (speed=={have to grab the object name}.speed)
{
done+=1
{object name}.turn
}
}
The turn based code. Still a bit long and bulky for my taste, but thank you Pirate-Rob! (complete)
i=0
while (i!=6)
{
if (Attacking[i]==2)
{
if (Attacking[(i+1) mod 7]!=3)
{
Attacking[(i+1) mod 7]=1
Attacking[i]=0
}
if (Attacking[(i+1) mod 7]==3 && Attacking[(i+2) mod 7]!=3)
{
Attacking[(i+2) mod 7]=1
Attacking[i]=0
}
if (Attacking[(i+1) mod 7]==3 && Attacking[(i+2) mod 7]==3 && Attacking[(i+3) mod 7]!=3)
{
Attacking[(i+3) mod 7]=1
Attacking[i]=0
}
if (Attacking[(i+1) mod 7]==3 && Attacking[(i+2) mod 7]==3 && Attacking[(i+3) mod 7]==3 && Attacking[(i+4) mod 7]!=3)
{
Attacking[(i+4) mod 7]=1
Attacking[i]=0
}
if (Attacking[(i+1) mod 7]==3 && Attacking[(i+2) mod 7]==3 && Attacking[(i+3) mod 7]==3 && Attacking[(i+4) mod 7]==3 && Attacking[(i+5) mod 7]!=3)
{
Attacking[(i+5) mod 7]=1
Attacking[i]=0
}
}
i+=1
}
You're going to have to write an entire engine for a turn-based RPG with some variable that keeps track of the current turn, adjusted by how many player and enemy characters there are on the field. I know we have a few people here developing turn-based games, but I don't recall seeing any examples on the site. As far as how to make them "go back and forth", I'm not sure what you mean.
Regarding your second question, I'd recommend at least implementing an obscurity check that fades out walls between the camera and the player. Additionally, if you have a wide playing area, removing the walls at the bottom-most border is probably a good design decision. But that's really up to you.I didn't know there were other people on here doing that. I'll have to keep my eyes a bit more peeled. That way, I can get in touch with them if I need help down the road.
Most of the rooms are broken up into smaller chunks and/or large open spaces with very little that sticks up enough to obstruct the view.Thank you for your attention.Use arrays!
Do it.Do it now.I'll do it later. For now, feel free to view how /not/ to make a turn based RPG system!
There are many more ways to not do something than there are, so that's kinda useless :P
Well, now they can see how to make a turn based system. The code is finished, although still a bit long in my opinion. Oh well. That's expected with a turn based rpg. :p
Now I just have to finish up the sprites, and I can make a demo! Yay!I /did/. 64 digits won't keep the formatting.
i'm knee-deep in a year-long RPG project, that's pretty much complete as far as the engine goes. I just haven't been working on the content as i've been more busy with my FPS engine. That being said, if you have any very specific questions, you can PM me any time. My RPG project is a traditional turn-based jRPG with a few twists in the leveling/skill system. I can't say i'm super experienced but my engine is solid so i should be able to help out on anything turn-based related.
Me and RPG-programming really clicked, i had a much easier and more enjoyable time working on the engine for that project, than i do with FPS or anything physics related. Also like Kilin, i have no idea what you mean by your 1st question and i agree with Kilin's suggestion for the 2nd question.i'll take a wild guess and say you're having trouble with cycling through turns. So my first question to you is, do you have a turn order? How many characters are active in the battle? What determines the characters turn order and are you storing this order in a data list? I guess not, other wise you wouldn't be having any trouble since if you have the turn order in the data list, it's as simple as returning to the top of the list every time you reach the bottom. (while also updating the list when necessary)Assuming you're doing this in GM, I've always used a ds priority list for turns. Just give every character on battle a speed value and add them to the priority list, the game will handle the turn order. Just update the list when changes happen such as characters doing or speed changes and scroll through it whenever an action has been finished.