Thanks for all the replies.
My purpose behind javascript as the driving force is I plan on making this an application that can be used from the browser as a nod to the DF players who aren't on Windows. I have already discounted Java because I really don't like the direction the language has taken but I don't think this is the place to have a long winded discussion on the merits of various languages.
The good news is after messing around with HTML + CSS + Javascript I found that this will be actually much simpler than I originally planned, I already have a small demo that displays a single tile. Each time the user clicks on it the image changes to the next tile in the sequence. So now that I have proven the concept it's only a matter of implementation
.
As for the "default tileset" I mentioned, I meant the ascii characters that DF uses. So a text mode, not a graphics mode, if you will. But as I said the graphics are working now so it is now just a matter of time.
I think I am going to work on an initial version that will simply be something along the lines of a 16x16 grid of tiles that can be changed to anything in the tile set.
I'm thinking the user will be presented with one drop down box for the tiles that represent background images (floors, smoothed floors, engraved floors, etc) and one that represents the images that can be layed down on top (the dwarves, furniture, walls, etc). Then the user would just click where on the 16x16 grid to place the selection of background and foreground images.
This initial version will be both a proving ground as to the viability of the project and also something that will garner me the eternal love and gratification of the tileset creators out there.
Long term I plan on adding the following features:
-Support for larger spaces the user defines, so if they wish they can represent an entire actual level of a map in DF.
-Multiple layers to switch between as per the actual game.
-The ability to designate whole "rooms" at once, both square and circular. A click on the first point and drag to the second point style kind of thing similar to the way you draw squares and circles in something like MS Paint.
-Ability to save fortress designs
-A "homepage" for the program where new tilesets can be added and previous fortress layouts can be loaded from.
-Allowing the user to also configure what material type things are so they can see what a black bronze plated room will look like vs a simple granite one.
Possible very long term features:
-Ability to create "rooms" across muiltiple levels, think cube and sphere instead of just square and circle.
If anyone wants to help with any of this I would appreciate it. I am not at the computer that has the initial demo at the moment, so I will get it tomorrow and try to find someplace to store it so others can take a look.
More than the actual code though, I would especially like some advice and ideas on how the GUI should look. Keep in mind this will be webpage-like so stuff like drop down boxes and buttons are very easy but some style of controls will be very hard or impossible.
Also I'd love to hear any suggestions for further features, I probably won't get to them for a long time (think months at earliest) but I'd love some ideas.
Finally, if you aren't interested in a discussion about language choices you can stop reading here.
c++ is very fast but has memory leaking and ugly syntax
True but it is overkill for this project. I don't need to reinvent the wheel on how to display a simple BMP image to the screen (or hunt down a library that allows me to), I just need capabilities already present in a webbrowser.
A firefox plugin can open files on the hard disk.
This is perhaps a valid point, I have not looked at the ability of javascript to save files locally. I assumed that they have to be able to since webservers generate files on the fly (yes I know they are normally just kept in memory...), but I might end up having to use a clutch like that which means this might end up firefox only but I'm going to try not to go that route.
You could do it in flash
Did you honestly suggest flash and then comment on the speed of any other language in existence? Plus, I have other issues with using highly proprietary languages when others exist that can fill the niche. I would not be above C# if I were going windows only, but I have already decided against that because I already know C# and want portability.
This is a really bad project to learn JavaScript with.
Not entirely sure this is as true as you think, but even if it is that just means I'll know the language that much better when I'm done.
One of the principal flaw of JavaScript is it's lack of native support for binary strings/data, and what you are trying to do is all manipulation of binary data.
First, with some of the HTML5 tags available I have a lot of capability dealing with binary data. Second, I'm not actually dealing with binary data at all (directly) because the browser already has the libraries it needs to display images. This is really a non-issue.
Razputin thanks for the info, but I actually already knew this much. If I were implementing the program from something like Java or C I would know exaclty how to do it, it would just be all the hassle of doing the math and setting up pointer arrays, blah blah. Instead I'm trying to utilize features that are already found in browser languages.
As far as speed of rendering and such is concerned it won't be an issue. First, I'm going to be dealing with a single image, the tileset chosen, to load into memory. Everything else is just pointers to which part of the tileset to display at any given point on the screen. And javascript plenty fast these days for rich applications. To the computer the difference might be whether it has 1,000 nullops between user actions or 1,000,000, but the end user won't see much difference compared to say C.
Since I get to make heavy use of HTML and CSS most of the memory footprint of the program will already be wrapped up in the browser, so as long as your computer can run Firefox it shouldn't be a deal breaker. Remember, that while it will run in your browser, the program will be local so the only speed issue is your PC, not the internet connection.
And I have a hard time believing that any computer made within the last 6 years would have a hard time rendering a bunch of tiles inside of a browser which is made for that sort of purpose.
Anyway, thanks for all the replies so far. I'll provide updates as I can manage.