So I've been doing some research on spatial partitioning for this upcoming weekend, and I've been rather successful.
Normally with collision checking, one needs to check every object against every other collideable object. With a few objects, this isn't really much of an issue, but when you start using a lot of objects, it can quickly become a mess.
The simple check every object against another object system used about 1,720,000 checks per second.
Using Kikito's bump.lua I was able to reduce it down to ~600 checks per second, and that was even with more ships. Damn amazing!
If you would like to try it out on your own computer, simply download `test_spatial_hash.love`, and run it with LÖVE 0.9.x.
Right click to reset and toggle bump. The window is re-sizable.
Today I tried to get the player to automatically "step" over small enough bumps, but while it works, its inconsistent, and I'd rather not have it then have it be unpredictable so for now its out.
I didn't add anything significant, only cleaned up tiny bugs and messed with stuff. I'm starting to feel a little burnt out, after streaking for 20 days. But the momentum of habitually doing SOMETHING on the game every day leads to a different kind of burnout than I am used to. I'm going to try to make it to 30 days and then take a break, and see what happens.
Today I implemented the scoring system and set up chest and key spawning. The spawning needs some work (the key and chest have trouble finding a spot to spawn right now) but at least it's in now!
All I have to do now is tie up any loose ends and the base game is finished. Then I can start adding new enemies, new levels, bosses, and maybe even some new gamemodes!
Nothing too much to tell today. Had tons of things to do unrelated to Crystal Kingdom. Mostly did some minor tweaking and came up with many tasks that still need to be done for example creating winning scenarios and an option to choose one of multiple possible bonuses before starting a new game. I'm hoping to finish some of them already tomorrow. :)
Yesterday's update can be found here.
In a case of any questions or suggestions, don't hesitate to contact me here or on twitter. ;)
For more updates, you should follow my twitter account - @PeterLauris and the account of Crystal Kingdom - @CrystalKingdom_.
tl;dr I can fade images in Unity now. Woo
I'm still learning Unity, slowly. I think I've exhausted the Tutorial resources, for now. To start really getting my hands dirty, I'm working on a dating simulator. At first I thought it would be a way to prove I knew how to change scenes, display sprites, and do simple effects like transforms and sprite indexing. Now that I know that I see that the real challenge is going to be creating a content creation workflow.
But I'm getting ahead of myself. Today I learned how to do a simple fade. Turns out there's three ways; calculating alpha values based on delta time and setting the alpha value manually, using Mathf.lerp to tween values automatically and still setting alpha manually, and using the CrossFadeAlpha function to do exactly what I need. Guess which method was hardest to find?
Also discovered that Unity tends to deal in milliseconds, or at least does for this function.