Merge remote-tracking branch 'ensl/develop' into macos

This commit is contained in:
jonnypower 2018-05-12 17:38:59 -07:00
commit cfcde19373
8 changed files with 748 additions and 1498 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,31 +1,29 @@
# Natural Selection v3.2.1a # Natural Selection v3.2.1a
This is a complete rebuild of the game [Natural Selection] for Windows and Linux. After the SteamPipe update the game remained in an pretty bad state for years, therefore I decided to recompile its sources which are provided by [Unknownworlds Entertainment]. With this update this might be the first half-life mod which achieves multi-platform support. Speaking of this you are encouraged to compile for Mac OS X. The ultimate goal is to provide a better expierence of the Natural Selection gameplay on all major platforms and a possible distribution in the future through [Steam].
### Downloads This is a complete rebuild of the game [Natural Selection] for Windows and Linux. It includes fixes by fmoraw, Bacsu, puzl and others mostly just to make this source code build and run on all platforms.
Here you find the new compiled `.dlls` or `.so` files for client and server. If you just want to play or to host a server you can download them here:
- [ns_patch_v321a.7z]
Remember to extract them to your Half-Life/ns directory. ## Downloads
First you need NS 3.2 full installation. Download from UWE website or from here [here](https://www.ensl.org/files/client/ns_install_v32.exe)
You can find releases [here](https://github.com/ENSL/NS/releases).
Download latest: [ns_v321b_patch.zip](https://github.com/ENSL/NS/releases/download/v3.2.1b/ns_v321b_patch.zip)
Remember to extract them to your Half-Life/ns directory. It should replace the existing files.
## Changes
The offical download url for the complete version ns v3.2 is not working with firefox. Either use:
```sh
$ wget http://www.unknownworlds.com/files/ns/ns_install_v32.exe
```
or
```sh
$ curl -LO http://www.unknownworlds.com/files/ns/ns_install_v32.exe
```
or follow this link http://sllegacy.unknownworlds.com/files/ns/ns_install_v32.exe
### Changes
In order to make this game work for linux the old half-life engine files were replaced with the newer ones. In addtion some changes are accounted for the use of an acient glibc library. Some changes to the game itself have been made and these include: In order to make this game work for linux the old half-life engine files were replaced with the newer ones. In addtion some changes are accounted for the use of an acient glibc library. Some changes to the game itself have been made and these include:
- The ChatPanel has been replaced in favor of the old hl chat. - The ChatPanel has been replaced in favor of the old hl chat.
- The observatory has now a spherical detection like the sensory chamber - The observatory has now a spherical detection like the sensory chamber
- Removed special NS gamma since it is windows only - Removed special NS gamma since it is windows only
The plan is to bring the chat and the gamma back when a cross-platfrom solution can be achieved. The plan is to bring the chat and the gamma back when a cross-platfrom solution can be achieved.
### Bugs ## Bugs
With great changes come great bugs.
- Chat input is not visible while spectating - Chat input is not visible while spectating
- [sg reload bug] - [sg reload bug]
- [FPS_Effects] FPS dependant fire rates and player physics - [FPS_Effects] FPS dependant fire rates and player physics
@ -36,38 +34,57 @@ With great changes come great bugs.
- windows server works only with the hlds tool - windows server works only with the hlds tool
If you find more please report them! If you find more please report them!
### Compile
First you will need to get the files: ## Compiling
First. you need some libraries. On Ubuntu it is:
```sh ```sh
$ git clone https://github.com/fmoraw/NS.git apt-get install build-essential git gdb gcc-multilib g++-multilib libc6-i386 libcurl4-openssl-dev:i386 libpng12-dev:i386
``` ```
Then goto `NS/main/source/linux` and use `make hl_cll` for the client and `make ns` for the server. For windows compilation should be working if you have VS2010 installed.
Then you will need to get the files:
```sh
git clone https://github.com/fmoraw/NS.git
```
Then to build `` and use `make hl_cll` for the client and `make ns` for the server.
```sh
cd NS/main/source/linux
```
For client use `make hl_cll` and for server use `make ns`
Make sure you have `g++-multilib` set up for x64 operating systems. For windows compilation should be working if you have VS2010 installed.
If you get the this error when running the app: `Fatal Error - could not load library (client.so)`, With a high chance it is because of some `UNDEFINED SYMBOLS` in the shared library. But you can check this with this command: If you get the this error when running the app: `Fatal Error - could not load library (client.so)`, With a high chance it is because of some `UNDEFINED SYMBOLS` in the shared library. But you can check this with this command:
``` sh ``` sh
$ ldd -r -d client.so ldd -r -d client.so
``` ```
Make sure you have vgui.so copied to cl_dll folder too on Linux.
## Debugging
If you want to debug: If you want to debug:
```sh ```sh
$ LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH" gdb ./hl_linux r -game ns -dev -steam LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH" gdb ./hl_linux r -game ns -dev -steam
``` ```
Due to the new engine and the nature of Linux I had to make a lot of changes! You can find them with grep -Ril `@Linux`. Due to the new engine and the nature of Linux I had to make a lot of changes! You can find them with grep -Ril `@Linux`.
### Hosting a server ### Hosting a server
Since servers are really rare at this point in time here is a tutorial how to set up an [Natural Selection] server with [hlds]. Since servers are really rare at this point in time here is a tutorial how to set up an [Natural Selection] server with [hlds].
1. Follow these steps: https://developer.valvesoftware.com/wiki/SteamCMD 1. Follow these steps: https://developer.valvesoftware.com/wiki/SteamCMD
2. Copy the [Natural Selection] directory to steamcmd/servers/ 2. Copy the [Natural Selection] directory to steamcmd/servers/
3. Run the game : 3. Run the game :
```sh ```sh
$ ./hlds_run -game ns -autoupdate +map ns_eclipse + sv_secure 1 + port 27015 + ip 127.0.0.1 +hostname "Natural Selection" +maxplayers 32 ./hlds_run -game ns -autoupdate +map ns_eclipse + sv_secure 1 + port 27015 + ip 127.0.0.1 +hostname "Natural Selection" +maxplayers 32
``` ```
If you are behind a NAT(Router) make sure to open at least those ports: If you are behind a NAT(Router) make sure to open at least those ports:
- 27015 UDP (game transmission, pings) - 27015 UDP (game transmission, pings)
- 26900 UDP (VAC service) -- automatically increments if used in case of additional server processes - 26900 UDP (VAC service) -- automatically increments if used in case of additional server processes
@ -82,6 +99,7 @@ There is an updated version of metamod called [metamodp](http://metamod-p.source
- [rcbot linux dlls](http://filebase.bots-united.com/index.php?act=download&id=428) - [rcbot linux dlls](http://filebase.bots-united.com/index.php?act=download&id=428)
### Usefull links ### Usefull links
* [Usefull collection of ns files server addons, maps and erverything ](http://www.brywright.co.uk/downloads/files/index.php?dir=natural-selection/) * [Usefull collection of ns files server addons, maps and erverything ](http://www.brywright.co.uk/downloads/files/index.php?dir=natural-selection/)
* [Great collection of ns guides/tutorials](http://www.naturalns.clanservers.com/forums/index.php?topic=5.0) * [Great collection of ns guides/tutorials](http://www.naturalns.clanservers.com/forums/index.php?topic=5.0)
* [rcbot downloads](http://filebase.bots-united.com/index.php?act=category&id=19) * [rcbot downloads](http://filebase.bots-united.com/index.php?act=category&id=19)

View File

@ -22,6 +22,7 @@ public:
HSPRITE m_hsprCursor; HSPRITE m_hsprCursor;
float m_flTime; // the current client time float m_flTime; // the current client time
float m_fOldTime; // the time at which the HUD was last redrawn float m_fOldTime; // the time at which the HUD was last redrawn
float m_wsFOV; //fov recalc corrected for widescreen
double m_flTimeDelta; // the difference between flTime and fOldTime double m_flTimeDelta; // the difference between flTime and fOldTime
Vector m_vecOrigin; Vector m_vecOrigin;
Vector m_vecAngles; Vector m_vecAngles;

View File

@ -47,52 +47,36 @@ int CHud::UpdateClientData(client_data_t *cdata, float time)
float height = ScreenHeight(); float height = ScreenHeight();
//horizontal+ widescreen view correction - engine uses vertical- //horizontal+ widescreen view correction - engine uses vertical-
//starts with hacked in commander view fix where commander fov was changed to 106 so the black background beind the map is fully rendered - remove that section and change comm fov back to 90 if fixed bool wstoggle = CVAR_GET_FLOAT("cl_widescreen") != 0;
if (gHUD.GetIsInTopDownMode()) if (wstoggle)
{ {
float commFOV; m_wsFOV = atanf(tan(m_iFOV * M_PI / 360) * 0.75 * width / height) * 360 / M_PI;
commFOV = atanf(tan(m_iFOV * M_PI / 360) * 0.5625 * width / height) * 360 / M_PI; //clamp for game balance
if (m_iFOV == 105 && m_wsFOV > 121)
//clamp {
if (commFOV > 107) m_wsFOV = 120;
{ }
commFOV = 106; else if (m_iFOV == 100 && m_wsFOV > 117)
} {
else if (commFOV < 90) m_wsFOV = 116;
{ }
commFOV = 90; else if (m_iFOV == 90 && m_wsFOV > 107)
} {
m_wsFOV = 106;
cdata->fov = commFOV; }
else if (m_wsFOV < 90)
{
m_wsFOV = 90;
}
} }
else else
{ {
float newFOV; m_wsFOV = m_iFOV;
newFOV = atanf(tan(m_iFOV * M_PI / 360) * 0.75 * width / height) * 360 / M_PI;
//clamp for game balance
if (m_iFOV == 105 && newFOV > 121)
{
newFOV = 120;
}
else if (m_iFOV == 100 && newFOV > 117)
{
newFOV = 116;
}
else if (m_iFOV == 90 && newFOV > 107)
{
newFOV = 106;
}
else if (newFOV < 90)
{
newFOV = 90;
}
cdata->fov = newFOV;
} }
cdata->fov = m_wsFOV;
CL_ResetButtonBits( m_iKeyBits ); CL_ResetButtonBits( m_iKeyBits );
// return 1 if in anything in the client_data struct has been changed, 0 otherwise // return 1 if in anything in the client_data struct has been changed, 0 otherwise

View File

@ -137,6 +137,7 @@ cvar_t *cl_forcedefaultfov;
cvar_t *cl_dynamiclights; cvar_t *cl_dynamiclights;
cvar_t *cl_buildmessages; cvar_t *cl_buildmessages;
cvar_t *cl_particleinfo; cvar_t *cl_particleinfo;
cvar_t *cl_widescreen;
/* /*
=============================================================================== ===============================================================================
@ -1544,6 +1545,7 @@ void InitInput (void)
cl_cmhotkeys = gEngfuncs.pfnRegisterVariable ( kvCMHotkeys, "qwerasdfzxcv", FCVAR_ARCHIVE ); cl_cmhotkeys = gEngfuncs.pfnRegisterVariable ( kvCMHotkeys, "qwerasdfzxcv", FCVAR_ARCHIVE );
cl_forcedefaultfov = gEngfuncs.pfnRegisterVariable ( kvForceDefaultFOV, "0", FCVAR_ARCHIVE ); cl_forcedefaultfov = gEngfuncs.pfnRegisterVariable ( kvForceDefaultFOV, "0", FCVAR_ARCHIVE );
cl_particleinfo = gEngfuncs.pfnRegisterVariable ( kvParticleInfo, "0", FCVAR_ARCHIVE ); cl_particleinfo = gEngfuncs.pfnRegisterVariable ( kvParticleInfo, "0", FCVAR_ARCHIVE );
cl_widescreen = gEngfuncs.pfnRegisterVariable ( kvWidescreen, "1", FCVAR_ARCHIVE );
// Initialize third person camera controls. // Initialize third person camera controls.
CAM_Init(); CAM_Init();

View File

@ -177,7 +177,7 @@ void CreatePickingRay( int mousex, int mousey, Vector& outVecPickingRay )
// char gDebugMessage[256]; // char gDebugMessage[256];
float fovDegrees = gHUD.m_iFOV; float fovDegrees = gHUD.m_wsFOV;
//cl_entity_s* theLocalEntity = gEngfuncs.GetLocalPlayer(); //cl_entity_s* theLocalEntity = gEngfuncs.GetLocalPlayer();
//Vector vecRenderOrigin = theLocalEntity->origin; //Vector vecRenderOrigin = theLocalEntity->origin;

View File

@ -47,6 +47,7 @@ extern cvar_t* cl_musicdir;
// : // :
#define kvCMHotKeys "cl_cmhotkeys" #define kvCMHotKeys "cl_cmhotkeys"
#define kvForceDefaultFOV "cl_forcedefaultfov" #define kvForceDefaultFOV "cl_forcedefaultfov"
#define kvWidescreen "cl_widescreen"
#define kvCenterEntityID "cl_centerentityid" #define kvCenterEntityID "cl_centerentityid"
#define kvHighDetail "cl_highdetail" #define kvHighDetail "cl_highdetail"
#define kvCMHotkeys "cl_cmhotkeys" #define kvCMHotkeys "cl_cmhotkeys"

View File

@ -7482,19 +7482,13 @@ void AvHPlayer::GetViewForUser3(AvHUser3 inUser3, bool inIsDucking, float& outFO
{ {
case AVH_USER3_NONE: case AVH_USER3_NONE:
case AVH_USER3_MARINE_PLAYER: case AVH_USER3_MARINE_PLAYER:
//case AVH_USER3_COMMANDER_PLAYER: case AVH_USER3_COMMANDER_PLAYER:
case AVH_USER3_ALIEN_PLAYER4: case AVH_USER3_ALIEN_PLAYER4:
default: default:
outFOV = 90; outFOV = 90;
outOffset = inIsDucking ? kDuckingViewHeightPercentage * HULL1_MAXZ : kStandingViewHeightPercentage * HULL0_MAXZ; outOffset = inIsDucking ? kDuckingViewHeightPercentage * HULL1_MAXZ : kStandingViewHeightPercentage * HULL0_MAXZ;
break; break;
//commander fov upped from 90 to prevent borders of black map background not drawing, compensated in hud_update
case AVH_USER3_COMMANDER_PLAYER:
outFOV = 106;
outOffset = inIsDucking ? kDuckingViewHeightPercentage * HULL1_MAXZ : kStandingViewHeightPercentage * HULL0_MAXZ;
break;
case AVH_USER3_ALIEN_PLAYER1: case AVH_USER3_ALIEN_PLAYER1:
outFOV = 105; outFOV = 105;
outOffset = 0; outOffset = 0;