Game versus Game Engine?

I was wondering if anyone could tell me how the game and the game engine fit into the development of the game. In particular, I mean that there is no game in the game engine. So, where I don’t understand, basically, do development developers develop an engine, and then create a new class that inherits from the engine, which becomes a game?

Example:

class ShooterGame : public Engine { }; 

So basically I don’t understand where the game code fits into the engine.

+4
source share
8 answers

The distinction between a game and a real game engine is architectural. The logic of the game is specific to one game, while the game engine is something that can be reused. Just as utilities for applications are provided in the operating system, the game engine does the same for the game code.

Game engines usually have different APIs for:

  • Download multimedia data such as audio, textures, 3d models.
  • Providing a game loop and disabling various events caused by user logins
  • Network
  • Graphic rendering and various methods to make the game beautiful using lighting, particle effects, or bump mapping.
  • Audio
  • Artificial Intelligence
  • An API that allows you to define game rules, games, and game logic.

Most game developers do not write their own game engine. It will be too much work. Instead, they will reuse the game engine that their company owns or licenses. For first-person shooters, id Software and Unreal are two popular options.

Once they have an engine, they should start writing code to make their game. This is done using the API provided by the game engine. For example, Valve forces developers to use C ++. If you want the monster you to separate from the Entity class and determine how this monster behaves in this base class.

I would recommend reading the documentation and tutorials provided by various game engine providers. Keep in mind that some games are classified as “mods,” and some are “general conversions.” Typically, a mod does not change the game engine, and a complete conversion can add or remove significant features to the game engine.

Here are some sources I would recommend:

+23
source

Actually, I can’t tell the difference between the engine and the carcass. These are just two different names.

What is really strange is that the game engine is on the client side, it seems that you do not need the server infrastructure, while a clean socket is enough for this.

But the reality is not so, at least there should be some kind of infrastructure, for example, rails or django, to facilitate the development of your server. Not seeing a game server is more difficult than web development in scalability, translation, and other areas.

There is a commercial solution called smartfox server and a new open source solution called pomelo framework, I tried both, pomelo is much better. pomelo.netease.com is his home.

+4
source

It also depends on the “level” of the engine. What I mean is how an abstract engine from a particular game. There may be small things, such as an FPS-oriented engine that can be optimized for indoor, outdoor areas that you fly at high speed. Therefore, even if the engine cannot be locked for a game, it will be easier for some types of games to implement some engines.

But, as stated above, the game does not inherit the engine, it will most likely draw its functionality, and you are likely to attach components to them already existing components. Or deploy components that are part of the engine.

 class CoolDiscoLight : public Engine::Light { }; ... //and somewhere in the source "CoolDiscoLight cdl = new CoolDiscoLight etc..." EngineInstance.AddLight(cdl); ... 

Even more plausible is the fact that, simply expanding from the light and overloading the correct functions, the light will be available to the level editor, etc., so you will not actually create them through the source.

+1
source

The game engine usually considers a code that can be pulled out and replaced by changing the game.

As already mentioned, how exactly do you USE the engine code depends on him.

Typically, you will use an instance class from the engine library and use them. The way you do this will be dictated by the engine.

Some may provide more features than others, some will focus on the module.

Often, a complete game engine simply connects various submodules, such as a graphics engine that processes the actual image on the screen. A physics engine to simulate the game world. user interface for user interface and menu. a network engine that handles entowrking things.

In the "game engine" these components can be built directly or it can simply wrap another engine / library so that you use it similarly to the rest of the engine.

0
source

Will the creators of the game create an engine and then create a new class that inherits from the engine that becomes the game?

It depends. In most cases, developers will use the use of existing game engines, but sometimes they will not be associated with the lack of desired effects.

I tried several different game engines. Most of them behave as follows:

  • Definition of sprites and sound elements by expanding the class of its main objects
  • Defining groups for ease of management
  • Defining a room or world for the interaction between IO and sprites
  • Program the logic in common functions, such as "update ()" (the function will be called for each frame)
  • Change the entrance to the program to get into the first "room" or "world" (this may be a menu).

Thus, the game engine basically performs tasks to determine how the screen should be displayed at an average level, and the developer does not need to worry about problems like will there be too many sprites loading outside the view-port? or When I press a key, where should the callback be located? , `Do they collide?" focus on the logic of a higher level game.

0
source

Well, I was looking for help in creating games and found that the engine is the foundation of the whole game, as creating a player is simplified, as well as custom graphics and physics or similar items. You also need to think about the next games you plan to make and use the engine to create very little in your game, which is already built for you.

If you want to know what a game engine is, how if functions or want to build them here, how it should happen.

  • GLFW - opening the OpenGL window. This is a great C library that opens windows in almost everything. This is great because there’s even less to worry about.

  • GLEW - Manage OpenGL Extensions. If you are going to do OpenGL, this is not really around.

  • Lua - Scripting. Although I have not used it in my game yet, it is largely suited for scripting in the industry due to its fast implementation of the virtual machine.

  • Protobuf - external state management. You can find the documentation here. The shortcut is that you can use protobuf wherever you usually use XML.

  • Qt - for standard containers and string manipulations. you do not need to use the whole set of Qt libraries, only QtCore. This gives you access to QList (std :: vector), QHash (optimized std :: map), QString (std :: string with support for multiple encodings) and many other goodies. Part of the reason you should go is that the documentation is excellent.

  • GLM - Mathematical Library. If you just want the math in your game, this is the library for you.

  • freetype-gl - text rendering. This is a very well written library for rendering text in OpenGL, you can do a lot worse.

  • libRocket is an HTML and CSS based graphics library. This is great when you just need a user interface on the screen, but it becomes problematic if you want to add animations.

Find the list here.

These are great ideas for the engine, which simply combine the libraries and build the game with the engine that you create from the theses, although you will need time to finish if you do not have a great team. I also read this list and many others, and this is the best 2d list. Also, you do not need to create a user interface for the engine, because you only need the basics of the engine and the collection of a separate project for each game. Here's how to do it.

  • Engine.h
    • enginepart1.h
    • enginepart2.h
    • enginepart3.h (ect.)

(use .h not .cpp for the engine, because you cannot reference engine.cpp, but you can reference engine.h) after creating that

  • Game.cpp
    • gameresources.h (resources include an Engine.h link)
      • gamepart1.h
      • gamepart2.h (etc.)

And build the engine in a way like this, but not 100%, as it would be optimal

  • Frame: math, random, utility, assets, network, window, graphics, audio, ...
  • Player: AbstractPlayer, Score, Input, Collision, Reaction, Skill, Inventory, ...
  • Map: AbstractMap, Area, Town, NPC, ...
  • Enemy: AbstractEnemy, Creep, Boss, BaseAI, FuzzyAI, ...
  • Status: IntroScreen, MainMenu, LoginScreen, Game, PauseMenu, ...
  • Interface: button, text, InputBox, ...

Found here here

Create it like this type

  • Frame: math, random, utility, assets, network, window, graphics, audio, ...
  • Entities / characters: player, enemy NPCs, friendly NPCs, BaseAI ...
  • Map: Map / Level Editor (if you want), map objects (can be placed here), special map functions, ...
  • State Control: Intro Screen, Main Menu, Logic Screen, Game State, Pause Menu (s), ...
  • Interface: button, text, input field, ...
0
source

he often likes it

 class ShooterGame { Engine anEngine; public void Run();///run the world here }; 
0
source

Yes what they said. I would add that these game engines are usually designed for the style of the game. Flight simulator requirements are very different from Quake. Games like Oblivion combine these needs together so that this may not happen soon.

-1
source

Source: https://habr.com/ru/post/1339501/


All Articles