Jump to content

Game logic as external module


narushevich
 Share

Recommended Posts

Let's consider that I would like to  make a multiplayer client-server game.

The game is much more like a 2d simcity, no physics, no object position sync.

The game has representation and logic, server is authorative and logic is located there.

Logic itself is simply a module which has nothing to do with game engine, networking, graphics, physics etc, user events.

Game server is simply mapping request data to some of the logic methods, e.g. logic.world.character.addMoney;

Game client fetches tile, house or whatever data and positions some predefined gameObjects on the scene.

 

I like this setup because logic would be independent, reusable module. I could later change the whole engine and still reuse same logic module. But it feels strange, like I'm using game engine only for rendering, like running volkswagen on jet engine.

 

Now let's say I would like to do a singleplayer-only game. Usually I would write all logic in gameObject/entity scripts and don't mess with logic separation and such stuff.

 

But what should I do if I want multiplayer + singleplayer game?! If I would put logic as module for singleplayer then it'll be a lot of overhead, but if I would move half of the game engine onto server...than,...can't even wrap my head around it. 

 

And even more, what if I have two copies of logic as module on both server and client, and both of them are running simultaneously, in order to predict server response results.

 

How do you separate game logic(game model!?) from application? Do you tie it to engine(by storing all logic in game engine's scripting system)?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...