HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [] Server and Client  (Read 1078 times)

DemonAgeOnline

  • World Owners
  • ****
  • Posts: 17
    • View Profile
[] Server and Client
« on: Mar 06, 13, 02:51:09 AM »

So just been running through wiki and doing some of the developer tutorials and wiki tutorials and now im starting to look into implementing stuff for my game. But one question always arises everytime I go to do something, Does this go on the client or the server? I kind of get it, but I kind of dont? so I just want clarification.

Question 1.

For fields and enums does it matter whether I put it on the server or client?

Question 2.
 
Deciding what method/function goes on client and what goes on server

Logged

Thazager

  • General Accounts
  • *
  • Posts: 1155
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: [] Server and Client
« Reply #1 on: Mar 06, 13, 03:27:25 AM »

A few things I have learned.

Most (if not all) GUIs will go client side.
Sounds and artwork go client side, no need for them on server.

Fields and enums can be on both client and server.

For functions/methods , some are obvious, like those controlling client side features, some are not to obvious to me.
I know the server controls the actions that go on in the game. The client/user gives input to which the server responds by showing what happens and what does not. When 1 player does something the server will show it to other players.
Logged

DemonAgeOnline

  • World Owners
  • ****
  • Posts: 17
    • View Profile
Re: [] Server and Client
« Reply #2 on: Mar 06, 13, 03:58:15 AM »

Is this a simple way of looking at it? If in the method/function nothing is actually shown to the user or needed by the user, do it on the server? Is there any scenario's where this might backfire?

Also what I'm asking about the ENUM's and fields, is there any difference from an ENUM made on the client to one made on the server?
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1155
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: [] Server and Client
« Reply #3 on: Mar 06, 13, 12:54:13 PM »

Yes this is the simple way of thinking about the differences of the two. For more detail and some examples, on HeroBlade, check the tab on top row for Heroscript, open the DOM. Many times you will find classes and fields on both sides to be near the same value. Sometimes one side goes into more detail and the other side just has less functions in it.

Another thing I learned is not to change any of these values in the DOM. Adding new ones and deleting only those you added is ok. You can add to classes, and delete that which you added, but deleting something you did not make or add can mess things up pretty bad. Basically, everything that makes the scripts work in the game are using these classes/fields/enums so changing or deleting is not a good idea, but adding to it is ok.
Logged