Skip to content

Game Development

What can we say - we like games. And you can use Qt to write some. Questions? Ask here.
862 Topics 4.0k Posts
  • Qt3D point and line picking?

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    J

    I checked on Qt5.12 and 5.13.
    renderSettings->pickingSettings()->setPickMethod(Qt3DRender::QPickingSettings::PointPicking);
    renderSettings->pickingSettings()->setWorldSpaceTolerance(10.0f);

    But I can't pick the primitive point.

  • Logitech driving force gt

    Unsolved
    2
    0 Votes
    2 Posts
    429 Views
    jsulmJ

    @Jun-wong I guess this SDK provides C/C++ library? In general there is nothing special about Qt here, Qt is simply a C++ framework. Check the documentation of that SDK to see how to use it in C++ applications.

  • Owning the game loop

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    F

    @SGaist
    Thanks for answering.
    Basically, I am separating rendering and updating to have fixed-timestep updating (for physics etc) as well as as-fast-as-possible rendering with time interpolation. (Heavily heavily inspired from Gaffer on Games article)
    My code looks as follows (only slightly simplified):

    ... within my OpenGLContext void GLWindow::gameLoop() { const double delta = 1.0 / fixedUpdatesPerSecond; auto time = QDateTime::currentMSecsSinceEpoch(); double accumulated = 0.0; while (! this->terminate) { auto newTime = QDateTime::currentMSecsSinceEpoch(); double frameExecution = tdiff(time, newTime); time = newTime; accumulated += frameExecution; while (accumulated >= delta) { // Handle user input / system polling //However, since Qt has event driven polling, let's just call processEvents and then handle any input events by putting their results into a map. QCoreApplication::processEvents(); // Update our states this->updateState(delta); accumulated -= delta; } this->render(accumulated / delta); } }

    In the same class, I have updateState and render:

    void MyGL::updateState(float delta) { //... Bunch of commented-out code to make sure base loop works first if(myKeys.at(Qt::Key_W)) { cam->translateAlongForward(delta * 3.0); cam->update(); } } void MyGL::render(float aheadAlphaPercent) { this->update(); } void MyGL::paintGL() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); lambertShader->setViewProj(cam->matrix()); // a lot of other drawing stuff }

    I know that my rendering code itself works because I initially tested it by just using a QTimer.

    Instead, I now do the following:

    ...in main... QApplication a(argc, argv); QSurfaceFormat::setDefaultFormat(format); MainWindow w; w.show(); w.start(); //return a.exec(); // ^Dont^want^to^uncomment^this^ ... MainWindow::start (MainWindow is QMainWindow subclass)... uiElements->glWindow->gameLoop(); //glWindow is subclass of OpenGLContext

    As you can see, I tried to avoid calling Qt's blocking event loop in QApplication::exec, but am still polling events. However, this doesn't work properly, as described in my first post.

  • Parsing Qt Game Dev

    Unsolved
    2
    0 Votes
    2 Posts
    435 Views
    jsulmJ

    @U7Development said in Parsing Qt Game Dev:

    is this a game or render engine?

    No, it's not. Qt is a C++ framework supporting UI, network and many other domains, but it is not a game engine. What it supports is OpenGL programming, see https://doc.qt.io/qt-5/qtgui-index.html#opengl-and-opengl-es-integration

  • Speed up QPainter.drawPixmap in pc emulators

    Unsolved
    4
    0 Votes
    4 Posts
    532 Views
    SGaistS

    The OpenGL Cube example shows the technique to map a PNG containing all the cube faces on a 3D cube.

  • 0 Votes
    1 Posts
    241 Views
    No one has replied
  • QML Particles any tutorial?

    5
    0 Votes
    5 Posts
    2k Views
    G

    in case somebody interested in result)
    it is there
    https://play.google.com/store/apps/details?id=ua.sp.games.DragonMykyta

  • Character moving using pictures, smooth moving

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    F

    @Bondrusiek i will check it out ty

  • Qt Opengl

    Solved
    15
    0 Votes
    15 Posts
    2k Views
    J.HilkJ

    @mkss QCheckBox has a build in try state functionality

    https://doc.qt.io/qt-5/qcheckbox.html

    if that helps

  • 0 Votes
    3 Posts
    4k Views
    S

    As it turned out, the per-installed version of QT 5.7.1 after installing libmali works fine with xcb and GPU acceleration, which probably indicates that the installation path of QT 5.13.0 is not correct, it is also possible to correct the location of the libraries. Probably the setting path should coincide with the location(5.13.0) of the qt5 folder where version 5.7.1 is installed.

  • starting a survival 2D game, looking for advice

    Unsolved
    11
    0 Votes
    11 Posts
    1k Views
    F

    @mrjj
    I'll try working with it and i'll see how it goes. Thank you very much for everything !

  • 0 Votes
    5 Posts
    3k Views
    M

    @mrjj Thank you for the link and regarding the multiplayer my teacher said that i can do either over the internet or LAN , i believe LAN is a much simplier thing to work with so i'd probably go with that if there are any stuff regarding this topic, for my graduation project it's required for game to be played by ( for example 4 ) players, but each player has to play the game on their own PC.
    @jksh ye i wanted to implement that into my game and of course like i said player vs the pc, but my professor said that i should put a multiplayer option in there aswell if i want to get a better grade.

  • configure joypad buttons on Qt5 QGamepad

    Unsolved
    2
    0 Votes
    2 Posts
    541 Views
    SGaistS

    Hi and welcome to devnet,

    You should add:

    Qt version used Linux distribution used Device connected How did you install Qt
  • 0 Votes
    5 Posts
    539 Views
    SGaistS

    Can you try with the latest Qt 5.13 version ?

  • Unexpected LevelOfDetail behavior in Qt3D

    Unsolved
    3
    1 Votes
    3 Posts
    627 Views
    EddyE

    for anyone interested.
    Here is the link to the bug report on Jira:
    https://bugreports.qt.io/browse/QTBUG-75373

    you can upvote it there to give it more attention

  • 0 Votes
    6 Posts
    1k Views
    C

    Apparently.

    This was working before. Looking through the documentation it seems this was not the best use case for the tree view so it looks like a safe change on our side.

  • Creating a Hexagonal Grid in Qt5

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    JonBJ

    @hskoglund
    I drew hexagons on a UNIX box more-years-ago-than-I-care-to-admit. I doubt I used floating point sine/cosine calculations. Don't the vertices come out at some nice integer coordinate values for 60 degrees if you pick a suitable integer for the side lengths?

    a slight complication in those days was the x/y ratio for the screen pixels, it wasn't 1:1

    That's not your problem as a programmer! 60 degrees is 60 degrees. The user can go buy a different monitor/graphics card if his ratio is not right :)

  • 0 Votes
    7 Posts
    6k Views
    V

    I've got the same issue with Qt3DExtras::QText2DEntity. But I found the workaround.
    Look like there is a bug? in implementation of Qt3DExtras::QText2DEntity that prevents internal initialization (QText2DEntityPrivate::setScene is never called). This happens when scene is already visible and Qt3DExtras::QText2DEntity is created with parent entity passed to constructor. The workaround I used to make it work is to pass nullptr (which is default) as parent in constructor and call ->setParent(parentEntity) in separate call.

    m_text2dLabel = new Qt3DExtras::QText2DEntity(); m_text2dLabel->setParent(parentNode);
  • Dynamic generation of QEntity and QGeometry data

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    T

    @mrjj Haha, I suppose it does. I think if it were in circles or odd shapes it'd look more like it. hehe.

  • Picking and Bounding volumes

    Unsolved
    1
    0 Votes
    1 Posts
    571 Views
    No one has replied