Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Variants (http://angband.oook.cz/forum/forumdisplay.php?f=4)
-   -   I've got a problem with half (http://angband.oook.cz/forum/showthread.php?t=6623)

Mikko Lehtinen March 6, 2014 22:27

I've got a problem with half
 
2 Attachment(s)
...his variant is much more popular than mine.

Oops, sorry, actually I meant to talk about this half:

Attachment 1111

So I've simplified the combat system. You need to have STR at least equal to your weapon's weight in lbs to swing it without problems. Wielding it two-handed (without a shield) adds +2 to your STR for weapon wielding purposes.

You don't roll for damage, a Falchion always deals six points. You get at most two-and-a-half blows with it, even if your Max Blows (depending solely on DEX) is higher.

Having half-blows might seem slightly inelegant, but playtesting showed me that I need that extra bit of granularity here.

One problem. The above screenshot is from the X11 Linux version, here ½ shows right. On the console or in Windows it shows as ? or something else.

It seems that sometimes I can simply enter the half character in the code, and it shows right in the X11 Linux version. Like this:
Code:

if (blows % 10) object_desc_chr_macro(t, '½');
But if I enter the half character in Term_putstr...
Code:

Term_putstr(col, 14, -1, TERM_WHITE, "Half ½");
...it shows like this:
Attachment 1110

I have no idea why. That might have something do with the fact that I learned everything I know about C by studying the Angband source code.

Even if I managed to solve this in the X11 Linux version, I would still have problems in Windows and in the Linux console.

There are also warnings when I compile (in Finnish):

Code:

object1.c:1489:49: varoitus: monimerkkikirjainvakio [-Wmultichar]
    if (blows % 10) object_desc_chr_macro(t, '½');
                                                ^
object1.c:1489:4: varoitus: ylivuoto implisiittisessä vakiomuunnoksessa [-Woverflow]
    if (blows % 10) object_desc_chr_macro(t, '½');


Could someone please educate me on how to handle non-ASCII characters in Angband? I know that modern variants are able to deal with all sorts of fancy characters (I'm stuck with the ancient EyAngband source code).

Solving this problem and updating the manual are the only remaining steps until I can release Halls of Mist 1.4.

Derakon March 6, 2014 23:04

I suspect this is a problem with character sets and you need UTF-8 support, which was added...oh, somewhere around 3.2? Man, I don't remember any more.

Is there any particular reason you can't just say "2.5" instead of using the special 1/2 glyph?

Patashu March 6, 2014 23:11

Quote:

Originally Posted by Derakon (Post 90317)
Is there any particular reason you can't just say "2.5" instead of using the special 1/2 glyph?

Possible reason: The 1/2 glyph saves a character.

Mikko Lehtinen March 6, 2014 23:15

Thanks! That's a start.

Quote:

Originally Posted by Derakon (Post 90317)
Is there any particular reason you can't just say "2.5" instead of using the special 1/2 glyph?

Using the special glyph seems to enable me to understand everything I need to know about a weapon with a glimpse. With this -- a Falchion (+0, 2.5x6) -- I find I need to stop and think, and I don't like it.

Maybe that's just my Steve Jobs personality.

fizzix March 7, 2014 01:41

I'm actually quite looking forward to the next version of HoM, and will probably stream that after the no-TO comp (if that happens)

debo March 7, 2014 02:38

Uh isn't that 1/2 character in the extended ascii charset? (If he pasted a unicode char from a browser into a literal C string, I'm pretty sure the compiler would have barfed.)

What happens if you do "This is a half \253" instead of pasting the actual 1/2 character in?

Djabanete March 7, 2014 05:26

You know who I really can't stand? Scatha.

I always think he'll be a pushover and then I get owned by his frost breath.

Mikko Lehtinen March 7, 2014 09:17

Quote:

Originally Posted by debo (Post 90323)
Uh isn't that 1/2 character in the extended ascii charset? (If he pasted a unicode char from a browser into a literal C string, I'm pretty sure the compiler would have barfed.)

What happens if you do "This is a half \253" instead of pasting the actual 1/2 character in?

Yay! Now the compiler warnings stopped, and printing ½ on the Mist character sheet works properly!

So it's extended ascii, and actually \275. I've got a key on my Finnish keyboard for entering ½.

Linux console still shows a block for a missing glyph. I then tried running Mist in a terminal emulator, same problem. But when I changed my terminal emulator's encoding from UTF8 to ISO-8859-1, the half character showed right!

Some googling, and I found a command that allowed ½ to show on an utf-8 Linux terminal!
Code:

luit -encoding ISO-8859-1 ./mist
I haven't tested Windows yet.

Nick March 7, 2014 11:04

Quote:

Originally Posted by Derakon (Post 90317)
I suspect this is a problem with character sets and you need UTF-8 support, which was added...oh, somewhere around 3.2? Man, I don't remember any more.

For the record, myshkin did the initial UTF-8 development code in late 2011, and it first made it into a release in 3.4.0 in September 2012.

Prior to that we did a lot of messing around with Latin1 code first written IIRC by Jeff Greene for NPP.

Mikko Lehtinen March 7, 2014 12:03

I'm happy with hackish, quick solutions for Mist. As long as it works. There's no point in reinventing any wheels. Game design is what I want to focus on.

Years into future, I may rebuild the game on Pyrel or whatever exists then.


All times are GMT +1. The time now is 03:29.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.