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

joshuanrobinson2002

Members
  • Content count

    55
  • Joined

  • Last visited

Community Reputation

187 Neutral

About joshuanrobinson2002

  • Rank
    Member

Personal Information

  • Location
    Norton, Ks
  1. Ravyne, I expected an exception because I've seen exceptions thrown with similar code in the past. I simply assumed it would throw in this case as well, and got egg all over my face as a result . Thanks for the responses everyone, I think I understand.
  2. The other day, I had one of our new developers asking me how he could get a null reference in C++. Now, I know enough about C++ to know I'm not an expert, but I felt comfortable fielding that question. I explained that a reference in C++ could not be null, but that it was possible to have an invalid reference if, for example, you return a reference to a temporary. To illustrate, I wrote the following simple code: [CODE] #include <iostream> using namespace std; class Foo { int _bar; public: Foo() : _bar(0) { } int Bar() { return _bar; } void SetBar(int value) { _bar = value; } }; //end class Foo& BrokenFoo() { return Foo(); } //end f() int main() { Foo& f = BrokenFoo(); f.SetBar(10); cout << f.Bar() << endl; system("PAUSE"); } //end f() [/CODE] Imagine my surprise when, not only did the application not throw an exception but the output was 10. What gives? We were using Visual Studio 2008. When we built the application in Debug Mode the output was -858993460, and in both cases we got a compiler warning, and I know I've hunted down this very bug more than once in the past. But, it the application seemed to allow it. I was expecting an AV, or some sort of exception.
  3. I don't know of any alternate high-score tutorials, but maybe we can help you figure out what's wrong with the one you're using. [quote name='cupidstunt' timestamp='1322739372' post='4889375'] But everytime I try to compile it will not work. [/quote] I assume this means you're getting a compiler error? Could you tell us what the error is exactly, and maybe post some of your code so we can help troubleshoot it. I didn't take a real close look at the tutorial, but it appears that it doesn't specify which class some of the functions should belong to (SaveHighScores and LoadHighScores, for example). Just a shot in the dark, but do all your functions belong to a class (or struct, or interface)? In C#, they must. [code] struct HighScoreData { static void SaveHighScores(HighScoreData data, int count) //<- This is okay. { /*Stuff*/ } } static HighScoreData LoadHighScores(string fileName) //<- This is not, this function does not belong to a class, struct, interface, etc... {/*Stuff*/} [/code] Hope that helps.
  4. Hey, [color="#284b72"]ndrul. If you're still stuck on deciding between C++ and C#, why not just give C# a shot and see if you like it. You said you spent two months learning C++, so you've probably got a handle on basic programming principles such as flow control, conditional statements, and functions. C# and C++ also share a somewhat similar syntax, which might make picking up C# a little eaiser. So, if this decision is a stopping point for you, why not just download C#, read up on it a bit, and spend a week (which is how long you said you've been working on your game in C++) working on a game in C# and see which one you like better, or feel more productive in. I know that sometimes wondering if you're using the right language, or doing things "the right way" can put a halt on a project. And, I'm not trying to say that these things aren't important. But, you put a lot of emphasis on getting things done (productivity) in you're original post. If you're spending a lot of time worrying about choosing "the right language" you're not being very productive on your game .[/color]
  5. Sounds like you're being asked to implement an Observer Pattern...
  6. Quote:Original post by Palidine If you're doing a straight up text-based game then command line is obviously the correct choice. I think he's talking about something that uses text characters for graphics. A-la Rogue. If thats the case and you're looking for a portable console library, you should look into Curses. PDCurses is a curses library for Windows. I've never used it myself. If portability isn't a concern, is there any reason you can't use C# and System.Console? I imagine it's a lot more pleasant to work with than straight Win32 :).
  7. Quote:Original post by alvaro I tried to learn a bit of python once. I gave up after I found out that `print input()' is powerful enough to evaluate 4*(1+2) as 12. If that's a problem, you shoud use raw_input() instead.
  8. I'm not sure I understand. You need the class that handles loading from the XML file to be available across multiple parts of your game? Is there any reason you can't new up an instance of this class where it is necessary? Or, perhaps, even make it static so that it doesn't require you to new up an instance? For example: public static class XMLLoader { public static PlayerStats LoadStats(String filename) { PlayerStats ps = new PlayerStats; /*Load ps from XML*/ return ps; } } MainGame.cs public class MainGame { public void DoSomething() { PlayerStats ps = XMLLoader.LoadStats(*/Path To File*/); //Stuff... } } StatsScreen.cs public class StatsScreen { public void DoSomething() { PlayerStats ps = XMLLoader.LoadStats(*/Path To File*/); //Stuff... } } etc, etc... Although, if you're storing the results of the load operation in global variables, I don't see what you'd need access to this class for beyond the initial load. Being global, wouldn't your main game, status screen and upgrade screen already have access to the stats you read from the file? So why read that file again? Hope that helps.
  9. Well, I'll echo others in this thread who said that XNA can be used to target more than just the 360. That being said, if you don't wnat to use XNA you'll need to find other ways of drawing to the screen and playing sounds and music and whatnot. jpetrie gave some suggestions, and I'll add that SDL and SFML also have .NET implementations.
  10. Looks like what you're looking for is a pointer to a member function... It's not something I actually use often, so I can't personally give you a great deal of information on how to use them. The updated code might look something like this... #include <iostream> #include <vector> #include <string> class unit { std::string _name; public: unit(std::string name) { _name = name; } void draw_unit() { std::cout << _name << std::endl; } }; class controller { std::vector<unit> _units; void loop_units(void (unit::*unit_function)()) { for (int i = 0; i < _units.size(); i++) (_units[i].*unit_function)(); } public: void draw_units() { loop_units(&unit::draw_unit); } controller() { _units.push_back(unit("Bob")); _units.push_back(unit("Steve")); _units.push_back(unit("Mike")); } }; //end class int main() { controller c; c.draw_units(); system("pause"); } Google can probably give you more information. I believe this is the site I referenced last time I was looking at pointers to member functions. Hope that helps.
  11. Glad I could help. I don't do as much coding at home as I used to, but at work we use DevPartner Studio for code analysis. Luckily, we haven't run into many situations where applications just weren't running fast enough (knock on wood) so the profiler doesn't see as much use as it maybe should. I think it requires an expensive liscence though, so it might not be the right tool for a hobby project :).
  12. Quote:Original post by rnw159 Why should I learn c++ when game maker can do make games faster and better?! Because C++ can be used to create more than video games. Because C++ is a marketable skill. Because you said: Quote:Original post by rnw159 I love to program ... I told him about the editor and how proud of it I was ... It felt great. Couple of fistpump moments. Game Maker has been around for, like, 11 years. Expecting to out preform it with an app you spent eight hours writing is probably being unfair to yourself. Quote:Original post by rnw159 How can I write my code to be as fast as that? How can I make my engine as fast as the game maker one? Hard to say. I suppose you'd have to profile your code, find out where it's performing poorly and see if you can optmize it. If you don't already have one, you might be able to find youself some profilers if you google something like "C++ Profiler" EDIT: Or, instead of googling, you can use the free profiler Sneftel linked to.
  13. After selecting "New Project" from the file menu, you should end up with a tree view in a pane off to the left with a bunch of project types. One of the nodes should be Visual C++ and underneath that you should see several more project types (ATL, CLR, General, MFC...). A CLR Project is a C++/CLI (Managed) Project. You want the project type "Win32". Choose a "Win32 Console Application" (I think) and when the Application Wizard pops up, click "Next" and under "Additional options" choose "Empty Project" Hope that helps.
  14. Are you posting the entire contents of your header files? Are there any other files in your project that could be causing the problem? What about the rest of the units.cpp like RobMaddison suggested? I only ask because I opened a new, empty win32 console project in VS2K8 copied and pasted your code exactly as it is into the approiate files, closed the curly braces in your units.cpp snippet, added a main function, and it built fine for me. This page might give you some ideas on what to look for that might be causing the problem.
  15. Are you seeding the random number generator? #include <time.h> int x; srand(time(NULL)); //Seed the random number generator, or you'll always get the same number. x = rand() % 5; //The rest of your code. I think you only need to seed it once, so probably in your main() function and not in your battle function.