• 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.

BrandonSnider

Members
  • Content count

    16
  • Joined

  • Last visited

Community Reputation

102 Neutral

About BrandonSnider

  • Rank
    Member

Personal Information

  • Location
    Salisbury, N.C.
  1. Thanks... XD I knew I would feel dumb at the end of this one... always the little things. Appreciate it. Sometimes it's just helpful to have someone else look at it.
  2. I've worked with other languages in the past including basic and a lot of scripting languages, and I have worked a decent bit on C++ too. I haven't worked on C++ in quite a while now, and last night I was trying to refresh myself on the basics... so--and this is a little embarrassing--I wrote this small piece of code for a console program to send my girlfriend: [CODE] #include "stdafx.h" #include <iostream> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { //Vars string username = ""; //Execute cout << "Hello \n"; cin.get(); cout << "What is your name? "; getline (cin, username); cout << "Your name is: " << username; cin.get(); if (username == "Tiffany" || "tiffany" || "Tiffany McClure" || "tiffany McClure" || "Tiffany Mcclure" || "tiffany mcclue") { cout << "Your name is Tiffany... \n The Creator has a message for you: \n I love you Cupcake"; cin.get(); } else { cout << "Your name is not Tiffany."; cin.get(); } return 0; } [/CODE] The problem is... it doesn't appear that the "if (username == "Tiffany" || "tiffany" || "Tiffany McClure" || "tiffany McClure" || "Tiffany Mcclure" || "tiffany mcclue")" statement evaluates correctly, as the program always displays the cout message in the "if" block, even if the if statement should be false. I know these are beginner C++ concepts that have nothing to do with game development, but... this is like the only forum acct. I have for anything like this, and I hate to create another just to ask this somewhat stupid question. I appreciate any help with this, I'm trying to pick up C++ again so that maybe I can do something useful with it. EDIT: Oops. I haven't been on this site in a while. Forgot there was a "For Beginners" Section. This probably belongs there. Sorry about that.
  3. [quote name='shadowisadog' timestamp='1310496411' post='4834440'] [quote name='bls61793' timestamp='1310495674' post='4834430'] Hello guys. I've only made a few posts here while I was (well, I'm still in the process of practicing) learning C++. I have since made the jump to using the Unreal Development Kit for my game projects. So far the Syntax is very similar to C++ which is helpful; however, I'm having a little problem Note: The reason I havn't posted to the Unreal Forums is that my account is currently not active and i am waiting in a Moderator Queue to allow me onto the forums. So I was wondering if anyone here knows Unreal Script and would be willing to answer a question I have. In C++ class functions and members can be accessed by the member operator '.' This seems to not be the case with unreal script. I'm trying to figure out how to call class member functions and access class members in Unrealscript for use with my HUD. Anyone know how accessing other classes works in Unreal Script? [/quote] Have you taken a look at the Development\Src\UTGame folder? Normally one would advise not looking at source code when learning to do something, however in the circumstance where you are working in an existing engine and trying to make things work in that engine, looking at existing code in my opinion is very valuable (The same constraints they have to make to work with the Unreal engine are probably the same constraints you will have). Also the '.' operator is used in that manner in Unreal Script. For instance from UTPlayerController, line 837 (roughly): [code] reliable server function ServerProcessSpeechRecognition(SpeechRecognizedWord ReplicatedWords[3]) { local array<SpeechRecognizedWord> Words; local int i; local UTGame Game; Game = UTGame(WorldInfo.Game); if (Game != None) { for (i = 0; i < 3; i++) { if (ReplicatedWords[i].WordText != "") { Words[Words.length] = ReplicatedWords[i]; } } Game.ProcessSpeechRecognition(self, Words); } } [/code] Main thing to note is that variables (in this case local variables) must be declared and initialized on two separate lines (as far as I know). Also you need to typecast to the appropriate type containing your methods. such as convertedInstance = MyClass(instanceToConvert) ect. Here we see Game = UTGame(WorldInfo.Game) . [/quote] Well I have seen many people typecasting variables from other classes but I'm not exactly sure how it works. Basically speaking, why can't (using my example) [code] TestGamePawn.getwaterlevel();[/code] why would this not call the function 'getwaterlevel()' from the TestGamePawn class? EDIT: Comparing it to C++ shouldn't it work like this: [code] //Class Declaration class TestGamePawn { int charwaterlevel; Public: int getwaterlevel() { return charwaterlevel; } } //Main int main() { int i; //Calling the class function via member operator. i =TestGamePawn.getwaterlevel(); } [/code]
  4. Hello guys. I've only made a few posts here while I was (well, I'm still in the process of practicing) learning C++. I have since made the jump to using the Unreal Development Kit for my game projects. So far the Syntax is very similar to C++ which is helpful; however, I'm having a little problem Note: The reason I havn't posted to the Unreal Forums is that my account is currently not active and i am waiting in a Moderator Queue to allow me onto the forums. So I was wondering if anyone here knows Unreal Script and would be willing to answer a question I have. In C++ class functions and members can be accessed by the member operator '.' This seems to not be the case with unreal script. I'm trying to figure out how to call class member functions and access class members in Unrealscript for use with my HUD. Anyone know how accessing other classes works in Unreal Script?
  5. [quote name='ApochPiQ' timestamp='1310087895' post='4832607'] I will bet you money that fixing the missing { changed the behaviour of your program [i]somehow[/i]... so what's it do now? ;-) [/quote] Actually it didn't change my program at all. The problem is that the computer is not waiting for user input at the 'getline'. It does this properly the first time through, however, it doesn't stop (doesn't work properly) after the loop. And actually, if it will help you, I can attach my current build. EDIT: Also, if it is helpful: 'charName' is a string class variable [ #include <string> | string charName; ] EDIT:EDIT: Also, How much money are we talking? Because even if I didn't add the braces and entered 'N' or 'n' the result would be the same. However, I will let you know I am glad you pointed that brace thing out, because when I actually did input 'Y' or 'y' it would have given me problems.
  6. [quote name='ApochPiQ' timestamp='1310084472' post='4832597'] Your problem is that you forgot a { after the else. This means that only the "input not valid" line is attached to the else clause, so userSatisfied is always set false immediately afterwards, and your program loops forever. This is why indentation is very, very important. Pick a style and stick to it, it'll help you catch these bugs a lot sooner. [source lang="cpp"]void set_charName() { using namespace std; bool userSatisfied; char userInput; do { charName = ""; cout << "Name your character. Then press 'Enter/Return'. \n"; getline (cin,charName); system ("cls"); cout << "You have decided to name your character " << charName << ", is this correct?\n (Enter Y/N)"; cin >> userInput; if (userInput == 'Y' || userInput == 'y') userSatisfied = true; else if (userInput == 'N' || userInput == 'n') { userSatisfied = false; system("cls"); } else cout << "Input not valid"; // Oops! userSatisfied = false; system("cls"); } while (userSatisfied == false); }[/source] [/quote] I hate to be the bearer of bad news, but this did not solve my problem. However, I am taking your comment about indentation to heart.
  7. (NOTE: C++ in Viz C++ Express 2010) I hate to post again after posting something earlier today. I don't want to burden you guys, or wear out my welcome here. However, I have a problem that I have been working on for upwards of 30 Mins now, and I think I really need someone's input besides my own. so I have this function: [code] void set_charName() { using namespace std; bool userSatisfied; char userInput; do { charName = ""; cout << "Name your character. Then press 'Enter/Return'. \n"; getline (cin,charName); //Entering a literal string here with whitespace. //Then: On loop, the program does not stop here (at 'getline') and allow the user to enter a new line for "charName" system ("cls"); cout << "You have decided to name your character " << charName << ", is this correct?\n (Enter Y/N)"; cin >> userInput; if (userInput == 'Y' || userInput == 'y') userSatisfied = true; else if (userInput == 'N' || userInput == 'n') { userSatisfied = false; system("cls"); } else cout << "Input not valid"; userSatisfied = false; system("cls"); } while (userSatisfied == false); } [/code] So, here is the problem: When I get to this part of the program, and enter a literal string, the function moves on as intended. Which is good; however, whenever I enter an 'n' or 'N' for userInput, the program loops, but does not pause and allow me (the user) to change the value of charName.
  8. [quote name='fastcall22' timestamp='1310064614' post='4832422'] [quote name='bls61793' timestamp='1310063569' post='4832412'] So is this warning not a bad thing? " 1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(16): warning C4351: new behavior: elements of array 'Character::charstats' will be default initialized " [/quote] Nope. It's just warning you that the same code may have had a different behavior in a prior version of Visual Studio. [quote] EDIT: Also: What does this error mean? "1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(16): error C2536: 'Character::Character::charstats' : cannot specify explicit initializer for arrays" [/quote] Drop the '0' between the parenthesis, and you're good. Also, if you want a detailed explanation of an error or warning, look it up on [url="http://msdn.microsoft.com/"]MSDN[/url], or Google "msdn C[i]xxxx[/i]". For example, [url="http://msdn.microsoft.com/en-us/library/1ywe7hcy%28v=VS.100%29.aspx"]C4351[/url] and [url="http://msdn.microsoft.com/en-us/library/9f53ks1w%28v=VS.100%29.aspx"]C2536[/url] [/quote] Yea, I've googled Error Codes in the past, but sometimes I don't understand the Microsoft Post. Sometimes it's helpful to get in lay-mans terms. Anyway, thank you very much for your help. And everyone else for theirs. I understand this all a lot better now.
  9. So is this warning not a bad thing? " 1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(16): warning C4351: new behavior: elements of array 'Character::charstats' will be default initialized " EDIT: Also: [s] What does this error mean?[/s] Figured it out. I feel stupid. "1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(16): error C2536: 'Character::Character::charstats' : cannot specify explicit initializer for arrays" [code]class Character { private: int charstats[5]; public: Character () : charstats(0) { } int statrecieve(int x) { return charstats[x]; } };[/code] ALSO: Thanks for helping me. Sorry I'm a super novice.
  10. [quote name='fastcall22' timestamp='1310061084' post='4832379'] [quote name='bls61793' timestamp='1310059704' post='4832358'] what exactly do you mean by Raw Array? [/quote] A "raw array" is a built-in type, constant-size array, which are quite rigid and unsafe (read: easy to shoot yourself in the foot, if you're not careful). (Raw arrays are typically contrasted with [url="http://cplusplus.com/reference/stl/vector/"]std::vector[/url]s. std::vectors are dynamic arrays, which can be resized, with automatic memory management, and extra safety checks when enabled.) [code] int arr[] = {1, 2, 3, 4}; // <-- this is a raw array arr = {1, 2, 3}; //you aren't able to do change the size of raw arrays arr = {2, 3, 4, 5} // nor can you reassign their contents int foobar[5]; foobar = {}; // can't reassign contents [/code] [quote name='bls61793' timestamp='1310060292' post='4832369'] But I still can't figure out where all these syntax errors are coming from.[/quote] Your error is on this line: [code] charstats = {0}; [/code] chrastats has already been declared as int[5], and you can't reassign it's contents, so you have to use one of the methods described in my previous post. [/quote] I'm sorry for my ignorance, but... can you explain your Initalizer example above? I'm still not sure how that works. That is what I'm trying to use, an initalizer list. My main thing is, what is with the colon, and what looks like another function (meaning "charstats ()") EDIT: Excuse my stupidity. You provided me a link. XD DOUBLE EDIT: Ok, so I'm having a little bit of a problem understanding this page because I havn't reached the chapter on inheritance.
  11. Still having problems though: Current (Updated Code)): [code] #include "stdafx.h" #include <iostream> #include <fstream> class Character { private: int charstats[5]; public: Character () { //Compiler Says The Next Line Is The Culprit Line. I know that it's not always the one that kicks the error though. charstats={0}; } int statrecieve(int x) { return charstats[x]; } }; int main() { using namespace std; return 0; } [/code] Current Compile Errors: " 1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(17): error C2059: syntax error : '{' 1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(17): error C2143: syntax error : missing ';' before '{' 1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(17): error C2143: syntax error : missing ';' before '}' " Thanks Mr. Other Awesome guy. I now know about "this" and the fact I don't need "Character." But I still can't figure out where all these syntax errors are coming from. I believe my semi-colons are properly placed... gimme a sec to look over it again.
  12. [quote name='fastcall22' timestamp='1310059187' post='4832352'] [quote name='bls61793' timestamp='1310057826' post='4832340'] [code] Character() { Character.charstats = { 0 }; } [/code] [/quote] First, members of objects should be accessed via the "this" pointer, either by "this->charstats = {0}" or "charstats = {0}". Second, C++ doesn't like raw arrays all that much. If you want to default-initialize your charstats, you can do either of the following: [url="http://www.cprogramming.com/tutorial/initialization-lists-c++.html"]Initializer list[/url]: [code] Character() : charstats() { } [/code] [url="http://cplusplus.com/reference/algorithm/fill/"]Fill[/url]: [code] #include <algorithm> Character() { std::fill( charstats, charstats + 5, 0 ); } [/code] [url="http://cplusplus.com/reference/algorithm/copy/"]copy[/url]: [code] #include <algorithm> Character() { int startstats[5] = { 1, 2, 3, 4, 5 }; std::copy( startstats, startstats + 5, charstats ); } [/code] Or DIY: [code] Character() { for ( int i = 0; i < 5; i++ ) charstats[i] = 0; } [/code] [/quote] Thanks for the help, I appreciate it. I feel like a noob saying this (because technically I am), but what exactly do you mean by Raw Array? EDIT: Also. As you can probably tell, I was trying to use an initalizer list. I was also wondering what the ' : ' colon is for in THIS: Character() : charstats() {
  13. I say it's a bit of both. My brother and I are the creative masterminds behind our world, which will hopefully be in a game sometime in the future, and we've done a lot of crappy concepts by hand. Our friend does some concept work for us, and by that we mean... He takes our shitty drawing and turns it into a masterpiece, and alters it until it's what my brother and I invisioned (or as close to). I believe the other point is valid too. On one of the crappy drawings we gave him, he returned with a concept that had a lot of changes to it... we liked the changes. It's nice for a concept artist to provide ideas for the group as well as just the designers. Although I see how this may not work in a big development studio.
  14. Ahhh so wait... I must missed this when I was fast-reading. The name of a constructor has to be the same as the class? Edit: I now have 4 Errors Kicked: 1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(17): error C2143: syntax error : missing ';' before '.' X2 and the same error with brackets. It appears these are related to misplaced member operators and or semi-colons in the wrong place, but to the best of my knowledge my code is good, so can someone point them out to me? Also, my current code looks like this: [code] #include "stdafx.h" #include <iostream> #include <fstream> class Character { private: int charstats[5]; public: Character () { Character.charstats = { 0 }; } int statrecieve(int x) { return charstats[x]; } }; int main() { using namespace std; return 0; } [/code] Also, Texus. You're cool because you're helpful and have an Abra icon
  15. [quote name='Texus' timestamp='1310057205' post='4832332'] [code] int statrecieve(int x); [/code] There shouldn't be a ; at the end of that line. [/quote] That may be true, as it is a function, but that still doesn't fix the problem. It only adds more errors: New Compiler Complaint List after deleting ';' and recompiling: " 1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(11): error C2059: syntax error : '{' 1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(11): error C2334: unexpected token(s) preceding '{'; skipping apparent function body 1>c:\users\brandon\documents\visual studio 2010\projects\theworld\theworld\theworld.cpp(17): error C2065: 'charstats' : undeclared identifier " I understand the last one. My main problems are the C2059 and C2335 Errors.