• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

TotalCoder

New tutorial for novices needs your critique again.

13 posts in this topic

First off let me express my deepest thanks to everyone that has critiqued the first tutorial. I have written a second tutorial trying to explain "cin" and "cout" so that a novice can add some interactivity to their applications. When critiquing, please remember, the target audience is complete novices or hobbyist, or people beginning. But once more would appreciate anyones critique, and of course, if your critique was used, you will be added to the tutorial under additional credits. Thanks, again, everyone! Find that tutorial at http://www.totalcoder.com if you haven''t read the first tutorial please do since that is still under development. Also an additional thought I thought about was developing a simple IDE to use Borland''s compiler. It would be a great excercise for beginners to watch and see the development of an application, plus it would give some added benefit to the visitors. Sam ----- TotalCoder http://www.totalcoder.com "Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
- required platform: wrong, shoudl work with ANY c++ compiler.
- streams are not declared in ''iostream.h'' but in ''iostream''.
- yes, you need to address somewhere the namespace issues when discussion the STL.
- yes, streams are part of the STL.
- you need to explain what a stream is : an abstraction for a communication channel, be it console/file/string ... or socket (still looking for a good stream socket class)
- you''re jumping ahead too much.
- the explanation for char, byte and stuff doesn''t quit belong here and you should be using string instead : it works as well (or better) and you wouldn''t have to explain it until much later.
- second code example is broken : cout<<"Hello World! "< }


0

Share this post


Link to post
Share on other sites
By the way, your code wont work, since your pointer is unallocated.

0

Share this post


Link to post
Share on other sites
Hey,

First of all I suggest you don''t use pointers so soon as it can be a very confusing subject and most newbies seem to get confused with pointers.

To talk about "cin" you could rather use an "int " rather than a "char *".

I would suggest not to use pointers at all until you cover the pointer subject.
0

Share this post


Link to post
Share on other sites
quote:
Original post by Fruny
- streams are not declared in ''iostream.h'' but in ''iostream''.



Streams are declared in ''iostream.h'' and you can use it if you want, you just can''t use namespaces if you do it that way.


---
Make it work.
Make it right.
Make it fast.
0

Share this post


Link to post
Share on other sites
Thanks for the input. Can for novices can I use std::string without bringing on too much confusion? It was hard enough trying to explain char* and then having to delve into bits and bytes. The reason I did this was to try and tell the novice no matter what you see the computer doing, no matter what application, no matter what game, it is all just a bunch of 1''s and 0''s. By doing this, I hoped to instill into them that no matter how complex the subject or portion may be it is just a matter of representing 1''s and 0''s.

Required platform change is correct and I''ll reflect that on both tutorials for C++. I was thinking of the platform that this compiler runs on which is Windows based. But since I''m trying to teach basic c++ in these tutorials, I''ll make the difference known.

Fruny I tested this code on the platform mentioned and it compiled and ran fine, and I don''t think there would be an issue of a memory leak since I did not create anything with new. But it worked. And I like flame warrior''s comment on pointers I forgot I can represent strings with other variable types at this point. Because pointers are very important and a hard concept to grasp.

I keep getting those damn HTML typos! See this is what happens when you code using MFC and a code correcting, syntax coloring, feature full IDE, you lose grasp of the basic concepts. Writing these tutorials has also helped me relearn a couple of basic issues.

I''ll make the revisions and repost on this thread when it''s done, and I assume everyone here won''t mind if I add them to the additional credit portion? Thanks once more for your valuable critique.

Sam
-----
TotalCoder
http://www.totalcoder.com
"Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
I''m not talking about a memory leak, I''m talking about the fact that you do "cin >> FirstName;" without making sure that FirstName (a pointer) points to a valid address, corresponding to allocated memory. Which you failed to do. I assume you ran a debugging build of your code, and that bcc caught your error.
0

Share this post


Link to post
Share on other sites
Fruny thanks for your help with this one, I just have to put you on the byline. Something interesting to note here. Using the Borland compiler no problem, no warnings got the code snippet to run fun, however, using Visual C++ I do have first chance exception error which is resolved by changing it to a explicit definition of a character arrays (i.e. char FirstName[20] as is mostly taught in text books, because I assume it is right.

However, I''m pondering A.)Why it works in one compiler/linker and not the other? B.) If this is the case which is more ANSI C++ compliant, and why one runs fine and not the other?

Intriguing questions I hope to have the answer to late tonight or tomorrow morning. For anyone jumping on the thread the code is

quote:

#include
using namespace std;

int main()
{
char* FirstName;

cout<<"Please enter your first name: ";
cin>>FirstName;
cout<<"Hello, "<
}



Works fine compiling under Borland, and executable runs, and does not work under Visual C++, compiles but First Chance exception error during the istream template code. This is an intriguing issue and if someone knows why it would work under one compiler and not the other, please share it with me :-)

Sam
-----
TotalCoder
http://www.totalcoder.com
"Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
It shouldn''t work. Where is the data being stored? I''m rather surprised Borland lets that one through (it should compile, but referencing memory you haven''t allocated - via the cin>> FirstName statement - should cause an exception). It''s bad coding practice anyway, as doing things like that makes your code susceptible to buffer overruns and other exploits.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
0

Share this post


Link to post
Share on other sites
Oluseyi thanks for the update. After reviewing the myriad of books and other references on the internet I have come to the same conclusion. Isn''t it funny how much Visual C++ and MFC hides so much from you, and you forget the most basic of concepts?

Bad coding practice, hmmmm. Wouldn''t it be bad to allocate a fixed array of characters, as most text books do in the beginning, and not instill into the programmer to check the upper and lower bounds of the string being passed in? This is cause for a buffer overrun as well. Is focusing on the concept of how it works more important than instilling good coding practice as most advanced books will teach eventually?

I mean why say do this one way for 2 semesters and 100 chapters, and eventually learn that you should have been checking the upper and lower bounds to avoid buffer overruns? Should I start instilling this from the beginning? Or is this a concept best introduced later, when the novice has more time to grasp the basic concepts? This is intriguing and something I did not think about in the beginning. Plus I''ll rewrite the sample so it can compile on both compilers.

Sam
-----
TotalCoder
http://www.totalcoder.com
"Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
why not use string? I''m writing an introductory programming book and I''m definently not going to get into bits and bytes or pointers or anything like that until near the end. Those are all implementation details. Implementation comes after you understand what you are trying to make in the first place. Using char* as string is really confusing, that goes in an appendix. The fact that string literals are char* is not a big deal so you never need to even mention that some people use char* along with a bunch of functions to mimic a proper string class. It will come up when you have to use c_str() but you don''t have to go into it too deeply there either. Along those lines, why use arrays either? I''m going to go with vector.
0

Share this post


Link to post
Share on other sites
I tried your web page for beginners. Its confusing and it seemed like everything was incomplete. I agree with who ever said it, you jump around to much
0

Share this post


Link to post
Share on other sites
the_nebuchadnezzar thank you for your post. What part did you find confusing? What would you have liked explained better? Or was the total flow just "off". I value your criticsm and would appreciate a more in depth description of what you found lacking so I can correct it.



Sam
-----
TotalCoder
http://www.totalcoder.com
"Resources, tutorials, and articles for the novice, part-time, and hobbyist programmer"
0

Share this post


Link to post
Share on other sites
a kinda off the topic comment on <iostream.h> vs. <iostream>
the former is "old style" c++ and is discouraged by the ANSI standard. the latter however is the "new" way to do it and I figure if your writing a tute that you oughta go that way, (of course you''ll have to do the namespace gig too)
sorry if this isn''t relevant i haven''t read your tute..
0

Share this post


Link to post
Share on other sites