Jump to content
  • Advertisement

udim

Member
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

1 Follower

About udim

  • Rank
    Newbie

Personal Information

  • Role
    Programmer
  • Interests
    Business
    DevOps
    Production
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @ hugolnx Wow thx alot! that helps, appreciate the effort!
  2. So in the observer pattern, the Player class will send the input? What if the Player class depends on the server answer? how will it fit with the observer pattern and the singleplayer? So for an example - shooting, the player will send its aiming direction and its position. So on multiplayer i guess that the client will wait for the server for its response whenever the player hit or not. when on singleplayer after taking the shot everything is done. We can approach this also from a different direction, on multiplayer when shooting the Player will observer to the server about its input, and without waiting for the server response will damage the player's target and trigger the blood animation, sound affects etc.. But the server still need to let the client know if the player actually hit, how will you consider that on the design? Maybe you know a tutorial or just a UML design to post here? Yeah i kind of figure it out when started on the design, can you give me a direction here on how can i approach this?
  3. Hello guys! i am trying to make my first game that involve multiplayer and singleplayer. The game is a shooting game, you can move and shoot other players. in singleplayer you will shoot AI and in multiplayer you will shoot other real players. Right now i am designing the code (UML) and i ran into a problem - I am trying to design the Player class, the problem is that this class is different between singleplayer and multiplayer. why? lets give an example: The moving function on singleplayer will just move the player on the screen. in multiplayer it will move the player & send the new location to the server Another example is when shooting players. In singleplayer when the player shoots another player It will just damage the other player, in multiplayer when shooting other player, the client will send to the server the action of shooting and the server will tell the client if the player actually hit the target and how much should it damage. In both single&multi of course you will play sound and trigger blood animation and so on My point is that although you have similar code between multi&single the implementation is still different between single&multi how can you design class like the Player class in these kind of games? Is inheritance is the correct answer? if so how would you design it? Thank you
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!