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.

Newcomers DBPro Corner / Role-playing games: Experience and levels in DarkBasic

Author
Message
hoopzbound
21
Years of Service
User Offline
Joined: 4th May 2003
Location: United States
Posted: 4th May 2003 22:06
I have a question about DarkBasic. How do you do create levels and experience for a role-playing game made with DarkBasic. I looked through the little showcase of games and there are maybe 3 role-playing games. Maybe. I can't find any tutorials for it either, and it doesnt seem that DB is that capable of creating 3rd person RPG's, with magic and swords but no guns etc. It looks like it can only make 1st person shooters or arcade and puzzle games. Well getting to the point, can someone please tell me if there is a tutorial for levels and experience. If not, could someone maybe tell me how this might be done? Thank you for your time! [b])
D Man
22
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Germany
Posted: 4th May 2003 22:12
DarkBasic is a programming language that meens it is capable of everything.
There is no tutorial for levels or experience because the way is the goal.
You have to code your own system.

God is real, unless declared integer.
hoopzbound
21
Years of Service
User Offline
Joined: 4th May 2003
Location: United States
Posted: 4th May 2003 22:20 Edited at: 4th May 2003 22:22
Oh. So it's sort of educational...??? I'm so confused. So your saying there is no tutorial because i have to figure it out myself? Are you just saying that because you dont know? lol Just kidding. Anyhow...Where would i start? To figure it out I mean?

RANDOM SQUIRREL!
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 4th May 2003 22:25
Darkbasic is capable of anything you throw at it, the only limiting factor is the skill of the programmer.

Experience and levels arent that hard. Basically, what you'd want is to plot out a serie of values that if reached, powers you up a level. How much you want for each value is up to you. One example would be to use the formula 10x(x-1), which would let you level up for level 2 at 20 exp point, 3 at 60 exp etc. This is entirely up to you how much difference you want between each level. So lets for example-sake use this formula. You start off with 0 exp. You beat an enemy who gives you 23exp. You use a variable, lets say playerExp, and you increment it by 23, bringing it up to 23. Then you run a routine comparing it whats needed, i.e. you're at level one, so you need to go to level 2. So let level = 2, then calculate:

if playerExp>((10*level)*(level-1)) then inc level

thus increasing the level. Then for stats, you can add a random value to each everytime you level up. So let the maximum they can get for a stat be 4. You have a stat called attack, so when you level up, you use:

attack=attack+(int(rnd(4)+1))

and do this for every stat. This is just simple code, it can be made more efficient but I'll leave it to you to figure the rest out.

Cheers,
Kentaree

Whatever I did I didn't do it!
hoopzbound
21
Years of Service
User Offline
Joined: 4th May 2003
Location: United States
Posted: 4th May 2003 22:29 Edited at: 4th May 2003 22:30
Thank you much

RANDOM SQUIRREL!
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 4th May 2003 22:32
No problem

Whatever I did I didn't do it!
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 5th May 2003 00:01
Thanks Kentaree, exactly what I need for one of my game ideas. Mind if I play around with the code to learn a bit? I want to try & create a full level up system, & if I get anything, I will post.

Thanks again,

Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 5th May 2003 00:04
No problem. Also, another useful suggestion is to use arrays for the stats, which is far easier and efficient than using lots of different variables.
Use something like

dim stats(numberOfStats)

Also, if you're using multiple characters, you can use

dim stats(amountOfCharacters,numberOfStats)

Cheers,
Kentaree

Whatever I did I didn't do it!
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 5th May 2003 00:11
Great, thanks for the help Kentaree, both of those ideas will come in handy, but I will have to wait till later today or tomorrow to start to play around with the codes, as my parents just got back from a long trip yesterday & we all were going to do some stuff today.

Thanks again,

Superbeest
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: Netherlands
Posted: 5th May 2003 00:33
And types are very handy too. Just declare a type and then make a variable use it. Sooooooow easy.

By steel will thy flesh divide
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 5th May 2003 01:09
A type? Can you provide an example code from the index Superbeest?

Thx,

hoopzbound
21
Years of Service
User Offline
Joined: 4th May 2003
Location: United States
Posted: 5th May 2003 05:54
Hey can anyone email me some example code so I can get started? I mean I understand what numbers to punch for the variables but I'm still a little fuzzy, especially on the arrays. I need a little boost right now. I'm sort of defying what D Man said, which is that I have to figure it out myself. But I don't want to spend forever on this. This takes patience, and I tend to give up after a long time. So anyway, if there are any kind soulds and wise brains out there please email me at hoopzbound2@netscape.net Thanks!

RANDOM SQUIRREL!
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 5th May 2003 06:09
I guess you could use a type to hold everything about each character. Rather than use multi dimensional arrays you give a variable a number of properties. Integer,Byte,String are all TYPEs and are the way data is stored in variables. What you can do (dbpro) is declare your own type.

Where did his Ak-47 go.
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 6th May 2003 01:18
Hey hoopzbound, I am making a trade with someone for a simple RPG code. Once I finish the model he wants, I can possibly email you or something with the example code. All it is, is a bunch of variables, with a few other things, but its a Morrowind Style RPG script, for those who know what that is. I cant explain on the forum, as the post will be very long, it took me about 1.5 hours to explain it all to the guy who was making it.

So, if you want to see the morrowind Style code, add me to MSN IM or email me sometime. All of my addresses should be in my posts, so read it if you want me to send you the code, when ready, & if you have MSN IM or ICQ, add me.

hoopzbound
21
Years of Service
User Offline
Joined: 4th May 2003
Location: United States
Posted: 6th May 2003 01:39
Wow thats good. I don't have ICQ or MSN though so I cant IM you Well anyhow I might email you but currently I am busy in game development. If i get stumped i will find time to see your code.

RANDOM SQUIRREL!
Eaglesoul
21
Years of Service
User Offline
Joined: 7th May 2003
Location: Finland
Posted: 7th May 2003 10:23
I guess you should find yourself (A)D&D ((advanced)dungeons & dragons) rulebook somewhere. There you can find all about experience and leveling systems that are used in almost all role playing games..



These site could be useful in any common things in RPG
http://www.saintsilver.com/zayix/index2.html
http://villa.lakes.com/JamesStarlight/SecTertSkills.html#ITEM%2016
http://www.geocities.com/lordstevil/adnd.html



Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 7th May 2003 14:00
Do most RPGs use that kind of formula? i.e. a quadratic one.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 7th May 2003 14:53
Good example Mnemonic (hey I actually saw that word yesterday so I know what a Mnemonic is now ) So for experience, in each enemys data you would have something like "Experience" and if you kill that enemy then you take your characters experience level and subtract from that the variable of the enemies experience given.

RPGamer

Current Project: Eternal Destiny
Tech Demo - Colan Island: Currently 716 Lines
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 8th May 2003 00:01
Here is a quick example that I recieved yesterday of a simple level up system. You can keep cloning the code, & making changes, so that you can make as many skills as you want. It seems to be similar to AD&D, but even more similar to Morrowind.

Armeggadon
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 8th May 2003 00:09 Edited at: 8th May 2003 00:09
wow this is perfect come to post a wuestion about his exact thing and someone els already did it. kewl.

@Shadow that code will come in very handy for me so thx

Current Status: learning MORE about dbpro
I consider myself: newb
Hamish McHaggis
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location: Modgnik Detinu
Posted: 8th May 2003 00:29
Hey, if your fuzzy on arrays then there is a tutorial on my site (below), it would be good if you don't understand anything to just email me and tell me. Hope it helps, thanks!

Why the hell'd you ask me for crying out loud!?!

Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM
Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 8th May 2003 17:55 Edited at: 8th May 2003 17:58
I've found I've learn some good tips from playing Neverwinter Nights - the instruction manual actually explains how the maths works in the game.

I could probably make an RPG; the only problem is making graphics for it (and the whole mechanics of the game world). The other bits would not be that hard.
Fluffy Paul
21
Years of Service
User Offline
Joined: 16th Dec 2002
Location: United Kingdom
Posted: 8th May 2003 18:29
Can I just suggest that you write stuff up on paper before hand?
Like, actually write down a list of stats, and what they're for.
If you have a clear idea of how it should all work then coding the mechanics isn't a problem. I even go as far as to produce a mini pen and paper tabletop roleplay version of my program and invite some friends round to "play" it. That's a really good way of thrashing out problems and inconsistencies. Plus, it means you can change your mind about things really easily. Once you have over a 1000 lines of code it becomes harder to go back and change something you're not happy with. My Final Year Project was in DBPro and was 8000 lines of code. There was a slight bug which I couldn't fix basically because I couldn't find it! That was a few weeks ago and I still can't find it!

Ending a sentence with a French word is so passé

Login to post a reply

Server time is: 2024-11-24 13:42:59
Your offset time is: 2024-11-24 13:42:59