Programming & Scripting

View unanswered posts | View active topics


Post a new topicPost a reply
Previous topic | Next topic 

User avatar   Crytek Staff Member Crytek Staff MemberMember since: 11.07.2008, 20:25Posts: 11645Location: Frankfurt am Main Likes: 21
 

 Post Topic: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 01:44 
So I was responding to a question on the subject of a level/XP system when I thought hey, that'd be a fun way to learn even more CryENGINE code stuff!

Voilà my new pet project, an as of yet unnamed attempt at integrating some RPG systems into the engine. To start off, I've forked CryGame and added an experience points system. It's a really rough draft right now, where killing any enemy rewards the player with 30XP, and every 100XP triggers a level up. There's no UI, it's just logged to the console:

Image

With the unwilling test dummies:

Image

It's also all serialised so your experience and level persists across save games :) As per usual from me, the code is all available to take a look at: https://github.com/returnString/CryGame

You'll probably want to check out the CPlayer::AddXP function, which alters the player's member variables, and the CGameRules::OnKill function, which is where we check whether the player has killed anyone.


Anti-flowgraph campaigner, professional server destroyer.

  Beginner BeginnerMember since: 21.04.2012, 22:37Posts: 44 Likes: 0
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 14:38 
that must be added to the game what would it all worked, that would not completely change the files?


sorry for my english-google >_<
User avatar   Crytek Staff Member Crytek Staff MemberMember since: 11.07.2008, 20:25Posts: 11645Location: Frankfurt am Main Likes: 21
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 14:43 
Quote by sm1le:
that must be added to the game what would it all worked, that would not completely change the files?

Download the repo and place the contents in your Code directory. Open up Solutions\CryEngine_GameCodeOnly.sln and compile. Should work with no more setup than that.


Anti-flowgraph campaigner, professional server destroyer.
  Beginner BeginnerMember since: 21.04.2012, 22:37Posts: 44 Likes: 0
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 14:55 
output to HUD no reports of that received by the next level? and adding +1 hp well no?


sorry for my english-google >_<
User avatar   Superstar Dolphin Superstar DolphinMember since: 16.08.2004, 10:46Posts: 9565Location: Finland Likes: 49
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 14:57 
Heh that's a really nice template for a basic RPG project! :D

Is the system (or more specifically, will it be) easily customizable? I mean, can the amount of XP awarded, the level up threshold etc be altered in a gamerules script or so, or must those things be hardcoded? :)
User avatar   Crytek Staff Member Crytek Staff MemberMember since: 11.07.2008, 20:25Posts: 11645Location: Frankfurt am Main Likes: 21
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 15:00 
Quote by sm1le:
output to HUD no reports of that received by the next level? and adding +1 hp well no?

I'm not building a game for you, you have to do that yourself ;)

Quote by the_grim:
Heh that's a really nice template for a basic RPG project! :D

Is the system (or more specifically, will it be) easily customizable? I mean, can the amount of XP awarded, the level up threshold etc be altered in a gamerules script or so, or must those things be hardcoded? :)

Atm the level-up threshold is defined by a CVar. Still gotta work out what kind of level system this is gonna be (i.e., should the XP threshold be equal to the current level x 100, or should it scale according to some percentage) but the end goal is to make it customisable, yup. :)


Anti-flowgraph campaigner, professional server destroyer.
  Beginner BeginnerMember since: 21.04.2012, 22:37Posts: 44 Likes: 0
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 15:02 
I did not understand how to use it in their own ..:(((


sorry for my english-google >_<
User avatar   Crytek Staff Member Crytek Staff MemberMember since: 11.07.2008, 20:25Posts: 11645Location: Frankfurt am Main Likes: 21
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 18:29 
Just added a flownode so you can give the player XP at any time, e.g., finishing a quest or entering a trigger.

Image

And as ever, the source: https://github.com/returnString/CryGame ... PNodes.cpp :)


Anti-flowgraph campaigner, professional server destroyer.
  Trainee TraineeMember since: 10.03.2012, 16:37Posts: 114 Likes: 1
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 18:42 
great : )
User avatar   Superstar Dolphin Superstar DolphinMember since: 16.08.2004, 10:46Posts: 9565Location: Finland Likes: 49
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 20:06 
*the_grim likes this*
  Beginner BeginnerMember since: 21.04.2012, 22:37Posts: 44 Likes: 0
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 21:10 
Open up Solutions \ CryEngine_GameCodeOnly.sln and compile
this is what you need to do?


sorry for my english-google >_<
  Beginner BeginnerMember since: 21.04.2012, 22:37Posts: 44 Likes: 0
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 21:17 
I added a note, but it is not fg .. what to do?


sorry for my english-google >_<
User avatar   Uber Modder Uber ModderMember since: 27.02.2009, 12:51Posts: 1401 Likes: 6
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 21:33 
Nice.
You are quciker than me, I also wanted to make something like CryRPG on my homebrew RPG mechanics as a testing ground for everyone to use. (thus my system is without leveling).

Well.. If I keep getting distracted I might even start this year :D


My Medieval/Fantasy Houses
Want to support Hi-res, Hi-Quality tileable textures, help me by adding more space to my dropbox account: http://db.tt/icZx0EWa (create you dropbox account from this link).
User avatar   Crytek Staff Member Crytek Staff MemberMember since: 11.07.2008, 20:25Posts: 11645Location: Frankfurt am Main Likes: 21
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 09.05.2012, 22:32 
Quote by sm1le:
I added a note, but it is not fg .. what to do?

Whilst the end goal is a system that anyone can use as a project base, right now it's only really for C++ programmers because it's so early in development. If you're not ready to dive into a C++ codebase, I suggest you wait till it's more advanced and user-friendly ;)


Anti-flowgraph campaigner, professional server destroyer.
User avatar   Crytek Staff Member Crytek Staff MemberMember since: 11.07.2008, 20:25Posts: 11645Location: Frankfurt am Main Likes: 21
 

 Post Topic: Re: Unnamed RPG template (w/ XP system)
PostPosted 10.05.2012, 04:15 
Couldn't sleep, did some more prototyping. I've added a listener node that reports XP (and where it came from) as well as level up events. This helps me do quick UI mockups to avoid staring at the console :)

Image


Anti-flowgraph campaigner, professional server destroyer.