Community made patches and improvements

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Postby RoKenn » Fri Jan 09, 2009 10:45 pm

I made an attempt to reduce the amount of overlapping text, especially concerning centerprint(). My first proposal is at:

http://paste.debian.net/25637/

It modifies the handling of centerprint(), which is used for a lot of stuff, like "you were fragged by", team messages, MOTD, etc...

In order to try it, you have to start a local server, because SVN servers will push their client side progs to you.

* The centerprint texts are now usually printed below the scoreboard. In case the text wouldn't fit on the screen it will be shifted up, so that it is just above the bottom.
* To avoid jumping of the text it is always below the scoreboard, even it is not visible.
* The centerprint can now easier overlap with the chat box... there is not enough free space.
* I moved the scoreboard down a bit, because it was overlapping with the event log.
* The patch is purely client side. I also started cleaning up the server code, but that is rather cosmetic.
[Tue Aug 5 2008] [00:15:01] <Ronan`> RoKenn, you're an evil person :P
Image
RoKenn
Alien
 
Posts: 141
Joined: Wed Apr 25, 2007 10:25 pm

Postby MirceaKitsune » Fri Jan 09, 2009 11:37 pm

divVerent wrote:This is known on DailyWTF as the "for-case paradigm". Don't use it. Remove the loop, do e = get_weaponinfo(activeweapon) once.

Also... use e.netname as weapon name. Don't use these numbers in the cvars any more, they're irritating to players.


Yeah, the for loop was a big mistake of mine. Anyway I ran into some block and probably found a bug as well... it seems that weapons.netname is broken in the client code. To test, replace the if(last_weapon != activeweapon) statement with the following one in View.qc:

Code: Select all
   if(last_weapon != activeweapon) {
         e = get_weaponinfo(activeweapon);
         print(strcat("Test", e.netname)); //Test

      weapontime = time;
      last_weapon = activeweapon;
   }


Now go into the game, switch some weapons then pick up new ones. You will only see "Test" being printed in the console, but no weapon name as it should. I tried every alternative... replaced e = get_weaponinfo(activeweapon); with e = get_weaponinfo(1); (which should return the laser), different print() methods for the test, a different new entity other then e, but this doesn't seem to work. If I write e.message instead of e.netname however it returns the name of the map I'm on and its author, weirdly enough. I don't know if this is a bug or not but I looked at everything and it should be working correctly but it doesn't.
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

Postby divVerent » Fri Jan 09, 2009 11:57 pm

Did you add a call to RegisterWeapons() to the initialization of the client?
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby MirceaKitsune » Sat Jan 10, 2009 12:32 am

That fixed it, thanks. Created the 4th version of the patch as requested, which does optimize the code as well as possible I think. Also found a way to compress some code in choosing between defaults and customs, and changed the default crosshair buttons and menu to use crosshair_default_* instead of crosshair_* which is more suitable now. New patch HERE and HERE. This can probably be implemented in SVN by now with crosshair_custom defaulting to 0 until the menu can be figured out as well.
Last edited by MirceaKitsune on Sat Jan 10, 2009 9:58 am, edited 1 time in total.
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

Postby Alien » Sat Jan 10, 2009 8:28 am

RoKenn wrote:* The centerprint can now easier overlap with the chat box... there is not enough free space.


Maybe wordwrap chat text at less than 69 (?) characters.
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby RoKenn » Sat Jan 10, 2009 11:24 am

Alien wrote:
RoKenn wrote:* The centerprint can now easier overlap with the chat box... there is not enough free space.


Maybe wordwrap chat text at less than 69 (?) characters.


The problem is that centerprint is used for a bunch of different purposes, also the MOTD, which can be quite long. If I split the text into more lines, the vertical overlap would get even worse for long MOTDs.

A simple "you were fragged by someone-who-has-a-long-name-to-show-you-that-he-sucks" will show up above the chat box anyway.

I already thought about not showing the scoreboard after connecting, only the MOTD. But then even more people would join the wrong team, probably. :roll:
[Tue Aug 5 2008] [00:15:01] <Ronan`> RoKenn, you're an evil person :P
Image
RoKenn
Alien
 
Posts: 141
Joined: Wed Apr 25, 2007 10:25 pm

Postby Alien » Sat Jan 10, 2009 12:02 pm

I meant CHAT box. :)
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby RoKenn » Sat Jan 10, 2009 1:19 pm

Alien wrote:I meant CHAT box. :)


:( *walks away to attend a reading course*

I will have a look at that. The question is if it helps. The MOTD lines often nearly cover the whole line, so it will still overlap and the other messages ("fragged by" and team messages) will be above it anyway. And making the lines too short can make important(*) messages disappear too fast.

It's a bit difficult to test all varieties, because I either have to run a local server, or go to a 2.4.2 server, which doesn't have the new scoreboard. :?

Another idea to solve the vertical overlap of the MOTD would be to automatically reduce its font size if an overlap would occur otherwise.

(*) maybe I should hook a small censor bot into the Say command that swallows irrelevant chat, when some people again confuse Nexuiz and IRC. :P
[Tue Aug 5 2008] [00:15:01] <Ronan`> RoKenn, you're an evil person :P
Image
RoKenn
Alien
 
Posts: 141
Joined: Wed Apr 25, 2007 10:25 pm

Postby RoKenn » Mon Jan 12, 2009 11:07 pm

I looked at wrapping the chat box. Basically I would have to wrap after 33 characters (including the name) to avoid overlapping on my screen (width 1280). So I left that as it is.

Instead I fixed a stupid bug and also shifted the message to the center in case of very small scoreboards (like in the campaign).

Here's the patches:

Client: http://paste.debian.net/25839/
Server: http://paste.debian.net/25838/

Note that these are basically independent and the server patch is mostly cosmetic (just removed newlines at the end).
[Tue Aug 5 2008] [00:15:01] <Ronan`> RoKenn, you're an evil person :P
Image
RoKenn
Alien
 
Posts: 141
Joined: Wed Apr 25, 2007 10:25 pm

Postby MirceaKitsune » Tue Jan 13, 2009 12:44 am

Remade the custom crosshair patch so it matches some modifications done in the Weapon Settings menu a few days ago. Link 1, 2. Also wanted to know what Div intends to do with this patch so I know if to keep working on it or not. Will it be added to SVN or must the menu chooser be figured out as well first?
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

PreviousNext

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron