ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.71k stars 625 forks source link

[GoldSource|CS 1.6] Fix avatar's on small resolution #2155

Closed afwn90cj93201nixr2e1re closed 5 years ago

afwn90cj93201nixr2e1re commented 5 years ago
//unicode patch for console
            HexReplaceInLibrary("cstrike/cl_dlls/client.dll", "7ECC880A", "76CC880A", 0xCC, 0);
            //www x 768<= tab avatar fixes
            HexReplaceInLibrary("cstrike/cl_dlls/client.dll", "817C24CC00030000", "817C24CC01000000", 0xCC, 0); 
            HexReplaceInLibrary("cstrike/cl_dlls/client.dll", "3D000300CC8B4424CC", "3D010000CC8B4424CC", 0xCC, 0);
            //wad files download fix            
            HexReplaceInLibrary("hw.dll", "1885C07403C600008D85", "1885C07414C600008D85", 0, 0);
            //GetHullBounds Fix
            HexReplaceInLibrary("hw.dll", "8B4C240433C02BC87406497403497505B801000000C3", "837C240401750B8B44240CC7400800000042B001C3C3", 0, 0);

related to Scorebar. https://hastebin.com/rilekuyijo.php

2010kohtep commented 5 years ago

I guess developers need more information on how to fix this problem.

The game will not show player avatars if the height of the game window is less than 768 pixels. According to many, this is a very large number and you need to reduce it or remove this check at all.

The fix is required in the following functions:

afwn90cj93201nixr2e1re commented 5 years ago
void PatchStuff()
{
    // Patch Unicode
    uintptr_t ptr = (clso_addr + clso_st["_Z12ScrollTextUpv"])+0x1D2;
    auto nint = *(uint8_t *)ptr;
    modify_1((void*)ptr, 0x76, PAGE_EXECUTE_READWRITE);
    nint = *(uint8_t *)ptr;
    // Patch avatars
    ptr = (clso_addr + clso_st["_ZN25CCSClientScoreBoardDialog16UpdatePlayerInfoEv"])+0x140;
    //ConsolePrintColor(0, 255,0, ">>>%d\n", *(uint32_t *)ptr);
    modify_4((void*)ptr, 1, PAGE_EXECUTE_READWRITE);
    ptr = (clso_addr + clso_st["_ZN25CCSClientScoreBoardDialog11ShowAvatarsEv"])+0x27;
    modify_4((void*)ptr, 1, PAGE_EXECUTE_READWRITE);
    ptr = (clso_addr + clso_st["_ZN25CCSClientScoreBoardDialog9AddHeaderEv"])+0xAA;
    modify_4((void*)ptr, 1, PAGE_EXECUTE_READWRITE);
    ptr = (clso_addr + clso_st["_ZN25CCSClientScoreBoardDialog10AddSectionEii"])+0x1BB;
    modify_4((void*)ptr, 1, PAGE_EXECUTE_READWRITE);
    ptr = (clso_addr + clso_st["_ZN25CCSClientScoreBoardDialog10AddSectionEii"])+0x475;
    modify_4((void*)ptr, 1, PAGE_EXECUTE_READWRITE);
    ptr = (clso_addr + clso_st["_ZN25CCSClientScoreBoardDialog18UpdatePlayerAvatarEiP9KeyValues"])+0x54;
    modify_4((void*)ptr, 1, PAGE_EXECUTE_READWRITE);
}
void cOffset::modify_1(void *addr, uint8_t hexCode, int prot) {
    addr = (void *)(((int)addr) & (-2));
    ProtectAddr((void *)addr, PROT_READ | PROT_WRITE);
    *(uint8_t *)addr = hexCode;
    ProtectAddr((void *)addr, prot );
}

void cOffset::modify_2(void *addr, uint16_t hexCode, int prot) {
    addr = (void *)(((int)addr) & (-2));
    ProtectAddr((void *)addr, PROT_READ | PROT_WRITE);
    *(uint16_t *)addr = hexCode;
    ProtectAddr((void *)addr, prot );
}

void cOffset::modify_4(void *addr, uint32_t hexCode, int prot) {
    addr = (void *)(((int)addr) & (-2));
    ProtectAddr((void *)addr, PROT_READ | PROT_WRITE);
    *(uint32_t *)addr = hexCode;
    ProtectAddr((void *)addr, prot );
}

@mikela-valve there simple fix.

afwn90cj93201nixr2e1re commented 5 years ago

Thank's, waiting for fix.

mikela-valve commented 5 years ago

This is added as of beta 8279. See my post here.

afwn90cj93201nixr2e1re commented 5 years ago

Im gonna test it in few day's. Wait please.

dager10 commented 5 years ago

resolution 640x480 when on server 24 or less players avatars looks good, when 25 and more is not centered

20190626171222_1 20190626171251_1 20190626171309_1

mikela-valve commented 5 years ago

@dager10 It's actually not centered in any of those, it just looks a bit better with the larger icon when the line height is larger. It's currently using a fixed amount of space for the avatar that doesn't vary with the line height, so when the lines are smaller the avatar is smaller as well and so sits more to the right in the column. I'll probably just make the avatar column dynamically size based on the line height so it always looks centered.

mikela-valve commented 5 years ago

This should look better in beta build 8279.

Splatt581 commented 5 years ago

According to my observations, avatars of players are displayed correctly at high and medium resolutions, but at low resolutions such as 800x600 or 640x480 avatars continue to shift only for spectators. Example below on gif: asd

mikela-valve commented 5 years ago

Thanks @Splatt581. Spectator rows are handled differently from T/CT rows and I'd missed updating the initial width of the column for them. That should be fixed in the next update.

mikela-valve commented 5 years ago

This should be fixed in the current beta. It did not require a full build so the build number is still 8279.

Splatt581 commented 5 years ago

Problem with shift of avatars in spectator rows is still exists in latest beta build.

mikela-valve commented 5 years ago

Ok, this is actually fixed now in beta. I had tested this in CS:CZ after the last fix and it seems that CZ handles the scoreboard differently than CS does so I didn't notice that CS still had the issue. Thanks @Splatt581!

Splatt581 commented 5 years ago

I confirm, fixed.

afwn90cj93201nixr2e1re commented 5 years ago

Tested. This is bad fix. @mikela-valve

BUXPb commented 5 years ago

How to disable avatars altogether?

twisterniq commented 5 years ago

How to disable avatars altogether?

Why do you want to disable them?

BUXPb commented 5 years ago

Tits, pussies and other things that I see on avatars make it difficult to concentrate on the game.

mikela-valve commented 5 years ago

@BUXPb That's a good question. Now that avatars are enabled for all screen sizes there's no way around having them there. I'm adding another cvar that you can use to disable them if you'd like either to avoid distraction or to have more space in the scoreboard.

scoreboard_showavatars will be 1 by default and 0 to disable showing avatars.

afwn90cj93201nixr2e1re commented 5 years ago

I'm adding another cvar that you can use to disable them if you'd like either to avoid distraction or to have more space in the scoreboard.

And then u ask about unnecessary cvars. No one game have this cvar, cs 1.6 also shouldnt, if he wanna play without avatar's he must download nonsteam version or smthng like that, and steam also have lil protection agains tits and dicks on avatars.

So. Ur solution is bad. Don't make avatar sizes fixed. They shown nice at 640x480, 800x600 and etc with dynamic size, just replace 768 to 0, and all. That's better. 2 - 10 player's on server, medium size, more player's avatar sizes automaticaly reduce to small and etc.

agrastiOs commented 5 years ago

@afwn90cj93201nixr2e1re Why do cvars bother you? They're not affecting you in any way. And it's definitely better to have a cvar than having to change resolution to disable avatars, so this cvar is not unnecessary at all...

SamVanheer commented 5 years ago

Also don't tell people to commit crimes by using cracked versions of the game.

afwn90cj93201nixr2e1re commented 5 years ago

He can go offline in steam and game without avatars. Coz a lot of cvar's in cs doesn't work as expected, some of cvar's unused in cs, some of cvars undescribed, and we must reverse game engine to understand how it's work, see issues at git.

xD, ok, but still no need's in this cvar.

agrastiOs commented 5 years ago

So these other cvars should be removed or fixed, not this one functionally useful cvar, even better, it can be added to other MP GoldSrc games.

afwn90cj93201nixr2e1re commented 5 years ago

There no options in source games too. Coz this is part of steam library and steam engine and paradigms, and @mikela-valve shouldn't add this cvar.

SamVanheer commented 5 years ago

Neither of those arguments make sense.

afwn90cj93201nixr2e1re commented 5 years ago

don't get u at all, sry.

SamVanheer commented 5 years ago

Whether Source games have an option or not has no bearing on GoldSource games, or even other Source games. And whether this is a Steam game or not also has no bearing on options like this.

afwn90cj93201nixr2e1re commented 5 years ago

And whether this is a Steam game or not also has no bearing on options like this.

Nice, let's read steam workshop guides.

afwn90cj93201nixr2e1re commented 5 years ago

@mikela-valve your fix is bad. Read above.

SamVanheer commented 5 years ago

The Steam Workshop doesn't have any bearing on this either (GoldSource games don't even use it), and please refrain from using issue tracker functionality to dictate action.

SamVanheer commented 5 years ago

Please take a moment to review the rules of conduct for this repository: https://github.com/ValveSoftware/halflife#conduct

kisak-valve commented 5 years ago

Hello @afwn90cj93201nixr2e1re, while it's fine to disagree with others and constructively discuss how an issue could be handled, please try to keep the discussion friendly.

Your choice to attack @SamVanheer's character has earned you a 24 hour timeout.

CS-PRO1 commented 5 years ago

Idk why you're trying to be unhelpful? The fix is good enough and the Cvar is a good addition and if Source updates were still going I'd suggest it to CS:S and other Source games myself.

mikela-valve commented 5 years ago

scoreboard_showavatars is added in the current beta.

afwn90cj93201nixr2e1re commented 5 years ago

:/ Just check user forums. Your fix is baaaaaaaaaaaaaaaaad. Don't make avatar size's static :/

Now we can't see anything on low resolution's. We must use loupe to see player's avatar's on 640x480, or what?

SamVanheer commented 5 years ago

You mean these forums: https://steamcommunity.com/app/10/discussions/0/

Because i don't see any complaints about this change.

afwn90cj93201nixr2e1re commented 5 years ago

изображение P.s it's 640x480 with your patch.

And our fix, which tested since 2013 изображение

Which one better? I think second.

Я не знаю как тут еще объяснить глупость подобного исправления.

Фикс верный дан в первом посту, но микелла решил его переделать, зачем? 3a4em?

agrastiOs commented 5 years ago

See, that's how you suggest things. It would be a pretty good idea to do this, I think you could do a separate issue report for dynamic avatars.

afwn90cj93201nixr2e1re commented 5 years ago

:/ :/ :/ it was dynamic by default. He changed it. I just patched some bytes to make it work on low resolution as well as on > 768. Fix described in first 3 posts.

agrastiOs commented 5 years ago

I would just recommend to make a separate issue for visibility, this one is closed.

mikela-valve commented 5 years ago

@afwn90cj93201nixr2e1re It was still dynamic in the changes that I made for smaller screen sizes. Avatars for both height <768 and >=768 have three different sizes based on the number of players.

In an attempt to keep the scoreboard looking mostly the same on <768 screen heights I kept the line spacing the same as it was when avatars were disabled whereas based on your image it looks like you're using the same line spacing and avatar sizes for all screen sizes. That's the difference between my changes and yours.

Unfortunately I didn't know that your first couple of posts were referring to removing the screen size check entirely since that patching code is not very clear about what is being patched over. Based on your screen shot however I've updated the latest beta (build 8301) to better match it. It should now be using the same spacing for all screen sizes and mostly the same avatar sizing (they're still slightly smaller on <768 so that less of the avatar is cut off).

mikela-valve commented 5 years ago

Any other changes to this to add more avatar sizes or different column sizing, etc should be handled in a new issue.

afwn90cj93201nixr2e1re commented 5 years ago

I've updated the latest beta (build 8301) to better match it. It should now be using the same spacing for all screen sizes and mostly the same avatar sizing (they're still slightly smaller on <768 so that less of the avatar is cut off).

Kohtep said 'bout it in https://github.com/ValveSoftware/halflife/issues/2155#issuecomment-485137663

Now everything is fine. изображение

изображение

Thank's.

Also check first screenshot. Can you make buffer for server name x2 or x4? for unicode symbols. If there free space with new hp and money column title's.

afwn90cj93201nixr2e1re commented 5 years ago

Also as you can see your fix doesn't help with column's, xD. https://github.com/ValveSoftware/halflife/issues/2595#issuecomment-512823806

It's totally should be done with ico's. @mikela-valve

SamVanheer commented 5 years ago

You should open a new issue for the server name buffer and any other adjustments like Mikela said.

afwn90cj93201nixr2e1re commented 5 years ago

Yep, i know how it's work. New issue, 100 likes and other things, instead 1 little message in post, he can fix it, or just ignore. Not my business.

afwn90cj93201nixr2e1re commented 5 years ago

изображение 'r u serios?