0 reviews
  • Add Review
  • Subscribe
  • Nominate
  • Submit Media
  • RSS

Many Bug Fixes, X11 Graphics Working

Current commit is:

I've finished a number of new improvements to the game. I've removed the very complex sprite masking system and replaced it with simple colored bases for units, fixed the X11 graphics system, and in the process fixed a bunch of graphics system crashes that mainly appeared when using the Unix/X11 graphics system (but could occasionally happen under any platform).

The biggest difference between the game right now and before is that units no longer have masked areas drawn over them to display their team. Instead, a colored outline of the tile they are standing on is colored based on their team. This is a much simpler system, and while the idea of fully color masked sprites sounds much bettter, it simply did not look very good. Maybe my sprites just aren't the best for it.

I've finally fixed the X11 backend to properly work. As it turns out, the issue is that 24-bit color on X11 still uses 32-bits per pixel. The alpha channel is just ignored :/ In any case, using X11 directly that makes the Linux and FreeBSD builds run MUCH smoother. They can top out at almost 300 FPS where they used to barely get 100 FPS. It also makes the executable smaller, and cuts down on dependencies on Linux and FreeBSD.

In the process of fixing the X11 backend, a huge number of flaws in the graphics system were uncovered. Many of them had the capability to case crashes under any graphics backend, but always crashed under X11. Most of them related to unimplemented clipping functions, which were actually doing no clipping at all. As a result, we were drawing outside the actual framebuffer. Fortunately, this was easily fixed.

I've also fixed a number of issues where it is hard or impossible to select the unit you want to use to move or attack, and I still need to fix not being able to attack the unit you want to. In the first case, it simply required adding a selection menu to choose which unit you want to select when there are two on the same tile. Sounds simple, but I had to do a lot of work to the menu system to make that possible! The solution to the second issue will be to enforce proper attack priorities in the server. There can be a maximum of two units on a single tile: one or zero units and one or zero buildings. If there are both, you must attack the unit first. This is currently not enforced, and so any attack is directed at the newest unit on the tile.

At that point, the actual combat system will be mostly roughed in, and I can begin to shape up the building system.