Skip to main content
gamedev.net
🔒 Locked

Game engine vs straight code?

Started by Herbst 2 replies 1.3k views
Original Post
Herbst
Herbst
Hi, i''m programing my first large scale c++ game. i was wondering if it would be easier to write an engine, or if i just coded the whole damn thing in visual c++. i''ve made some simple games in the past, but they were nothing that couldn''t be done easily in visual studio. any suggestions on this?
Aldacron
Aldacron
Why must a game engine be coded outside of VC++? I don''t get it.

Anyway, if you plan on making more games, I suggest you take a modular approach. Create some static lib or dll projects in VC++ for all of your low-level stuff. For example, one lib could handle graphics output, another could handle DirectInput, another sound/music. It''s not too difficult to come up with a good, reusable design that you can plug in to your future projects. You could also make seperate modulesfor a specific game types, i.e. an isometric engine, an overhead tile engine, a portal based 3D engine, etc... The more components you develop, the more you can focus on game code for each new project. And if you spend enough time thinking through the design of each component, you''ll be able to add new features without breaking old code.
Gaiiden
Gaiiden
Definetly an engine - no doubt. Any big project will need a modular inteface that will allow you to tweak one part without directly affecting the rest. Engines can do this (if they are designed correctly). The other plus is that they can be reused for any other program and easily modified (by switching in and out new component parts). And, of course, they are easier to maintain than pure staright-forward code. I can''t imagine making a game (today) with no graphics or sound engine or anything like that... what a nightmare that would be.... damn, now I''m afraid to go to sleep.

==============================
"Need more eeenput..."

- #5, "Short Circuit"
==============================
Drew Sikora
Executive Producer
GameDev.net
JD
JD
I''ve downloaded the crystal space 3D engine source code and it''s pretty well organized. It might help to take a look how they achieved platform independence. So basically you can go:

1)Platform independent
2)Platform dependent but graphics/input api independent i.e. opengl vs. direct3d, etc.

I''ve built a simple dll and linked it to the exe with an import library in vc++. In WinMain() I called exported Run() from dll that created the win32 window class, registered it, created the window and one global window procedure function for handling messages, all in the dll. Then I would give you the exe file and give you different dlls based on what you wanted.

You can also go the id ways of creating each engine from scratch. I find that when I experiment I tend to not bother with modular design because it isn''t important only the graphic concept matters. Later once I have an idea I put my code into objects and static/dlls libs for reuse. I then split into two minds one of a coder the other of a user. As a user I would like to add modules to the program and remove them as I please and as a coder I want to reuse my code and not have to write it over and over again. I don''t know if this helps you but it''s something I been thinking about lately so I thought I throw some ideas around.

my homepage
E-Mail: BlueOrbSoftware@mailcity.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.