Contents

Suggestions And Improvements

I really like your approach of writing an engine, but wouldn't it be better to use:
virtual void AdditionalInit() = 0
instead of
virtual void AdditionalInit() {}?

Also I would suggest to declarate the virtual functions even in the CMyEngine class as virtual. Although it is not necessary most people prefer it, cuz this way you always keep in mind what kind of function this is.

- To the question about virtual versus pure virtual, you are correct. It would probably be better to make them pure in order to force users to implement the functions. It would be even better to have the CEngine-class inheirit an interface-class (a pure virutal class), but I'll leave the structure as it is for now.

EDIT: I changed all the virtual function to pure virtual functions, and sat looking at the code for a bit. It then occured to me that I don't want to force people to implement functions like WindowActive and WindowInactive or even AdditionalInit and End. The user can just implement the functions he or she want.

- To the suggestion of making the implementations of the virtual functions virtual as well; good idea but it would undermine the stability of the class hierarchy. That would allow other class to inheirit the CMyEngine-class and make their own implementation of the virtual functions, but that also opens a lot of possible errors. To make it appearent that they are virtual functions, a uppercase "V" could be prefixed to the function name. Some developers use this approach to be able to tell normal and virtual functions apart. I'll leave it as it is. Making the functions virtual just to signify that they are implementations of virtual functions dosen't make much sense to me.

Questions

Wot's the license for this code - i.e. GPL, BSD, public domain, some random terms for usage, or maybe I have to stand on my head and do three back-flips while whistling obscure dance club mixes backwards? :) --69.132.183.189 21:16, 4 Sep 2005 (EDT)
Never mind, I just saw the notice about source copyright below as I was posting this.

I know that the source in the code that's in archive for you to download is required to be Public Domain, but I don't know about code that's actually on the page. It's either FDL or Pub. Domain. If you're reading this, you could ask in the forums. --Snoolas 14:58, 5 Sep 2005 (EDT)

FrameTickValue?

I was wondering what FrameTickValue is for since it is not used at all after it is defined. How do you control the fps? Thanks. --68.160.34.253 01:43, 11 December 2005 (EST)

You are exactly right. m_lFrameTickValue is not being used. It is a variable that I used for keeping the framerate steady, but now the engine uses time based calculations instead, so it's really just a left-over. The elapsed time since the last update is calulated in CEngine::DoThink(), and time is then passed to the concrete engines Think() method. It is then responsible for updating the logic according to the time passed. Here's the code that finds the elapsed time, it pretty straight-forward:

I've finished the engine! The binary version is packaged and ready to go. I'm just writing the tutorials for now, but hopefully I can get some of my class mates using it soon :). I won't be releasing the source yet, I'm still kind of attached to it. When I finish the tutorials, and have them all tested by my friends I will release the binary online. I think it's a bit rude advertising it here, but I'm still going to make a page for it on the GP wiki, even though it will be uploaded somewhere else. It's called KAGE, by the way.

It's been a while since I've been here, and I'm ashamed to admit that I never actually posted my code. I'll remove my page. On another note, after all of the things that I've seen and learnt, I'm confident enough to say that this page needs a rewrite. If nobody objects, I'll get to it now. Also, I don't think that Scion actually watches this page anymore. --Ratstail91 12:03, 18 April 2012 (UTC)

We haven't seen Sion for a long time. His last visit to the forum was 2008. If the page needs an update and you think you're up to the job, feel free.
Codehead 12:01, 22 April 2012 (UTC)

I think https://github.com/Ratstail91/Codebase is a pretty good alternative, although admittedly the earliest version of codebase came from this page. It's amazing to see how something like Scions framework could evolve into my codebase.