Sign in to follow this  
X5-Programmer

Rpg Inventory.

Recommended Posts

Hi there, dont know were I shall begin, but anyway im intresting in how the inventory are made and what I shall think about when I try to create one for my game. If anyone knows any tutorials/examples about it I will be glad, and feel free to come up with some advice about it. edit : I use OpenGL. thx.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What part about inventory are you asking about? Are you looking for information about data structures, and how to store lists of these data structures (ie. linked list, vector, etc.)? What attributes inventory items should have? How to display the inventory to the user?

Also, which language do you use (C, C++, Visual Basic, etc)?

Share this post


Link to post
Share on other sites
I think that the book that chadmv referred to is an excellent reference. I actually decided to buy this book based on the sample chapter.

This part is can be adapted for any particular API.

A link to the sample chapter can be found here

If you are looking for code samples on how to handle the graphics of the inventory system (actually drawing the 2d stuff), I dont know anywhere off the top of my head, but I can help you look

Share this post


Link to post
Share on other sites
Not a problem, It helps me too.. Haven't found too much though.

There is a link that I found here that has some tutorials on creating a GUI in OpenGL. It looks interesting, and could be adapted for writing your Inventory graphics. I haven't had much of a read over it yet, but it does seem to have alot of information.

Is this kind of what you were looking for?

Share this post


Link to post
Share on other sites
From the chapter I read on GameDev, that book does some lame stuff, like not using strings or vectors, and instead doing some hacks. In fact, I beleive the whole thing was in C. Can't blame the author, though. It probably sells books, with C being the "1337" language and all. Premature optimaztion is the root of all evil, especially when your optimization doesn't even speed things up.

Share this post


Link to post
Share on other sites
I disagree, that chapter, which is also linked here does some pretty standard stuff. In my personal opinion, using the standard C syntax for arrays, and strings brings the information down to the lowest common denominator.

This book is aimed at intermediate level programmers. Using the standard template library could easily throw off these people.

C++ is the language used, there are class definitions included. It uses structs for things that would only hold data. This is also pretty standard in my opinion.

I don't understand you point about premature optimization. Where does he do this?

Share this post


Link to post
Share on other sites
Quote:
Original post by Stagz
I disagree, that chapter, which is also linked here does some pretty standard stuff. In my personal opinion, using the standard C syntax for arrays, and strings brings the information down to the lowest common denominator.

This book is aimed at intermediate level programmers. Using the standard template library could easily throw off these people.

C++ is the language used, there are class definitions included. It uses structs for things that would only hold data. This is also pretty standard in my opinion.

I don't understand you point about premature optimization. Where does he do this?


I wasn't intending to insult the author at all. I was referring to the fact that many people use C because they think their game will run faster, when in fact it will not.

Now, as to using strings and vectors and lists: strings are easier than char[], and much more powerful. Anything that you would do with a char[] would be done easier and more beginner friendly with a string. With vectors, it would require some explaining what push_back and pop_back means, but if they visualize it as a stack of boxes, with the top being the back, it is extremely easy to understand. You wouldn't even have to use iterators for what he is probably doing, just use operator[]. By using the old fashion C way doing things, you ingrain terrible habits.

BTW, I have no problem using structs for things that only hold data. And for a beginner, I guess that is the easiest way. However, he could at least mention that the way he is doing isn't necessarily the best, and tell them to, maybe, after they have finished making the book's final project (I assume it has one, I haven't read the whole thing, just the free chapter) and had a little fun with it, too, have a look at object oriented programming.

[Edited by - thedevdan on August 5, 2004 8:04:54 PM]

Share this post


Link to post
Share on other sites
X5-Programmer:
Nothing more for you yet. There are in fact a few things to look at here. For example.

* 2D GUI creation for drawing the actual screens. I think that the tutorial above contains enough information for this.

* Possibly scripting to identify what happens when an item is added/removed. Eg, add sword to hand item -> increase damage output, draw sword in hand... etc. Haven't found anything here yet.

* Data management options for how to handle all the items in your inventory. The chapter linked above shows a good (maby not perfect) method of looking afeter your data.

Which area would you be more interested in? Im on lunch now, so ill be able to have a bit of a look :P


thedevdan:
Sorry for sounding too defencive before.

Now I get it, true, some people do think that. I just didn't see what you were trying to say. I use C/C++ mainly because that is what I know best.. turns out that this makes me l33t :D

Thanks for clearing things up.

Share this post


Link to post
Share on other sites

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

Sign in to follow this