OpenGL 2.1 vs 3.x

Posted by | Posted in Game Development, Pioneer | Posted on 14-09-2016

Back in the heady days of… erm, the past, when I wrote the OpenGL 3.2 post I didn’t think I’d ever be adding support for OpenGL 2.1 back in, or revisiting the mess that is multiple OpenGL version support.

Skip to right now though and I’ve got a PR in adding in support for OpenGL 3.x + 2.1 which is getting reviewed piecemeal and I’m playing whack-a-mole with the various issues that arise from it.

OpenGL 2.1 seemed like a logical place to start for this. Not because I want to see it back but because I wanted an existing code base that has previously worked to update rather than write a new one from scratch. It was also important to determine how much of pain the mixing of OpenGL version would be. The answer to that last part turns out to be very painful, at least using glLoadGen.

What I wanted was to have everything namespace’d and separated so that the GL2.1 renderer only had access to OpenGL 2.1 functions and extensions, likewise for GL3.x but this proved to be much more complex than I like.

The final goal is to have support for other renderers but right now I’m trying to wrack my brains for the dregs of energy needed to switch away from glLoadGen to… well that’s the problem.

  • GLEW still has the same problem that caused me to switch away from it and the maintainer seems determined not to merge anyones repeated attempts to fix it.
  • GLee appears 100% dead in the water.
  • libEpoxy – I’m starting to evaluate this now but it looks like yet another slightly overly complex library and there’s no discussion of multi-version GL support.
  • glBinding – looks bureaucratic.

There’s limited time in the evenings to do this in and a tonne of other projects in Pioneer to be digging through. It is so disheartening that it’s all in this fucking mess and that’s before I go into a rant about how poorly manufacturers support older graphics chipsets by backporting feature and support. nVidia outshine the rest here massively but even they can’t push technical fixes back onto some of the older chips.

Back to the coal face

Pioneer Clouds

Posted by | Posted in environment, Game Development, Pioneer | Posted on 03-06-2016

Some time ago I tried slapping a texture of the Earths clouds onto a sphere around Pioneers planets. It didn’t look awful but it was a static texture meant for just the Earth itself and having a selection of high-resolution textures to pick from would look very repetitive uncomfortably quickly.

As usual in a thread like that I immediately got asked why it wasn’t better, why aren’t I doing like X,Y or Z, etc but the idea is still bubbling away in my head. The thread itself was really just to gather resources and ideas rather than to track anything.

Now I have a small gallery of test images based on some noise based shaders which update over time but look rubbish.

See, from the ground:

From the ground

From orbit:

From Orbit

To get better looking clouds, ones that look like they’re generated by the planets surface and properties, you need to analyse that planets geography and the energy inputs/sinks.

There are a couple of interesting pages like the Stainless and Dungeon League sites who really dig into and iterate through ideas to produce some very interesting results.

Heat & Friction

Heat & Friction

2D normalised wind direction

2D normalised wind direction

I fairly sure that I can combine them already to get some interesting results but I hope that more than using them raw like this I can do some more processing to generate evaporation, rainfall (precipitation), rain-shadow style maps that will look even more compelling.

Right now I am basing the number of “bands” of weather on the Earth’s global atmospheric circulation which will not hold true for other worlds, so having some way of determining the number of “cells” to divide a planets circulation into will be necessary. Take Jupiter as an example, it has numerous “cells” which all have different gases being mixed into them giving it that distinctive layered look. Depending on the planets size, rotational velocity, atmospheric density, viscosity, heat absorbtion, angle of inclination to the nearest star(s), etc there could be anything from 1 to 100’s of cells dividing up the atmophere.

That would be something amazing to see, different on each and every world with corresponding weather systems and biomes.

That still won’t be the end however as all of this so far is excruciatingly slow to generate, requiring as it does a decent level of heightmap detail.

Generating those heightmaps is the most expensive single process in Pioneer, which is why the development of the multi-threaded processing made such a big difference.

Some simplifications, optimisation and cleverness will be required before this can ever make it into the game proper.

PS: IN parting I should also add that working on this came about because I needed to generate from of this data for the new JSON driven terrain generation system and because of the XFrontier forum thread which just looked too damned good to pass up.

Unspeakably rude.

Posted by | Posted in Game Development, Life | Posted on 11-08-2015

The Incident:

The other night (Friday, 7th Aug) I was in the RoundHouse pub with some friends when I spotted a group of former work colleagues sat at another table.

I exchanged the usual pleasantries with one I know a bit better & thought nothing more of it.

At the end of the evening as they left someone I didn’t know came over and said “Hi I’m ####, you’re Andrew Copland?“, and I said – whilst reaching to shake hands – “Yes that’s me“. He shook my hand and said “I fix all your bugs“.

He let go of my hand and left laughing leaving me in silence with my hand still in the air, stunned.

A friend that I was sat beside asked me if he really had just said that and I, slightly dazed, simply confirmed he had.

This has been bugging me more than it should so I want to get why off my chest.

The Past:

When I started at this former workplace I was broke. It was after another company I worked for had gotten into financial difficulty and not been able to pay, simultaneously several big studios in the UK had gone under and made about 800 developers (in total) redundant in the UK.
There was a massive glut of talent and finding work got really hard, really fast at the worst possible time. I was unemployed from early July to late October that year.

Eventually I went to this place out of desperation, I’d heard bad things about them, so even though they were based very conveniently I’d instead chosen to go up and down the length of the country before applying to them. Partly this was also because it wasn’t a games role but a Tools one and my first time doing more than just tinkering or bug fixes on development tools.

It started fairly badly with some office politics treating the outgoing developer I would replace unfairly. Thankfully the Tools team themselves were great and the guy who was leaving (that I knew already) made that whole time work despite the bullshit.

Sadly about 6 months into this I started to suffer from depression and a little anxiety. It took me a while to realise this of course, anyone with these things will know that they don’t come with an easily identifiable rash or something to give themselves away, they come on slowly and discreetly.

The pressure was on at work due to company finance problems, project deadlines, a new tool that needed creating – which should have been a simple affair and conceptually I had no problem with. However by now my mental health was affecting my work. This was when I realised what was wrong and went to my doctors.

To cut all that short, I got help.

The Fix:

I got some very mild anti-anxiety tablets to stop me having panic attacks and elected not to treat the depression medically but to get counselling (CBT to be precise) instead and to keep medication an option for later if that wasn’t helping.

I also started to look for another job as it was clear that the way the company worked, and the work itself, didn’t suit me at all.

Getting the anxiety under control really helped my work but during the time leading up to this I had written some of the worst code of my entire life. Even with things being better I was still under a lot of time pressure to fix existing bugs / features and to write the new tool so this code also suffered quite badly. I have no doubt that I left some absolute stinkers in that codebase.

Since I started as a technical QA (bug fixer) I’ve been on the receiving end of code like that too. In fact the code I was replacing was already pretty hideous and bug ridden but only because it too was written whilst it was being used in production with all those same time constraints.

What I have never done is approach someone else and mock them for their bad code.

I’m Normal.. No, Really:

Perhaps it’s because I am an average coder, I strive for excellence, I achieve average but I don’t see a reason to beat myself up for that as I always strive for excellence regardless. The attitude that you should only code if you’re some kind of code-magician is only held by the most deplorable of shit heads. Sadly I’ve worked with a few, being openly mocked in a company wide email by the lead programmer of another studio, as junior coder, for asking for help comes to mind. I shrugged it off as my own lead was far more supportive and the better man, it was his opinion (to paraphrase: “Don’t mind him, he’s a dick”) that mattered more. I’ve remained friends with many of the people I’ve worked with, and have been rewarded in my work by always being recommended and thought of highly, sometimes even for my skill and not just my dedication.

Over time I’ve learnt that I’m not alone, other people have gone through periods like me, outside influences in their lives that have affected their proficiency at work. It seems obvious when you say it aloud, but if you’ve been dumped by your girlfriend, divorced by your partner or separated from your children, maybe you suffer from depression or anxiety for any reason, then yes your work will suffer because you are suffering. You shouldn’t be mocked for that, not then and not unfairly in the future when some 20-ish-year-old University graduate has to see those bugs you wrote at one of the lowest and most difficult times of life you’ve yet faced.

My subsequent job was also in Tools, I found out that at least that hadn’t been the problem. Just some combination of the company / tasks / projects / environment had combined badly with what was going on in my personal life at the time to affect so horribly. The next job went well and I enjoyed it until the company was being bought out and I saw an opportunity to get back into developing games themselves. Tools development just isn’t for me, Tools are part of the process of making a game, and it’s the game I wanted to be making.

These days I do contract work, we re-launched an older PC title on Steam with some bug fixes and improvements including replacing the old networking with Steam’s system and I wrote a lot of improvements and additions for it. Now I’m still working with that company and with my friends because everyone has been pleased with my work, for the most part I am too. There are disappointments, I am after all just average and I make mistake or do stupid things, but I’m also successful far more than I fail.

The, let’s be generous and assume nothing malicious, “witty-put-down” I experienced the other night out with friend has been slowly gnawing at my mind now not because I’m without fault but because of that time, because of those difficulties I faced and how much everything hurt…

…well, that and it was a just a really shit thing of them to say ;)

Andy

 

NB: Yes you can probably look at my LinkedIn page and figure out where this all happened but I’ve deliberately omitted that stuff so keep it out of the comments please.

Asteroids

Posted by | Posted in Game Development, Pioneer | Posted on 08-02-2015

These are some screenshots of a test asteroid created via procedural methods for Pioneer Space Sim.

Work, DLC & DRM

Posted by | Posted in Game Development, Life | Posted on 22-01-2015

So, back from Xmas I get my PC working again at long last, several parts later but what the hell eh?

This means back to work too and immediately I am reminded of just how clueless this industry can be. Take our DLC releases, or rather the DLC we’re releasing for other companies for our game. Confused yet? Not as confused as I was since this wasn’t supposed to be on the cards for quite some time yet. However due to the games success it’s been pushed forwards from “many weeks” after launch to… well we’re about to release the 3rd DLC pack on Tuesday! How’s that for a change in timetable.

Maybe it wasn’t a change and the client are simply goddamn awful at communicating with us what is going to be happening, or indeed when it will happen. Having dealt with this now for a few weeks, and through my exhaustion, I can confirm there’s nothing malicious just sheer ineptitude.

The reason I am exhausted is because I’ve been implementing the initial DRM system we’ll be using for future DLC. Yes even whilst we’re releasing DLC that I have to double-check for problems I am writing the DRM for that same system. This is a DRM setup that I explained could take upto 3 months to write, but they wanted it in a hurry so I stripped it down and said “How about 3 weeks?” to which the reply was “Great! We’ll start testing it in 1.5 weeks then!” … that’s not how it works, 3 weeks means it will start working in 3 weeks. No I am of course now committed to doing what was initially a 3 MONTH task in 1.5 weeks because some people can’t read who sadly are also the ones who pay the bills :(

Then there’s the DLC, I’ve had them turn up without you being able to see outside of the plane, then to get a “fixed” version, where the plane was completely invisible. Or when asking for the raw original why is it that we nearly always get the installer? Meaning we must install the thing, get past it’s DRM / license then extract the changed files then build the DLC from them and hope we didn’t miss anything? That’s assuming that anything works. We’ve fixed issues in each and every DLC we’ve received, issues that were in them when they were sold as standalone products for the last 8 years! Simple text file and naming issues that take seconds to fix.

All the while I’m trying to create this whole new DRM system and my mind is staggering under it all.

Thankfully Rocco has finished most /all of his bugs and has taken the DLC checking off my hands, Steve does the initial unpacking/packing and testing, then Roc’ does a sanity pass on it in the Debug build to see what asserts, which given that they’re mostly conversions from an even older version of the game means that lots of things assert.

The lack of professionalism is confusing, nevermind staggering, and tiring to deal with. Files arriving at the very last possible second when testing them properly is impossible because it’s so late in the day, or last minute changes the morning before launch abound. It’s risky and it’s unnecessary.

Mostly I am enjoying this work but as ever the parts that suck are the parts where your deadlines are driven by those who don’t have a clue and don’t seem to have the nous to acquire one.

Back to work.

What to do when your PC goes Kablooey on you.

Posted by | Posted in Game Development, Life | Posted on 06-01-2015

Obviously your first response should always be to panic.

By “Panic” I don’t mean furiously try and solve your problem. I mean that you should take a long time to just sit there, scream, cry, wail, gnash your teeth at the wall of horror that is the demise of years of effort and a couple of thousands of pounds of hardware. Really wallow in that despair because lets face it: You’re fucked.

Just before Christmas I was faced with this and I made the classic mistake: I didn’t panic. No what I did was carefully diagnose the issue, then the reality crept up on me. The costs to fix it began to mount, the work and personal data I had that could be irreparably lost followed by that absolute sadness that is the demise of your personal PC.

Maybe I should explain that last item. I built my PC. I didn’t make the chips and circuit boards that are in it I just picked them, carefully and after lots of choice. I weighed up all of the costs, the implications for the future, the path that choosing a particular chipset would set me upon. Those decisions were heavy and the impacts are still being felt now.

When everything was chosen, bought and delivered I sacrificed my old machine. It was another custom built one but I couldn’t afford to buy all-new and had to re-use certain components. This is fairly typical for the budget tight PC builder but it does have one terrifying downside: fuck-up and you have no PC at all, and no money left to get one. Things went well though and I built my new PC. it was awesome compared to the old. Over the years there have been numerous upgrades, memory, GPU(s), harddrives and even the CPU. An attempt at water cooling using a closed loop cooler is best forgotten but hey, I tried!

It’s been through 3 operating systems too and a couple of monitors, and multi-monitor setups, I’m probably missing out a lot of things. I think I had SLI GPUs for a while, I forget, there’s been a lot of things. Things I have done, with that machine, we have spent time together. More time than anyone spends on a car, more personal than any static musical instrument, more involved and consuming than anything I can think of beside having children. I don’t have children.

I’ve earn’t money with that machine, it has been my personal PC, my work PC, my hobby PC, my gaming PC, my learning PC, my development PC.

Right now it’s switched off. Inert, inoperative, lifeless and waiting for me to make it function again. People that I discuss this with tend to think I’m a bit special, then harp on about there own hobby, the one they spend the odd evening once a week/month doing, and how it makes much more sense to feel involved with that despite spending a tiny fraction of the time and energy on it. Yes it is “only a  PC” in much the same way someone might say to a musician that something is “only a guitar” – I wouldn’t, I have at least half a fucking clue.

The last time it turned out that it had fried the GPU, an expensive component by itself but thankfully under warranty.

By the way www.overclockers.co.uk customer service were great, I phoned, told them the problem, they immediately sent me the return information and issued an RMA. They sent me a replacement card the same day that they received the broken one. I couldn’t have asked for better. They gave me the option of a refund too but I chose the replacement. Cheers anyway if you ever read this.

This time it’s looking like it might actually me even more serious, and more like the problem I initially believed it to be before Christmas. I think the motherboard might be toast. Not completely toasted yet, but getting a bit crunchy and too dry to call bread anymore at this point… I may have to abandon that analogy. The motherboard being the most central component of the whole machine means replacing other parts like the CPU and RAM too. At this point there are only a few other parts I’d want to bring across. That shiny-shiny GPU, the harddrives (2x SSD, 1x HDD) and erm… that’s it actually. Even the case is old and newer ones have some much better layouts and… I’m justifying aren’t it? I can hear the imaginary pound coins being sucked out of my bank account “full” of imaginary money.

When it initially went kablooey before Xmas, once I’d stopped not-panicking, I priced up a replacement machine. Then I went looking for how much a loan would cost me.

Time to dig out those figures and get a PC built then? Something a lot less Personal, less PC more Computer. Something with … a warranty.

Andy

OpenGL 3.2 in Pioneer

Posted by | Posted in Game Development, Pioneer | Posted on 19-11-2014

I just merged in my changes to update Pioneer to use OpenGL 3.2 on Windows/Linux/OSX and since I haven’t posted about anything in a while now seemed like a good time to describe those changes, and why I’ve made them.

Pioneer has been using OpenGL 2 for many years now, it even supported the fixedfunctionpipeline until not long ago and it’s rendering system has stopped Pioneer from being ported to run on mobile class devices which typically use OpenGL ES. It used methods that have become deprecated including the matrix stacks, built-in lighting and texture coordinate structures and had several performance sapping calls to glGet* functions.

Over time I have removed all of the glGet* function calls, which improved performance and consistency but put off the really big rewrite to refactor everything to use our own matrix stacks, lighting and texturing for a long time. Eventually the lure of modern Vertex Array Objects tempted me and I bit, sadly this broke the OSX version of the game and I didn’t even notice for a few weeks.

This was the straw that broke the camels back. I knew that OpenGL 3.2 would work on OSX/Linux and Windows for most people from experiments/rewrites I had done, but struggling along with all of the old crud and extensions was taking up a lot of time and making it almost impossible to progress.

Perhaps a better coder could have found the magic combination of incantations required to make everything work across of them and retain the OpenGL 2.x setup we had but I am only human so that Sisyphean task could go and kiss my ass.

There will be no talk of the “future” in this post since I’ve learnt my lesson that discussing it just means it gets sidetracked and won’t happen within anything like the timeframe I thought it would. Of course these changes means that there will be bugs, there will be performance issues and opportunities, there will be features that people will magically want adding in zero time ;) and so on and so forth. We’ll just have to deal with them as they occur.

NB: I have removed the links to the older 2.x compatible executables as they were removed from the download page at some point.

Andy

Making more work

Posted by | Posted in Game Development, Pioneer | Posted on 09-03-2014

After taking a look at the awesome No Man’s Sky videos and artwork I decided that enough was enough: Pioneers terrain engine must die!

Now I’ve been “meaning” to do something about it for several years, and I have done bits of work too it over the years: reduced it’s memory footprint drastically, refactored it internally, multi-threaded it with a job system, numerous optimisations etc. There’s some things though that I’ve just left well alone.

That time is over: yesterday I merged some work-in-progress code that takes the underlying GeoSphere code and splits it into 3 classes: BaseSphere, GeoSphere and GasGiant.

In future there will be more splits because Stars are still rendered with the GeoSphere system meant for CONSTRUCTING PLANETS! That won’t do at all.

It also means separate shaders, materials and all manner of other technical bits which means that the way gas giants are generated and rendered can now start to diverge drastically and rapidly without worrying about breaking the way that stars or rocky planets are created. Even just doing this much has taken a surprising amount of time mostly because I do this as a hobby and don’t have a lot of opportunity to dedicate too it. Also my real job tends to leave me without an awful lot of spare mental capacity at the end of a day.

Progress s progress though and there’s  couple of other things coming up.

  1. I’ve been working on implementing terrain texturing, which you can read about on the forum, and am currently writing the system to manage to tiles and build the texture atlas.
  2. GPU generation of gas giant textures, hopefully allowing for less CPU work and bigger textures, possibly updating them in realtime someday in the future.
  3. Placing instanced detail objects – think trees, rocks, grass etc – this ones very very early work though don’t expect it … for a long time!

I haven’t forgotten the Oculus Rift stuff either, it’s just a little bit down the priority list.

Oh and I am now on Twitter, although I haven’t figured out why yet.

Oculus Rift and Pioneer Space Sim progress

Posted by | Posted in Game Development, Oculus Rift, Pioneer | Posted on 20-02-2014

Yes progress, real progress!

That there is a video of the Intro menu being rendered onto a quad, and the 2nd video is of the ingame GUI/HUD being rendered onto a Quad.

The things that I DON’T show are the messed up sector/system view screens, or the projected city/planet/object names which go all over the place and the Quad isn’t centred because I’ve just been hacking in it’s position without a care in the world :)

 

I should have been in bed about an hour ago, g’night!

Oculus Rift and new cockpit model.

Posted by | Posted in Game Development, Pioneer | Posted on 04-01-2014

screenshot-20140104-150433screenshot-20140104-150435screenshot-20140104-150451screenshot-20140104-150507screenshot-20140104-150540screenshot-20140104-150543screenshot-20140104-150547screenshot-20140104-150549screenshot-20140104-150551screenshot-20140104-150555screenshot-20140104-150624screenshot-20140104-150637screenshot-20140104-150642screenshot-20140104-150644

 

Pretty, better in motion but I haven’t gotten a way to record yet :)