Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Can I get some advice with browser game item system/db?

$
0
0
Hello,

I've been developing a little browser game as a side project for a while now. I currently have a decent amount of features in the game, such as combat, messaging, inventory, equipped items, stats, and some different areas to explore. As the development as progressed, I've realized that the design of my item system is getting pretty sloppy and I wonder if there is some way I could make it more organized. Before I get to the question, I'll give a little more information.

The game is a typical browser-based text(ish) game built using -
-PHP
-Javascript
-MySQL

Now here's the dilemma.

My current item system uses a table called "items" to store all different items in the game. Each item has a "type" column, which is used in code to determine what "flags" the code should look for. There is also a "flags" column in the items table. The flags column hold key and value pairs of different attributes of the item such as heal amount, damage, strength boost, and so on.

This is starting to get very hard to manage as more items are added and different modifiers are added. It's easy to forget to add some modifiers to the code, or to forget to scan for certain modifiers on a particular item when calculating stat totals and such.

Can anyone offer any insight on how to create an efficient and flexible item system that allows for different types of items and flexibility in their modifiers? I'm looking for general discussion on possibilities.

Thank you.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>