Rpg Inventory.

Started by
17 comments, last by X5-Programmer 19 years, 9 months ago
j0seph....thanks for the new input...lol
Advertisement
j0seph, The link allredy posted :)

thx anyway.
-[ thx ]-
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.
Not giving is not stealing.
true
-[ thx ]-
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?
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]
Not giving is not stealing.
Stagz have you found something more yet? ;)
-[ thx ]-
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.
Stagz.

Possibly scripting and the pickup/dropdown item in specific squares can be interested parts.
-[ thx ]-

This topic is closed to new replies.

Advertisement