Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Designing trouble

Sign in to follow this  


Well.. I've hit a wall in my coding. I need some easy-to-use way of maintaining player item inventory, equipment, and store lists (rather, maps), but I don't want the user to have to create and maintain three separate files. I'm thinking of having one master file with all the information about an item in it, but then comes two other problems: it'll likely be somewhat unweildy to parse, and I'll have to put the data into each component's map, which might be difficult considering each component is withing its own class, and depending on the needs of the user, it might be there and it might not.

I'm thinking of making it so you HAVE to create an object of type cArena to have everything work, which would allow me to make every other component call a cArena object function, which would switch a bool value to "true", which would cause the cArena file parser to know which components can be loaded...

Well. I guess writing in this journal has helpful side-effects, huh? :P

EDIT: As a last remark, this means I'll need to think up a format the user will use for the "master item file". This is what I'm currently thinking of...

Mana Potion
Adds 10 to your current amount of mana.
Adds 20 to your current amount of life.

The first line is a flag that determines which component recieves the info (in this case, the store only). The second is the key used for maps. The third line is the name of the item (duh?), and the fourth shows which player attributes are affected when the item is used (in this case, Mana for 10 points). The fifth line is a description of the item. Between item descriptions is a ~ thing to tell the parser that it's moving on to a new item. The only major differences in the second description are that it has two effects: Life +20 and Mana +20, using the ! to let the parser know it's got another attribute on its hands; and there's three flags set for the item: i (inventory), e (equipped), and s (in the store).

How I'm going to accomplish this is beyond me. I'll sleep on it. *sigh*
Sign in to follow this  


Recommended Comments

Ideally you write parser and serializer objects. Then you provide a client Tool so they don't have to edit files by hand. :) Although this is a start.

Share this comment

Link to comment
The tool will probably come later (if it comes at all, hehe). My primary goal is just to get it working (green on the list). then I'll be doing the polishing, optimising, making things easier on the user, etc. (not that I'm not actively making things easier as it is)

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!