Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 05:33:21 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperPlaytestingFirst C++ game - engine working OK?
Pages: [1]
Print
Author Topic: First C++ game - engine working OK?  (Read 1878 times)
QuadrupleA
Level 2
**



View Profile WWW
« on: December 13, 2012, 07:08:33 PM »

Hey guys,

Wanted to see if any PC users had a quick moment to try this out; since two weeks ago I've been learning C++ and building a basic game engine for future use (and saying farewell to XNA). Hope to get a few more pieces built and then make a small jam-style game with it over the weekend.

Here's the file:

EngineTest.zip

If you get a chance to open it up: let me know if it runs, if the music plays and loops correctly, if you hear sounds when adding/removing stuff, if the framerate is solid and if the "controls" work:

+ / - (main keyboard):    add/remove stuff
Arrows/WASD:               move stuff

A little concerned about msvcrt110.dll being missing on some peoples' systems, I'm on the latest Visual Studio (2012). If anyone encounters an error there let me know and I'll try a statically-linked version.

Thanks!
Logged

Weapon Hacker - roguelite metroidvania;
Battleship Solitaire - mindless podcast companion
Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #1 on: December 13, 2012, 07:43:49 PM »

I tried to run it on XP and got an error that its not a valid Win32 application.
Logged

QuadrupleA
Level 2
**



View Profile WWW
« Reply #2 on: December 13, 2012, 08:10:55 PM »

I tried to run it on XP and got an error that its not a valid Win32 application.

Thanks. Looked into it a bit, looks like Visual C++ 2012 doesn't support compiling for XP, which sucks. They have an Update 1 which gave me other problems - ended up uninstalling it - but looks like it supports XP so guess I'll try to get it to work.
Logged

Weapon Hacker - roguelite metroidvania;
Battleship Solitaire - mindless podcast companion
Quicksand-S
Level 10
*****


View Profile WWW
« Reply #3 on: December 13, 2012, 08:21:08 PM »

On Windows 7 Home Premium 64-bit, I got a missing DLL error. It needs MSVCP110.dll. Obviously, I can just download that file, but it might be nice to include it if possible.

Apparently, it means that I require Visual Studio 2011 installed, which seems weird. Maybe it's the difference between compiling for release and compiling for debugging?


Edit: Well, I found the file online and it still didn't detect it. In addition, I already have a version of the DLL in my Windows System32 folder, so I don't know why your engine is giving me that error.
Logged

My Old Game: We Want YOU - Join the Fight for Freedom

Twitter - Mostly comments on games, old and new.
QuadrupleA
Level 2
**



View Profile WWW
« Reply #4 on: December 13, 2012, 08:31:01 PM »

Thanks Quicksand - here's a version with that DLL included (not as huge as I had feared -  646k - but I might be able to link it into the EXE later and save space).

EngineTest2.zip
Logged

Weapon Hacker - roguelite metroidvania;
Battleship Solitaire - mindless podcast companion
Quicksand-S
Level 10
*****


View Profile WWW
« Reply #5 on: December 13, 2012, 08:53:27 PM »

Well, that error is gone. Now I've got a different one: "The application was unable to start correctly (0xc000007b)."

What I've read about that error suggests that it's either a problem with your program trying to load an invalid image format, or the DLL you included is 64-bit and the program is 32-bit.

It works fine on your computer, with that DLL?
Logged

My Old Game: We Want YOU - Join the Fight for Freedom

Twitter - Mostly comments on games, old and new.
QuadrupleA
Level 2
**



View Profile WWW
« Reply #6 on: December 13, 2012, 09:39:13 PM »

Still working out the XP kinks - this build ought to work for Windows 7 though:

EngineTest3.zip

@Quicksand, I think you're right about the 64-bit DLL thing - I just copied that one from my system directory before. This version uses static linking for everything, which means all the library pieces used should be bundled into the EXE now, and no more extra DLL's (except the FMOD one for audio).
Logged

Weapon Hacker - roguelite metroidvania;
Battleship Solitaire - mindless podcast companion
Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #7 on: December 13, 2012, 10:56:18 PM »

I tried to run it on XP and got an error that its not a valid Win32 application.

Thanks. Looked into it a bit, looks like Visual C++ 2012 doesn't support compiling for XP, which sucks. They have an Update 1 which gave me other problems - ended up uninstalling it - but looks like it supports XP so guess I'll try to get it to work.

Thats bloody terrible. Suppose I'll be sticking with VS 2008 more.
Logged

QuadrupleA
Level 2
**



View Profile WWW
« Reply #8 on: December 13, 2012, 11:27:26 PM »

Thats bloody terrible. Suppose I'll be sticking with VS 2008 more.

Yeah - I'm usually dubious of the latest tool versions, don't know why I went with 2012 out the gate this time. Anyway I think I worked out the kinks - here's an XP-friendly version, built with VS 2012 Update 1, linked to an older DirectX SDK to hopefully avoid the need for anyone to download a new runtime:

EngineTest4_XpHappyHappy.zip

If anyone gets a chance to run it let me know if it works (see 1st post for keyboard info).
Logged

Weapon Hacker - roguelite metroidvania;
Battleship Solitaire - mindless podcast companion
Quicksand-S
Level 10
*****


View Profile WWW
« Reply #9 on: December 13, 2012, 11:41:33 PM »

It works!

Also, the frame-rate was pretty great. I had the window completely filled with no noticeable slowdown at all. Of course, there's no AI or anything, but it's still good.

The music (which is terrible, in a strangely catchy way) seemed to get quieter when I started adding objects. Not sure why, since it later got quieter when I removed them. I think it's that the volume starts maxed out and when I press a key, it goes to the correct volume for that number of objects. Anyway, I guess it doesn't matter since it's just an engine test.
Logged

My Old Game: We Want YOU - Join the Fight for Freedom

Twitter - Mostly comments on games, old and new.
Gregg Williams
Level 10
*****


Retromite code daemon


View Profile WWW
« Reply #10 on: December 13, 2012, 11:43:03 PM »

Yep worked on XP now, things seemed good.
Logged

QuadrupleA
Level 2
**



View Profile WWW
« Reply #11 on: December 13, 2012, 11:52:09 PM »

Thanks guys - nice to get the kinks worked out early. 

I'll have to check into that music volume thing - it's supposed to start soft then get louder (and crazier/annoying) as you add stuff, but my function to set the volume might not be working right.
Logged

Weapon Hacker - roguelite metroidvania;
Battleship Solitaire - mindless podcast companion
QuadrupleA
Level 2
**



View Profile WWW
« Reply #12 on: December 18, 2012, 12:44:45 PM »

Well, looks like 3 weeks is not enough to learn C++, create an engine, and make a game after all Smiley. So instead we have:

CAPTAIN FIBER: Bowel Custodian

CaptainFiber.zip

A half-day attempt at a puzzle game featuring:
* A bowel-scrubbing superhero!
* An uplifting orchestral soundtrack! Gets old quick!
* Character movement!
* Half-assed art and animation!
* No discernable goal!
* A sprite-font rendering system!
* A level editor! (see Content/Config/KeyMappings.json for the keys - make your own pointless levels!)



Heading into a month or two of crazy web consulting work, so think I'll put a cap on this gem.

On a serious note, loving C++ so far - so many excellent libraries and tools available - and native code runs crazy fast. The engine still needs a fair bit of work to catch up to what I had in XNA, but learning a lot of lessons on how to structure things better / more simply than what I had before. And it's been nice to throw off some of the shackles of XNA: overly complicated content pipeline, slow startup times, lack of low-level access to things, shitty sound library, questionable non-windows/xbox support, etc. Looking forward to making actual games with it in the near future...
Logged

Weapon Hacker - roguelite metroidvania;
Battleship Solitaire - mindless podcast companion
mamoniem
Level 0
**


making games 247


View Profile
« Reply #13 on: December 18, 2012, 06:31:44 PM »

it looks pretty nice so far Wink good job. I have small quick questions for you if you donn't mind;
is it Opengl(SDL, SFML,...) or DirectX engine ?
for sound did you used fMod ?
i have small old experience in making such thing. but it backs to old technologies Smiley but i would like to work in something similar with the latest tools Smiley just tile engine can build small quick games;
which articles or books helped you alot ?

thanks
Logged
QuadrupleA
Level 2
**



View Profile WWW
« Reply #14 on: December 18, 2012, 06:55:46 PM »

It's a DirectX9 based engine, using the D3DX sprite functions for drawing - pretty basic. I got up and running with the tutorials at http://www.directxtutorial.com/LessonList.aspx?listid=9 , and then used the DX9 references on MSDN after that. For creating the window etc. I just used the Win32 API (I learned by looking up the functions from the basic Win32 template that comes with Visual Studio 2012).

For C I read the GNU reference manual ( http://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html ) and for C++ the tutorial on http://www.cplusplus.com/ , and learned the basic C/C++ libraries and STL from that site too (vector<> map<> and string<> are really useful). I used some of the Boost libraries too - property_tree, filesystem, random, and a couple others - lots of good stuff in there - http://www.boost.org/ .

This is getting long Smiley. Anyway for engine structure I stole a lot of ideas from Unity - I like a lot of their architecture and organization. Tried to make it so I can swap in an OpenGL renderer and other platform windowing/input etc. pretty easy in the future.

And yeah, FMOD for sound - they have a good help file.

BMFont for sprite fonts - had to cook my own renderer using the font files it generates.

I plan to do fancy stuff in the future (shaders, advanced audio, a little 3D here and there, etc.) so am mostly building my own stuff, but for small sprite-based games something like SDL or SFML would be a lot less time up front and more portable out of the box (but less flexible for doing advanced stuff later maybe).

Hope that helps Smiley
Logged

Weapon Hacker - roguelite metroidvania;
Battleship Solitaire - mindless podcast companion
mamoniem
Level 0
**


making games 247


View Profile
« Reply #15 on: December 18, 2012, 11:26:08 PM »

It's a DirectX9 based engine, using the D3DX sprite functions for drawing - pretty basic. I got up and running with the tutorials at http://www.directxtutorial.com/LessonList.aspx?listid=9 , and then used the DX9 references on MSDN after that. For creating the window etc. I just used the Win32 API (I learned by looking up the functions from the basic Win32 template that comes with Visual Studio 2012).

For C I read the GNU reference manual ( http://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html ) and for C++ the tutorial on http://www.cplusplus.com/ , and learned the basic C/C++ libraries and STL from that site too (vector<> map<> and string<> are really useful). I used some of the Boost libraries too - property_tree, filesystem, random, and a couple others - lots of good stuff in there - http://www.boost.org/ .

This is getting long Smiley. Anyway for engine structure I stole a lot of ideas from Unity - I like a lot of their architecture and organization. Tried to make it so I can swap in an OpenGL renderer and other platform windowing/input etc. pretty easy in the future.

And yeah, FMOD for sound - they have a good help file.

BMFont for sprite fonts - had to cook my own renderer using the font files it generates.

I plan to do fancy stuff in the future (shaders, advanced audio, a little 3D here and there, etc.) so am mostly building my own stuff, but for small sprite-based games something like SDL or SFML would be a lot less time up front and more portable out of the box (but less flexible for doing advanced stuff later maybe).

Hope that helps Smiley

thank you for this great details it will be helpful for anyone googled something similer  Beer!
Logged
PiotrMi
Level 0
**



View Profile
« Reply #16 on: December 19, 2012, 10:26:45 AM »

Really nice engine sample Smiley
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic