Saturday, 16 August 2008

Engine initialisation and threading improvements

I haven't blogged in a while mainly because nothing major has really happened. I've mostly been learning to drive which is going very well. I have my theory test on Thursday which should be OK as I've been doing well on the practice CD i have.

I've just committed a fairly big update to the utilities and the core mainly aimed at threading as well as the engines initialisation sequence. One problem that existed was that for systems that are very slow to initialise (like OGRE) the engine would start running/ticking before it has completed.

There were many different possible solutions but the solution i went for is process every initial request (register/initialise/schedule) and only once every single one has completed, initialisation will finish. Ticking will not occur because the EngineTimingHandler has not been started yet, so game states etc cannot be ticked and cause the original problems.

A problem that existed before and probably emphasised with this solution is that all systems assumed the current time is 0 when they were created, and during initialisation they we're told it was 0. By the time everything has initialised, the time could be at least several seconds later, causing them to calculate very large time intervals which would result in incorrect calculations.

The solution now is that when a system is scheduled it is told the current time, which could be incorrect if the engine hasn't started running yet. The EngineTimingHandler solves this by telling every system that is scheduled the real current time before it starts running.

There are still many improvements to be made to OGE's threading but it has been fairly easy to make the necessary changes so i think our current approach is working well. The main improvement i want to make soon is to get OGE to work out how many threads to create at the start semi automatically. It will take various hints and requirements (from config) and retrieve details about the current CPU (such as number of packages, cores and logical processors) to work out how many threads to create.

On another note, i think its possible for us to get Intel's Threading Building Blocks working in OGE (the scheduler/algorithms part) because it allows you to specify the number of threads that the TBB scheduler can use/create. It would allow us to allocate all the threads we need and then let TBB create the remaining number of threads. On future CPU's with more cores than work that we can allocate from the various systems, we can put more workload onto the tbb scheduler.

Friday, 18 July 2008

First driving lesson!

I just had my first driving lesson today which went really well. Learnt some of the basics and got to drive around a car park a bit. I am at least happy i haven't stalled the car...yet. Bit of a squeeze getting into the car as its smallish and I'm not. My instructor seems good as well, i think I'll be able to learn at a good rate. I'm hoping the rest of my lessons go as well as (or better than) today's.

Monday, 14 July 2008

Framework for Features

We have been writing framework code for quite a long time now for OGE, a large amount being utilities and a fair amount for the core. We are now starting to add new projects/modules, currently graphics, input and audio. We are really close to being able to start adding loads of features to OGE which i can't wait to be able to do. Finally the fun part! Sadly though we still have some more framework to add, such as the basic initialisation/shutdown of each of the plug-ins and adding more to the core, but I'm hoping this won't take long.

Once we have the first few plug-ins up and running, it will be a lot quicker to add the remaining ones as we won't have to discuss how to name various files and classes.

Tuesday, 24 June 2008

Final results!

I checked my results again on my uni's portal and they have all been finalised. I've got five 2.1's and one 2.2. Over the three years, i've got 15 1sts (>= 70%), 13 2.1's (60 - 60%), 5 2.2's (50 - 59%) and only 3 passes (40 - 40%). I'm really going to have work hard in the last year as i want to pull my average up a lot. Not all of the years count, in BEng the second and third years count but I'm not sure about MEng, do the last 2 or 3 years count?

I am trying to think of some software projects i can do for my final year project, I'm hoping it can be something related to games or even OGE. I really want to show off my programming abilities in this project to hopefully give me a better chance at getting a good job.

Wednesday, 18 June 2008

Rough Core

I've been working on the core recently. I haven't been able to program as much as would like. To be able to get more done, i am focusing on getting a basic core up and running, where most configuration is done manually. This will allow the separate systems to be developed in parallel with the core. I will then continue to work on the core but being able to put all of the features that is needed/wanted in it.

These features are mainly thread handling and system creation and configuration. For the moment, you tell the core how many threads to create and it will just distribute the different systems by adding them in a cycle or round-robin way. The more advanced way, which is the goal, is to get OGE to detect the number of processors the computer has and to use various user defined settings to create the correct number and types of threads. It will also allow different ways of distributing the systems between the threads. The goal is to allow the engine to scale to the hardware its running on without altering the engine or application.

Provisional Results!

I just checked my uni's portal for the latest results from the last semester. All of them are filled which 4 of 5 units are a 2.1 and the last is a 2.2. One of my units is also a double credit unit, so that's five 2.1's and one 2.2, so I'm happy! These of course, are provisional and can change when they are moderated, but I can finally relax.

Friday, 6 June 2008

I'm Free!

At last, this uni year has finished! I now have to wait for my exams. I can work on OGE a lot more now, which i have some personal goals for that i really need to complete over the holiday. So hopefully by the end OGE will be at a very basic, usable state that at least simple games can be made.