Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Game Engine tutorial  (Read 16853 times)

0 Members and 1 Guest are viewing this topic.

Mars_999

  • Full Member
  • ***
  • Posts: 103
    • View Profile
    • Email
Game Engine tutorial
« on: February 20, 2011, 07:23:35 pm »
Hello, anyone here have a link to a complete .zip file of the version 1.6 code base? I see there is a 2.0 version in the comment section.

Would be great if it was in a VC++ 2008 solution.

Thanks!

SamuraiCrow

  • Newbie
  • *
  • Posts: 40
    • Yahoo Instant Messenger - samuraileumas
    • View Profile
Game Engine tutorial
« Reply #1 on: April 11, 2011, 08:15:12 pm »
Did you look at http://code.google.com/p/gqe/?  It's more up-to-date than the stuff in the wiki but still needs work.

--Edit--
You can easily make your own Visual Studio project by using the Windows version of CMake from the CMake download page.

GatorQue

  • Newbie
  • *
  • Posts: 36
    • View Profile
SFML 2.0 support
« Reply #2 on: April 14, 2011, 05:19:45 am »
I agree with SamuraiCrow, the GQE Google Code site contains the most updated version.  My next version will have SFML 2.0 support and several other fun features as well.  Over the months of May through August I will have _lots_ of time to work on this and make it progress even further.  I only have 1 more semester left and after December I plan on continuing this project and adding to the examples and wiki of SFML.  Please let me know what other features you want me to focus on over the summer.

phoekz

  • Newbie
  • *
  • Posts: 14
    • View Profile
Game Engine tutorial
« Reply #3 on: April 15, 2011, 11:01:09 pm »
I love your engine design, GQE. I didn't directly copy paste or stuff like that, but I did learn a lot by studying your design philosophy (mainly manager classes, handlers and states) and have successfully applied them to my first game project.

One idea you could add would be how to properly do AI, but that might be too specific and far fetched though.

Keep up with good work man!

GatorQue

  • Newbie
  • *
  • Posts: 36
    • View Profile
AI
« Reply #4 on: April 16, 2011, 02:32:07 am »
Thank you, and you are more than welcome to copy the code as is according to the MIT license it was offered under.  I am working on a concept for implementing Game Objects, Actions, and other great stuff that will also include AI, Networking, and other great features.  I hope to flesh out the basics in the next few months, so keep checking back to see what I have added.  I have 3 more weeks of classes this semester and a summer full of ideas and goals.

game_maker

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Email
Re: Game Engine tutorial
« Reply #5 on: June 26, 2012, 03:03:11 pm »
What is the Game Engine?
I have seen this engine.
But that still does not quite understand his purpose.
It would be to facilitate the creation of games?
It is integrated with SFML (easily)?

GatorQue

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Game Engine tutorial
« Reply #6 on: June 26, 2012, 04:29:59 pm »
@game_maker

The GatorQue Engine (GQE) project consists of two libraries that together form a basic game engine. It uses SFML, C++, and CMake build scripts. Together with the GatorQue Project (GQP) you can use SFML, GQE, and other 3rd party libraries to create computer games more easily.

GQE gives you the basic game loop algorithm and asset management features you commonly need in a game. By using these features you can focus on writing the game logic instead of creating the game loop algorithm. It also provides Game Object/Entity management to help making game interactions easier.

GQP provides the glue necessary to download, compile, and link several 3rd party libraries together. GQP is capable of downloading SFML, GQE, Thor, Box2D, TmxParser, TinyXML, and zlib source code from the internet and linking one or more of these libraries against your project.  All you need to do is copy the "skeleton" or "example" project and rename a few lines in the config file to start a new project.  The GQP infrastructure will take care of the details of linking your project to your desired 3rd party applications. Since it uses CMake, you can use GQP under linux, windows, or Mac. You can use GQP for the Visual Studio 20xx, CodeBlocks, XCode, or MinGW/GCC compilers. Linking and compiling several 3rd party libraries can be difficult for beginners so I created GQP to bridge the gap while you learn.

You can find GQP at http://code.google.com/p/gqp/ and GQE at http://code.google.com/p/gqe/.  I recommend you start with GQP since this will setup everything you need to work with SFML, GQE, and other 3rd party libraries (including downloading the latest code).

Don't hesitate to ask further questions, I love helping people get started on their own game projects and seeing their ideas come to life.

NobodyNothing

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Game Engine tutorial
« Reply #7 on: July 06, 2012, 04:01:48 pm »
@GatorQue

Does the latest version of GQP (0.11.1 currently) support the SFML 2 RC?
Also, will there be any more documentation or tutorials coming? I have been trying literally for months to use your engine, but without any knowledge of CMake, or much of anything outside of Visual Studio, I've only ever been able to get a single project to compile and link to GQE, and I can only do it in debug mode, and I had to remove large portions of the engine to do it.

Even after seeking out general tutorials for CMake, I can't seem to find the information I need to make things work. I really hoped GQP would be the answer to my problems, but despite following the limited instructions to the best of my ability, I just get a wall of CMake errors I don't understand.

There's a really odd discrepancy in how everything seems to aimed at beginners and simplifying the process, while the actual execution and documentation seems to be aimed at people who know exactly what's going on, what everything is, and how everything SHOULD look if configured correctly, and GQP is just a time-saver for them.

For instance from the GQP readme
Quote
Step 3: Open up the Options.cmake file in this new folder and adjust the
project settings to your liking. Don't forget to enable the project to be
built! This includes specifying the 3rd party/external libraries you need and
their find_package modules you require. The name of the dependencies is the
same name as the folder found in the 3rdparty folder (except all in caps).

Nowhere in the project are any examples of what these statements might look like, even in the "example project" folder, there's nothing specified. Its just assumed the user is already familiar with CMake.

Despite the trouble I've had, I have to say I really do like the engine, it's worked really well where I've gotten it to work, I just need a bit more hand-holding to get things setup.

GatorQue

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Game Engine tutorial
« Reply #8 on: July 06, 2012, 05:18:35 pm »
@NobodyNothing

I'm sorry that you feel that way, I didn't intend for GQP or GQE to be so difficult to use or understand. Please help me improve the documentation and help you with the errors you are receiving. In answer to your specific question, yes GQP does support both SFML 2.0 RC and SFML 1.6 natively, the explanation on how to use GQP will follow below. GQE also supports both SFML 2.0 RC and SFML 1.6 natively too. I can appreciate your frustration with using CMake, I myself had a hard time using CMake well at first and wish that there were better instructions. The information below I hope will assist you with getting GQP setup and making it useful for you.

GQP was designed to enable you to make use of many 3rd party libraries available on the internet in one of your Game Projects and also make it easy for you to have 1 or more projects started at the same time. Currently it supports the following 3rd party libraries natively: SFML v1.6 or v2.0RC, Thor (needs some work), TinyXML, Box2D, GQE latest version, TmxParser, and zlib. Each of these 3rd party libraries have an Options.cmake file that you can adjust as desired. Some of the options that can be modified include:
  • Enabling or Disabling the 3rd party module from being used by GQP
  • Using v2.0 RC (default) or v1.6 version of SFML
  • Building the Example programs that come with each 3rd party module
  • Building the Documentation for each 3rd party module (often using Doxygen)
  • Using Shared or Static libraries when building each 3rd party module
  • Specifying a specific revision tag to use when downloading each 3rd party module (defaults to Tip/Master)
Simply edit the Options.cmake file in the corresponding 3rd party library folder (e.g. see GQP/external/SFML/Options.cmake) to adjust these settings.

The next step is to create a new game project folder in GQP. For example, you might like to create a Galaga space shoot-em-up game. To accomplish this you navigate to the GQP/projects folder and copy either the "_Rename_Skeleton_" folder as "Galaga" or the Example folder as "Galaga". Then navigate and edit the Galaga/Options.cmake file and change every "SKELETON_" or "EXAMPLE_" to "GALAGA_" that you see in this file (there should only be two or three of them). The directory name you choose should match this name since that is how GQP matches project options to the directory they came from during the CMake processing. You should also modify the GALAGA_DEPS option in this file and add, in capital letters, the directory names of each 3rd party library you wish to use for your GALAGA program so that CMake will link these 3rd party libraries against your project during the Linker phase of compiling. Once this has been done you are ready to proceed to the next step.

The next step is to use CMake to produce a build environment for you to use. Most people prefer Visual Studio so I will give that example first, but if your using Code::Blocks or Linux the same can apply, just change the -G portion to suit your needs or let CMake auto detect what will work best. CMake works best if you build your code "out of source".  This just means that you should create and navigate to a build directory before running CMake.  I usually create GQP/build for Visual Studio and GQP/build2 for MinGW/Code::Blocks. Navigate to this directory and do one of the following from a command prompt.

cd C:\GQP\build
C:\GQP\build\cmake ..
OR
C:\GQP\build\cmake -G "CodeBlocks - MinGW Makefiles" ..
OR
C:\GQP\build\cmake -G "Visual Studio 10" ..

What will happen after running one of the above is that CMake will begin to parse all the CMake logic of GQP. The first thing it will discover (on the first run) is that the GQP/SFML directory and other 3rd party libraries don't exist, so it will download each 3rd party library directly from the Internet to the GQP folder. Once downloaded, it will not attempt to pull these 3rd party libraries again unless you delete these 3rd party folders and rerun the cmake commands above.  Also, if you add a new "project" folder you can simply rerun the cmake commands above to have the new project added to your list of available projects. If everything goes well you should see "-- Build files have been written to: C:/GQP/build" indicating CMake completed successfully. Now you are ready to begin editing code for your project and using GQP, GQE, SFML, and any other 3rd party library you chose for your project(s). GQP provides an additional benefit for Windows users in that it will _automatically_ copy your "resources" folder from your project directory to the resulting Debug or Release directory creating by Visual Studio or the output folder created by Code::Blocks. This makes it easy for you to run the program from within your IDE without requiring you to manually copy the SFML, GQE, or TinyXML DLL files to your project build folders.

If you're using Visual Studio, open the newly created TopLevel.sln file found in the C:\GQP\build directory. This solution file will show all the external libraries you have active and your Galaga project you are about to start. The first thing I typically do is to right click on Galaga and select "Set as StartUp Project" and then right click and select "Properties". From the Properties dialog window find the Debugging category on the left and select it. Then change the Working Directory value on the right from $(ProjectDir) to $(OutDir). VisualStudio always executes code from the ProjectDirectory not the resulting "Debug" or "Release" folder it creates which is why the step above is necessary. By doing this you can just push the Green arrow at the top to begin the process of compiling and launching your Galaga program.

I'm not as familiar with Code::Blocks, but I expect the situation to be similar to the situation described above. I will setup Code::Blocks and make sure to document my experience in a future tutorial on the GQP website soon.

At this point you can "add" files to your project knowing that GQP is handling the compiling, linking, and management of the 3rd party libraries you have selected for your project.

Please don't hesitate to ask specific questions about the process described above, please give GQP another try and let me know how I can improve the documentation.  Also, know that GQP makes heavy use of multiple tools (Git, HG, SVN, CMake, Doxygen, etc) and all of these tools _must_ be found on the Path. I have a defect on GQP to download these tools and use them from a local GQP directory instead to make it easier to use GQP which I will be doing soon, this way the only tool that will need to be installed is the CMake tool and your preferred compiler tool.

Mars_999

  • Full Member
  • ***
  • Posts: 103
    • View Profile
    • Email
Re: Game Engine tutorial
« Reply #9 on: July 06, 2012, 06:39:55 pm »
Just wanted to chime in and say you can use the wizard in codeblocks to setup a project default... I would recommend you install C::B and do this and post this wizard file so people can just download that and run Gator easily without any hassles...

If you do this I will give it a shot also...

Thanks!

GatorQue

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Game Engine tutorial
« Reply #10 on: July 06, 2012, 07:53:52 pm »
@Mars_999

This is a good suggestion, I will look into pushing a prebuilt version of the library files to combine with GQP (which it supports natively) to help with using GQP. This way you won't need to have the many source control programs installed.

NobodyNothing

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Game Engine tutorial
« Reply #11 on: July 07, 2012, 05:07:08 am »
@GatorQue

Thanks for the quick response! That was incredibly helpful and much more thorough than anything else I found, I was able to get it working, and once I actually did everything correctly, it worked impressively well. Thanks again and great work with GQP, just, perhaps consider copying that post to the project's page. It's also probably worth making it explicitly clear that dependencies are set in in the cmake options file in the following format
Quote
set(MYAPP_DEPS SFML GQE)
maybe by making them the default  in the skeleton project, or leaving a comment explicitly showing the format. I was a bit thrown off by this because I was expecting to pass a comma separated list of values, or a statement for each dependency, or something similar.

Now I've just got to modify my code to use the new Asset Manager, and start looking into what the Entity Module does  8)

GatorQue

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Game Engine tutorial
« Reply #12 on: July 07, 2012, 06:34:50 am »
@NobodyNothing

I posted two tutorials on the GQP website and I'm working on publishing a "prebuilt" version of GQP for download as well.  Please check out our Demo game, http://code.google.com/p/burgled/, for an example on using the gqe-entity library and its associated classes.

I'm so happy to hear that you got it working. I'm hoping my precompiled versions will also be helpful for those who don't want to download and compile every 3rd party library each time when writing their projects. Just for completeness sake I should mention that the INSTALL-SFML, INSTALL-GQE, INSTALL-etc, are all special build targets that will copy the compiled libraries, DLL files, documentation, examples, etc. into the GQP\3rdparty folder. This way you can have your 3rd party libraries precompiled and only see your projects in your Visual Studio Solution file.  It makes debugging into the depths of these libraries next to impossible, but it makes your build times faster and doesn't require as many tools to use GQP (if you have all 3rd party libraries in this directory the only tool you need is cmake and a compiler). Let me know what you think and email or write me any questions you have.


 

anything