Monday, 25 July 2011

Evenings are dark again!

Here's one more short post, and a warning that I'm on holiday for one week beginning Friday, so my next post may end up being scheduled and therefore old news.

I shall be here in a week. Expect numerous photographs, of nowhere near this artistic quality.
I've actually made decent progress with the game - I'm now at 6.5K lines of Java code, which to be fair doesn't sound like much, but does represent significant progress. By comparison, Unreal Engine + Editor is reportedly over 1.4M lines, Source SDK at 780K, Quake 3 at 310K, and the Crysis SDK at 280K lines. In any case, judging a program by the number of lines of code is like judging an aircraft by its weight [quote shamelessly paraphrased from Bill Gates]. I'm aiming to have a working renderer with terrain, water, models and UI working in "real" space within the week - which should be achievable. One significant annoyance for me is that OpenGL intentionally doesn't have any native way of handling fonts - which is going to add a significant amount of code (unless I cheat, and just bake every bit of text into images, which isn't possible for stuff like resource count).

Once I've got the renderer up and running, the rest of the engine is actually much less complex in terms of the maths, and doesn't have to be nearly as efficient or fast. Keeping everything in sync across a network isn't too bad as long as you aren't doing any prediction (for those who are interested, there's a very impressive explanation of how games like Counter-Strike predict movement over in the Valve wiki or for the older Quake here) From there all I need to know in terms of engine is skeletal animation (I could probably implement it now, but don't fully understand it - there's some maths we simply haven't covered - Quaternions - from what I understand, essentially multi-dimensional imaginary numbers - the extension of an Argand diagram into 3 or 4 dimensional space - too many hyphens - I think not!). After that the client needs sound, encryption and streaming of textures/file manager, and then is finished.  Server-side requires a file server, gameplay logic, account manager and AI (PvP would of course solve this, but it's worth having very basic AI to help the game start and get people acquainted with controls and basic gameplay). From there, my job is level design tools. supporting the artists and gameplay, and the website/backend.

Ambitious? Yes. Achievable? Let's find out, shall we?
Charlie

Monday, 18 July 2011

Apartment and Connections

Much of my last week has been spent on filming - if you haven't yet seen it, check out the Facebook page for the film here, and see the "Finding an Apartment" videos. We still have a fair amount to shoot, likely around September, but we've got a fair amount complete, and the rest planned and written. There's also a fair amount of processing to do - shots taken when walking backwards aren't exactly prime candidates for the "smoothest shot of the year" award, and masking out any wires and misplaced boom poles will take a while (more due to my lack of experience than the amount of processing required though).

I also fixed a website of mine - and started using a reverse proxy to look at traffic. One thing which surprised me is that over 90 unique threatening machines are blocked attempting to connect to the site every week. The proxy also cut response times, stopped over 14,000 requests, and saved the best part of a gigabyte of bandwidth, which is always nice. Thanks to Cloudflare for an excellent service, at an unbeatable price (free, paid service for better statistics and more control).

Pageviews are down because the domain was stuck on a landing page for over a week in transfer delays. That's one way to wreak search rankings. 
Savings are awesome.
I'd never miss a chance to show off my (quite frankly pathetic) site statistics...
Charlie

Monday, 11 July 2011

A collection of semi-related ideas

Today, I thought I'd just set down most of the projects and thoughts that are floating around inside my head, in the hope that it'll help me think more clearly about them. Most of these should be accomplish-able over the summer.

Quadrotor: Parts are on the way. Not much that can be done before they arrive, really. The only real priority is ensuring we can work in the Mills Centre (or failing that, finding a place to work).We do still need to find a good set of 4 blades (and a set of spares too).


Game: I'm getting there. Perhaps too slowly. The aim is to have a completely deterministic client-server system, running at 5-10hz for gameplay (variable depending on latency?), 60hz+ for graphics/rendering/motion. Whilst that's entirely possible, my knowledge currently doesn't cover skeletal animation or some of the newer OpenGL techniqies, and I need to work out a good model for handling gameplay on server, and resources and data on the client. My audio plan is also limited, and requires OpenAL to be installed manually, which is a pain.

DT: Check money for parts - need to go to bank.

3D printer: Ditto.

BlackBerry: Why do I have to boot up an XP VM just to sync or back up my phone? Ridiculous as a solution. RIM, I expected more. I can't really solve this though. Plus, waiting on my network to enable BBM and push email.

Sites: img - not viable? VW - in progress/ Scopegames - waiting on domain.

Fixing crap: iPhone needs doing. iPod Touch is awaiting parts. The DVD drive is being very odd indeed. Laptop is a lost cause?

Anything else I've mentioned on here (plasma balls, vlog) - suspended indefinitely either for practical reasons or apathy. So sue me. Or slap me. But bear in mind that you haven't posted this week...

Tidying up: The less said the better. I know there's a floor around here somewhere....
Lists: the procrastinator's alternative to actually producing something.
Charlie

Monday, 4 July 2011

Reaction Times and Gaming

With just 3 days left at school, it surprisingly feels like teachers have increased our workload rather than lightened it. The holidays are definitely going to leave me with a lot of time to have fun study hard and prepare for the future. 

In lieu of a working game engine, I'm instead going to present some of the stats from my reaction tester (horrifically coded with JavaScript, with absolutely no security whatsoever - check it out at http://reactions.haveibeenraptured.com/). I said that this data has a weak negative correlation. Equally, and probably far more significantly, it shows that people are inclined to round their numbers (or play games for exactly 15 or 20 hours a week but not for any time in between the two).


Most amusing name: "Charlie I'm Horny"
Most amusing hypothetical attack: "i was tempted to leave it on overnight for a super retarded time and put 'single mathematician'" - Jamie Go
Longest time: 14,283ms - Josh P
Runner-Up: 10,744ms - Benjamin S
Worst DDoS: You know who you are...
Best-known participant: “Andy Murray”

Thank you for participating in this enrichment centre activity
Charlie

Monday, 27 June 2011

Filler posts? Who, me?

I've been out all weekend filming (more over the next month - and no spoilers I'm afraid) so I haven't had much time to work on the engine or any other projects - though I have ordered the motor, charger and batteries for the quadrotor. The work I have done towards the game is mostly non-visual (i.e. importing 3D models, materials, user input, and animating colour transitions). I'll be finishing the model and material importer, and designing the renderer properly over the next couple of weeks.

CryTek know how to do lighting.

Once model importing is sorted (not too far off) the next big problem will be lighting. Lighting is easy in certain situations but next to impossible in others. Take the above image as an example (a model of Sponza Atrium, rendered in CryEngine 3). If you consider light as moving only in a straight line, then any covered areas would be completely dark. We know from experience that this is not the case, however - light is bounced off all surfaces, providing light to the covered areas. This is known as radiosity. Games like Half Life 2 pre-compute the radiosity but this method has limitations (most notably, the lighting is only valid when the sun is in one position) so increasingly games have started to handle more advanced lighting in real-time. There's still no "standard model" to speak of as yet - though there are some techniques in common between virtually all games. Advanced illumination like this won't be relevant in an RTS game, but I prefer to plan ahead and think about how features could be incorporated. 

Project size to date: 384mb
Charlie

Monday, 20 June 2011

Progress. Kind of.


I do Linux. It's a thing now.
This is going to be another short post, I'm afraid. Current progress towards the game is shown above - I've set it up to do real-time colour toning of scenes. It's currently just set to turn Red and Green down a lot, and Blue down slightly, and then switch the Red and Blue channels around (fixing the odd colouring issue I was having at the time of last week's post).  It's also rendering to an off-screen buffer at the same time - which means that the in-game content could all be treated in the same way, not just a raw image as shown here.

For anyone interested, the fragment shader code itself is shown. It really isn't that bad, actually. The code that goes with it (feeding it the data points, textures, etc) is horrific at first sight though. Finer-grain control over colours will be possible, when I write some code to handle one-dimensional textures (multiplying by 0.9, 0,7 and 0.6 were really just to test the concept).

The switch to Linux is an interesting one - I had previously done so on my laptop whilst "revising" - but now it's on my desktop, and it's permanent. On the whole I love the OS - everything is free, without any hassle - installing programs is as easy as typing its name, and pressing "Install". Programming is far easier than under Windows - the entire O/S feels more geared towards it. Even advanced changes only require a couple of lines of text. I'll only cave in and install Windows 7 when my craving to play Portal 2 gets too great, or when I discover that there's no fix for a bug I have with it. (The choice to use a Portal-related texture as my test image suggests I'm not going to last too long...) The only real barriers against wide adoption is the lack of apps like Photoshop, After Effects, and a large library of decent games, the perceived increase in complexity (no steeper than Windows - just not what people are used to), and maybe the self-imposed "free software" barriers (again, not a problem to me - technically formats like MP3 and DVD are licensed, and drivers without source code available throw up a "non-free" warning). That's how my experience of it as my "Main O/S" has been, anyway.

Linux is the one responsible for destroying the performance - it's not actually that slow.
Charlie

Monday, 13 June 2011

Shaders Aren't Easy

What I've done there is failed. 
I'm afraid there isn't going to be a substantial post today - I'm just going to show what little progress I've actually made on an "engine" (term used loosely) - my code can import a texture and show it on a slightly-mutated ex-square. Colours are a work in progress, and it's also using a complete hack to set the texture coordinates, but I think it shows that I'm not far off doing "useful" things in OpenGL. It's not going to win any awards for pretty code (once I have model importing, basic illumination and muti-texturing sorted, I can start writing pretty, fast and flexible stuff), but it's all practice and experience in the graphics language.

The texture on the right is the original, the two on the left are various attempts (guesses) at the right colour profile.

I've managed to keep the performance, at least...


"Failure is just delayed success". Is what failures say.
Charlie