Sword of Moonlight > Beginner and other Nonsense

STICKY: Random News

<< < (2/16) > >>

Holey Moley:
I've made some more changes to the built-in English for the next release. I'm beginning to be comfortable with pretty much everything. I must admit that I've been uneasy for a while.

The top menu now looks like:

Menu
 Use Item
 Work Magic
 Equip
 View Summary
 Arrange Inventory
 System

I've also changed "Knock" to Rest. This is the 2nd or 3rd of the Strength based ratings as mentioned above.

I like Rest because you can rest the weapon on its rest side, and because it also works as "the rest" or everything that isn't an Edge or a Point. I wouldn't mind if it was the third stat in the Summary screen so that it looks like 'and the rest'. I may arrange for that. On the other screens it's off to the side on it's own.

I also changed Effect back to Accessory. I don't think it was Effect for long, but I was reminded that the point of the built-in English is not to be neutral. Really every game should customize its text to fit within whatever series the game belongs to.

For the record, I base the built-in English on King's Field. Or what seems best for KF to me anyway.

Holey Moley:
I've added a little fix to some extended combos that enable recentering the vertical view axis and mouse. Now there is a 100ms window to release the combo buttons so that they don't have to be released at the same time.

I don't know if the mouse recentering function is so necessary anymore since for a while know the mouse automatically recenters itself if left still for very long.

The combos work by antagonistic inputs. So if you hold left and right down together then that recenters the mouse horizontally. And up+down recenters vertically, this also resets the view visually. Look-up+down also recenters. As does turn left+right horizontally.

This fix just eliminates a potential negative experience for the player.


PS: The original plan was to put the inputs on a delay so that they could be processed in advance. But I don't think that's going to happen anytime soon. So this is a nice afterthought for now, as part of the campaign of late to tie up loose ends.

Holey Moley:
Eureka!

I finally cracked the nut that was Brunt->Knock->Rest and maybe even something I've left out.

I woke up knowing I was still unhappy with this today. I spent all morning brainstorming alternatives. Technically it's the only work I'll do today because I'm heading out in advance of storms.

Dun dun dun, the new (and final) term is Area!

I'm not sure why this never occurred to me. Surface seemed like the right word, but too long, and too wordy. So I'd just about given up, and I decided to see if there were any words in its definition that might function as a lead. I'm sure I'd considered it before. But just before it occurred to me something like all weapons that aren't cutting or stabbing (in the hopes of stuff rupturing) are based on their surface area...

So it makes perfect sense that damage is being channeled through some surface area.

In lieu of this I'll probably consider alternatives to Point before I'm done. But #2 is definitely the trickiest. I'm both convinced and relieved that it won't be changing. If fact I don't even want to think about it ever again!


Edge 1  Area 2
Point 3

Fire 4    Earth 5
Wind 6  Water 7
Holy 8

Holey Moley:
Found a surprising bug today around locale selection. It turned out that do_use_builtin_english_by_default was being applied to Japanese computers!

I don't know how this managed to go so long without being caught by myself, but it was exacerbated by the fact that if there is not a LANG folder then the system locale is used, which is more often the case for me. Plus if there is a Japanese translation file in the LANG folder the bug was well hidden also.

So it basically wasn't setup correctly, but appeared to be correct under both of those conditions. It's only with an empty dummy LANG folder that the problem revealed itself.


Today I also added a trick to the Ex.ini file, so you can reset an extension to its default behavior (which can sometimes be more complex than a simple default value) by writing the extension with a . (period) directly in front of it. I've wanted to do this for a while, but could not arrive at a syntax that agreed with me.

I call this hiding the extension. Like on many computers files that begin with a period (.) are hidden. And I plan on adding the same functionality for whole sections at some point, but there's no rush.


PS: I also changed the English for the Arrange Inventory screen to say Pack and Unpack when asking for confirmation.

Holey Moley:
Here's a strange twist.

Because I was wondering how to translate the new do_start extension in the script file, I was wondering if the gettext plural forms could be used as a kind of a trick, so that each start_mode can be translated independently in one place. So in this scenario the 0 plural form would translate the SOM emulation mode 0, 2 for KF2, and so on.

That got me looking up the binary file format for the message catalogs since that needs to be added to the lib/swordofmoonlight.h portable file format library anyway. That looks like this BTW:


--- Code: ---namespace msg /*SWORDOFMOONLIGHT::*/
{
/*For gettext-based script files*/

/*UNIMPLEMENTED: we'll need these*/
/*http://punt.sourceforge.net/new_svn/gettext/gettext_8.html#SEC155*/
/*http://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Plural-forms.html*/

typedef swordofmoonlight_lib_file_t file_t;
typedef swordofmoonlight_lib_image_t image_t;

/*todo: helpers for searching for MO files*/
void maptofile(msg::image_t&,msg::file_t mo);
/*always unmap after map (even if image is bad)*/
inline int unmap(msg::image_t &img){ return swordofmoonlight_lib_unmap(&img); }

/*nplurals: we'll parse the header for you
//plural: you'll have to compute plural yourself*/
/*reminder: add Unicode logic symbols to Ex.number.cpp*/
int nplurals(const msg::image_t&); const char *plural(const msg::image_t&);

/*gettext: int returns the length of msgstr
//this length includes 0 terminated plural forms*/
int gettext(const msg::image_t&, const void *msgid, const void* &msgstr);
}
--- End code ---

Anyway, the funny thing, and the reason I'm posting is in order to implement the plural forms part of the Gettext specification you have to be able to compute which plural form to use based on arbitrary formulas that depend on the world language. There are a number of examples in here:

http://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Plural-forms.html

One of the longest used by Slavic languages looks like:


--- Code: ---plural=n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2;
--- End code ---

So what's interesting is if not for the work done last year to add a calculator system (http://en.swordofmoonlight.org/wiki/SomEx/list_of_numbers) originally for the purpose of computing user provided damage formulas, there'd be no real way to do this at this time. But now, just in the nick of time, there is.

It's funny because this would've presented a huge stumbling block to implementing the Gettext specification from scratch. Which is necessary to do because the only real Win32 implementation on Windows isn't cutting it for SOM. I think because no one has ever used it with real-time applications like a game, or because it's not intended to be used with real-time applications.

There's no reason at all a Gettext catalog can't be used by a game in real-time, it just sometimes runs into problems due to however its implemented that drags the frame rate down to a crawl when it shouldn't be taking any time at all to translate each bit of text.


PS: I reckon in order to do this, since things like && and != are not part of the number calculator syntax I'll have to add extended Unicode logic symbols to the calculator, and then just substitute them for these digraphs when generating the formula.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version