(and things that need changing that much are only slightly slow, so it's not a big issue).
That was really wrong. :V
So I radically cleaned up a lot of bad old code, improved error handling, sped up texture loading roughly by 30% (got rid of SDL_image and did it with libpng directly), reworked the way rendering is handled, nearly halved memory usage and fixed many old little bugs I haven't noticed before.
Rendering is now managed by a global rendering queue which handles most interactions (all of them except texture/shader loading) with OpenGL. I had a lot of GL calls all over the place so it was pretty chaotic and hard to control (and really hard to find what's causing problems). Because it prevents excessive GL state changes, it's also much faster.
I have dropped support for OpenGL1.X (OpenGL 2.0 is required now) because it was too much of a burden and a hell to maintain. Workarounds are either awfully slow, take a lot of time to write or outright impossible. It's not really needed (who still doesn't have GL2.0?) anyway. It may still work with GL1.5 if required extensions are there, but that's not guaranteed.
That took a whole lot of time of course, and I definitely won't be done by August, but the code is much nicer, faster and cleaner now. Further cleanup is required in some places, but it's just a matter of time.
Now for the things from todo list:
- Main story: Significant progress here, but far from done. Aside from just "more events/dialogues", events and dialogues are now completely independent from source code, so it's way easier to add/edit them now.
- Human village: Untouched (this one is scary)
- Characters: Done
- Maps: No new ones, but I redesigned start areas. Before, they were a very chaotic random labyrinth. I felt that it was creating a "heavy" atmosphere, so I made them less like a labyrinth and more "free" and added roads to give the player a clear direction. These areas are supposed to be roads after all, and even Forest of Magic was giving more sense of direction because it has a branching tree structure and not a random one.
- Enemies: Done with a few exceptions, because I'm not sure about their abilities.
- Boss Battles: Done, but not tested.
- Items: Untouched (that'll come together with new maps)
- GUI: *Almost* done. This took much longer than I expected (about two weeks of just GUI work). It's a long chain of "hey, this could be much better if..."
just like the entire game pretty much. - Side quests: Still on the idea stage (in-game there is a grand amount of 1 side quest)
- Battle obstacles: The system is done, but no new obstacles.
- Battle backgrounds: New grass background, but it's barely better. Aside from that, nothing.
- Tileset: Water is now (shader-)animated, one new tile type (dirt roads, huh), new tile connections.
- Character sprites: 1/8
- Monster sprites: Untouched (that's very sad.
Empty spaces Flying names will probably be there for a long time). Oh wait, there IS a new sprite! A recolored slime! :V - Character animations: I got rid of remains of old animation system and removed simple old one-image sprites, combining everything into a unified bodypart-based system.
- Attack animations:
I wasn't quite happy with how most special effects looked, sooo I made a particle system. Here are some new attack animations that use particles:
Screenshot link
Screenshot link
Screenshot link
Projectiles and scripts were redone almost completely. Their implementation was very old and bad (and slow, it's now 5 times faster) so it direly needed that.
Previously, an attack needed a projectile type and script as parameters, and scripts used that projectile type.
While I could use the same script for many attacks with this approach, it lead to many copy-pasted projectiles that only differ slightly. And considering that projectiles have a lot of parameters, that turned projectile data files into a huge mess.
Now projectile data file only defines textures and animation frames and everything else is done through a script. Of course, if I copy-paste scripts instead of projectiles, it wouldn't be much better.
So now it's possible to pass variables to scripts in the data files. If SCRIPT_BASIC_SHOT creates a few circle bullets with 10 speed, SCRIPT_BASIC_SHOT projectile_data: projectile='ICICLE' speed='14' creates a few icicles with 14 speed.
Projectiles can have scripts too, but they aren't absolutely required - if there is no script, it will use the default behaviour of that projectile type: bullets will move directly to their target and will create an explosion once they reach it, explosions will play an animation, lasers will just appear and disappear.
Well, I already had attack scripts and projectile scripts before, but there are three new types.
Since I want particles to be available more than just for attacks and projectiles, I have added scripts for units and objects as well. Both of these can create particles too, and not only that - unit scripts may be used later for the random idle animations, but that's very low priority.
Also, weapons can emit particles too. For that there is a third new type - "emitter configuration script". These are used to create an emitter on a weapon, which will work automatically after that. It's less flexible, but it does its job:
Screenshot linkAside from that, you can also use these scripts anywhere to set up emitter data, but that's not necessary.
By the way, scripts were finally exported out of the source code to external files. I decided against reviving my own failscriptlanguage and used AngelScript instead.
Also, a small nice new feature - units in battle now have hitboxes and if, say, 5 out of 10 bullets in the attack miss, these 5 bullets will also miss visually. Before, it would always look like as if they all hit.
This won't work for all attacks though, since for area attacks hits/misses are calculated individually for every target and I have no idea how to animate that.
It's like I'm making a danmaku game instead of RPG. Well, it's Touhou after all. :V
Oh, and I caught the stealthy AI bugs, but one of them miraculously disappeared when I was trying to fix it. :derp: It probably *didn't* disappear, but I can't reproduce it anymore. Maybe I accidentally fixed it, I don't know.
I also caught a funny new bug where Sakuya could make all AI units stuck "because every hex adjacent to them is unreachable". Mad time-space warping skills :V