GithubHelp home page GithubHelp logo

melikeycode / qtgameengine Goto Github PK

View Code? Open in Web Editor NEW
109.0 8.0 37.0 63.48 MB

A game engine for the Qt framework.

C++ 97.27% QMake 2.73%
game-engine-2d qt game-engine game-development qt-game-engine cute-game-engine

qtgameengine's Introduction

Welcome!

Qt Game Engine (QGE) is a game engine written in C++ and built on top of the amazing Qt framework. It presents a very easy and more importantly, a fun to use interface for creating your own 2d games from a top down or angled (e.g. isometric-like) viewpoint. The game engine is very well written, well documented, and easily extensible.

Click the picture below to view a video of the engine in action. demo teaser video

I've written the engine with my top priority being that it is fun to use. For me, building things by plugging a bunch of different parts together and wiring them correctly is insanely fun, so that is how i've designed the engine to be.

How to use QGE in your project

If you just want to use the engine to build your own game (not necessarly contribute to the engine codebase itself):

  1. Download/extract.
  2. Copy the qge folder to the same directory as your .pro file.
  3. Add include(qge/qge.pri) in your .pro file.

That's it! Now you can simply #include <qge/SomeHeader.h> to use QGE classes. I sincerely hope you enjoy using the game engine as much as I enjoyed making it.

Tutorials/Documentation

I've created some YouTube tutorials on creating a basic game using the engine. That is a great place to start! Next, you may want to check out the example projects in the QtGameEngine/examples folder. As you're working on the tutorials/examples, have the documentation open so you can look at the documentation of the various classes you use along your journey.

Contributing

Currently, I work full time and am a full time master's student, but I promise to allocate as much free time as I can muster to support the continued development of this engine.

I warmly welcome anyone who would like to contribute to the engine. If you would like to contribute, familiarize yourself with using the game engine first, then head on over to the contribution guidelines page. Additionally, please skim/read the code of conduct, which could honestly be summarized as:

Be kind, classy, and professional.

qtgameengine's People

Contributors

edenreich avatar martinmike2 avatar melikeycode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qtgameengine's Issues

Add logo

We need a logo for QGE.

The logo should represent the fact that QGE is very "component" based, i.e. you plug various components together to create a new component with interesting behaviors (e.g. plugging EntityControllers into Entities).

Some ideas for a logo:

  • placing the letters Q, G, and E into different puzzle pieces
  • making the letters Q, G, and E into gears (and/or other hardware parts) that are somehow joined together

Entity::damage() is weird; the whole damage system is weird.

Every single entity can specify what classes can and can't damage them through run time type identification. This is weird.

  • give Entities two functions: one called nonFriendlyDamage() and the other called friendlyDamage().
    • nonFriendlyDamage(Entity* entityToDamage, double dmgAmount) will only damage if the said entity is an enemy
    • friendlyDamage() will damage said entity even if it's friendly

This way, whenever one entity wants to damage another (irregardless of how - via weapon, ability, etc) it does it through this API. If it is an ability/weapon/etc that deals friendly damage, they can use the friendlyDamage() function, otherwise the nonFriendlyDamage(). This is an excellent idea! I'm a genius!

Trim down the `qge` folder.

It is 58 mb, too damn big! The vast majority of the size is most likely due to image/sound files.

If the image/sound files are indeed the culprit, we should remove the images/sounds we don't use in the examples. Alternatively, we can remove almost all of the images/sounds, and then put them individually in each example.

Make QGE run in a web browser.

Use can use emscripten to run portable C++ code in a web browser. Basically, you feed emscripten your C/C++ and it will spit out javascript.

out of memory allocating 1073745919 bytes

Summary
Attempt to build example1 for the first time throws out of memory exception.

OS / Softwares / Compilers

  • Windows 10
  • QT v5.9.0
  • MinGW 5.3.0 32 bit

Steps to Reproduce
Clone the repository and try to build example1

Screenshots
screenshot

Suggestion
Add directive resources_big to CONFIG

Add a few example projects that use QGE.

We should create a few example Qt projects that use QGE. Each of these projects should have all files they need except the qge folder (client needs to copy/paste the qge folder inside each of these projects to successfully run them - this is to prevent distributing multiple copies of the qge folder).

Benefits of having example projects:

  • clients can quickly see and play with example projects that are already using QGE
  • clients can use one of the examples as a starting point for their own game
  • one or two of the examples can be used to create a video and/or text tutorial from

Here is a brief description of some example projects we can create:

  1. blank map - Just a Game, Map, and MapGrid.
  2. moving entity - add a moving entity to example 1.
  3. multiple maps - add multiple maps to example 2.
  4. enemies - add some body thrusting enemies and make them randomly drop items.
  5. shop - add an entity that sells stuff (to demonstrate a gui).
  6. extending - example showing how to create a custom item, projectile, controller, etc. Point is, it needs to show client how to extend the game engine with their own components instead of just using prebuilt components

Please add "PathingMap" as a parameter for qRegisterMetaType

Hey,

The spider entity will not move even when the player is in the field of view. The issue is PathingMap is not registering just by using qRegisterMetaType<PathingMap>(); //(Line 45 in Game.cpp)

qRegisterMetaType(); requires that you first declare the struct using Q_DECLARE_METATYPE()

Using this instead of the above solves my issue.
int qRegisterMetaType(const char * typeName)
i.e. qRegisterMetaType<PathingMap>("PathingMap"); //I was able to find this using the Debug messages.

Love your work,
Thank you,
Abhishek

Change license to Apache 2.0

First of all, if the license is missing, then the default "All rights reserved" does apply.

However, even if this repo adds like the LGPL 2.1 license file, then the produced games would be too easy to reverse engineer.

I mean, allow users to static-link to the engine, and dynamic-linking to Qt is more than enough.

Finish (and upload) videos on creating a basic example game.

We need to create a series of videos in which we walk through building a basic game using QGE.

We can build the same basic game described in the "example projects " (see issue #2)

Basically, create a game with a moving player, some body thrusting enemies who drop items, and an entity to buy items from.

error: 'auto' return without trailing return type

Summary
error: 'auto' return without trailing return type; deduced return types are a C++ 14 extension.

The error comes from STLWrappers.h where 'auto' type specifier is used.

OS / Softwares / Compilers

  • Windows 10
  • QT v5.9.0
  • MinGW 5.3.0 32 bit

Steps to Reproduce
Clone the repository and try to build example1

Screenshots
screenshot

Suggestion
Add minimum requirements to README.md file.
Or
Use C++14 in qge/qge.pri config file

QML Version?

I tried to built in 5.12 QT version to make it work in ubports , the build library works but not working. i noticed that it used QtWidgets which is problematic on ubports device . is it possible to create QML counterpart of this ? thank you

Document project file/folder structure.

We need a markdown page (something like projectStructure.md) that documents every file/folder starting from the QtGameEngine folder.

Note: Some of this has already been documented in the diagrams, move it to the markdown page.

Qt 5.14 MSVC2017 have some runtime errors ,how to solve?

libpng warning: iCCP: known incorrect sRGB profile
QObject::connect(QObject, qge::InventoryViewer): invalid nullptr parameter
e
e
e
e
e
DirectShowPlayerService::doRender: Unknown error 0x8004022a.
DirectShowPlayerService::doRender: Unknown error 0x8004022a.
QObject::disconnect: Unexpected nullptr parameter
QObject::disconnect: Unexpected nullptr parameter
QObject::disconnect: Unexpected nullptr parameter

Redo front page of website.

Linear page structure.

First there should be a title:

Abdullah Aghazadah's
Qt Game Engine

Then the logo.

Then, an About section which states about (written in C++ ontop of the Qt framework, fun, easy, well written/documented, easy to extend)

Then a "Demo" section with link and pic to demo video.

Then a how to use in project section
-this section will state the two steps to using and will link to a more detailed page where they can learn about more flexable ways of using the game engine

Basic example (just a blank map)

Where to go from here

  • watch youtube tutorials (link to them)
  • try text tutorials
  • play with examples while reading docs for classes you use
  • if you are interested in contributing, read contribution guidelines
  • contribution guidelines will have
    • familizrize yourself with game engine first (by watching youtube tutorials/text tuts/and doing examples)
    • read file/folder orginization
    • read conventions
    • will state how core team will be small and people with high quality contribs will get invite

Make entity movement from map to map smarter.

When you an entity moves from one map to another, and there is a size difference between the adjacent sides of the two maps, where should the entity move to in the new map?

Consider the adjacent edges of two adjacent maps. One map is way bigger than the other. Here is how we should decide where the entity lands in the new map. If the entity is 50% along current map's edge, it should be 50% along new map's edge. If the entity is 25% along current map's edge, it should be 25% along new map's edge, etc. This makes sense.

QObject::disconnect: Unexpected null parameter

Summary
Running Example8 everything renders correctly, but getting output in QT Console:
creates an DirectShowPlayerService::doRender: Unresolved error code 0x8004022a ()' spam

And when trying to hit a monster, the following is being outputed to the QT console:
QObject::disconnect: Unexpected null parameter

OS / Softwares / Compilers

  • Windows 10
  • QT v5.9.0
  • MinGW 5.3.0 32 bit

Steps to Reproduce
Run example8

Screenshots
screenshot1
screenshot2

Improve body thrust ability

  • make field of view start at origin of entity not (0,0)
  • entity doesn't seem to actually thrust, it just makes a noise and damages

Add credits page in documentation

We need to keep track of people/organizations that we "borrow" ;) resources from. We should create a documentation page dedicated to this, called credits.

People to give credit to so far:
-Derek & Brandon Fiechter for bg music of test game
-open game art for art/sound

Extract more accurate bounding boxes from sprites.

Often, frames in sprites are much bigger than the actual content (i.e. there is lots of transparent edge/border pixels.). We currently use the entire image as the bbox, which makes collisions seem weird. We should have functionality to extract more accurate bboxes from frames.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.