Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Text Based RPG. NEED HELP!

Author
Message
Nerd In Training
16
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 26th May 2010 16:36
I need help with the game flow for the rpg. I'm working on the battle, but I can't figure out how to make it work.

If x=y then we're all doomed.
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 26th May 2010 18:19 Edited at: 26th May 2010 18:20
I would advise breaking it down to small components and implement them using gosubs and functions.

First thing I would suggest is learning how to use types. This way you can bundle all your data into one type for let's say a monster the player encounters.



A battle can be called by using a gosub.
For example:


If the player attacks you can build functions like


Of course, you also need the basics. But if you master these concepts you should be able to make a good text based RPG.

I'm rooting for you

Cheers!
Sven B

Devonps
16
Years of Service
User Offline
Joined: 5th Nov 2009
Location: Nottingham
Posted: 26th May 2010 21:05
I've started a Roguelike and my main loop consists of



BTW this loop is for my test-bed and not my main game.

I would look at combat as a series of steps, such as:

1. Make preparations for the upcoming combat, e.g. choose weapons.
2. Calculate base damage based on chosen weapon + PC modifiers
3. Add item/spell/skill/etc modifiers to the %chance-to-hit & damage-amount
4. Calculate the opponents %chance-to-block the incoming attack
5. Calculate if the attack actually hit the opponent
6. If hit=true then apply the precalculated damage minus any situational modifiers (you might employ).
7. Check for end-of-combat situations, e.g. zero HP, etc
8. Rinse and repeat.

This is a quick and dirty approach but it's generally how combat is resolved in RPGs, there are lots of things I haven't mentioned such as pet/ally support during combat, skills expiring, spell casting which can all happen as part of a turn during combat.

Good luck and hope this helps,

Steve.

Marriage is a circle of rings....
Engagement ring, Wedding ring, Suffering!
Dark Dragon
19
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 27th May 2010 02:48 Edited at: 27th May 2010 04:20
Good to see I'm not alone(in the quest to create an awsome RPG).......... I always have sub-projects and and a RPG(it's.......not exactly text based....) is one of mines at the time. I can post my entire project for ya if you want(I always throw my source at people, lol.). You gotta wait a while, tho, i'm usin a phone atm and as you can see im gettin lazy wit da typin.....

L8tr, I'm gonna ask a question anyway, cuz I's kinnda....stuck. so look out for a new thread wit my name on it....i'll upload it(and probly source) therre.....




EDIT}}}}}

Okay, So lookie here at my code. You can see I havent bothered with cleanning But you'll get the basics of my system, i Think. you need an explaination, I'll give it!




Hope it helps a bit.

Nerd In Training
16
Years of Service
User Offline
Joined: 13th Feb 2010
Location:
Posted: 28th May 2010 16:20
Thanks for the advice everyone. Dark Dragon that's a HUGE code. Do You really need so many spaces. Sven B why is the intager thing better? Also ran into another problem here is the code that is causing this.

I run into problems at the choice1 line

If x=y then we're all doomed.
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 28th May 2010 18:35
Quote: "Sven B why is the intager thing better?"


The integer-thing is entirely up to you. You can use floats if you want. But usually, RPG's work with HP, which are integers.

This:


is not valid DBP code. This however:

is.

Also, is this normal?: ehp1=eph1-ggc1#
Anyways, I think it might be better to use slightly longer variable names.

Cheers!
Sven B

Dark Dragon
19
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 28th May 2010 19:46
Quote: "Thanks for the advice everyone. Dark Dragon that's a HUGE code."


Sorry bout the spaces, thats kinnda just how I do. Sorry!

Flatlander
FPSC Tool Maker
19
Years of Service
User Offline
Joined: 22nd Jan 2007
Location: The Flatlands
Posted: 28th May 2010 20:02 Edited at: 28th May 2010 20:10
NIT, I'm not suggesting you spend any more money, but if you are doing an text based RPG, then the plug-in "Unity" could be quite helpful. It incorporates "LUA" and it has other features that could be useful.

It requires you to learn some more commands but if you can't learn the programming commands then I don't know what to say.

Addendum:

Quote: "Anyways, I think it might be better to use slightly longer variable names."


Yup, makes it easier to debug and to know what's what. Here are just a couple of examples of my variable names. If you can't type very fast then I understand that is a handicap for longer variable names. I'm a touch typist and can type fairly fast so it's easy to use long variable names (and some of mine are even longer than the ones that follow.)

global rpg_currentinvitems as integer
global rpg_missioncomplete as boolean


BTW, I also like to define all of my variables using global and local.

Login to post a reply

Server time is: 2026-07-25 17:31:19
Your offset time is: 2026-07-25 17:31:19