• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
fir

divide on subsystems

11 posts in this topic

Do you divide your game project/ sources on subsystems?

I found it usefull to divide my code on some subsystems 

mainly window subsystem and graphics subsystem 

(and game subsystem), that would be the three most logical

but some things i do not know where to put (like camera code,

or math routines)

 

 

 

0

Share this post


Link to post
Share on other sites

Here are a list of the modules/libs/subsystems in my game:

1. base (math routines, utiles, factories,statemachines,dispatcher )

2. game/ai  (game entities, pathfinding, scanning, steering)

3. script (script engines for ui , behavior, ai)

4. physics engine

5. network

6. rendering

7. audio

8. tools

2

Share this post


Link to post
Share on other sites

I don't assign math routines to a sub-system; like many other things they give the foundation framework used by the sub-systems.

 

The explicit sub-systems I use are

* Input (to abstract input raw handling, HID, ...)

* Video (to abstract display related stuff: monitor + graphics card)

* Audio (to abstract audio hardare related stuff)

* Graphic (to abstract graphic rendering; implemented in 3 layers)

* Sound (to abstract sound rendering; implemented in 3 layers)

* Storage (for VFS and the like)

* Netz (for networking)

 

There are many more sub-systems that are used to handle aspects of CES; I call this kind of sub-systems "services", e.g. SpatialServices which manages placement, proximity, collision detection, and similar things. Following this, NPC controlling (AI, steering, …), physics, and similar things are implemented as services, too.

1

Share this post


Link to post
Share on other sites

I used to go crazy with modules, one for graphics, one for mesh and texture databases, one for the animation engine, one for audio, etc.

 

now i keep it simple, one for the audio library (Zaudio), one for the "graphics and everything else" library (Z3d), and one for game-specific code (Caveman, Airships!, SIMSpace, etc.)..

 

the graphics and everything else library is graphics, math, file i/o, timers, dice - pretty much all the generic low level stuff for games, except audio. when i implemented the audio library i made it separate as it seemed the cleaner way to do things. good module separation and all that jazz

1

Share this post


Link to post
Share on other sites

in my case, my engine is basically divided up somewhat...

 

renderer stuff:

    "lbxgl": high-level renderer, ex: scene/model/animation/materials/...

    "pdgl": low-level renderer, ex: texture loading, OS interfaces (WGL, GLX, ...), various utility stuff.

common:

    "btgecm": lots of stuff needed by both client and server, ex: voxel terrain, map loading, some file-format code, ...

    "bgbbtjpg": graphics library, deals with image loading/saving, video codecs / AVI / ..., compressed-texture formats, ...

    "bgbmid1": audio library, deals with mixing, MIDI, text-to-speech, several audio codecs, ...

client:

    "btgecl": deals with "client side stuff", mostly sending/recieving messages from server, updating the scene-graph, ...

server:

    "btgesv": server-side stuff (game logic, simple "Quake-like" physics, mobs / AI, ...).

    "libbsde": rigid-body physics simulation stuff, largely not used at present in favor of simpler physics.

script / infrastructure (back-end):

    "bgbgc": garbage collector

    "bgbdy": dynamic types, object-system stuff, VFS (virtual filesystem), ...

    "bgbsvm": script VM

    ...

 

generally I had split libraries up when it gets sufficiently big that it is either unwieldy or takes a long time to rebuild.

in the past, this had generally been somewhere around 50 kLOC.

 

this is not always the case, for example, my high-level renderer ("lbxgl") is ~ 111 kLOC and is not split up.

adding up a few renderer related libraries, works out to around 303 kLOC.

 

current project line-count: 879 kLOC.

 

granted, this project has kind of been ongoing for a while...

1

Share this post


Link to post
Share on other sites

and how you up (asking to all answerers) divide on this subsystems?

 

You make dll, or group in folder, or this is only by some

prefixes?

 

I previously used pfefixes but now Im changing to folders

but yet not sure if im quite happy with that (I always had 

strong problems with name chosing and here my code is all 

clean and good but the module (file) and systems naming and

grouping makes me angry

0

Share this post


Link to post
Share on other sites

Here are a list of the modules/libs/subsystems in my game:

1. base (math routines, utiles, factories,statemachines,dispatcher )

2. game/ai  (game entities, pathfinding, scanning, steering)

3. script (script engines for ui , behavior, ai)

4. physics engine

5. network

6. rendering

7. audio

8. tools

 

could you maybe say me what you call by dispatcher? 

Also what dou you mean by scanning?

0

Share this post


Link to post
Share on other sites

I don't assign math routines to a sub-system; like many other things they give the foundation framework used by the sub-systems.

 

The explicit sub-systems I use are

* Input (to abstract input raw handling, HID, ...)

* Video (to abstract display related stuff: monitor + graphics card)

* Audio (to abstract audio hardare related stuff)

* Graphic (to abstract graphic rendering; implemented in 3 layers)

* Sound (to abstract sound rendering; implemented in 3 layers)

* Storage (for VFS and the like)

* Netz (for networking)

 

There are many more sub-systems that are used to handle aspects of CES; I call this kind of sub-systems "services", e.g. SpatialServices which manages placement, proximity, collision detection, and similar things. Following this, NPC controlling (AI, steering, …), physics, and similar things are implemented as services, too.

Could you say how do you make such layers?

0

Share this post


Link to post
Share on other sites

in my case, my engine is basically divided up somewhat...

 

renderer stuff:

    "lbxgl": high-level renderer, ex: scene/model/animation/materials/...

    "pdgl": low-level renderer, ex: texture loading, OS interfaces (WGL, GLX, ...), various utility stuff.

common:

    "btgecm": lots of stuff needed by both client and server, ex: voxel terrain, map loading, some file-format code, ...

    "bgbbtjpg": graphics library, deals with image loading/saving, video codecs / AVI / ..., compressed-texture formats, ...

    "bgbmid1": audio library, deals with mixing, MIDI, text-to-speech, several audio codecs, ...

client:

    "btgecl": deals with "client side stuff", mostly sending/recieving messages from server, updating the scene-graph, ...

server:

    "btgesv": server-side stuff (game logic, simple "Quake-like" physics, mobs / AI, ...).

    "libbsde": rigid-body physics simulation stuff, largely not used at present in favor of simpler physics.

script / infrastructure (back-end):

    "bgbgc": garbage collector

    "bgbdy": dynamic types, object-system stuff, VFS (virtual filesystem), ...

    "bgbsvm": script VM

    ...

 

generally I had split libraries up when it gets sufficiently big that it is either unwieldy or takes a long time to rebuild.

in the past, this had generally been somewhere around 50 kLOC.

 

this is not always the case, for example, my high-level renderer ("lbxgl") is ~ 111 kLOC and is not split up.

adding up a few renderer related libraries, works out to around 303 kLOC.

 

current project line-count: 879 kLOC.

 

granted, this project has kind of been ongoing for a while...

 

Do you need it such wide and heavy (800k lines is big, my all own personal codes last 5 years framework + prototypes is 100k lines

only) 

0

Share this post


Link to post
Share on other sites

Here's the solution explorer for a project I'm involved with (blurred due to NDA) - each folder icon is a "module". Cross module dependencies are kept track of and enforced -- if I committed code that makes module A depend on B, while B already depends on A, it would be detected and I'd be told off for being an idiot and breaking the architecture.

fiEsBs1.png

Inside many of those folders, there's internal layers -- e.g. the public cross-platform interface, and several platform-dependent implementations.

0

Share this post


Link to post
Share on other sites
...

Could you say how do you make such layers?

Layered software is a common approach where higher layers use lower layers to do their job, usually provide support for higher layers, but without knowing about layers above self. In the case of graphic rendering the lowest layer is the 3rd party graphics API like OpenGL v4.x or v3.x, OpenGLES v3.x or v2.x, D3D v11 or v10, whatever.

 

The next higher layer, the one that is the lowest w.r.t. to the own implementation, is an abstraction of said graphics API and is called GraphicDevice in my case. A GraphicDevice abstracts the API and gives it a unified interface. This interface is data driven: A given list of graphic rendering jobs is processed. Each job consists of state setting commands and a draw call (you probably / hopefully knowns of the threads that deal with such a rendering approach).

 

The next higher level obviously generates such rendering jobs. It does so by processing the scene, determining which objects need to be rendered, requesting the necessary parameter sets, generating mentioned rendering jobs, and pushing the jobs into the current job queue. This layer is actually given mainly in form of a graphic rendering pipeline (i.e. the place where the distinction between forward rendering, deferred rendering and such is implemented; I hope some day it is programmable by a node system, but for now it is modularized but hard coded :) ). On the other hand, this layer of Graphic is coupled to some Services instances. A specific Services is GraphicServices where abstracted graphic rendering resources like rendering targets, "code units" (actually shader script snippets), textures, and similar things are managed. The already mentioned rendering jobs often contain simple indices that refer to an abstraction stored within the GraphicServices. The GraphicDevice then is able to get information about abstracted resources and deal with them as needed for the underlying 3rd party graphic API. Other Services used by the graphic rendering pipeline provide the placement or materials to be used.

 

One may say that above the graphics pipeline layer there is the producer layer. Its job is to generate resources like meshes for freshly spawned particles or the skinning of skeletons. But that does not fit really good into the pattern, because such a layer would not need the next lower one (the graphic rendering pipeline) to do so. Moreover, from an optimization point of view, generating meshes for objects that are not visible is a waste of time, and culling is done in the layer below, so to say. So producing has not really an own layer in this sense.

 

 

From an implementation point of view, layers are a collection of instances that together provide an API for a specific, well defined task. It often uses another layer but this is (mostly) not visible to own clients. The higher a layer the higher is the level of dealing with a problem. E.g. the graphic rendering pipeline layer looks at the scene and picks what to render, but it isn't interested in the details like sorting the jobs by material / script / or whatever.

Edited by haegarr
0

Share this post


Link to post
Share on other sites

 

in my case, my engine is basically divided up somewhat...

 

renderer stuff:

    "lbxgl": high-level renderer, ex: scene/model/animation/materials/...

    "pdgl": low-level renderer, ex: texture loading, OS interfaces (WGL, GLX, ...), various utility stuff.

common:

    "btgecm": lots of stuff needed by both client and server, ex: voxel terrain, map loading, some file-format code, ...

    "bgbbtjpg": graphics library, deals with image loading/saving, video codecs / AVI / ..., compressed-texture formats, ...

    "bgbmid1": audio library, deals with mixing, MIDI, text-to-speech, several audio codecs, ...

client:

    "btgecl": deals with "client side stuff", mostly sending/recieving messages from server, updating the scene-graph, ...

server:

    "btgesv": server-side stuff (game logic, simple "Quake-like" physics, mobs / AI, ...).

    "libbsde": rigid-body physics simulation stuff, largely not used at present in favor of simpler physics.

script / infrastructure (back-end):

    "bgbgc": garbage collector

    "bgbdy": dynamic types, object-system stuff, VFS (virtual filesystem), ...

    "bgbsvm": script VM

    ...

 

generally I had split libraries up when it gets sufficiently big that it is either unwieldy or takes a long time to rebuild.

in the past, this had generally been somewhere around 50 kLOC.

 

this is not always the case, for example, my high-level renderer ("lbxgl") is ~ 111 kLOC and is not split up.

adding up a few renderer related libraries, works out to around 303 kLOC.

 

current project line-count: 879 kLOC.

 

granted, this project has kind of been ongoing for a while...

 

Do you need it such wide and heavy (800k lines is big, my all own personal codes last 5 years framework + prototypes is 100k lines

only) 

 

 

it is big mostly because there is a lot of stuff that it does.

 

often, stuff seems simple until one needs code to do it, and more code to do it reasonably efficiently (scaling things up to more realistic world-sizes and workloads, ...).

the code then has a way of getting bigger.

 

sometimes things can also expand when they need to be generalized, say what could otherwise be done with a big function of doom needs to be broken up into smaller general-purpose sub-functions, but potentially resulting in a higher overall line count than had it been a single one-off function, ...

 

periodically I prune things down to try to keep things from getting too far out of control though.

also, a lot of doing stuff myself without much use of 3rd party libraries (I am not really personally much of a fan of having lots of external dependencies).

 

some things can also get a little hairy though.

video stuff, texture-compression, getting stuff packed into large combined VBOs in an attempt to avoid killing performance with endless small draw-calls, making a script-interpreter perform acceptably (and do useful levels of stuff), ... it all takes code.

 

nothing in particular is particularly huge, mostly just lots of little things.

 

 

in comparison to a lot of other codebases, for what stuff it does, it doesn't really seem to be doing all that terribly though.

Edited by BGB
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0