Jump to content


Photo
- - - - -

Rpg Level System Tutorial V1.2


  • Please log in to reply
26 replies to this topic

#1 jsmithLMSL

jsmithLMSL

    Katamari Devotee

  • New Member
  • 1323 posts

Posted 19 December 2007 - 04:20 PM

Replies to topics in this forum are held to a high standard. Reviews must have a critique or suggestion for use to be approved. Read the rules here.


Title: Level_System_Tutorial version 1.2
Size: .94 KB
File Type: .gmk
Version: Made for GM 7 but includes instructions for GM 6 up
Overview: VERSION 1.2 HAS FINALLY ARRIVED! This level system tutorial shows you how to use global variables to make a leveling system for RPG's, or for other games that leveling could be useful in. Please read the complete list of things you will learn as well as the updates in the list below!

Direct Link: http://host-a.net/js...torial_v1_2.gmk

The tutorial is typed in the games information screen. (F1 in game)

Updates in v1.1:
1) Higher goals; you will now need to reach 100 exp to move to the next level.
2) Status bars; you will learn how to draw variables on screen, as well as show thier status using GM's built in healthbars.
3) More GML; v1.0 featured mostly GML, but drawing the variables in Drag and Drop; We will now code everything.
4) Health and an enemy; Hey... Why not? What's a game without being able to die?
5) New HUD; Create a new, nicer hud to place variable information and status bars.
6) Improved 8 directional movement; you'll see... it's better for sure!
7) Rolling over EXP; In v1.0, if you gained over the current exp goal to level up, you would lose that extra exp that was over the goal. That is now corrected in v1.1. If the exp goal is 100 and you have 75 exp at level one and gain 50 more, you will move up to level 2 and that extra 25 exp past 100 you just gained WILL be added to your level 2 exp.

Updates in v1.2:
1) All values are now relatively added to their designated variables making coding this a lot easier, shorter, and more accurate, also opening the possibilities of more more levels if you the user chooses to add them...
2) I introduced a skill level to the player which is inaccessible until level 5 is reached, but once it is accessible, the player can launch an attack on his enemy objects
3) There is now an attack system for the player which will in turn, update the players skill level (also inaccessible until level 5 is reached)
4) There is now a defense system for the player which changes the amount of damage the player may receive based off of its value (also inaccessible until level 5 is reached)
5) As the player levels up, he now receives an updated sprite (every 5 levels)
6) Per request, I have once again re-typed this entire example. This took me the good part of a day to do, but it is extremely thorough. THIS EXAMPLE IS THOROUGHLY EXPLAINED, FROM EVERY ACTION, TO A DEFINITION FOR EVERY SINGLE EXPRESSION AND STATEMENT USED IN ALL OF THE CODES


7/1/2009 - LOL... thought I'd see if this was still out there in GMC land. Between this version and the first, we're over 4000 dowloads! BUT, for this guy, 3500 and counting! I'm lazy and will not be updating this anymore. Enjoy and if the link is dead, PM me and I would be glad to re-host it!

jsmithlmsl // Joshua Smith

Edited by jsmithLMSL, 01 July 2009 - 10:17 PM.

  • 0

#2 jon sploder

jon sploder

    GMC Member

  • GMC Member
  • 859 posts

Posted 22 December 2007 - 04:39 AM

Its nice but it cancels out XP gained if you get more than you should at the end of the level, its good 4 nubs :unsure:
  • 0

#3 jsmithLMSL

jsmithLMSL

    Katamari Devotee

  • New Member
  • 1323 posts

Posted 24 December 2007 - 12:12 AM

That's a good point... I'll update and turn a 1.1. Thanks for the feedback! =)
  • 0

#4 blasterman_95

blasterman_95

    Blasterman's Army Leader

  • New Member
  • 251 posts

Posted 25 December 2007 - 03:34 AM

jon, I agree, it's good for the n00bs. But it has limitations that a few modifications would fix.

Good example, though.
  • 0

#5 jon sploder

jon sploder

    GMC Member

  • GMC Member
  • 859 posts

Posted 25 December 2007 - 05:05 AM

OK, if you need help (I doubt you do cause its simple) but, I suggest that you make into HP bars. But with the exp bar, instead of when on contact it minus's the variable, it adds to it, and that it variable "current_hp" or something is on 0 in the create event. If you have absolutely no idea what im smoking (no-one does :)) then PM me and I'll give you the code. Also make it go up to lvl 99, I know it'd take forever, but it'd be a time saver, or give me the fixed version with bars, and I'll do it. (I did it to 20)

Again, great example,

Jon
  • 0

#6 Astrosapien

Astrosapien

    GMC Member

  • New Member
  • 473 posts

Posted 30 December 2007 - 04:52 AM

Nice example, but I suggest (for slightly more experienced users) adding set amounts relative to the current amount, as opposed to saying
if level=1
{defense=5}
or something like that, for every single level.

NOTE: I actually got this from another example, but I can't remember whose.

//This works out whether or not the player is over the xp for the next level
if global.xp >= global.nextlevel
{
global.level += 1 // Add 1 to level
global.strength += 1// Add 1 to strength level
global.accuracy += 1// Add 1 to defense level
global.nextlevel += 10 // adds 10 to the amount of experience needed
global.xp = 0 // resets the xp to 0
global.hp = global.level + 9 + global.armor
}

This is just a copy-paste from my game, I didn't really try to make this special to your situation.
  • 0

#7 jsmithLMSL

jsmithLMSL

    Katamari Devotee

  • New Member
  • 1323 posts

Posted 30 December 2007 - 03:05 PM

Astrosapien,

That is a good idea, and actually a real simple fix. I can just start n with a value and add to it through each level. I'll go ahead and slap that in there for v1.2. I will also show speed on screen with another status bar. Another extention: I will be adding a shield variable that say adds 10 relative to it's current value every level we go up, and takes 20 away every time you collide with a comet BUT, for a twist, when the player has some defense/shield (=<20), comet collisions will only take away 1/2 of the normal player damage... Great suggestion adding relative to the current value and thank you for your reply.

(Also, the snippet from your game is informative, but if I were to reset exp to 0 every time I level up, I would lose the rollover exp. If I just subtract the relative amount that was needed to level up, the remainder stays "appearing" to roll over. I guess in the case that a game goes 1 point at a time, this would be sufficient though.)

Keep the great idea's coming everyone!

Josh // jsmithlmsl

Edited by jsmithLMSL, 30 December 2007 - 04:56 PM.

  • 0

#8 LRG

LRG

    GMC Member

  • GMC Member
  • 687 posts

Posted 30 December 2007 - 04:33 PM

why don't you just use a quadratic or linear formula?
something like global.nextlevel=sqr(global.level)*10
  • 0

#9 meziathol

meziathol

    GMC Member

  • New Member
  • 505 posts

Posted 01 January 2008 - 07:32 PM

can i make 3 seperate exp bars using featured codes in this?
  • 0

#10 blasterman_95

blasterman_95

    Blasterman's Army Leader

  • New Member
  • 251 posts

Posted 02 January 2008 - 03:24 AM

I like the new version way better. So, if I use it, who should I credit to?
  • 0

#11 jsmithLMSL

jsmithLMSL

    Katamari Devotee

  • New Member
  • 1323 posts

Posted 02 January 2008 - 11:17 PM

blasterman_95: This would be just fine and thank you.

Credit to jsmithlmsl from the GMC

meziathol: Yes. I have sent you a PM with a quick fix to do this, but I will include this in the new version.

Astrosapien: You are correct so here is the list of updates I have for the next version of this example that is in the making:

V1.2 so far:

1) I am changing the game concept and sprites to represent a more classic style RPG; Though this has no effect on bettering the example itself, I feel that some people may relate more to this in oppose to the planets and stars theme.
2) I will be adding more skills to aquire and build; a great suggestion was pm'd to me that I should add an attack level and a defence level.
3)Astrosapien's post of adding to relative value's in oppose to predetermined values to make for easier coding is on the money and the new version1.2 example will be converted to that method.
4)I will create one single skill that until a certain level is reached, is inaccessible to the player

Thank you all for your creative suggestions and please keep them coming!

-J
  • 0

#12 heyufool1

heyufool1

    Fail

  • GMC Member
  • 1651 posts
  • Version:GM8

Posted 03 January 2008 - 09:07 PM

It's pretty good except i recommend that you add sprite changing and enemy ai and stuff like that then just make it into a RPG Engine.

The only thing i don't understand is that you comment on all of the thing that is easy for anyone to understand like setting the fonts and other drawing options, but you don't comment on the things that can be difficult for new users of GML...
  • 0

#13 jsmithLMSL

jsmithLMSL

    Katamari Devotee

  • New Member
  • 1323 posts

Posted 04 January 2008 - 06:01 PM

heyufool_1: Please post or PM me on what I have not explained thoroughly and I would be happy to add more documentation. You are the only person that has brought this to my attention.

As far as the future of this example, I am going to leave this as just a level system, but I have been talking to jon_sploder on including this as well as some other examples I have made and making a full on RPG example fully documented A to Z. I don't want to list details yet because the idea is only in the works, but it would be a zip with .gmks of all the examples and one .gmk of everything combined and working together.

Thank you for the feedback and I am looking forward to your reply so I can update ""'s documentation to better this example.

-J

Edited by jsmithLMSL, 04 January 2008 - 10:01 PM.

  • 0

#14 jengajam

jengajam

    GMC Member

  • GMC Member
  • 522 posts

Posted 05 January 2008 - 04:45 AM

This is a great, simple, engine which still does the job. I will put this in my game (with modifications).

Cant wait for new version =D

10/10
  • 0

#15 jsmithLMSL

jsmithLMSL

    Katamari Devotee

  • New Member
  • 1323 posts

Posted 07 January 2008 - 05:42 PM

jengajam: Thanks! I'm glad you like it and happy to see it in action. Please PM we when your game is complete; I'd love to see how you utilized this.

-J

Edited by jsmithLMSL, 09 January 2008 - 05:52 PM.

  • 0

#16 jsmithLMSL

jsmithLMSL

    Katamari Devotee

  • New Member
  • 1323 posts

Posted 13 January 2008 - 07:03 PM

Everyone: As promised, I have just released Version 1.2 of my Level Example. I have added as many requests as I could (see my head post) of things that I found to be positive ideas. Check it out if you will and please feel free to post some feed back as I'm curious if there are any other great ideas out there from all of you! Thank you to everyone for the fantastic suggestions and please keep them coming!

jsmithlmsl // Josh
  • 0

#17 RPG Gamer

RPG Gamer

    GMC Member

  • New Member
  • 9 posts

Posted 31 January 2008 - 11:59 AM

This is a great, simple, engine which still does the job.  I will put this in my game (with modifications).

Cant wait for new version =D

10/10

<{POST_SNAPBACK}>


Ditto - This is an incredible system that you've devised.

I'd like to admit, it was difficult sitting here reading through your huge explination without groaning slightly, but some coffee fixed that.

This is certainly the best exp system I've ever seen - If you added in more complex features such as other skills other than fighting, I'd be greatly impressed.. who knows? Maybe it'll be become the top download here.

I will fully credit you for this in my game, and I hope to see more of your work. :D
  • 0

#18 jsmithLMSL

jsmithLMSL

    Katamari Devotee

  • New Member
  • 1323 posts

Posted 01 February 2008 - 03:42 PM

I'd like to admit, it was difficult sitting here reading through your huge explination without groaning slightly, but some coffee fixed that.

That is so very true: When I wrote the tutorial, I wanted to explain everything in the simplest terms that I possibly could and not miss a thing, hence, my own converted definition of every function we use in the example. When I finished and stepped back and proof read the tutorial, I myself sighed too. It is extremely long and seems to go forever, but, I wanted to make sure that everyone, even the newest user of Game Maker, could understand how this works and operates, and learn some GML in the process with thorough explanations.

This is certainly the best exp system I've ever seen - If you added in more complex features such as other skills other than fighting, I'd be greatly impressed.. who knows? Maybe it'll be become the top download here.

That is a very nice thing of you to say and I'm very much obliged by your responce. It's nearing the 1000 mark and growing... I'd like to know a little more about what kind of skills you think would make this tutorial better. If you would, please send me a PM with some of your suggestions and perhaps we can get version 1.3 up and moving.

I will fully credit you for this in my game

I appreciate that and please PM me with a link to your game when you are finished or have made a demo. I would love to see how you incorporated and utilized this system.

I hope to see more of your work.  :(

Same to you! :(
  • 0

#19 anasky

anasky

    GMC Member

  • GMC Member
  • 2 posts

Posted 03 April 2008 - 12:01 PM

Ey everybody, well, you asked someone else which skills should be added, i was thinking of:
-Home Building
-Removed for own use
-Cooking
-Fishing
-Farming
-Removed for own use
-Removed for own use
-Removed for own use
-Woodcutting
-Firemaking
-Removed for own use
-Thieving
-Agility (the higher, the faster you move)

If you wanna know some more, just send me a PM and i'll have a look
Reward for you: Credits in my coming game, and if possible, you become a Moderator.

Greetings, anasky

Edited by anasky, 09 April 2008 - 05:23 AM.

  • 0

#20 jsmithLMSL

jsmithLMSL

    Katamari Devotee

  • New Member
  • 1323 posts

Posted 04 April 2008 - 02:35 PM

Good ol' Rune Scape Re-Creations... Many projects heard of and started, but never seen again...

Hello Anasky!

First, thank you for downloading the example and I hope you enjoyed and learned from it.

You suggested quite a few new skills, and to that request, this is my reply: If I were to actually add all of those skils to this tutorial, the scene would have to change to fit to fit the skills (new sprites, new backgrounds, lot's of changes). Now that I'm thinking about it, if I were to add those Sprites and animations and tiles and skills and more attacks, I'm a text box and 50 missions shy of creating a game by itself. I do appreciate your suggestions and I did ask for new Idea's, but this is a little far fetched as to bettering the general idea of this tutorial. I wanted to show a simple, easily implemented level system that anyone could add, use, or just read to learn a little GML.

As for your suggestions, you could easily add those into your game. Go back over the tutorial until you have a good understanding on why we do what we do, where we do it, and what for, and you should have no problem creating your own skills, for example:

Wood Cutting:

You create a global variable called global.wood_cutting=0;. In your game, you allow the player to achieve an axe. If the player is within a distance of a tree, and presses a button © that acts as the "swinging" of the axe, you could test the value of global.wood_cutting and determiine how many swings it will take to cut down the tree. Within the tree, you create a variable called tree_strength. You set this to a number that goes against global.wood_cutting. You now have a basis of swings to cut down the tree: the power of wood_cutting versus the power of the tree_strength. Every swing, you deduct the value of global.wood_cutting from the varable tree_strength. Once tree_strength is depleated, you change the tree sprite to a stump and add some points to global.tree_cutting, making the player's swing stronger.

Coded example:

Tree object's create event:
tree_strength=25;

Tree object's collision event with obj_player:
if obj_player.sprite_index=spr_cutting and tree_strength>0
  {
  tree_strength-=global.wood_cutting;
  if tree_strength<=0
	{
	global.wood_cutting+=1;
	sprite_index=spr_stump;
	}
  }

Obj_player's create event:
cutting=false;

Obj_player's step step event:
if (cutting=true) exit;
if keyboard_check(ord('C')) and cutting=false
  {
  sprite_index=spr_player_swing_axe;
  cutting=true;
  alarm[0]=10;
  exit;
  }

Obj_player's Alarm 0 Event:
cutting=false;
sprite_index=spr_player_stand;


That's just off of the top of my head and that code would probably need some work, but I wrote it so you could compare. There is very little difference between that code and the example itself. You can add your own variables and skills easily. As for my example, I'm going to leave it as is for now, but if you would like me to make a small personlized example and work with you a little to help you understand how to implement new skills, go ahead and PM me and I would be glad to try and help you get started.

Cheers,

Josh
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users