More OpenGL fun
Hi all! Man, apart from the fact that it gives problems for some people's machines, I'm really enjoying my new toy OpenGL. The last few weeks I already described a number of fun little things I'm implementing that weren't (easily) possible before, and today I'm going to do it again. This week, it's aiming circles:
Last weekend, during a small LAN party with some friends, I noticed that in League of Legends, for some attacks the aiming mechanic is more or less similar to aiming in Olvand. However, for some reason, you feel like you're much more in control: in League of Legends, hitting things with your spells is hard because you're trying to hit a moving target, not because you simple can't be sure where your 'bullet' will be going. How is that possible? After an hour of experimenting, I think I know the answer: remember how [adding some (audio) feedback to the fishing mechanic changed it from strange to fun]? My guess is that the aiming mechanic needs to some feedback too, and that's what I'm trying to achieve with the aiming circle. Now, when your Olbs are traveling through your gun, the aiming circle appears, which (1) lets the player know they successfully clicked the 'shoot' button, so something is coming, and (2) shows the player an arrow that follows your mouse pointer, informing you the olb is going to fly exactly toward your mouse cursor.
For it to work, though, quite some changes in the code were necessary, as images need to be able to turn around their center. I've solved this problem before by using nine pre-generated arrows, which worked good enough for pointing to the next checkpoint during races, but for aiming it's far from precise enough:
I thus needed to make changes to how the very basics of the code worked. These changes then had consequences for various other parts of the code, so it took quite some time all in all. But when I finally saw and 'felt' everything in action, it was definitely worth it :).
The Big Book About Crafting
Another new thing that's forcing me to change some very basic code is 'The Big Book About Crafting'; as the name suggests, it's a book new players get in their inventories that contains the most basic crafting recipies to get them started. It's something I've been thinking about for quite some time now, as I don't really like the fact that you need your browser to be able to experience the game fully. Last week's new video finally inspired me to do something about it, and add The Big Book About Crafting to solve this problem. You just click it, click 'Read', and you instantly get an in-game overview of how to craft ropes, axes, shovels, etcetera. In other weeks, when this is finished, you can now play the game without having to study a bit beforehand.
When implementing things like this, I basically have two options:
1. I make the book a completely separate part of the code. This is relatively easy to build, but requires that I update the book each time I change crafting recipies or add new ones.
2. I link the book to the actual crafting mechanic. This requires me to invest some time now, but in the end this means that book is automatically updated each time crafting changes.
During my time developing Olvand, I've learned to go for options like 2; most times I went for the easy route, I've found myself porting everything to the smart route eventually anyway. However, right now that means the whole crafting mechanic had to be rewritten, and while doing so I of course accidentally broke everything that could possibly be broken. At the moment I believe I have restored most of it, and this time with some openings to link it to the Big Book!