Unicode support in VCMP

Started by ysc3839, Feb 03, 2016, 05:57 AM

Previous topic - Next topic

EK.IceFlake

Quote from: Stormeus on Jul 18, 2016, 01:58 PM
Quote from: EK.CrystalBlue on Jul 18, 2016, 01:43 PMCant you generate your own bitmap where whenever a new letter is used you put it in your new bitmap. If it was used previously then draw it from the bitmap otherwise read it from the font and add it to your bitmap

That's an idea, except that introduces a denial of service attack where a player could just send a large string of Unicode characters to exhaust the memory of everyone in the server.
You can purge the least used characters when some bitmap limit [maybe a megabyte] is reached

Stormeus

Quote from: EK.CrystalBlue on Jul 18, 2016, 07:02 PM
Quote from: Stormeus on Jul 18, 2016, 01:58 PM
Quote from: EK.CrystalBlue on Jul 18, 2016, 01:43 PMCant you generate your own bitmap where whenever a new letter is used you put it in your new bitmap. If it was used previously then draw it from the bitmap otherwise read it from the font and add it to your bitmap

That's an idea, except that introduces a denial of service attack where a player could just send a large string of Unicode characters to exhaust the memory of everyone in the server.
You can purge the least used characters when some bitmap limit [maybe a megabyte] is reached

That doesn't really solve the issue though because someone could just forge a chat message packet and fill it with as many Unicode bytes as possible, which would exhaust memory anyway. Setting a limit like 1MB makes no sense because I'm pretty sure the bitmap of pure Latin characters takes up more than that at the moment anyway.

.

Quote from: EK.CrystalBlue on Jul 18, 2016, 07:02 PMYou can purge the least used characters when some bitmap limit [maybe a megabyte] is reached

So now we're supposed to keep track of which characters are used? That would imply scanning every string and processing each character, and for each character keep a time-stamp of when it was used and then periodically scan those time-stamps to see which is too old. And then remove the associated character from the bitmap. Then if someone uses that character, create the bitmap again... I mean come on... is this how the industry did this so far?
.

KAKAN

why not do something like if the user's RAM is more than 2 GB, enable a option a use Unicode chars. And if it's <2 GB, ask the user about it, also, create a function in the settings menu :D
oh no

EK.IceFlake

Quote from: . on Jul 18, 2016, 07:14 PM
Quote from: EK.CrystalBlue on Jul 18, 2016, 07:02 PMYou can purge the least used characters when some bitmap limit [maybe a megabyte] is reached

So now we're supposed to keep track of which characters are used? That would imply scanning every string and processing each character, and for each character keep a time-stamp of when it was used and then periodically scan those time-stamps to see which is too old. And then remove the associated character from the bitmap. Then if someone uses that character, create the bitmap again... I mean come on... is this how the industry did this so far?
Except when you remember they are only a few thousand operations, which would take a few KHz of the processors few GHz, which only 1 GHz is 1024MHz which only 1 MHz is 1024KHz.

Stormeus

We're not hacking Unicode into the bitmap system, full stop. The traditional approach generally involves using FreeType or DirectWrite to render the text and only once we have a satisfactory implementation of that will we migrate to Unicode.

ysc3839

Quote from: KAKAN on Jul 19, 2016, 08:43 AMwhy not do something like if the user's RAM is more than 2 GB, enable a option a use Unicode chars. And if it's <2 GB, ask the user about it, also, create a function in the settings menu :D
In Windows, 32bit programs can only access 2GB memory.

EK.IceFlake

I have a question. Does the mGUI support Unicode?

ysc3839

Quote from: EK.CrystalBlue on Jul 19, 2016, 11:55 AMI have a question. Does the mGUI support Unicode?
As I know it doesn't.

KAKAN

Quote from: ysc3839 on Jul 19, 2016, 11:39 AM
Quote from: KAKAN on Jul 19, 2016, 08:43 AMwhy not do something like if the user's RAM is more than 2 GB, enable a option a use Unicode chars. And if it's <2 GB, ask the user about it, also, create a function in the settings menu :D
In Windows, 32bit programs can only access 2GB memory.
They can access upto 4GB, I think so.
oh no