# mager1794

Member

5

101 Neutral

• Rank
Newbie

• Interests
Design
Education
Production
Programming

## Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. ## RPG Calculating experience gained per kill.

You should remember that lots of factors go into how much experience you gain. I'd start off with figuring out exactly how much experience you want to gain at level 1. Lets say you have 400xp for level 2 and you get about 55xp per kill. (this is lowkey based on wow level 1 from my memory) at level 2, a level 1 mob shouldn't give you the same xp as it did when you were level 1. Val = 55 PlayerLevel * Val = x And we need to extend other variables into this equation to account for it as well. Exp Multiplier * Enemy/PlayerLevel ExpMultiplier = 1.0 * (xp boost) * any other variables So your algorithm could be Val * (ExpMultiplier * Enemy/PlayerLevel) First, calculate the level ratio between enemy and player, reduce XP if the player is higher level increase if lower. Add the multiplier in, 1.0 is the default, however, you can make this value scale based on level or anything you want really, the point of it is to add more numbers to toy with our XP rates. Now even with all those values and modifiers, a level 1 player fighting a level 1 enemy still results in only 55 xp assuming Val = 55
2. ## Potions usage and how to implement it

What I would do is create some form of consumable function, create a switch statement around the adjustable stat ConsumePotion(StatType.Health, 25); = SmallHealthPotion ConsumePotion(StatType.Armor, 200); = Greater Armor Potion If you do your switch based on a specific stat, you have an unlimited potion arsenal, with minor changes instead of tons of changes.
3. ## How To Structure My Rogue-Like Game?

It helps me a lot to think about everything in the game as an object, and then understand the concepts beyond gameobject hierchys and Interfaces(like the C# term not the User inteface one) Everything in your game will likely be a gameobject, so you should create a gameobject prefab. Anytime you update your GameObject prefab, those changes will happen globally to any prefabs using the GameObject prefab. Then think about the people in your game world, because in my world ALL players/npcs interact with physics. So I built a character prefab. The character prefab handles ALL environment related interactions. If I build it right, I can build it once and never look at it again in a best case scenario. Expand character into 2 new prefabs. Player and Enemy Player -> attach Controllers to move character Enemy -> Attach AI to move character. Sorry if my explanation is weird, but the overall idea is think really really hard about your objects and try to make them as versatile as possible and slowly expand. If you run into a physics problem 8 months into the development process, you don't want to have to look through 152 different objects with physics attached to them, you just want to try to fix 1. Don't be afraid to write, and if you study UML that is not a bad place to start either.
4. ## Enforcing input order?

You're going to need to build a controller that accepts ALL input, and compare it to the input you're expecting. Create a class with two variables Button Completed And then fill them into an array of x, make sure that youre code doesn't process the next button in line unless the value of completed on the previous is true.