Oh boy. Time sure flies when you're building the backend for a game, huh? I've got lots of questions this time around, although not all of them are necessarily about making my game. I'm not even certain all of these first ones will be easily answered by anyone but Alex, honestly.
Last update:
2/18Improvement Inquiries1.) Perhaps my most important (in my mind) inquiry that's not related to an issue I'm having with my game.
Quite a long time ago, someone made a
post here related to some improvements to ASL; amongst other things, I was interested in shorthand operators to increment, decrement, and otherwise shorten code while changing the value of a variable, similar to JavaScript. (++, --, and +=|-=|*=|/=) I wasn't too interested in much else there, but I'm sure other people would be; I'm basically fine with our current and/or/not, seeing as Quest
is supposed to be easily understandable by the average person. (I know I had no clue how to read more advanced JavaScript when I first saw it -
&&?
||?
!? Those aren't intuitive at all!)
Did that ever pan out? They ended up just not posting ever again in that topic, it seems, and it apparently never got committed as an actual improvement to ASL. If it was a matter of man-hours, I'd be willing to look into helping make it happen; I'm no professional coder, but with enough time, Google, and determination, I can definitely learn enough to get things done.
2.) This actually segues nicely into my second non-issue inquiry. I've noticed that there are no GUI interfaces for Object or General Dictionaries, and that there was a similar issue of GUI elements being required for prior improvements.
In a similar vein, I've noticed that the Script Editor has the same layout as it did back in ~2008-2010: a single column of folding categories that you have to scroll down and find what you're looking for.
Modern game design has shown me how terrible this is. Seriously. The more elements you have, the more cluttered it gets, and the further down an element is, the longer it takes to access it. IIRC, Kerbal Space Program used to have an issue with this, as did TerraTech. It just doesn't cut it with large numbers of entries.
I suggest it be switched to a tab-style interface, just like most of the QDK. In fact, I'd be willing to help modify/extend the current editor libraries to allow for editing and creating the new dictionaries. I'm not certain if the current Script Editor layout is defined by the editor libraries or by vbscript(?); if it's not defined by the libraries, I think I'll have a lot more learning to do.
?: I don't recall exactly what the topic said Quest/QDK is written in, but that was the first language I saw at a quick glance, and it may be wrong.
3.) While reading the forum topic linked in #1, I'd like to think I've gained at least a little bit on insight into how ASL (and by extension, Quest) works. Correct me if I'm wrong, but are stringdictionary, scriptdictionary, and objectdictionary preferred over a generic dictionary because the system has to check what kind of value an entry is before it can return it?
If so, perhaps it would be a good decision to implement dictionaries for booleans, doubles, integers, etc...? I don't recall any other types off the top of my head. As above, I'd be willing to help with their UI elements.
4a.) I have a few suggestions to improve upon the current Map system. For one, I think it would be a good idea to include dropdown selectors for all 15 non-blank tiles that are possible with the current system; currently, only something like 7-9 are available.
4b.) Second, how difficult would it be to implement a more advanced border draw system (such as diagonal edges, round/circular walls, geometric shapes, etc)?
4c.) Less importantly, I would suggest eventually implementing a tile preview on the room's Map tab, if possible; that way, a test run wouldn't be necessary to check your colors and/or otherwise confirm you're satisfied with the look of a room.
5
a.) After all of this talk about the UI, I've actually thought up something else about it; correct me if I'm wrong, but currently, the UI requires fiddling with JavaScript and CSS for actual, physical layout customization.
Would it be possible to implement an easily-editable layout, such as an HTML template and stylesheet pair defined in XML? You would define the correct div IDs within the html file in the order and layout you want, and the system would then insert the necessary properties and other data. By default, Core.aslx would eventually point down to the default UI files.
If I remember correctly, (I haven't done much digging into the current UI system) it may also be necessary to include a JS file with that pair, to define certain variables for the UI to properly update.
5b.)
2/17: After taking a look through some of the functions defined by Core, I've mocked up a
library editor that could be used for such a custom UI feature. I will warn you (Alex) ahead of time, though; it may be necessary to change your current code for InitInterface to split externalstylesheets as a string if you don't feel like adding a stringlist controltype.
Actually, after having typed this; is it possible that there's already a means to implement a completely custom game UI in Quest, just lacking a UI element for itself? What I have seen doesn't seem like it has quite the flexibility I'm looking for; since writing this post, I've already devised and prototyped a rather nice UI replacement that I'd like to implement into my game if at all possible. It would absolutely require that I be able to efficiently replace the entirety of the current generic UI html, though (and likely the UI code itself); I don't know if you build the UI in code or simply use a base HTML template, but if it's the latter, this would hopefully go quite smoothly.
2/18: I forgot to mention last night; my intent is that the HTML template replace only the body of the current UI template. As far as I can tell, almost everything currently in the header should absolutely not be removed.
6
a.) Last but not least, would it be possible to implement extended and direct JavaScript callbacks?
For example, let's say we have a function "yes" that simply returns "yes" as a string. Normally, to use the value of this function, it would have to call an ASLEvent, which would then call some dedicated function that would do something with that "yes".
It would be great if you could simply type something along these lines:
answerVariable = JS.YesLib.yes()
6b.)
2/13: I only just thought of this, but how difficult would it be to extend the ASLEvent function/native ASLEvent code to handle any number of parameters?
Questions1a.) Alright, now that I've gotten all of that stuff out of the way, time to go through my questions list. First off, I've been wondering for a while; is using dictionaries faster, slower, or the same speed (delay) as using purely object attributes? Originally, I had my combat stats (defenses) stored as attributes; however, now that I mostly use Cloud9 to edit my game, I realize that there's just so much clutter in my player object.
I've been considering two different systems to replace my old one (and to build off of in the future), both of which I've prototyped and made a lot of code for: one revolves around using dictionaries to store almost all data (ie game.pov.equipment["weapon"], game.pov.def["kinetic"], etc) and one revolves around object trees to organize data (ie game.pov.equipment -> Character_Equipment, game.pov.equipment.clothing -> Character_Clothing)
Which of these will cause the least amount of delay when being accessed? I'd rather prefer to use dictionaries, but I've played some IF in the past where access speed was just horrible; taking up to three seconds to switch area and having a good second delay to every command. I want any games I make to be snappy and light, so knowing this in advance would be very useful.
1b.) Along the same lines as above, which would be the better choice: an object with up to a thousand (possibly more?) boolean attributes ("flags", if you will), or a single dictionary filled with booleans? Again, I'm primarily concerned with access time; if there's a noticeable delay from using __DictionaryItem() as opposed to simply using object.attribute, I'd really like to know. That said, these flags won't likely get called nearly as often as combat stats.
1c.) I also have been looking into the processing delay in Java for integer variables compared to doubles and floats. I got the sense that what I was reading mostly applied to extremely time-sensitive tasks (where every ms counts), but would it be better for me to store doubles (ie percent modifiers, or fractions of a liter) and use them directly, or to store integers and divide them to get the double I need?
For example, I'm creating a more advanced volume system that measures in mL; my first draft simply used the built-in volume system to store individual mL, but would it be noticeably slower if I were to instead base volume in liters and have objects measure down to the thousandths?
2.) Is it possible to have functions with subfunctions (methods?) in Quest like JavaScript? For example, a function CustomUI.Update or something. It's getting a bit late, and I don't really know how else to elaborate on that matter. It would just be convenient for organization, I can certainly make due without it.
3.) How would one use a positive-number variable as a negative number? Is it as simple as typing variable = var1 + -var2, or would I have to use something like var2 = 0 - var2?
Alright. I'm heading to bed; this post took a lot longer to make than I thought it would. See you all tomorrow morning.