Jump to content

Question about general game architecture using this game engine


Prit
 Share

Recommended Posts

Hello, I’m new to the game development scene biggrin.png. However not new to programming, I am currently on a work placement, however going back in September to complete my final year to achieve a degree in computer science.

Well that’s my background done. For my final year I wish to make a 3D network game. Reason for this is I do wish to pursue a career in game development. (My current work placement is cooperate development).

I have a few questions and seek a bit of advice and would really appreciate your answers and insights.

I have purchased the standard edition as I wish to code in C++.

My questions are generally about the architecture of a game; say for example I was to make a network game pong. I have made this in unity but it felt a bit messy, maybe it was just the way I was taught or just the way game development is.

The whole idea of just attaching scripts to game objects instead of having dedicated modules/subsystems to handle these things confuses me. I’m not sure how I would document that into a class diagram or sequence diagram at all.

The way it would work in my head would be something like this (Close layered):

 

2jcge9.png

However most game engines seem to attach input and graphics all into one game object.. which makes me wonder how you would you plan out the architecture like that.

Many thanks in advance sorry for the long post (I don’t usually post on forums).

 

I am looking for answers more relevant to this game engine if possible and how you would plan games architecture around it.

Link to comment
Share on other sites

If you were using Lua then you'd basically do the same thing as Unity. However it sounds like you are using C++ (which also allows Lua so you could do the same thing but if you want to use pure C++).

 

Go get a copy of RakNet and use that for the multiplayer aspect.

 

Leawerks requires a gfx card right now so you won't use LE at all for the server application (assuming client/server vs peer/peer).

 

Use a state machine for your major states (Logo, Main Menu, Gameplay).

 

App.cpp creates a window, context, world, camera and I like that it does because you will probably use all of those through all the states so no need to create them in each game state. I just pass them through to the states so that I can use them.

 

I place my RakNet network look inside the state manager, and have each state able to register a network message to a state (class) function and the generic loop will see if a message has a function registered to it and if it does it calls it. Now I don't have to mess around with that loop ever again. I simply link class method to network message ID and I get functions called when network messages come in.

 

I do my network messages with a Request/Response idea. The client always makes Request messages to the server that always sends Response messages.

 

Not sure if this is what you were looking for.

Link to comment
Share on other sites

Hi and welcome to Leadwerks.

 

The beauty of Leadwerks here is that you are not forced in to using a game architecture. You can use Lua scripts to deal with entity scripting but don't have to if you don't want to.

You can make it hierarchily based or component base. That choice is all yours.

Link to comment
Share on other sites

I always find those kinds of diagrams to be totally confounding. Leadwerks is an entity-driven system. You can add a script to an entity for sort of generic behavior the artist places in a scene. You can also program directly with C++. For example, your players in the game will probably be a C++ class, but some simple behavior like a rotating fan will probably be a model with a Lua script added to it. Leadwerks adds a flow graph control between scripted entities, which makes high-level interactions really easy to set up, which would be nearly impossible in C++.

 

Steamworks has a networking library built in that lets you just send data directly between Steam IDs without worrying about NAT punch-through, etc. You might want to look into that as well as RakNet.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

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.

 Share

×
×
  • Create New...