Jump to content

  • Log In with Google      Sign In   
  • Create Account


Josh Petrie

Member Since 11 Jun 2003
Offline Last Active Yesterday, 12:42 PM

#4947083 Knowing where to arrive

Posted by Josh Petrie on 07 June 2012 - 10:17 AM

I would suggest you start with a language other than C++, but you already knew that and don't really want to hear it, so why I should I waste my time dispensing more advice that you might have arbitrarily predetermined you don't want to hear because you think you know better?


#4947082 Creating graphics for a full screen game? What dimensions?

Posted by Josh Petrie on 07 June 2012 - 10:15 AM

My GDD is getting near completion so it's time to make it even more detailed...

I would venture to suggest that your next step should be to actually start making your game, instead of trying to do all this design and "GDD" bullshit up front. You're putting the cart before the horse, and if you spend too much time going too far in-depth with your design and pre-producing your art assets and all that you run the risk of having to throw away a ton of that time when it becomes apparent during iteration that something isn't going to work.

You've already made mistakes in your design and content production, so start iterating on something practical so you can expose those mistakes and correct them sooner rather than later.


#4947077 Need C++ Roguelike Tutorial

Posted by Josh Petrie on 07 June 2012 - 10:07 AM

There's RogueBasin, which evolved from Dungeondweller (which I mention for posterity only, as most of its information is likely extremely outmoded these days). You may also want to check out Amaranth.


#4932510 Need Help : error: syntax error before `*' token

Posted by Josh Petrie on 18 April 2012 - 10:38 AM

You forgoet a ";" from first line of code.

This is correct. Your first bit of code is:

//music
Mix_Music *music = NULL
You're missing the semicolon after the NULL.

Sometimes, when you see an error from a compiler and it points to a line that looks okay -- in this case, it's probably indicating the line
Mix_Chunk *muks = NULL;
which looks fine, you should take a look at the line (or the code) above the error. The C++ compiler processes code from the top down and certain errors confuse the parse enough that it cannot pinpoint the source of the error with complete accuracy.


#4907533 Slimdx Xinput - Exception Error - A short Code Provided

Posted by Josh Petrie on 29 January 2012 - 11:13 PM

None of those calls block, and there is no loop keeping the program alive. It's doing exactly what you wrote: determines if the controller is connected, prints one line, and exits immediately.


#4905341 Have i choosed the right path for beginners?

Posted by Josh Petrie on 22 January 2012 - 11:21 PM

Do less reading, and more actual practice. No amount of reading books -- especially on C++ (a poor choice for a first language, I would have recommend Python or C#) will teach you everything you need to know. Much of programming is problem solving and to train that skill you need to try to work on actual problems. Write actual programs, even simple ones.

I wouldn't bother with the DarkGDK thing either.


#4903323 is it posible

Posted by Josh Petrie on 16 January 2012 - 01:09 PM


Is it possible? Yes. Would I recomend it? Nope.

I would suggest starting with C#, learn it, and then if you wish move on C++.

and whichis better c++ or C#

They are different tools and neither is objectively better in general. However, as a first language C# is a better choice because C++ is rife with the cultural assumption that the programmer is always correct -- as a beginner this will rarely be the case.

Making console games is a difficult task for a beginner. C# (with XNA) is the most viable approach. With any other language or technology you will only be able to use homebrew libraries, which are often poorly documented and not the most user-friendly. You are not able to make games for any consoles that you can distribute (or play on non-modified consoles) without XNA, because you will not be able to obtain a license and development hardware for those consoles.

Focus on learning to program above all else; languages, tools and platforms are largely incidental.


#4902886 Can someone explain the problem with this compilation error!

Posted by Josh Petrie on 15 January 2012 - 12:37 AM

The problem is that piece.h and board.h depend on each other (by including each other). Such a dependency can never be corrected resolved, so you must change your code.

Remember that #include is just textual substitution by the preprocessor, and that the compiler builds each translation unit in isolation. A translation unit is originated from a source file (.cpp) -- header files are typically never explicitly compiled, their code is first preprocessed into a source file which is then compiled. In your build output, you should be able to see the actual .c or .cpp file the compiler is trying to build when it reports this error.

That source file probably includes piece.h, directly or indirectly. It probably does so before including board.h, directly or indirectly. This means that the preprocessor would have first evaluated the #include for piece.h, and then during the evaluation of piece.h, evaluated board.h. During evaluation of board.h, piece.h would be evaluated but because of the include guards in piece.h, no text was added to the translation unit.

Thus, the file preprocessed file (as seen by the compiler) probably looks like this:

    namespace Foo {
    class Piece;

    class Board{
        //ERROR OCCURS HERE
        bool isOccupied(int x, int y,const detail::PieceEnums::PieceID pid)const;
    };
    }

    namespace Foo {
    namespace detail{
        struct PieceEnums{
            enum PieceID{ ID1, ID2 };
        };
    }

    class Board;

    class Piece{
    public:
        void foo(Board& b)const;
    };
    }
    #endif

You can see, then, why the compiler complains that "detail" is unknown -- it hasn't been seen yet at the point the error occurs.

You need to break the dependency between the files to fix the problem. From the code you've provided, board.h doesn't need anything from piece.h except the enum, which you could pull out into its own header, for example. A forward declaration of Piece (or Board) would allow you to use Piece (or Board) as pointers or references or in other ways incomplete types are permissible as well, without requiring the #include.


#4889123 Game Development Langauge

Posted by Josh Petrie on 30 November 2011 - 10:49 AM

Closed; this question has been asked-and-answered elsewhere on these forums. Please search.


#4879111 Ripping Assets from Commercial Games

Posted by Josh Petrie on 31 October 2011 - 08:49 PM

I don't think this is appropriate for this forum at all.


#4867793 Quake 2 MS-VC 6 does not transfer to VS2010 Express

Posted by Josh Petrie on 30 September 2011 - 06:19 PM


Yes. Because VC6 came with both a compiler and a standard library that were completely broken with respect to the burgeoning standard at the time -- sure, VC6 "worked" left to its own devices, and in some ways it was even "good" for the time, but code written against VC6 is necessarily broken and won't work without modifications on *any* other compiler, even the very next iteration of VC, and rightfully so. VS2010's compiler still maintains switches to enable *some* of the broken behavior of VC6 in order to ease porting, IIRC.




"Yes. Because VC6 came with both a compiler and a standard library that were completely broken with respect to the burgeoning standard at the time -- sure, VC6 "worked" left to its own devices, and in some ways it was even "good" for the time, . . . "


What the heck ?

Try to give a little referential documentation and evidence.

This is a relatively well-known fact. Visual Studio 6 shipped in June of 1998. C++ itself was not accepted as an ISO standard until September of 1998. VS6 was a decent toolchain for its time, but it was released (and thus, most of its major development) was done well in advance of any kind of final ratification of the C++ standard. The VS team had to pick what was popular and looked good from the available collection of C++ variants and ideas being tossed about and implement that.


#4867755 Quake 2 MS-VC 6 does not transfer to VS2010 Express

Posted by Josh Petrie on 30 September 2011 - 04:23 PM

You're better off just making new VS 2010 solution and project files and manually adding the source. Chances are most of the code won't compile anyhow and your time will be better spent fixing those errors.


#4863861 SlimDX, Winforms and full-screen

Posted by Josh Petrie on 20 September 2011 - 10:17 AM

Windows Forms is rendered with GDI. Using GDI and D3D over the same pixel airspace results in the problem you are observing as they both compete to render to those pixels.

The only way you can make this work is to trim up the screen real estate and allow only GDI, or only D3D, to render to the appropriate region. You cannot do this is exclusive full screen mode; you'll have to run in "full screen windowed" mode, which is just windowed mode where your main window is resized to be the dimensions of the screen (and immovable, et cetera).


#4778294 I got beat up by a cop

Posted by Josh Petrie on 23 February 2011 - 11:12 PM

*blink*


#4766508 Setting Up VS2010 Do Output Release Build In Multiple Locations?

Posted by Josh Petrie on 28 January 2011 - 11:10 PM


I tried the command in cmd and it say the command can't find the file specified however I can go to that directory "D:\Coding Projects\Dynamically Linked Libraries\Test\src\TestLibrary\TestLibrary\bin\Debug" and the TestLibrary.dll is there. D:\test also exists. Does anyone see anything wrong with my code?


You should have been using quotation mark, since your path contains spaces. The copy command probably tries to copy "D:\Coding Projects\Dynamically" to "Libary" which makes no sense at all. You should try the following:

copy "D:\Coding Projects\Dynamically Linked Libraries\Test\src\TestLibrary\TestLibrary\bin\Release\TestLibrary.dll" D:\test


However I have no idea how to separate the build events for different configurations: I didn't find a way either.


You can't do this directly in the IDE, you have to edit the .csproj directly to author your own MSBuild XML, or use the IDE's macros it makes available during the post-build steps as parameters to a batch file that does the "only copy in Release" logic. Visual Studio is actually a relatively poor build configuration system.




PARTNERS