Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Hi, can anyone assist me with an assisgnment I'm working on....it entails coding a basic NPC with the associated networking on C++
Forum Updated to NodeBB v4.3 + New Features

Hi, can anyone assist me with an assisgnment I'm working on....it entails coding a basic NPC with the associated networking on C++

Scheduled Pinned Locked Moved Unsolved C++ Gurus
15 Posts 3 Posters 1.6k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #4

    So you basically need to implement the AI part of the game.

    The networking part is completely unrelated to that. It is just a mean for players to join the game. The AI shall not care whether it's playing against local or remote players.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • L Offline
      L Offline
      LaylaN
      wrote on last edited by
      #5

      So I should treat it as a separate entity from the the players' actions?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #6

        That's a bit the goal of a NPC, it's independent of the player and will react based on what they do.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        L 1 Reply Last reply
        1
        • fcarneyF Offline
          fcarneyF Offline
          fcarney
          wrote on last edited by
          #7

          You might consider making a player object. Then make an npc object that derives from the player object. So it appears like a player to game itself.

          C++ is a perfectly valid school of magic.

          L 1 Reply Last reply
          1
          • SGaistS SGaist

            That's a bit the goal of a NPC, it's independent of the player and will react based on what they do.

            L Offline
            L Offline
            LaylaN
            wrote on last edited by
            #8

            @SGaist I was having troubles on how to co-ordinate players turns over a network

            1 Reply Last reply
            0
            • fcarneyF fcarney

              You might consider making a player object. Then make an npc object that derives from the player object. So it appears like a player to game itself.

              L Offline
              L Offline
              LaylaN
              wrote on last edited by
              #9

              @fcarney Thank you, I will most definitely try that. My issue lies in the actual player co-ordination

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #10

                How do you coordinate them locally ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                L 1 Reply Last reply
                0
                • SGaistS SGaist

                  How do you coordinate them locally ?

                  L Offline
                  L Offline
                  LaylaN
                  wrote on last edited by
                  #11

                  @SGaist I'm currently trying to use QHostAddress with QUdpSocket to allow for multiplayer, however I'm having issues. Sometimes the code builds and sometimes the code crashes. I can't understand why it does this

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #12

                    This does not answer my question.

                    That said, why UDP ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      LaylaN
                      wrote on last edited by
                      #13

                      Apologies, I'm having troubles on how to approach the coordination (local or otherwise), how would I go about that?

                      The specifications of my assignment specifies the usage of Udp

                      1 Reply Last reply
                      0
                      • fcarneyF Offline
                        fcarneyF Offline
                        fcarney
                        wrote on last edited by
                        #14

                        Start with the chat example: https://doc.qt.io/qt-5/examples-network.html

                        C++ is a perfectly valid school of magic.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #15

                          Do you already have the logic of the game working ?
                          Without that, adding a network layer does not make any sense.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved