Is this engine design any good?

Started by
121 comments, last by Mage2k 20 years, 11 months ago
quote:Original post by superpig
Bungo,

I think that''s a good idea, especially for concepts like Singletons. I might include links in a section at the end of each article, though, rather than throughout the text.. not sure yet.

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Or, why not just write the entire article not worrying about links. Then, when you proofread it, plug in the links wherever you see fit. Keeping the links in the text will help a lot to impart the context for the need for the link...



peace and (trance) out

Mage
---------------------------------------------------There are 10 kinds of people in the world:Those that understand binary, and those that dont...Mage
Advertisement
Er, whoops.. thought this topic died

I''ve made a decent start on rewriting the thing now, and after a brief discussion with Dave, I''m probably going to do it as a series.

Your comments have all been religiously noted down and I''m bearing them in mind...

The first article will purely cover what a game engine *is*, and lay out a bit of a ''roadmap'' for the rest of the series (it''s more or less what you''d expect from an introductory article).

The second article covers my *revamped* memory manager - which includes my own implementation of Smart Pointers, so you can see how they work, and also includes a way of allocating memory for blocks of built-in data types (CMMBlob and CMMDynamicBlob); error logging, once again (but this time, we use variable-argument lists); and a few utility classes like Functor<>, Singleton<> and ringbuffer<>.

When it comes to my own implementation of all of this - that is, the engine that these articles are about - I''ve already got the networking stuff (mostly) working (UDP still needs some work, but TCP is down pat), with an installable message-handler system; all this to the extent that I can bounce a ball around a box on one computer, and watch it on another.

While I''m aware I said I''m a fan of middleware - and I am - I don''t think people should use it until they understand it to the extent that they could probably make their own. That''s why I use my own implementation of smart pointers, for example, rather than boost or loki; it''s much easier to explain them as I go along.

The engine''s name (and the name of the series)... will be a secret till the first one comes out. It''s a secret because I want to get as far away as possible before you hear it, before being lynched for usage of extremely bad puns.

I fully intend to actually show how to build a game with the engine - I''m not just going to heap it on you and let you figure it out. We''re talking simple games - like Pong - but they''ll be in there, and hopefully pretty well polished. Because after all, a general-purpose game engine is what you make when you''ve run out of ideas for games.

I want to get at least 4 articles written before I submit them (to make sure that I don''t hit problems after a couple of articles). The 3rd article will (I hope) cover XML-based settings files (which, funnily enough, will be published *after* the second part of my XML article ), a runtime profiler so you can see which tasks are taking longest to execute and stuff, and the ''kernel'' itself. The 4th article.. I''m not sure yet. Probably video, sound, input, and the timer (the ''task pool'').

I guess I''d better go get writing, then.



Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Hi,

I just had a brief look over the article and it looks nice (that''s at least what I as a seasoned game engine veteran think) and applicable for a newbie. What I wanted to recommend for the design itself (well to be honest there''s a lot of things I could suggest, but they are not for newbies unfortunatelly). Since you said you like middleware, so that you don''t have to reinvent the wheel, the engine design also fits into this category. It''s basically software design and as that you already have "middleware software design" solutions which have been around long, long time. One such would be an OS kernel, especially UNIX based systems. They are a perfect spot to learn a whole plethora of great and optimal tricks, but not just that, the whole design and feel behind it is enough to give you great ideas. And remeber to stay faithful to the KISS rule ("keep it simple stupid", unneeded complexity kills efficiency.
Keep up the good work!

Cheers,
Vedad

Vedad,

The new design is much more similar to something like an OS - it''s based around a ''task loop,'' for example.

These ''middleware design solutions'' sound a lot like Design Patterns... just on a slightly larger scale.

I am basing my engine on my experience with commercial engines (not least Quake 2, Half-Life, and Auran Jet, and a couple I can''t name here ).

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Well I agree that your design somewhat resembles that of an OS, though I must correct you with ''task loop''. An OS kernel operates on operation chains ( something like a list of seperate task loops), but that isn''t the topic. What I wanted to show with this is two most important things a game engine must have flexibility and modularity. Maybe it doesn''t seem important at this point but those will come out latter with all their glory, when you acctually start making game resources and trying to import them. But when I say flexibility I don''t mean a beast that can automagically run any type of content, or be able to run on any microprocessor, just be able to provide a simple interface to test some ideas or maybe quickly plug some new cool effects into the renderer. My opinion is that your article is already facing in that direction and I hope it continues.

I deliberatelly didn''t use ''Design Patterns'' because they are pro-C++ topic and a good engine design is language independent. You should think outside any language, language as C++ is just a means to turn that logic into reality. A good advice for any newbie would be to first implement their engine on paper in block diagrams or whatever they like, visualize the interactions, see pixels being drawn, images rendered and understand it all then think of the implementation after you throughly understand what you want to make.

These were just some bits I learned through experience (mostly through mistakes I made ).

Cheers,
Vedad
Vedad,

I must point out that you''re basing your comments on the engine design in the article linked in this topic; the new design is.. quite different.

I''m fully aware of the importance of modularity and flexibility. They''re good software factory techniques; and given that my aim with these articles is to help people develop their own *reusable* engines (rather than coding one engine per game), I''m constantly bearing it in mind. Of course, reusability means the engine has to be flexible and extendible.. unless you intend to make the same game, over and over again. I guess that counts as reuse...

I don''t necessarily agree with you that Design Patterns are pro-C++ - I''m sure they can be applied to other languages as well - but I made up a block diagram of my new engine design before beginning the engine overview, and.. I like it. It''s pretty.

I''m glad this draft is being so well recieved. The shorter, neater articles should blow you all away



Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Yes, design patterns are not pro-C++, but it could be said that
C++ is pro-design patterns. The reason for this is that design patterns emerged out of software engineering practices based in the OO methodology and, hence, are easily adaptable to any OO language...

peace and (trance) out

Mage
---------------------------------------------------There are 10 kinds of people in the world:Those that understand binary, and those that dont...Mage
quote:Original post by superpig
I don''t necessarily agree with you that Design Patterns are pro-C++ - I''m sure they can be applied to other languages as well


Well it mainly depends on how you look at it: 1) a general phrase/approach or 2) standardized language approach.

Design patterns is really a all-around phrase that can be used pretty much outside computer science. As you state yourself they can be applied to other languages, but they are used mainly in context of c++, so they have become a bastardized c++ standard, not a general OO approach as it should be (blame the community ). Same thing is with something like singletons or class factories, they can be applied elsewhere, but when we refer to them, thez are refered to as an encapsulated part of c++.

Cheers,
Vedad
quote:Original post by weddo
As you state yourself they can be applied to other languages, but they are used mainly in context of c++, so they have become a bastardized c++ standard, not a general OO approach as it should be (blame the community ).


Heh. In the immortal words of Hal, "it can only be attributed to human error."

If only the people over in the software engineering forum had read this before their 5-page debate on whether design patterns are language-neutral...

BTW, I''m dropping the idea of doing settings files in XML, opting for a more quake-style approach, as it allows me to parse settings files and the command-line arguments in exactly the same way (not to mention letting me get away without any extra external libraries).

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Quick Quick Quick!!!


Publish soon superPig !!


All this new talk of articles and such has given me the coding fever, something ive not felt in a long time!

I looked into SDL for the first time after reading yon article, and now I''m a total convert!

Had semi-developed a game called Zombie Island for Win32 (Desperately needing zombie .MD2''s anyone?!?!), now refactoring the whole thing with SDL in mind and also my beloved iBook ;P


Cheers,

vooodoo_john

This topic is closed to new replies.

Advertisement