wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 01-10-2007, 02:47 PM   #1
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default Analysis of Game Messages

I have recently done a lot of experiments with game messages. This thread is meant as a repository of my findings, as well as some general information about game messages.


Game messages are messages you display on screen with the Game - Text Message GUI trigger actions or JASS natives like DisplayTimedTextToPlayer(). They are typicaly displayed in the bottom left corner of the playable screen, however with JASS functions, you can specify an offset from that point at which to display the game message. Here, the tricks begin.


If you display multiple game messages one after another, the earlier ones will be pushed up as new ones are displayed below them. Game messages therefore always appear in a "block", the oldest ones being at the top and the newer ones at the bottom. Whenever you specify coordinates for your game message to be displayed at, the whole block gets moved to those coordinates. This means you can't display game messages at independant positions on the screen.

Another problem with the offset is that it does not accept negative values. This means you can't display game messages lower than the height they normaly appear at, which is at coordinates 0,0. This leaves a notable ammount of room on screen that can't normaly be filled with game messages, however a trick was discovered that supposedly allows this.

The last oddity about offsets is that they work differently for game messages displayed at map initialization. In game, an x (horizontal) offset of 2.4 would push a game message almost off-screen, however if the same game message is displayed at map initialization, the same result is achieved with an x offset of 0.82.


Excessive use of game messages can cause the game to lag horribly. The cause is unknown, I discovered this in a map where I displayed 200 game messages per second, after a minute or two the lag became very noticeable. As long as you don't use game messages with very fast periodic triggers, this isn't a problem, though. For example, an AoS map that uses game messages to display notifications about hero kills and tower kills would probably use less than 100 game messages in a whole game.


Game messages have a fixed width, which is about 2/3 of the screen. Any game message longer than that is displayed in multiple lines. The ammount of characters that can be displayed in one line varies, depending on their width. You can fill in many more "I"s than "W"s. Once a character breaks the line length limit, all the following characters are moved to the next line, so a line of "W"s can appear just slightly longer than a line of "I"s, since the last "W" can stretch further over the length limit than the last "I". This difference is not very significant, though.


The fonts used for game messages have a fixed width relative to the screen width, so the same game message should be equaly long no matter what resolution you use. This, however, isn't exactly the case. The width of individual characters is always rounded to the whole pixel. Because of this, it takes a different number of (for example) "M"s to fill a line in one resolution than in another.

I have done a lot of testing on this, in an attempt to be able to center game messages on screen no matter how long they were. I have documented for all characters of the english alphabet how many can be placed in a single line on four different resolutions. I am attaching the test map as well as the results (in an excel table) for anyone who might be interested.
Attached Files
File Type: w3x SubtitleTestMap.w3x (17.5 KB, 88 views)
File Type: zip Game message font widths.zip (6.1 KB, 46 views)
__________________

Last edited by Anitarf : 01-10-2007 at 06:49 PM.
Anitarf is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 01-11-2007, 12:32 AM   #2
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Not that I'll ever use this, but I rep'd you for taking time to research these things. Where would we be without Anitarf to unravel the mysteries of Game Messages?
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 01-11-2007, 07:01 AM   #3
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

You haven't seen the stuff he pastebin'd. Good job.
blu_da_noob is offline   Reply With Quote
Old 01-12-2007, 02:17 AM   #4
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Quote:
Originally Posted by blu_da_noob
You haven't seen the stuff he pastebin'd.
Oh boy...
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 01-12-2007, 11:03 AM   #5
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,886

Submissions (4)

Toadcop is just really nice (299)Toadcop is just really nice (299)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

Quote:
200 game messages per second, after a minute or two the lag became very noticeable.
the problem must be in strings are they different ? such as I2S(GetRandomInt(0,100000)) ? because i had this lags then i was useing this func 1000 times per second (if less i must wait longer)
first time i have discovered this by gamecache storages (with peopdical interval like this). but then i have tested only string and it lags any way.

btw as for me it's nothing new... i know it long ago but ofc not all what you have write here.
GJ !
Toadcop is offline   Reply With Quote
Old 01-12-2007, 05:38 PM   #6
karukef
User
 
Join Date: Jan 2004
Posts: 388

karukef has a spectacular aura about (97)karukef has a spectacular aura about (97)karukef has a spectacular aura about (97)karukef has a spectacular aura about (97)

Default

No, my experience also suggests that even if you print the exact same string, it will start to lag if you print it often enough.
karukef is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 10:15 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services