Oh hey, I'm managing to keep these updates going! It's been relatively productive since the last update.
Shadows
One of the thorns I'd had to contend with when producing the Rayman Alive teaser for Detox was the fact that there were issues at the time with multiple shadow sources. As a workaround, during the night and day cycle, they would be balanced so the shadows produced by the 'moon' switched off just as the 'sun' started to rise, and vice versa.
This also ruined my plans to have additional light sources visible in the teaser, as they didn't look quite right without shadows.
Anyway, I've finally resolved this now while looking into an entirely different issue. It turned out it was a foolish mistake on my part of simply not restoring the state of the depth buffer.
Resolving this wasn't too high on my list as I'm not really expecting to have multiple lights casting shadows in this particular project, but hey, a win's a win.
You might have noticed that some of the shadows cast by one of the lights are a little messed up in the video. This seems to have been a regression I inadvertently introduced while fixing something else and didn't notice until the issue with multiple shadow sources was resolved. So, that's since been fixed now too.
Rectifying that led me to make some unexpected optimisations too, so, a pretty good result.
Transparency
So this is what I'd actually intended to fix at the time I was resolving the above, but transparency was previously handled incorrectly by the engine. This is something I finally rectified since the last update too.
You'll still currently stumble upon issues if you have multiple transparent surfaces overlapping (that's on my list to address some other time), but for now, transparent surfaces should now blend correctly with everything else.
Debug Drawing and More Ropes!
I'd finally got round to implementing a simple API for allowing you to queue things to draw during the simulation for debugging. Right now it just exposes lines, arrows and spheres for you to draw.
/**
* Draws a basic wireframe line from start to end.
*
* @param start Point the line starts.
* @param end Point the line ends.
* @param colour Colour of the line.
*/
void ape_draw_debug_line( PLVector3 start, PLVector3 end, PLColour colour );
/**
* Draw a wireframe arrow from start to end.
*
* @param start Point the line starts.
* @param end Point the line ends. Arrow will point in this direction.
* @param colour Colour of the line.
*/
void ape_draw_debug_arrow( PLVector3 start, PLVector3 end, PLColour colour );
/**
* Draw a wireframe sphere at the given location.
*
* @param origin Position of the sphere.
* @param colour Colour of the sphere.
* @param scale Scale of the sphere.
*/
void ape_draw_debug_sphere( PLVector3 origin, PLColour colour, float scale );
I immediately used this to make sure the rope physics implementation was working.
Both the start point and the end point of the rope can be fixed—totally optional for either end. Here I'm just fixing both the start and end, and have some code updating those fixed points for demonstration purposes. Really looking forward to using these for all sorts of things!
Debug Menu
I'm almost always using a controller right now to control the camera. And even when I'm not, it can get a little tedious opening the console and typing in the same commands over and over. This pushed me to flesh out some older code I wrote ages ago for a menu and add a debug menu with some rather crude checkboxes.
As you probably noticed, there is a level selection menu in there too.
Something Game Related audible gasp
Just thought I'd show something besides the work I've done on the engine for a change.
Not much I want to share about these just yet, but these models are intended for objects that players can build. In this case, these are both actually versions of the same thing.
The first model (on the left) was something I actually threw together last year in September. The model on the right was something I was experimenting with during this week, but it's probably a little hard to visualise until the textures are done.
And I'm not entirely happy with it, so I'm not even sure if I will texture it.
I'm trying to aim for something a little weird looking. The general idea is fantasy meets "dieselpunk", though that's not dieselpunk in the typical sense given we're not really dealing with something in our world. It's pretty hard to keep the balance of being able to immediately tell what something does while aiming for that though.
Oh. One last thing to show, just for a bit of fun! This is a scrapped head model for the playable characters in the game. It was called a Snortle. Something I was working on at the end of last year. Obviously unfinished.
I don't recall showing it before. So there it is. It was a little bit too cute, so it had to go. There were some others from even earlier, but I'll save those for another time.
And yeah, my modeling skills suck. I'll likely eventually commission or contract someone to take over when things are further along.
Final Rambling
Some of the upcoming changes I've got lined up that I need to get out the way are going to be a pain in the ass. They're less visual. More boring. Not really things I'm going to be able to show on the blog.
A friend was going to provide a placeholder character model for me (a rigged character made up of boxes). However, that didn't quite pan out (my fault), so for now I'm resorting to using some character models from another game as placeholders.
There are some problems I need to figure out in relation to how coordinate space is going to work in relation to rooms having their own local space, etc. All that ties up with changes to how the visibility system works. And once that's figured out, I'm hopeful I can start reintroducing collisions. Unlikely that'll all be done this month but fingers-crossed for next month.
And I'm also finally throwing together a little test framework. Fun.