• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Machaira

Moderators
  • Content count

    3484
  • Joined

  • Last visited

Community Reputation

1033 Excellent

About Machaira

  • Rank
    Moderator
  1. [quote name='obizues' timestamp='1346888340' post='4977021'] I'm not sure if I'm supposed to create an entire game loop for the character class, or if I'm only supposed to have that in the Game class. [/quote] The latter, basically. The actual loop is hidden. All you need worry about is the Update and Draw methods really. [quote name='obizues' timestamp='1346888340' post='4977021'] For example, I was trying to load sprites within the character class itself in it's own LoadContent method. Am I not supposed to do that? [/quote] If those sprites are to be used for that character instance, sure, otherwise, no. [quote name='obizues' timestamp='1346888340' post='4977021'] I fully understand OOP, I can implement everything I want in JAVA, but I'm not sure how I'm supposed to do in within the XNA framework with C#. [/quote] OOP works just fine in C#. Create a character class (old sample class from my RPG book): [CODE] public delegate void EntityLevelUpDelegate(Entity entity); public class Entity { #region Members private EntityType _type; private string _name; private string _classID; private byte _level; private int _experience; private string _raceID; private short _baseHP; private short _curHP; private byte _diseaseResistance; private byte _poisonResistance; private byte _magicResistance; //Affects is empty for these private List<Damager> _damageResistances; private List<Damager> _damageWeaknesses; //Any misc, offensive, or defensive bonuses (ie. spells cast on character, items, etc. May be positive or negative) private List<Bonus> _defBonuses; private List<Bonus> _offBonuses; private List<Bonus> _miscBonuses; private EntityAlignment _alignment; private EntitySex _sex; private short _age; private List<EntityStat> _stats; private string _portraitFileName; private bool _isVendor; private string _spriteFilename; private Dictionary<int, int> _skills; private int _curSP; private int _baseSP; //used for things like hiding and spells private bool _isVisible; private Object _target; private Dictionary<int, EntitySpell> _spells; private Dictionary<int, int> _spellbook; //key is spell ID, value is the page it's on private int _baseMana; private int _curMana; private bool _inCombat; private Inventory _inventory; //list of items, for a vendor this is what he sells private Money _money; //requires a strength stat private float _maxWeight; private AttackTypes _selectedAttack; #endregion #region Property Functions public EntityType Type { get { return _type; } set { _type = value; } } public string Name { get { return _name; } set { if (!string.IsNullOrEmpty(value)) _name = value; } } public string ClassID { get { return _classID; } set { _classID = value; } } public Byte Level { get { return _level; } set { if (_type > EntityType.Character) _level = value; } } public int Experience { get { return _experience; } set { if (_type > EntityType.Character) _experience = value; } } public short BaseHP { get { return _baseHP; } set { if (_type > EntityType.Character) _baseHP = value; } } public short CurHP { get { return _curHP; } set { if (_type > EntityType.Character) _curHP = value; } } public Byte DiseaseResistance { get { return _diseaseResistance; } set { _diseaseResistance = value; } } public Byte PoisonResistance { get { return _poisonResistance; } set { _poisonResistance = value; } } public Byte MagicResistance { get { return _magicResistance; } set { _magicResistance = value; } } public List<Damager> DamageResistances { get { return _damageResistances; } set { _damageResistances = value; } } public List<Damager> DamageWeaknesses { get { return _damageWeaknesses; } set { _damageWeaknesses = value; } } public List<Bonus> DefensiveBonuses { get { return _defBonuses; } set { _defBonuses = value; } } public List<Bonus> OffensiveBonuses { get { return _offBonuses; } set { _offBonuses = value; } } public List<Bonus> MiscBonuses { get { return _miscBonuses; } set { _miscBonuses = value; } } public EntityAlignment Alignment { get { return _alignment; } set { _alignment = value; } } public EntitySex Sex { get { return _sex; } set { _sex = value; } } public short Age { get { return _age; } set { _age = value; } } public string RaceID { get { return _raceID; } set { _raceID = value; } } public List<EntityStat> Stats { get { return _stats; } set { _stats = value; } } public String PortraitFilename { get { return _portraitFileName; } set { _portraitFileName = value; } } public bool IsVendor { get { return _isVendor; } set { _isVendor = value; } } public string SpriteFilename { get { return _spriteFilename; } set { _spriteFilename = value; } } public Dictionary<int, int> Skills { get { return _skills; } set { _skills = value; } } public int CurSP { get { return _curSP; } set { if (value >= 0) _curSP = value; } } public int BaseSP { get { return _baseSP; } set { if (value >= 0) _baseSP = value; } } public object Target { get { return _target; } set { _target = value; } } public Dictionary<int, EntitySpell> Spells { get { return _spells; } set { _spells = value; } } public int BaseMana { get { return _baseMana; } set { _baseMana = value; } } public int CurMana { get { return _curMana; } set { _curMana = value; } } public bool IsAlive { get { return _curHP > 0; } } public bool InCombat { get { return _inCombat; } set { _inCombat = value; } } public Inventory Inventory { get { return _inventory; } set { _inventory = value; } } public AttackTypes SelectedAttack { get { return _selectedAttack; } set { _selectedAttack = value; } } #endregion public Entity() { _stats = new List<EntityStat>(); } #region Bonus, Resistance, Weakness Functions public short GetTotalOffBonus() { short total = 0; Bonus bns; if (_offBonuses != null) { for (short i = 0; i < _offBonuses.Count; i++) { bns = (Bonus)_offBonuses[i]; total += bns.Amount; } } return total; } public short GetTotalMiscBonus() { short total = 0; Bonus bns; if (_miscBonuses != null) { for (short i = 0; i < _miscBonuses.Count; i++) { bns = (Bonus)_miscBonuses[i]; total += bns.Amount; } } return total; } public short GetTotalDefBonus() { short total = 0; Bonus bns; if (_defBonuses != null) { for (short i = 0; i < _defBonuses.Count; i++) { bns = (Bonus)_defBonuses[i]; total += bns.Amount; } } return total; } public void AddDefensiveBonus(Bonus bonus) { if (_defBonuses == null) _defBonuses = new List<Bonus>(); _defBonuses.Add(bonus); } public void SetDefensiveBonuses(List<Bonus> bonuses) { _defBonuses = new List<Bonus>(); if (bonuses != null) { foreach (Bonus bonus in bonuses) _defBonuses.Add(bonus); } } public void AddOffensiveBonus(Bonus bonus) { if (_offBonuses == null) _offBonuses = new List<Bonus>(); _offBonuses.Add(bonus); } public void SetOffensiveBonuses(List<Bonus> bonuses) { _offBonuses = new List<Bonus>(); if (bonuses != null) { foreach (Bonus bonus in bonuses) _offBonuses.Add(bonus); } } public void AddMiscBonus(Bonus bonus) { if (_miscBonuses == null) _miscBonuses = new List<Bonus>(); _miscBonuses.Add(bonus); } public void SetMiscBonuses(List<Bonus> bonuses) { _miscBonuses = new List<Bonus>(); if (bonuses != null) { foreach (Bonus bonus in bonuses) _miscBonuses.Add(bonus); } } public void AddDamageResistance(Damager resistance) { if (_damageResistances == null) _damageResistances = new List<Damager>(); _damageResistances.Add(resistance); } public void SetDamageResistances(List<Damager> resistances) { _damageResistances = new List<Damager>(); if (resistances != null) { foreach (Damager resistance in resistances) _damageResistances.Add(resistance); } } public void AddDamageWeakness(Damager weakness) { if (_damageWeaknesses == null) _damageWeaknesses = new List<Damager>(); _damageWeaknesses.Add(weakness); } public void SetDamageWeaknesses(List<Damager> weaknesses) { _damageWeaknesses = new List<Damager>(); if (weaknesses != null) { foreach (Damager weakness in weaknesses) _damageWeaknesses.Add(weakness); } } #endregion public int MaxWeight() { int str = 0; //find the strength stat foreach (EntityStat stat in _stats) { if (stat.StatName.ToLower() == "strength") { str = stat.CurrentValue; break; } } return str * 3; } public void AddSkill(int id, int ranks) { if (_skills == null) _skills = new Dictionary<int, int>(); _skills.Add(id, ranks); } public void SetSkills(Dictionary<int, int> skills) { _skills = skills; } public bool HasSkill(int key) { if (_skills != null) return _skills.ContainsKey(key); else return false; } public void Damage(int amount, DamageType type) { //reduce amount based on damagetype protection foreach (Damager damager in _damageResistances) { if (damager.Type == type) amount -= GlobalFunctions.GetRangeAmount(damager.DamageAmount); } _curHP -= (short)amount; if (_curHP <= 0) { //entity is dead } } public void Buff(int amount, BonusType type) { //switch (type) //{ //} } public void UseSkill(int key, Difficulty difficulty) { int result = 0; Entity entity = this; if (GlobalData.Skills[key].Use(ref _target, ref entity, difficulty, ref result)) { switch (GlobalData.Skills[key].Type) { case SkillType.Defensive: { if (_target is Entity) { } break; } case SkillType.NonCombat: { if (_target is Entity) { } break; } case SkillType.Offensive: { if (_target is Entity) { } break; } } } } public int GetSkillValueByID(int id) { if (HasSkillByID(id)) return GlobalFunctions.CalculateSkillBonus(_skills[id]); else return 0; } public bool HasSkillByID(int id) { foreach (int key in _skills.Keys) if (key == id) return true; return false; } public int GetCastingSkillBonus() { int amount = 0; foreach (int id in _skills.Keys) { //TODO: copy function from backup if (GlobalData.Skills[id].Name == "Spellcraft") { amount = _skills[id]; break; } } return amount; } public bool LearnSpell(int id, int skillPointsAllocated) { bool hasSpellcraftSkill = false; foreach (int key in _skills.Keys) { //TODO: copy function from backup if (GlobalData.Skills[key].Name == "Spellcraft") { hasSpellcraftSkill = true; break; } } if (!hasSpellcraftSkill) return false; _spells[id].AllocatePoints(skillPointsAllocated); //get any bonuses for learning spells int amount = 0; return _spells[id].Learn(amount); } public List<EntitySpell> GetPageSpells(int page) { List<EntitySpell> spells = new List<EntitySpell>(); foreach (int key in _spellbook.Keys) { if (_spellbook[key] == page) spells.Add(_spells[key]); } return spells; } //TODO: spellbook member should probably be passed to GUI public void MoveSpell(int id, int page) { //check to see if page has an empty spot int count = 0; foreach (int key in _spellbook.Keys) { if (_spellbook[key] == page) count++; } if (count < Spell.SpellsPerPage) _spellbook[id] = page; } public void AddMoney(ref int amount) { //do check to make sure max weight isn't reached before adding float totalWeight = _money.TotalWeight + Money.GetWeight(amount) + _inventory.TotalWeight(); if (totalWeight < _maxWeight) _money.Add(ref amount); else { //figure out how much can be added } } public bool HasItem(int id) { foreach (EntityItem item in _inventory.Items) { if (item.ID == id) return true; } return false; } public void Update(GameTime gameTime) { //check for mana regain } public void SetAttackType(AttackTypes type) { _selectedAttack = type; } } [/CODE]
  2. The only courses I took in programming were back in high school in the early 80s - COBOL, FORTRAN, and BASIC using an Apple 2c. Other than that I'm completely self-taught and I've been programming for a living for about 15 years doing .NET development. I took a C++ refresher course before I started with a company when I was in the industry and ended up helping out the other students since the course taught me nothing I didn't already know. I should go back and get my degree though as it's getting harder to get any further in my career. I still want to go full-time indie game development but that's difficult when you have a family to support.
  3. Answered in the SO post
  4. One thing - you shouldn't be passing the ContentManager every Update. Just keep a reference to it. Other than that, if it ain't broke don't fix it.
  5. There's always the tutorial on the AppHub site - http://create.msdn.com/education/tutorial/2dgame/getting_started
  6. Have you looked at the tutorial on the AppHub site - http://create.msdn.com/education/tutorial/2dgame/getting_started
  7. I'm pretty much of the same mind as the previous posts. Iterate quickly and in small pieces of the game. At some point you'll have to do a couple of large pieces when you tie various systems together to make sure everything is balanced. As for your current design, the big problem that I see is that you're running the game under 800x600. Even if you're trying to get that retro feel, there's no reason IMO that you should be using anything less than 1024x768. Doing this should immediately fix your current problem even if you don't change anything else. However, you should also be considering giving the player the ability to change resolutions, which means more testing of the UI to ensure it works decently at various resolutions. Some specific things about your current UI: * the message window doesn't need to be that tall by default. Just show one or two lines and give the player the ability to increase the height, even if it's just a button to pop it up to a half-dozen lines high. Give the player the ability to hide the window as well. Hotkeys are your friend! * the window that shows health and other info doesn't appear to need to be as big as it is either, and should be in a corner. Other windows like inventory and such should probably be able to be moved around and overlap each other, just so the player can see more. * If you haven't already done so, consider coding your UI in an OO manner - have a base "Window" class or some such and several interfaces, such as IResizable, IMoveable, IDropTarget etc. and implement as necessary for each window. You're doing great so far, just keep it up and don't get discourage. You're working in the toughest genre of game IMO, so consider each little step you complete a victory.
  8. [quote name='sgdimitris' timestamp='1330857883' post='4919141'] I would like to combine them! Is it possible? [/quote] Not really. Why do you want to do this? What's wrong with just launching the Win32 exe?
  9. So it sounds like inventory should be an interface that whatever class needs to can implement. "Can the player carry a bag in a bag in a bag?" Only when they're empty. Otherwise it just doesn't make sense. You then don't have to worry about nested inventories. "But you can carry corpses right?" I'd say no. Why would you? "Now, weight restrictions..." I'm all for these.
  10. Nice job. The only thing I'd change is if you're using Entity for everything you might want to consider a bit of a redesign. I'd probably do something like: [CODE] public enum CompassPoint { North, East, South, West } public interface IUpdateable { void Update(GameTime gameTime); } public abstract class WorldObject { public int X { get; set; } public int Y { get; set; } public abstract void Draw(); } public class MoveableWorldObject : WorldObject, IUpdateable { protected CompassPoint _moveDirection; protected bool _isMoving; public void Update(GameTime gameTime) { //figure out if object should move, probably NPCs, monsters, etc. } protected void Move() { //calculate moving if applicable if (_isMoving) { switch (_moveDirection) { case CompassPoint.North: { if (Map.Instance.CanMove(X, Y, CompassPoint.North)) Y -= 1; break; } case CompassPoint.East: { if (Map.Instance.CanMove(X, Y, CompassPoint.East)) X += 1; break; } case CompassPoint.South: { if (Map.Instance.CanMove(X, Y, CompassPoint.South)) Y += 1; break; } case CompassPoint.West: { if (Map.Instance.CanMove(X, Y, CompassPoint.West)) X -= 1; break; } } } } public override void Draw() { } } public class Item : WorldObject { //add members for item //items don't necessarily need an Update method public override void Draw() { } } public class Player : MoveableWorldObject, IUpdateable { //only player object needs to poll input public void Update(GameTime gameTime, KeyState keyState) { //look at keys to determine if the object is moving //calculate moving if applicable base.Move(); } public override void Draw() { } } class Map { public static Map Instance; public bool CanMove(int startX, int startY, CompassPoint direction) { bool ret = true; return ret; } } [/CODE] Looking forward to the next post.
  11. You're doing your drawing backwards. You need to draw the background first, then objects in the foreground - paddle, balls, blocks.
  12. If I'm not mistaken that tutorial series was for XNA 3.1, which has a lot of [url="http://www.nelxon.com/blog/xna-3-1-to-xna-4-0-cheatsheet/"]conversion issues[/url] to get to 4.0. Have you looked at the [url="http://creators.xna.com/sample/winforms_series2"]WinForms samples[/url]?
  13. [quote name='maxdelphi' timestamp='1328106770' post='4908379'] i would like make my own game like new super mario bros wii [/quote] [quote name='maxdelphi' timestamp='1328106770' post='4908379'] want a powerful engine [/quote] Why do you want a powerful engine for a Mario game? That's a bit of overkill. You could take a look at the [url="http://machxgames.com/blog/?tag=platformer"]Platformer Starter Kit posts on my blog[/url]. If you really want something more powerful, [url="http://www.synapsegaming.com/products/sunburn/engine/"]Sunburn[/url] is the way to go.
  14. There's not really a right or wrong, there's what works best for you as long as it actually works. Designing a WinForms apps to create levels should be relatively quick and simple if you have some experience.
  15. [quote name='plusnoir' timestamp='1326563457' post='4902695'] [color=#333333]I am attempting to use System.Windows.Forms objects within an XNA application (as opposed to using a XNA device in a System.Windows.Forms application) - which has no examples as far as the AppHub samples go.[/color] [/quote] Because you're not supposed to do it that way.