Giter Club home page Giter Club logo

_ef2-game-source's Introduction

This code has been patched by GSIO to work with
VisualC++, tested in VS 2005 and VS 2010.

Patched by Chrissstrahl to work with Visual Studio Community 2022 - 2022.03.20


This is the game source for Star Trek Elite Force II.  The package contains all of the 
server side game code for singleplayer and multi-player and it includes all of the 
changes up to and including the 1.10 patch.

How To Use
----------
When compiled it will create the file gamex86.dll which will be placed in the
.\executable\Debug directory or the .\executable\release directory depending on 
if you are creating a debug or a release build of the dll.

You can either replace the old gamex86.dll from the full game (although you
should back it up) or you can change which game dll the executable uses
by specifing which one to use at the command line.

ex.
EF2 +set gamedll c:\projects\EF2\executable\debug\gamex86.dll

NOTE: the code has only been tested under Visual Studio 6.0.


Quick layout of the code
------------------------

multiplayer code:

mp_manager      - manages all of the multiplayer code

mp_modeBase     - the base class for all of the modes (dm, team, ctf, etc.)
mp_modeTeamBase - code that is shared between for all team related modes

mp_modeDM       - all deathmatch related code
mp_modeTeamDM   - all team deathmatch specific code
mp_modeCtf      - all CTF related code

mp_modifiers    - all of the code for the various modifiers (action hero, disintegration, etc.)


main class hierarchy:

class - base class, allows safe pointers
  listener - adds event handling
    entity - basic entity class
      sentient - anything that thinks on its own
        actor - AI creatures
        player - the player(s) of course
      trigger - a host of different kind of entities that are turned on in some manner (touch, damaged, etc) to do a specific task
      item - your basic item
        weapon - weapons that can be used by sentients (players or actors)
        powerups - special items that can be picked up, are automatically used, and usually last a specific amount of time

This hierarchy only shows a small portion of the code base but it is a fairly good start at understanding
it.
  

Restrictions
------------
This code and the dll that it will build will only work with a full copy of Star Trek Elite Force II.

All code and contents included in this package are
Copyright (C) 1998 by Ritual Entertainment, Inc.
All rights reserved.

This entire package is supplied as is.  Ritual and Activision will not provide any support.

See the file licenseAgreement.txt in this package for the full license agreement.

_ef2-game-source's People

Contributors

chrissstrahl avatar

Watchers

 avatar  avatar

_ef2-game-source's Issues

Player not getting disconnected correctly from server if sv_floodprotect enabled

If player kills him self, or goes into spectator or changes their model, then disconnects immediately player will not be disconnected correctly from the server a ghost will remain on the server. If Player reconnects player will retain all previous settings like location, team, points, ect...

Command being stalled/dropped if sv_floodprotect is enabled

This might not be fixable other than by temporarly disabeling sv_floodprotect if player gets killed, as the score command was not yet issued and the disconnect command is being stalled already.
console command arrived at gamecode: kill
User1 ^8commited suicide^8
stalled clientCommand (disconnect) for User1
User1: Delta request from out of date packet.

Bots freeze when using "restart"

Multiplayer Bots freeze with ping 999 and get dropped after a while if level is restarted with "restart", instead of being loaded with map command

water/drowning - Restore health lost by drowning fully after leaving waterlevel 3

Health is not yet restored fully after emerging out of the water.
Damage(substraced health) that is given to player while under water by drowning should be restored to health again.
The primary goal is to keep compatibility and NOT to add any new variables to Player class.

Related variables and functions:
void Player::WorldEffects( void )
player->air_finished
player->drown_damage
player->health
player->waterlevel

Physics issues - Gravity - m6-exterior

Level on which the issue is apperent: m6-exterior
Specific Script Command: $world.physicsvar ( "gravity" , 80 );
Script Command translates to Gamecode:

//Updates each sv_frame in:
void World::Think( void )
//to cvar:
gi.cvar_set( "sv_currentGravity", va( "%f", temp_gravity ) );

sv_currentGravity->value

How to recrate: Load the Level in Singleplayer and make sure you have V-Sync Off and you com_maxfps set to something above 75 FPS, like for example 120 and compare the speed at which you glide down after a jump with fps at (com_maxfps 75) an (com_maxfps 120). The higher the FPS the slower you will glide down.

Conditions:
g_gametype 0;
g_gametype 1; dedicated 0;
Singleplayer/Listen Server, Offical Relase 1.1, the GOG Version has a "fix" that limits the FPS to 85 at which the issue isn't as apparent.

The issue does not occur on dedicated servers, it is reasonable to assume that it has to do with something where the game uses CLIENT 0 gameframes for the calculations. There probably is a math inaccuracy or a limit missing. I have not really looked into that issue.

sv_currentGravity

sundown - level creating crash - with bots_enable 1

Custom level sundown https://www.gamefront.com/games/elite-force-2/file/sundown
creating a crash upon load if bots are enabled.

A recompiled AAS file did not resolve the issue.
As far as I recall this map always had issues, I just don't remember if it was this specific issue.
The level was specifically designed for the ULTIMATE PATCH MOD.
The error occours on windows/linux and listen/dedicated.

Conditions:
g_gametype 1;bots_enable 1;

Related functions:
int BotAILoadMap( int restart )

Specific location at which the ACCSESS VIOLATION occurs:

int BotAILoadMap( int restart ) {
	int			i;
	vmCvar_t	mapname;

	if (!restart) {
		gi.Cvar_Register( &mapname, "mapname", "", CVAR_SERVERINFO | CVAR_ROM );
		gi.BotLibLoadMap( mapname.string ); //<- ERROR - ACCSESS VIOLATION <-
	}

	for (i = 0; i < MAX_CLIENTS; i++) {
		if (botstates[i] && botstates[i]->inuse) {
			BotResetState( botstates[i] );
			botstates[i]->setupcount = 4;
		}
	}

	BotSetupDeathmatchAI();

	return qtrue;
}

Physics issues - Falldamage on slopes - Randomly "ducking" on slippery/icey surfaces

  • Issue occures on all levels, in SP and MP, best observed in Multiplayer.
  • Occures on Windows and Linux.
  • Issue is also pressent on the Patched 1.1 gamex86.dll, but it does NOT do falldamage.
  • My guess is that falldamage is caused by bad code when using modern more accurate compilers.
  • Slopes are exactly angled 45° facing towards the player like a ramp
  • similar behaviour is occuring if player slides down a pipe build from a patch-mesh
  • slipery(SURF_SLICK) surfaces cause the player viewcam to randomly duck (swsglobe)

You might have to noclip exactly at the place or use: script $player origin "x y z"
Paste text with the middle mousebutton into the game console.

1. m9l1b-klingon_base
Origin: 2442 1458 485 - On level start jump on the pipes on the $player origin "2442 1458 485"
right side and try to get stuck between two pipes the view/player
cam starts to tilt and roll now crouching will kill you with falldamage
This is easy to reproduce

2. m5l2b-drull_ruins1
Origin: 11093 81 200 - On the angled Incubation Tube near the Lifts. $player origin "11093 81 200"
when sliding slowly down, this is difficult to reproduce

3. swsglobe (only g_gametype 1/multiplayer)
This is very easy to reproduce.
Link: https://www.gamefront.com/games/elite-force-2/file/sws-globe
File: SWSxmas.pk3
Mapname: swsglobe
Instructions: Approach the center platform on one of the 4 slopes, even if you aproach very slowly it will push you away on high speed after it killed you with falldamage.

Issue is probably related to "PM_WalkMove" or "void PmoveSingle (pmove_t *pmove)" and "pm->landedVelocity" in bg_pmove.c

Actor::playdialog - crashes the game if headhud is enabled in multiplayer

In function: Player::handleDialogSetup( Entity* entity, const str& soundName )
The following code causes a crash: _dialogEntnum = entity->entnum;
_dialogEntnum is set on: client->ps.dialogEntnum

It does not crash with version 6.0021 of the Coop Mod,
how every I can not recall or figure out how it was fixed.

disassembly_

bots - hudprint/hudsay - sending commands to bots- creating crash

A workaround fix has been implemented, see 49b917f

Sending certain commands to bots will create a crash.
Level which raised awareness: ctf_faceoff - if a bot jumps off into a trigger that does a hudprint to activating client
The Hudprint that creates the issue:
e.hudPrint("^5Thanks to: ^7Avenger,Explorer,GSIO,Mystiqe,Stupidus,Modboy,Ronnin,Marvelman,Metar\n");
This translates to the following gamecode:

command = "hudprint \"^5Thanks to: ^7Avenger,Explorer,GSIO,Mystiqe,Stupidus,Modboy,Ronnin,Marvelman,Metar\n\"\n";
gi.SendServerCommand( edict - g_entities, command.c_str() );

Related Functions:
void Player::hudPrint( const str &string )
void MultiplayerManager::HUDSay( int entnum, const str &string )
Might also be related:
int BotAI(int client, float thinktime)

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.