Hair Physics

Game progress has slowed down somewhat over the middle of this year, but I’m hoping for it to start picking up momentum again. I decided to show off some new hair physics I’ve been working on. I had made the changes to the physics engine required to make this possible some time ago, but I decided to finally get around to implementing the hair physics themselves.

activity_screen.png
WIP RPG activity screen

I’ve actually a lot more features which are almost complete which I plan to show off in the coming weeks, including an SMS messaging system, RPG stats and activity system, real-time mode, a character creation system, more visual novel features, and functioning weather effects with clouds. Please check back soon.

Advertisements

Slow Month, But Update…

skinship

Don’t worry, I’m still alive. I just haven’t had much chance to work on stuff specific to the game over this past month, things have just been very busy. On one hand though, I have added some new features to the engine which might of interest to people interested in the underlying technology of the game.

The most notable of the engine features I have now is an experimental live script reloading system, which to put it simply, allows me to edit the game logic while the game is already running. This should help significantly with prototyping and iteration, and I imagine will also be very useful for people who want to make mods. I’m quite proud of this feature and I’m hoping it will be available in the mainline version of the engine soon. I’ve also made significant progress on the occlusion buffer feature, which mainly requires me to write my own software rasterizer from scratch, though exclusively concerned with the depth buffer. With this in place, it should be possible for me to start including larger locations to explore. Smaller features including a new multipass material system which should replace the hacky method I’ve been using so far for handling character outlines, as well as new controls for customizing shadow casting options of game instances. Most other things are minor features and bug fixes.

That said, the big thing I wanted to show off, in line with my objective to introduce new gameplay mechanics is a new skinship minigame. I was hoping to show that off today, but unfortunately I’m still waiting on some extra sound and graphical effects to be made before. Also, I’m going to be away for the next four days and will be unable to really do any work on the game or engine at all, though I may still be able to answer questions. When I get back though, I intend to finish up the minigame and show it off.

See you then 🙂

Obligatory Valentine’s Day Post

obligation

‘Hmph…well it’s Valentine’s Day today. I don’t even care, it’s just another pointless ritual designed to ostracise and mock anyone in society who refuses to participate as being a NEET virgin loser. Utter nonsense. Oh well, there’s no real purpose in trying to fight it this time, and I guess you are my senpai, so you might as well take your stupid obligation chocolate.’

So yes, Happy Valentine’s Day…I guess. Like this character quote, I don’t particularly care for the holiday, but given the subject matter of this game I felt I had to acknowledge it in some way, so I decided to do this drawing. Yeah…

Anyway, even if you’re not celebrating Valentine’s Day with another person, you can still spend it chilling with your favourite anime waifu.

As for the game, it seems that according to the poll the majority of people would like me to focus on implementing stat-building gameplay first and foremost, so that’s what I’ll do. That said, I’ve actually already gone ahead and implemented the VN engine extensions I’d hinted towards including menu choices, conditional branching, and inline code embedding. My test cases compiled and executed code as it was needed, but now it get pre-generated when the game starts and should suffer no significant performance penalities. I’m generally quite proud of how elegant this solution turned out to be, and although I haven’t got much to show for it yet, the way it’s implemented has basically limitless possibilities since VN scripts can now interface with any aspect of the game logic. I’m actually going to be using this system to implement a lot of the stat-building gameplay since it’s very easy to work with and choice menus are quite flexible in regards to implementing a lot of basic gameplay options.

screenshot_0029.png

Another thing I worked on recently is that I stepped forward and managed to get GPU skinning working, which is something I’ve mentioned several times as something which will likely be important in improving performance when it comes to rendering characters. It does indeed improve things, but there are still other issues making the game slow right now that it’s hard to fully assess things. Regardless, this is an important step forward, and introduces the possibility of soon being able to have more characters rendered in a single location.

I apologise again for anyone who’s still waiting for playable updates, but I’ve still got lots of newly introduced glitches and bugs I want to iron out before putting anything else out there. It will still be happening soon, but I want to get it as polished as I can before doing so.

Day/Night Cycle with Procedural Scattersky

I’m putting a strawpoll here to help me determine which of these two features you would prefer for me to focus on next. Please read the second to last paragraph to understand exactly what each would involve and require before voting (http://strawpoll.me/6632748).

Okay, sorry for the delay without any further significant update, but I started working on one of the features I’d promised in December and really wanted to get it working as a functional prototype before doing anything further. Here’s a video of it being shown off with some music generously contributed by OnlyWednesdayMusic. What this feature is is mainly a skydome with the sky’s colour and atmospheric scattering determined through algorithms rather than a static cubemap as it was before, primarily Rayleigh and Mie which are a tried and tested approaches to a feature like this. To my knowledge, this is the first time such a feature has been implemented in the Godot engine, and while some aspects of this implementation were inspired by the implementation in the Torque 3D engine, it is mostly implemented from scratch in the engine’s own intermediary shader and scripting languages.

This feature should be easy enough to implement in anyone’s Godot project now, but the only exception is two features exclusive to my fork of the Godot engine, that is the ability to create a single render viewport out of multiple cameras ordered with a new ‘depth’ property, and the ability to tint the baked lighting in realtime for the full effect. The way it is structured is there is another spatial scene in the root of the tree which contains the skydome, the sun model, another camera, and a directional shadow-mapped light which acts as the primary light source for an entire scene. This scene is hooked into the already existing timeflow system which determines the state of clocks in the world, and then I use node groups (which is a very useful feature in Godot I wasn’t even really aware of before hand but really helps in managing such complex game logic) to update the skydome state. The first thing it does is run this information through an algorithm which, along with specifying a latitude and longitude value, theoretically provides the correct azimuth and elevation properties of the sun for a particular time of day based on where the scene would be located in the world, I then take that information and use it to determine direct and ambient colour based on customisable colour ramps, the direction of the sun, ect., and use this to map the appropriate values. Finally, I update the sky shader uniform with this information and apply the scattering algorithms in order to determine the final colour of the sky, which is rendered first and the rest of the scene rendered on top of it.

screenshot_0010
The sunsets can actually look quite appealling at times.

There are still some issues which I would like to tweak and polish further, but on the whole, I think it looks quite convincing for what it is. I still plan to include clouds and precipitation as part of this system, and while clouds should be fairly easy to do, precipitation will be more of a challenge due to the feeling that it would need to affect materials in the world itself to truly look convincing. Two more pressing issues I’m still working through are the facts that the character shaders have some serious problems when rendered at night time (basically coming out practically all black), and that since shadow mapping is largely a brute-force rendering technique requiring the scene to more or less be rendered twice from an orthogonal angle, the performance issues are again a large concern depending on the direction of the sunlight. I’ve also switched the default shadow mapping algorithm from PCF to ESM due to the shadows looking slightly off at certain angles, though you’ll be able to easily switch back to PCF even though that is not the primary source of the game’s performance issues; they still seem to be mostly related to scene traversal and skinned mesh rendering.

Now this brings me onto another participation-related request. Usually I have to take authority on where my efforts are going to be focused simply because I feel it’s necessary to develop a game as complex as this somewhat as a pyramid of features, focusing more on the foundation before implementing more game-specific elements, meaning a lot of the time I feel obligated to focus on one feature before it feels appropriate another as it would depend on the existence of the previous feature. In this case, this feature opens up a lot of possibilities of implementing stuff in the game related to time management. The core of the game, while more open-ended than most similar dating sims, is still going to based around balancing stats over the course of ingame months and even years, and having the game visually change to convey that certain actions results in time passing should help make these mechanics more convincing and impactful, as well as making the world feel more dynamic and realistic.

photograph_0020
Exploring the school at night time gives it a very different atmosphere. It actually feels slighty foreboding now.

That being said, I am now at a situation where I could focus on two main areas: I could continue to attempt to implement gameplay related activities which would include things like attending classes, studying, travelling between locations, and balancing stats over the course of several ingame months, and this feature, along with the fact that the protagonist’s apartment is mostly finished and just pending being prepared for the game itself, would make this viable direction to go. The other option is to attempt to implement something which I was going to hold off until later due to the perceived scope and complexity of what I wanted to get out of this feature, but would consider pushing it forward due recently discovering a quirk of the engine I might be able to exploit in order to cut out a ton of effort required to make this feature as powerful and flexible as I wanted. The game already has a rudimentary visual novel parser based off the Ren’Py scripting language, and it’s used right now for examining objects but not much else. The main thing that Ren’Py has that my implementation does not have is the ability to embed native Python code inside of the scripts which is what makes it so powerful. While it does not use Python, it does use a very similar language, and I may have discovered a way to dynamically execute native script code inside my custom VN script files in the same that Ren’Py does. This would automatically give me the full power of the game’s scripting language inside my custom Ren’Py-esque implementation without the need for any fancy parser of virtual machine which could potentially save a ton of effort and give practically unlimited flexibility. In fact, while I won’t promise anything, this may even result in the visual novel aspect of the game becoming robust enough that it could be spun off into its own independent project, giving VN creators access to familiar framework built on the foundation of a powerful, 3D-capable engine. Getting this feature in would primarily require three things: implementing this ability to embed native script code, creating some new idle animations, and writing some script for said scenes. I consider both of these features equally important to the overall experience, but I’m going to let my readers help determine what I should focus on first. I was going to add optimization overhauls as one of the potential options, but I decided I’d rather focus on something which would result in something more gameplay-related first, and neither feature should result in any further significant performance implications.

I still intend to put out another playable update of the game soon, but I feel I need to solve some of the newly introduced issues beforehand.

Inverse Kinematics

Update 1: Sorry for the delay again. I actually decided to go off and work on one more big feature before releasing a new build, and it’s nearly done now. It just requires a bit more polish. I’m quite excited about this one since while it is another aesthetic feature, it actually plays a highly significant gameplay role. I’ll be showing it off in the next few days…

I just wanted to show off a short video with a new feature I’ve been working on: dynamic inverse kinematics. Inverse kinematics is a technique where the rotation of joints are dynamically calculated based providing the final position of the end joint. In this case, I’m using it in conjunction with a variety of raycasts in order to prevent the character feet from intersecting when walking on uneven surfaces. There will be a new build hopefully coming out in the next few days featuring a few minor incremental fixes and features, and I’ll try to include this as part of it.

On another note, it’s now officially 2016. Will 2016 finally be the year of waifuism? I guess we’ll have to find out.

Merry Christmas!

xmas.png

Nothing really special to show here, but I wanted to wish everyone who still follows this blog a very Merry Christmas. I’m working on some fixes for a few bugs I’ve had reported via email, but there should be some more interesting stuff coming very soon.

Stay tuned and thank you for following!

Advent Release – Second Test Build

(Update 5: Another build released which may solve the bug people have reported regarding being unable to interact with objects. If it doesn’t please send me the log files again. Ammendment: very sorry, but I forgot to update the download link to the latest version until just now. The latest version is actually ‘galatea_win32_public_build_2d.zip’)

(Update 4: New build provides logging and no longer causes player movement to freeze if object examination fails (but probably doesn’t fix the problem itself since I can’t reproduce it), proper interpolation for third-person camera motion, and mouse cursor no longer gets locked if the game window loses focus (Alt+Tab, ect.))

(Update 3: Another build has been released which should solve the crashing issue. I’ve had a chance to test this on another PC, and while I still haven’t discovered why it runs fine on my own machine, it seems related to texture compression. I also fixed a bug which resulted in the girl not being able to blink and a missing interaction hotspot.)

(Update 2: Based on the reports I’ve gotten, I’ve uploaded another build which is based on a hunch of what I think might be the problem. Again though, I can’t test this because I’m unable to reproduce the crash on my own system.)

(Update 1: Since I got a report regarding the failures in the loading screen I can’t reproduce myself, I’ve uploaded a new build which attempts to generate error logs. If you experience crashes or lockups at the loading screen, send me the error.log and console.log file found at C:\Users\$yourname\AppData\Roaming\Godot\app_userdata\Galatea via email)

window.png

Okay, I’m putting out the second major test build of Galatea tonight. You can find it on the download page. I understand this build has been a long time coming, but I’ve been trying to put as much polish into it as possible, and a lot of underlying systems were changed between this and the last release, which resulted in a lot of things breaking. While this build is still fairly light on what I would consider interesting content, this release does mark the first showcase of my character model functioning in the environment. She doesn’t yet do much, as that requires more animation and AI, but you can ask her to follow you and she does so relatively bug-free now from what I’ve tested. Due to popular demand, we also have a fully-functional third-person camera written from scratch which also seems relatively bug-free. While most people reading this blog are likely aware of these features, one new feature I haven’t yet talked about is the ingame music player.

music_player.png

What’s noteworthy about this feature is that as well as three original tracks contributed by AkiMiso (https://soundcloud.com/aki_miso), I have also made it possible for players to import their own music. Instructions on how to do so are contained on the downloads page and the included readme.txt file. There are many other smaller features, including rewritten player physics, making the key to the secret room easier to find, and a bunch of new configuration settings, but there are really too many to note down and I’ve probably forgotten most of them, so you’ll have to see for yourself. I apologise for the large download size by the way; I’m running into some issues with the engine’s image compression methods.

Things I Wanted to Include but Couldn’t Because of Reasons…

Although I’m generally happy with the level of polish in this release, there were several things I planned to release but couldn’t because I didn’t want to delay this any longer. There were going to be more random students using the same AI routines, but I’m still waiting on some engine optimizations which are needed to make such a feature practical. Along with that, we have several original hairstyles which I planned to include through console commands, but I ran into some last minute technical issues. These hairstyles are very high quality, and I’m looking forward to sharing them with you soon. I was also hoping to have the vending machine fully functional along with a few extra applications on the ingame phone, but I simply didn’t have time to complete them. A couple of people also contributed early localizations to the project, but again, I’ve not been able to include these due to some technical issues. I would also have liked to put in a small collection quest, but I simply didn’t want to delay this any longer. Hopefully though, some of these features may yet appear shortly; I’m hoping that I can get another smaller point release out before the end of the year to include some of them.

Where to go From Here…

For these first two major test releases, I generally focused around a particular theme, the first being the environment, the second being to get a character functioning in the environment. My next major focus is going to be the introduction of the actual gameplay flow and mechanics. Although I don’t have anything substantial to show for it yet, I have already implemented the databases which are intended to be the backbone of the how the game functions. Basically, some of the planned features are as follows: a working day/night cycle (possibly) with weather, player stats, the ability to attend classes and other activities such as studying, travel between your home and the school, more random students, and expansions plus visual improvements to the school environment, particularly the outdoor area, but this is dependant upon how optimized we can get the engine. Basically, I want the ability to play out a fully functional albeit basic gameplay loop. The introduction of the databases will also make it fairly easy for people who want to mod the game. In the next few days, I’m planning to reformat my computer and install some new hardware, and since I’m doing that, I plan to get a Linux port out. I may also be moving my entire development system to Linux too, since all the tools I use on a regular basis in developing the game are open source and run on Linux.

https://galateaproject.wordpress.com/download/

Anyway, I might have more to post soon, but for now, enjoy.