Coder Social home page Coder Social logo

avoitishin / xray-16 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openxray/xray-16

9.0 9.0 6.0 55.92 MB

XRAY 16 Engine Modifications

License: Other

C 25.72% Assembly 0.15% C++ 60.88% Perl 0.04% TeX 7.58% Shell 0.23% Objective-C 0.47% Haskell 0.01% JavaScript 0.01% C# 0.11% Pascal 4.12% Makefile 0.25% CSS 0.03% Lua 0.38% Cuda 0.05%

xray-16's Introduction

XRAY 16 Engine Modifications


This repository contains XRAY Engine sources based on version 1.6.02. The original engine is used in S.T.A.L.K.E.R. Call of Pripyat game released by GSC Game World and any changes to this engine are allowed for non-commercial use only (see License.txt for details).

Note that Master branch contains stable code that is documented on Wiki but you can also checkout Working for nightly builds

  • Build instructions can be found here (not updated for this code base yet).
  • If you find a bug or have an enhancement request, file an Issue.
  • Please go to our Wiki pages for detailed description of changes and other useful information.

Pull requests appreciated! Just check out the task list and follow our procedures. (not updated for this code base yet)

xray-16's People

Contributors

andrew-boyarshin avatar avoitishin avatar awdavies avatar casualdev242 avatar highflex avatar loner1 avatar revolucas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xray-16's Issues

Utilizing 3rd person weapon animations

I just noticed that you added a check for the existence of 3rd person weapon animations to the code. I'd like to use this as Shoker mod 2.1 has them and I think I can simply recompile the OWR and UWR guns on those animation sets with those animations.

The question is: how does it work? I mean, if there's a shoot animation in the world model does the code know to use it? Or, do I need to write a script to use it?

Missing MSVCP120.dll error

One of the Redux team members is trying to use the latest binaries from this repo, but is getting this error:
http://puu.sh/eciO7/5ad724199f.png

It seems to be related to the C++ redistributable, but he's got the 2013 C++ Visual Studio redistributable installed and it's still happening.

I don't have this problem personally, so I'm not sure what's going on.

He's running Windows 8 x64, just like I am.

build of xrGame.dll fails on x86/32-bit Windows systems

I tried to build the complete solution with Release config on an x86/32-bit Windows system, and xrGame failed to build with this error (everything else compiled flawless):

LNK1318: Unexpected PDB error; OK (0) ''

I guess, that the building of xrGame hit the memory barrier or the pdb files were growing too large, and the linker surpassed the 4 gb limit. Are there any chance to split the xrGame to multiple modules?

I tried:

  • remove all pdb files from intermediate folders: same error
  • for xrGame Project properties -> C/C++ -> Code Generation -> Enable Function Level Linking -> Yes and now i get this error: C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(242,5): error MSB6006: "CL.exe" exited with code -2147483645.

Armor piercing

This is more of a question than an issue or bug.

I was searching through the code to see how k_ap is calculated against people.
To my surprise, it looks as though there is no such function, there is only a function to get the material type from gamemtl.xr
This is based on looking at lines 416 - 425 in Level_bullet_manager_firetrace.cpp.

I tried testing this theory in game by setting a gun to 0.25 damage, and then with the ammo I set the FMJ's and JHP's to have the same stats, except k_ap, which was 0.02 for the FMJ and 0.8 for the JHP. It appeared from my testing (shooting mercs in the torso) that they would go down in the same number of shots.

It appears that armor is done on NPC's through values in damages.ltx and immunities.ltx, but that k_ap has no actual affect on body armor at all. It's only there for materials (wood, brick, etc.).

Am I correct or am I missing something?
I'm not asking you to fix this, just curious if I have come to the correct conclusion?

Compiling Latest Revision, lua.hpp missing

Hey there,

I noticed that i get a missing lua.hpp when i try to compile your recent revision?

Probably related to luajit-2 i guess.

Errors i get on lua_extensions || luabind :

1>c:\projects\xray_engine\cop_branch\development\xray-16\src\3rd party\lua-extensions\script_additional_libs.h(5): fatal error C1083: Cannot open include file: 'lua.hpp': No such file or directory

How did you make sure that

include "lua.hpp"

gets found?

Ability to download builds

Good afternoon!
We need something like nightly builds from master and working branch. For example, every one or two week upload on MEGA. I can do this in main repo (OpenXRay), but not this week - I have no access to fast Windows PC with VS 2013.
And it will be great for others, who want to get latest features, performance improvements and bugfixes.
Thanks.

Can't seem to compile

I have the enviroment for libs set as

E:\lib\

Yet when I try to compile I get several errors like

Error 4 error C1083: Cannot open include file: 'ogg/os_types.h': No such file or directory e:\dev\libraries\libvorbis\lib\os.h 25 1 libvorbis_static

Why isn't it even looking for the includes in my set enviroment?

Sun direction fix

Swartz27:
Instead of just the sun direction fix, allow for working sun_altitude and sun_longitude commands. Although the sun direction fix works, it doesn't fully work with Atmosfear 3. The modified dll originally used with Atmosfear 3 enabled usage of those two commands which is how he was able to set the sun and moon direction and longitude. You can see an example of the sun direction fix not working the best as the moon doesn't ever show up with it, due to the lack of those two commands.
To give you a push in the right direction, the fixed dll's he used for this were only the render dll's, so something needs to be corrected there.

Feature requests: OpenAL Soft & Stalkers dying in anomalies

I realize you're not back to doing things yet as you're bored with Stalker but if/when you come back, I was thinking it would be nice to see OpenAL32 replaced with OpenAL Soft.

It has many benefits, including:
support for mono, stereo, 4-channel, 5.1, 6.1, 7.1, and HRTF output.
EFX for environmental audio effects.

I realize it would be a big undertaking but I think people would be able to appreciate the effort if they could pick true surround sound in-game in Stalker, or pick HRTF if using headphones.

I also realize that OpenAL Soft can work without being integrated, but I think most people won't bother to install it, and to make things more streamlined people would be able to pick these option in the game's sound menu.


The second feature I would like to see is NPC's being killed by anomalies. Both myself and Alundaio have looked through the code, comparing it to the SOC code, to see why NPC's aren't being damaged, but so far have not come up with a solution.

I did notice the following in the scripts for npcs and wonder if it's disabling damage from anom's:
new_action:add_precondition(world_property(stalker_ids.property_anomaly,false))

Also Alundaio found an issue in CAI_Stalker::inside_anomaly in ai_stalker_fire.cpp that may relate to it.

If you can figure it out it would be an amazing addition to Stalker:COP.

Implement workaround for 'error in stalker with visual'

Alter the method on line 223 of xrGame\stalker_animation_manager_update.cpp as shown below:

void CStalkerAnimationManager::update                  ()
{
    START_PROFILE("stalker/client_update/animations")
    try {
        update_impl            ();
    }
    catch(...) {
        Msg("Error in stalker with visual [%s]",*object().cNameVisual());
        global().reset();
        head().reset();
        torso().reset();
        legs().reset();
        return;
    }
    STOP_PROFILE
}

To prevent this error:

! error in stalker with visual actors\stalker_merc\stalker_mercen2b_mask stack trace:

0023:08C6FA61 xrGame.dll, CStalkerAnimationPair::select_animation(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\stalker_animation_pair.cpp, 242 0023:08C6FA96 xrGame.dll, CStalkerAnimationPair::select(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\stalker_animation_pair.cpp, 257 0023:08C6B61A xrGame.dll, CStalkerAnimationManager::global_critical_hit(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\stalker_animation_global.cpp, 74 0023:08C6B693 xrGame.dll, CStalkerAnimationManager::assign_global_animation(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\stalker_animation_global.cpp, 98 0023:08C6D0BC xrGame.dll, CStalkerAnimationManager::play_global(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\stalker_animation_manager_update.cpp, 162 0023:08C6D1FC xrGame.dll, CStalkerAnimationManager::update_impl(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\stalker_animation_manager_update.cpp, 223 0023:08C6D270 xrGame.dll, CStalkerAnimationManager::update(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\stalker_animation_manager_update.cpp, 16707566 0023:08C65420 xrGame.dll, CAI_Stalker::SelectAnimation(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\ai\stalker\ai_stalker.cpp, 1151 0023:08BC39CA xrGame.dll, CCustomMonster::UpdatePositionAnimation(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\custommonster.cpp, 566 0023:08BC6B66 xrGame.dll, CCustomMonster::UpdateCL(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\custommonster.cpp, 525 0023:08C68472 xrGame.dll, CAI_Stalker::UpdateCL(), d:\stalker\source\cop\vs_2008_experimental\engine_vs2008_fixed\xrgame\ai\stalker\ai_stalker.cpp, 892 0023:0041A694 xrEngine.exe, CObjectAnimator::operator=() 0023:004168C3 xrEngine.exe, CBoneData::operator=() 0023:09075D74 xrGame.dll, PI_DIV_2() 0023:090FDE2C xrGame.dll, GS_ExceptionPointers()

[error][ 8] : Not enough storage is available to process this command.

DirectX11 not working

Myself and r_populik cannot get the R4 renderer to function properly. For both of us, promptly on game start it shows an error box saying my video card doesn't meet game requirements.

Neither of us are using modified shaders, as I know that is what normally causes that particular error.

The code in question is identical the code in your working branch.

Game Over and Death Cam

Is anyone else having an issue with the game_over tutorial not triggering on death since the commit where FP_DEATH define was added?

'Your video card doesn't meet game requirements'

Just gone back to test the modified bins again and have run into this issue.

When I try to launch the game with the latest binaries, I get this message.

http://puu.sh/ezgSx/bc5dac6770.jpg

I deleted my user.ltx, and the game then launched fine. I reset all my graphics settings again (all max on DX11) and restarted, then the error reappeared.

The error does not happen with vanilla binaries, and the game launches fine.

Feature request: Additional callbacks

It would be totally awesome if the following callbacks were implemented:

  • npc_take_item
  • npc_take_item_from_corpse
  • npc_take_item_from_box
  • npc_drop_item

Fatal error....error

http://imgur.com/6DlUR1A

This error pops up every once in a while due to changes in the scripts it doesn't like (this one being caused from a new faction added that the game doesn't like I do believe).

The problem isn't the error screen, it's the fact that you can't escape it. If you hit okay, it takes you to the Xray process to close the program, and as soon as you do the error screen pops up again, and the process repeats itself.
The only way of escaping it is by doing ctrl+alt+del and restarting your PC.

xrCore.dll get this error in the console

When you compile xrCore.dll get this error in the console.

! VERIFY_FAILED: FS.cpp[423] {IReader::r} Pos + cnt <= Size
! VERIFY_FAILED: FS.cpp[423] {IReader::r} Pos + cnt <= Size
! VERIFY_FAILED: FS.cpp[423] {IReader::r} Pos + cnt <= Size
! VERIFY_FAILED: FS.cpp[423] {IReader::r} Pos + cnt <= Size
! VERIFY_FAILED: FS.cpp[423] {IReader::r} Pos + cnt <= Size
! VERIFY_FAILED: FS.cpp[423] {IReader::r} Pos + cnt <= Size
! VERIFY_FAILED: FS.cpp[423] {IReader::r} Pos + cnt <= Size
! VERIFY_FAILED: FS.cpp[423] {IReader::r} Pos + cnt <= Size
! VERIFY_FAILED: FS.cpp[423] {IReader::r} Pos + cnt <= Size

'clsid' crash, _g.script

We've been running into a really strange issue lately, where the game will randomly crash with the following error:

FATAL ERROR

[error]Expression : fatal error
[error]Function : CScriptEngine::lua_error
[error]File : ..\xrServerEntities\script_engine.cpp
[error]Line : 180
[error]Description :
[error]Arguments : LUA error: ...n\stalker call of pripyat\gamedata\scripts_g.script:331: attempt to call method 'clsid' (a nil value)

stack trace:

0023:0077723F xrCore.dll, xrDebug::fatal()
0023:0A441835 xrGame.dll, CDialogHolder::IgnorePause()

It's very random, I can't seem to replicate it, and doesn't seem caused by anything specific, it just happens.

What we seem to be seeing is that our random weapon system is calling IsStalker() on an object when it spawns to check whether to proceed with spawning weapons and ammo, this function then checks for a clsid, which returns nil and causes the crash.

That's what we think, at least!

Hoping you guys could perhaps shed some light or more info on the issue.

DPI / HUD scaling independent of resolution?

I am asking if it would be possible to make DPI and HUD scaling not dependent on the resolution but on a setting changeable from the game options and tweakable in user.ltx, which allows people to set up appropriate font and hud scaling on resolutions like 4K, where fonts are so little that they're barely visible. Best example of this issue is when you launch Stalker on DSR.

About HUD scaling, it would be pretty okay to have HUD scalable too. Sometimes, resized textures based on what resolution is Stalker being played at, can make a custom, or even vanilla HUD, look awful.

First shots fire at different RPM

Swartz27:
Add an ability for weapons like the Abakan to function properly. GSC made code that allows the gun to fire two bullets at a different bullet speed. What they should have done, as I believe was intended, was allow the Abakan to fire two shots at 1800 RPM then switch back to it's normal RPM (600) the rest of the time.

Shotgun spread

Right now the spread depends on stance, aiming, crouching etc. which is total nonsense for a shotgun loaded with shot. These factors should only affect the gun when using slugs.
Suggested change:

float CActor::GetWeaponAccuracy() const
{
    CEntity::SEntityState state;

    if (g_State(state))
    {
        CWeapon* W = smart_cast<CWeapon*>(inventory().ActiveItem());
        int buckShot = 0;

        if (W != NULL)
        {
            if (!W->m_magazine.empty())
            {
                buckShot = W->m_magazine.back().param_s.buckShot;
            }
            else
            {
                CWeaponAmmo *pAmmo = (W->m_pCurrentAmmo != NULL) ? W->m_pCurrentAmmo : smart_cast<CWeaponAmmo*>(W->m_pInventory->GetAny(W->m_ammoTypes[W->m_ammoType].c_str()));
                buckShot = (pAmmo != NULL) ? pAmmo->cartridge_param.buckShot : 0;
            }
        }

        if (buckShot > 1)
        return 0.0;

        float dispersion = m_fDispBase * GetWeaponParam(W, Get_PDM_Base(), 1.0f);

        if ( IsZoomAimingMode() && W && !GetWeaponParam(W, IsRotatingToZoom(), false) )
        {
            return m_fDispAim;
        }

        //fAVelocity = angle velocity
        dispersion *= ( 1.0f + (state.fAVelocity/VEL_A_MAX) * m_fDispVelFactor * GetWeaponParam(W, Get_PDM_Vel_F(), 1.0f) );
        //fVelocity = linear velocity
        dispersion *= ( 1.0f + (state.fVelocity/VEL_MAX) * m_fDispVelFactor * GetWeaponParam(W, Get_PDM_Vel_F(), 1.0f) );

        bool bAccelerated = isActorAccelerated( mstate_real, IsZoomAimingMode() );
        if ( bAccelerated || !state.bCrouch )
        {
            dispersion *= ( 1.0f + m_fDispAccelFactor * GetWeaponParam(W, Get_PDM_Accel_F(), 1.0f) );
        }

        if ( state.bCrouch )
        {    
            dispersion *= ( 1.0f + m_fDispCrouchFactor * GetWeaponParam(W, Get_PDM_Crouch(), 1.0f) );
            if ( !bAccelerated )
            {
                dispersion *= ( 1.0f + m_fDispCrouchNoAccelFactor * GetWeaponParam(W, Get_PDM_Crouch_NA(), 1.0f) );
            }
        }
        return dispersion;
    }
}

Great work

Sorry for filing this as an "issue" but I don't know how else to contact you.

I'm not sure if you take requests, but if you do, I have two suggestions:

  1. Add an ability for weapons like the Abakan to function properly. GSC made code that allows the gun to fire two bullets at a different bullet speed. What they should have done, as I believe was intended, was allow the Abakan to fire two shots at 1800 RPM then switch back to it's normal RPM (600) the rest of the time.

  2. Instead of just the sun direction fix, allow for working sun_altitude and sun_longitude commands. Although the sun direction fix works, it doesn't fully work with Atmosfear 3. The modified dll originally used with Atmosfear 3 enabled usage of those two commands which is how he was able to set the sun and moon direction and longitude. You can see an example of the sun direction fix not working the best as the moon doesn't ever show up with it, due to the lack of those two commands.
    To give you a push in the right direction, the fixed dll's he used for this were only the render dll's, so something needs to be corrected there.

Great repo btw, the best repo of the code I've seen so far and you also appear to be the only one currently working on any fork of this code.

Is this fork dead?

No updates in a while. Just curious if you're taking a bit of a vacation like Alundaio and Bangalore, or if you're done coding for a while? I check here every day hoping you've done something new, but I realize you have to have a life :P

A very strange idea

Is it possible, and how much would it take, to create a bridge between engine/lua and csharp application?

At this point, i'm curious, how much time and pain would it take to implement this. This csharp application will work in separate thread on low priority. Main goal is to create very large amount of interesting situations between stalkers and creatures.

For example: A group of stalkers decided to go on Radar. A few days for preparations, few broadcast messages, few days of quite road. Meanwhile, information leaks, and a group of bandits knows, that very soon, a group of stalker will return from Radar and they might have a few very interesting artefacts.

When stalkers going back, they will meet bandits, last will win. Then, while returning to Dark Valley, they will encounter a stress-amount of creatures, or, maybe they will go through those location, where player might be. Or, maybe non of it.

Meanwhile, lonely stalker found bodies and sent broadcast message. Friends of dead stalkers decided to go after bandits. Meanwhile, bandits sending private message to base, that they have very large amount of artefacts. This message intersepted by Mercs, and they already on they way.

All this, can be curated in background thread, with broadcast messages, tasks for npcs, creatures and etc. Yes, it could be developed under lua, but i dont like it very much, and there might be a few problems with calculating everything in background while player is playing (heavy fps-drops).

The questions are:

  • Is it possible to create a bridge, between engine and csharp-app, that will have full access to game? For example - executing lua-code.
  • How much time might it take, and can you develop very tiny example (i mean bridge), so i could start testing this idea?
  • And most important - is it interesting to you?

Example: with ability to execute lua script, i can create a very comfortable and low-memory consumption broadcast news. Modmakers will be able to create a large amount of news, but they wont be loaded at once. Also, it would be easy to test it in program, rather than launching game each time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.