Jump to content


Photo

Items in MMORPG


  • Please log in to reply
6 replies to this topic

#1 heatedflame

heatedflame

    GMC Member

  • New Member
  • 8 posts

Posted 18 February 2012 - 12:58 PM

Could someone enlighten me on this: I've been thinking about how items are identified in MMORPGs. Take for example, there's a sword with Weapon Power (WP) ranging from 1 to 3.

The scenario: Unique IDs for the different WPs of the sword, but same IDs for a specific WP of a sword.
i.e. Sword WP 1 : id=0000
Sword WP 2: id=0001
Sword WP 3: id=0002

Whenever a 'Sword WP 1' is dropped from a monster, the id of the item is always fixed no matter who obtains it. Or is it the case where any new item that will have a new ID (since trading the item between players would be quite confusing)? A brief and rough idea would help a lot!

Edited by heatedflame, 18 February 2012 - 01:39 PM.

  • 0

#2 chaz13

chaz13

    GMC Member

  • GMC Member
  • 3877 posts
  • Version:Unknown

Posted 18 February 2012 - 03:34 PM

I'd keep it all handled by local variables. Pick up a sword, you delete the object and the player or whatevers) WP variable now ='s that of the sword, when you drop it you create a sword object with the right stats again. Simples! :)
  • 0

#3 heatedflame

heatedflame

    GMC Member

  • New Member
  • 8 posts

Posted 19 February 2012 - 08:21 AM

Getting confused. I'm fine with affixing a specific WP to a sword. But how to identify two similar swords of a same WP?

i.e. 1st item dropped = Sword WP 1
2nd item dropped = Sword WP 1

What I thought of was giving different IDs to each item to avoid conflicts if players were to trade items with same WP. But is that realistic/practical? Really curious how items MMORPGs (or games with inventories) work.
  • 0

#4 Zesterer

Zesterer

    Professor of Articul

  • GMC Member
  • 1022 posts
  • Version:GM8

Posted 19 February 2012 - 09:22 AM

Who cares if they get mixed up? They are identical anyway!
  • 0

#5 heatedflame

heatedflame

    GMC Member

  • New Member
  • 8 posts

Posted 19 February 2012 - 02:27 PM

Who cares if they get mixed up? They are identical anyway!


I guess that settles the part of items having the same IDs. So I would assume that there are two instances of an object if there were two swords with the same WP?

That aside, another thing boggled my mind. How about randomizing a number for the WP? Something like:
var sword_wp //resulting fixed value (WP) of the sword
sword wp = 0

var sword_wp_roll; //to randomize the value (WP) of the sword
sword_wp_roll = irandom(3) + 1

...

How to 'attach/affix' the randomized number such that it has become fixed to the object (like when object is dropped/picked up)? My thought was to randomize var_sword_wp_roll then attach it to var sword_wp.
  • 0

#6 Yal

Yal

    Gun Princess

  • Global Moderators
  • 5865 posts
  • Version:GM8.1

Posted 23 February 2012 - 09:08 AM

var is used for temporary variables, first of all! To use a normal variable, just assign a value to it.

You should investigate Disgaea's item system. Much like characters, each item has all the stats in the game: HP, SP, ATK, DEF, INT, RES, HIT, SPD, MOV, JMP, THW, ETC... When you equip an item, the character basically gets all the item's stats added to his own stats. Also, you can level up items to raise its stats there.

Implementation-wise, you could use a 2-D array for all items in your possesion and have inventory spots on one axis and item stats for the item on that spot on the other axis.
Posted Image
  • 0

#7 Mayhem Games

Mayhem Games

    Proud Kiwi

  • GMC Member
  • 956 posts
  • Version:GM:Studio

Posted 23 February 2012 - 12:00 PM

If you are serious in learning the in and out's of a MMORPG, before starting I recommend you looking at Trinity Core. TC is a World of Warcraft server written in c++. It is interesting to see how a big MMO such as WoW works.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users