Showing posts with label Stonesense. Show all posts
Showing posts with label Stonesense. Show all posts

Thursday, February 24, 2011

29 – Captain! We need to bridge the wooooüoorlds!

I would like to thank all the people who gave suggestions in the comments section. I have looked over your suggestions and also investigated additional techniques for optimization and I am fairly sure that I can make the 3D engine work fine on strong computers. I am not sure yet if I can do it on middle or low-end computers. So the 3D engine stays. If I can’t manage to get it to run on a wide range of computers, you will still have it as a 3D integrated “visualizer”, where performance is not that important. The problem is that most of these techniques are quite complex and will take a while for me to implement the changes, especially when I am at a moment where I would rather like to add new features. I need something that works right now.

So I brought back the isometric engine. And it immediately felt familiar and like a good fit. I felt like a dwarf after regrowing his long lost beard in a freak gasoline fight accident. I just need to add a few new features to the isometric engine to solve some of its problems. But it is basically done and I will never remove it again. All new features can easily be done by simply adding tiles, so there is no good reason to not support this display mode for the entire lifetime of this project.

On with the changes!

Isometric and 3D coexist

I have fine tuned both engines and they basically coexist peacefully in the same code base. The problem is that the caching system was not designed to handle both 2D and 3D objects, so I need to decide which rendering mode will be used before map load. But once I extend the cacher, you will be able to flip between isometric and 3D at will at the press of a button without any loading time, just something under a second while the cache is rebuilt.

Isometric engine support borders and short walls

Let us look at a picture that illustrates the problems with isometric engine. There is not enough contrast with some kinds of soil and stones and walls can cover up things behind them:


First thing I did is add some borders. Stonesense has this, but I added more borders. I still need to fine-tune which borders are drawn. I wanted to add these borders for a long time, and finally they are here:


The display of borders can be turned on or off at the press of a key. Another new feature is short walls. You press a button and walls are not drawn at full height, but instead are drawn very short. I still need to decide what to do with ramps:


Here the contrast is very poor. But, if I enable borders:




Wednesday, January 12, 2011

24 – Random stone explosion

A lot has happened since last post.
I managed to get in contact with the Stonesense crew and they gave their permission for me to use the tiles. While as time goes by it is becoming more and more apparent that 3D is the way to go, until that point it is good to know that I don’t have to worry about getting sued! All joking aside, I would like to thank them and wish them the best.
Also, special thanks to Jadael, who hooked me up with a sizeable set of graphics for all kinds of stones and stone objects. Now, I can’t let these resources go to waste, even if this means that I need to change my schedule a little.
And even though I said that I shouldn’t rewrite existing systems anymore, I really needed a new item system. So, on with the show!

New item system

I have a new item system that is faster, cleaner, more elegant, general and powerful that ever. The old was quite cumbersome and the new system also has the advantage of being a fully OOP system. So is it possible that I could have a new system that has only huge advantages and no disadvantages when compared to the old one? Well, if I was an idiot the first time maybe. Unfortunately I wasn’t, and as is often the case, you need to compromise and the gains of the new system come at the price of more memory consumption. Don’t worry, it is still under control and you will be able to run on a wide range of machines.
Another side effect is that workshops are broken, but they were placeholder anyway and they’ll be back.

Stone added to the editor

The editor has a new tab for stones. I added 80 kinds of stones, all with unique graphics. I’ll take some time and finish the basic stone system before I move on with what I had scheduled.

Maps now use stones randomly

Well, if stones are present in the editor, they must be present in the world too, right? For now, they are just randomly placed, but by next version I should have some basic layering done.

Stones can be smoothed and then engraved

That’s right! Two new actions for your dwarves! They are not that useful yet, but once you get the ability to carve out furniture (next post), you will be almost at the point where you can create a real fortress, not just an empty tunnel in the ground. All smoothed and all engraved stone kinds have unique graphics.

Plants have seeds

The plant editor has some extra fields, where you can edit what plants have seeds, how they are called and if they are available for purchase by new expeditions.

Expedition supplies customization dialog extended

The new expedition supplies customization dialog has been extended with seeds, but the big new feature is that it now uses the new item system allowing for more control and it now also track and groups together identical items, giving you a better overview.

Better cell inspect feature

Again, thanks to the new item system, the little panel that shows you what is under your mouse just got a lot better. Let me show you a montage of different information it can provide:

New mining scheduling algorithm

This new algorithm is quite experimental, but the old one had one big problem. If you would designate an area with unreachable tiles, these tiles would be removed from your designation and thus ignored. Not cool. The new system determines if the tile is reachable, and if not, it ignores it only for the moment. As soon as it becomes reachable, the dwarves will carry on with their given task. If the system proves itself a success, I will apply it to all tasks, not just mining.

Things to come

For my next post, I’ll do my best to give the final polish to some existing features, add stone layering and stone carving and create a tutorial video on YouTube, which will walk you thought the beginning phase of a new game and the existing features. Existing videos are old and not quite representative anymore.

Wednesday, November 10, 2010

16 – Is that wood in your stockpile?

As you saw from previous screenshots, I am going with a fixed key/function system. “1” is always digging. The keys are going to change maybe and it is going to be hard to add all actions to easily reachable keys without overwhelming the player, but it is a good system. I think I should get rid of the right panel and go with something that takes less place though.
So I have a new action, “5”: wood stockpile. This will designate your selection as an empty wood stockpile. I have a hidden cheat key that places a single log in an empty stockpile. No, you won’t get to use the cheat key. It is only available in super secret God mode. I will demonstrate this with a video. Next step that is not implemented yet is to place the logs as trees are being cut down.
This time I captured my video with Fraps. It was slightly problematic because the captured video was 2.5 GiB and YouTube only allows 2 GiB files. But I downloaded a conversion tool and got it down to 93 MiB so no problem! YouTube took a few hours to process my video, so I waited with the post until it was done. I am not completely happy with the quality yet. And as you can see, the resolution is different now. I have added support to the INI file for resolution and full screen flag. You can give any resolution if you are not running in full screen. Someday this will be available in game.
There is also a new mini feature. The editor now allows you to customize the names of you skill levels and also the maximum value for skills. They are no longer hardcoded:

So now, without further a due, the video:
Same as the last time, I have added a disclaimer because I am still using Stonesense tiles for demo purposes, but I do have some original graphics mixed in there.
Disclaimer:
This video has been produced by using a version of DwarvesH and modifying it by applying the tiles form Stonesense (http://www.bay12forums.com/smf/index.ph­p?topic=43260.0) only for the purpose of creating an early demo video. DwarvesH is not available in any form with the tiles from Stonesense by default officially or unofficially and does not assume any right to use them. The process can be repeated by anyone by downloading both applications and using a simple image editing tool to selectively change the tiles from DwarvesH with those from Stonesense or the tiles from Stonesense with those from DwarvesH.


Statistics S34:
DHCore: 1522 lines / 37.0 KiB / 6 files
DH: 2034 lines / 52.2 KiB / 10 files
DHEditor: 613 lines / 16.1 KiB / 13 files
Total: 4169 lines / 105.3 / 29 files

Wednesday, September 29, 2010

09 – Isometric?

One of the goals of this project, besides creating a nice little sandbox game for myself, is to create something that anyone can pick up and have at least a slight idea of what is going on without prior preparation. But the past days, when I have shown someone my work, the universal answer was “WTF is going on here”. I have no problem with ASCII graphics and when a group of “d” letters is approaching menacingly I’m not thinking “hey, a d”, but “OMG, IT IS A BLINK DOG APOCALYPSE” (ADOM reference). And I know that people that are not familiar with such graphics have a steep learning curve. This is why I had some top down graphics, to lessen the impact and adaptation period that is necessary before picking up an ASCII game and before learning its specific mechanics. But I was not enough. So I tried isometric graphics.
Before I link to the video, there is a point to be made. I have my own hastily assembled tile set. It is not pretty, but I want to code right now, not mock around endlessly with graphics. Yet I need something good looking to illustrate the point that graphics play a large role in the ease of learning something. So for the purpose of a video I borrowed the awesome tiles from Stonesense (http://www.bay12forums.com/smf/index.php?topic=43260.0). I’ll proceed to let the people there know about me using their tiles for the purpose of the video, but until then I have included a disclaimer:
Disclaimer:
This video has been produced by using a version of DwarvesH and modifying it by applying the tiles form Stonesense (
http://www.bay12forums.com/smf/index.php?topic=43260.0) only for the purpose of creating an early demo video. DwarvesH is not available in any form with the tiles from Stonesense by default officially or unofficially and does not assume any right to use them. The process can be repeated by anyone by downloading both applications and using a simple image editing tool to selectively change the tiles from DwarvesH with those from Stonesense or the tiles from Stonesense with those from DwarvesH.

Now this looks a lot better! The response that I’m getting is also better. In the video I dig a couple of simple caves and demonstrate the rather slow covering of the landscape with snow and dying of plants. Pressing “T” advances the time artificially with one day. For such a big change, I would have liked a longer video, preferably HD, but I still don’t have adequate capturing software. I’ll try FRAPS next.
Not much left to say. Feature wise everything is the same, a little bit of extra polish and nothing got lost in the transition to isometric. Smashing!

Statistics S17:
3162 lines of code in 23 files
82.2 KiB of code