I am talking of course about the isometric engine. It has served me very well. It was fast and slick. But now it is gone. The 3D engine is ready to be included in production code, so in order to symbolically confirm my commitment to 3D, I deleted all isometric code. Don’t worry, I still have backups with it. I doubt I’ll ever need it, but it is there.
But before I continue, let me tell you a short story. It began with me working late into the night and applying the finishing touches to the 3D engine. In the prototype state, it was a total mess that maybe had the potential to one day be called a proper engine. By Monday, when I last posted, it was a chaotic blob of hacks that worked surprisingly well. And by 2-3 AM, it was pretty much production ready. Code was in very good shape and technically there was very little to object (I don’t have yet enough meshes and did not implement lighting, but that is a different story).
In the morning I selected all folders and wanted to create a backup archive. I noticed that the backups are getting quite numerous, so I selected a few and hit delete. Without deselecting my code! I noticed that it was deleting to many files and realized my mistake, but I decided not to hit cancel and revert the delete after it finished, since most of the files were deleted already. I would like to stop here and congratulate Window 7 Recycle Bin for being a total piece of crap. In the past it was a useful tool. Now it greats you with a list of all your files, and after restoring, it screwed up and restored different versions of my files. And most of them old. Oh well, shit happens. I managed to rewrite 99% of the changes and merged with a different backup that had all the new features that are not related to the 3D engine.
I really need to start using a repository. But a local repository wouldn’t have helped, since it would have gotten deleted. I don’t want to set up an online repository server on my machines. Most free hosting is for open-source, and anyway I don’t trust such services not to steal my code. Sigh…
Let us get back to the change log.
New 3D engine now in production code
And let me tell you, I am really starting to like it. There are still a few issues, like tilt and zoom are very restrictive because I can’t figure out how to make them more flexible without killing performance. Rotate is not implemented yet. But still, combining zoom, tilt and old fashioned scrolling makes for a pleasant interaction with the map and obstructed items can be easily brought into view. And speaking about performance, the engine is a little bit slow. Of course, when I am claiming that something is slow and don’t give explicit numbers, you should always take that with a grain of salt. I am somewhat of an elitist and perfectionist. The engine runs at around 150 minimal FPS and it can get up to over 600 when rendering a barren landscape. But it is not enough!
The new tweaks to the engine have made it more “center” centric. I don’t want to get into technical details. Suffice to say the math is simpler now and I am happy. There is a problem though. Since the camera is now centered on the viewport it did not look that good with the interface taking up half of the screen. Anyway, such huge panels are a thing of the past. I’ll talk about this later.
I think I managed to recode everything that was lost in the little delete incident.
Interface takes up less space
Because of the above mentioned centering, I’ve made the interface smaller. Now it is harder to use at first, but no worries. In the future I’ll add proper graphics for these buttons and when mouseing over them a little panel will open up telling you what the button does. In the next screenshot you can see the interface in its new minimalistic look. I won’t show you the new engine though. Even if it is technically very sound, I haven’t gotten around to making it less ugly. So enjoy a brown screen and the interface (better than a blue screen, am I right?):
Moving the cursor with keyboard
This feature was requested on YouTube. Some people are more comfortable with a keyboard than a mouse. DwarvesH allows you to do everything with a keyboard except move the cursor and do selections. I implemented the moving of the cursor by keyboard, but this change was lost in the incident. I’ll silently patch this back in. It is only a few lines of code.
Stress testing items
I have begun both adding items and really stress testing the system. I added 2000-3000 items and by the end of the month I’ll try to get as close as possible to 20000 unique items. Creating so many items out of scratch is time consuming, so I’ll use again Dwarf Fortress data as a test bed. There are three parts to this. First, the items must be created and represented in the game. Here is a terribly outdated tree made yesterday with the item available:
Items in red are the general root categories, entities in their raw form as they appear in nature, like plants, animals, minerals… Grey items are forms in which these entities may appear which you do not own, but interact with them. So you may have a cow and 7 axes, but you do not have 10 walls and 5 floors. Items I bold are final products, in blue are the process though which they were obtained and normal text items are categories.
The second part of this process is the actual stress test. Adding these items in large numbers and seeing if everything works fine and consumes few resources.