Giter VIP home page Giter VIP logo

jacoders / openjk Goto Github PK

View Code? Open in Web Editor NEW
1.9K 162.0 603.0 77.74 MB

Community effort to maintain and improve Jedi Academy (SP & MP) + Jedi Outcast (SP only) released by Raven Software

License: GNU General Public License v2.0

CMake 0.40% C++ 56.52% C 42.77% Objective-C 0.02% Batchfile 0.01% Shell 0.01% Dockerfile 0.01% GLSL 0.27%
jedi-academy jedi-outcast star-wars game-development fps tps openjk openjk-mod game game-engine

openjk's Introduction

OpenJK

OpenJK is a community effort to maintain and improve the game and engine powering Jedi Academy and Jedi Outcast, while maintaining full backwards compatibility with the existing games and mods.
This project does not intend to add major features, rebalance, or otherwise modify core gameplay.

Our aims are to:

  • Improve the stability of the engine by fixing bugs and improving performance.
  • Support more hardware (x86_64, Arm, Apple Silicon) and software platforms (Linux, macOS)
  • Provide a clean base from which new code modifications can be made.

discord forum

build coverity

Supported Games

Game Single Player Multi Player
Jedi Academy โœ… Stable โœ… Stable
Jedi Outcast ๐Ÿ˜ง Works, needs attention ๐Ÿ™… Not supported - consider JK2MV

Please direct support queries, discussions and feature requests to the JKHub sub-forum or Discord linked above.

License

OpenJK is licensed under GPLv2 as free software. You are free to use, modify and redistribute OpenJK following the terms in LICENSE.txt

For players

To install OpenJK, you will first need Jedi Academy installed. If you don't already own the game you can buy it from online stores such as Steam, Amazon or GOG.

Download the latest build (alt link) for your operating system.

Installing and running OpenJK:

  1. Extract the contents of the file into the Jedi Academy GameData/ folder. For Steam users, this will be in <Steam Folder>/steamapps/common/Jedi Academy/GameData/.
  2. Run openjk.x86.exe (Windows), openjk.i386 (Linux 32-bit), openjk.x86_64 (Linux 64-bit) or the OpenJK app bundle (macOS), depending on your operating system.

Linux Instructions

If you do not have an existing JKA installation and need to download the base game:

  1. Download and Install SteamCMD SteamCMD.
  2. Set the download path using steamCMD: force_install_dir /path/to/install/jka/
  3. Using SteamCMD Set the platform to windows to download any windows game on steam. @sSteamCmdForcePlatformType "windows"
  4. Using SteamCMD download the game, app_update 6020.

Extract the contents of the file into the Jedi Academy GameData/ folder. For Steam users, this will be in <Steam Folder>/steamapps/common/Jedi Academy/GameData/.

macOS Instructions

If you have the Mac App Store Version of Jedi Academy, follow these steps to get OpenJK runnning under macOS:

  1. Install Homebrew if you don't have it.
  2. Open the Terminal app, and enter the command brew install sdl2.
  3. Extract the contents of the OpenJK DMG into the game directory /Applications/Star Wars Jedi Knight: Jedi Academy.app/Contents/
  4. Run OpenJK.app or OpenJK SP.app
  5. Savegames, Config Files and Log Files are stored in /Users/$USER/Library/Application Support/OpenJK/

For Developers

Building OpenJK

Contributing to OpenJK

  • Fork the project on GitHub
  • Create a new branch and make your changes
  • Send a pull request to upstream (JACoders/OpenJK)

Using OpenJK as a base for a new mod

  • Fork the project on GitHub
  • Change the GAMEVERSION define in codemp/game/g_local.h from "OpenJK" to your project name
  • If you make a nice change, please consider back-porting to upstream via pull request as described above. This is so everyone benefits without having to reinvent the wheel for every project.

Maintainers (full list: @JACoders)

Leads:

Significant contributors (full list)

openjk's People

Contributors

adnanfzafar avatar ahmedtd avatar alexandreblin avatar archangel35757 avatar bibendovsky avatar bszili avatar daggolin avatar deepy avatar devnexen avatar dionrhys avatar eezstreet avatar ensiform avatar exec64 avatar imperatorprime avatar klusark avatar lrns123 avatar madebr avatar monsterovich avatar mrwonko avatar ouned avatar razish avatar redsaurus avatar smcv avatar somaz avatar svoboa avatar taysta avatar xscooper avatar xycaleth avatar yberion avatar zturtleman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openjk's Issues

Don't hardcode animation names

I believe the animation names (BOTH_STAND1 etc.) are hardcoded. That's why there's BOTH_CIN* for level-specific cinematic animations. It would be nice if the names were not hardcoded, and you could just add a new one by listing it in animation.cfg.

The .ibi format does not need to be changed, the animation names are saved as strings in there anyway. It's not until ingame that they're presumably turned into an enum.

Renderer rewrite

I propose that the renderer is rewritten or at least updated to take advantage of the newer graphics techniques which have been available for the past 10 years or so (they were introduced around the same time that JKA was released).

There are many ways the current renderer can be improved. The bottlenecks in the current renderer (from an educated guess) are:

  • All vertex processing is performed on the CPU. All games nowadays offload this work to the GPU which is designed to handle these types of calculations (in parallel).
  • All vertex data must be transferred to the graphics card every frame. Using vertex buffers allows the vertex data to remain resident on the graphics card which are referenced by identifiers. Instead of sending all the vertex to render, the renderer can instead tell the GPU to render vertices from a specific vertex buffer instead.
  • Each shader stage is a separate 'render pass'. This means that a surface may have to rendered multiple times in order to generate the desired outcome. I half-wrote a Q3 shader to GLSL shader translator a few years ago which I may consider finishing to help with this. By doing this, most cases the shader stages should be able to be merged into one render pass.

I'll post a proposed renderer design some point in the near future (hopefully). I probably won't have enough time to code it until June/July so by posting the design, there's a chance someone else can start work on it.

Feature Request: Widescreen/Eyefinity Support

Any chance you guys are going to update these to work properly in widescreen and eyefinity? They can be made to run at any resolution via an ini file, but it'd be nice to have proper resolution detection in the menu, or at the very least just fix the HUD for WS and Eyefinity.

When Return to Castle Wolfenstein's source was released, a guy did a fix for them for widescreen and triplehead, I've mirrored his source code here: https://github.com/thelolotov/RTCW-WSGF

He unfortunately seems to have dropped off the face of the earth, otherwise I'd just ask him.

Anyone willing to give this a go? It would be amazing to have widescreen and eyefinity working properly in these games, and it couldn't be that hard to port from another Q3-based game, his solution was kind of bare-bones, but it worked.

I have the programming capabilities of a legless frog, otherwise I'd try and do this myself, but if there's any way I can help, please don't hesitate to ask. I can clear up any confusion regarding my request, etc. If someone does do this, I can give you guys a plug on wsgf.org, as I am staff there.

Thanks either way, guys!

Mouse centering is a bit wonky with multiple monitors

I've found with jamp that if I have two monitors and put the JKA window on the secondary monitor, the mouse doesn't get locked to the window properly. It seems to lock it towards the left edge of the second screen (sometimes outside of the window) which prevents me from turning/aiming etc. This might be because my second monitor has a different resolution (1280x1024 compared to 1920x1080).

Pull Request Formatting and Better Organization

While I realize this is an early project, I've notices that several commits are a bit... ambiguous in what they are accomplishing, and several of the pull requests don't exactly state what they do. If this project is going to become the main base of all other JK mods, organization is crucial.

For an example of good organization, lets take the Bukkit project as an example. Each pull request plain and simply states exactly what it does. Now to be honest, their formatting standards are ridiculous, but I think we should at least have clear pull requests so that project followers and contributors can easily track progress and see what needs to be done. Some examples of ambiguous pull requests (and now commits) include this commit, this commit, and this one.

On the first link, I had to go in and check the diff just to see what it did, which was change the config files from 'jaconfig.cfg' to 'openjk_sp.cfg.' As such, a more appropriate title would have been Moved SP config file from jaconfig.cfg to openjk_sp.cfg or something similar. For the third, I might have said Merged Linux and Mac ifdefs on dedicated server

Another thing to work on is squashing commits. I know, it's a pain in the rear if you're like me and use a console to do everything Git, but this (again) goes to help with the topic of plain and simple PRs. This might also require a bit of cooperation between the PR commitee and acceptee, since it can be difficult to get people to squash when needed. The only other option is to have the PR acceptee to squash them and then commit them. Again, either way it's a pain, but once this project is up and going it will end up making things a bit more clear.

Now obviously this is just my opinion and is just a mere suggestion, but it is definately something to think about and consider for OpenJK. If anyone has something to add or critique feel free to comment. :)

Remove QVM layer

Remove QVM layer, add import/export tables like the renderer interface.
QVM binaries are not used in JASP/JAMP anyway, the QVM/syscall layer is just extra overhead: CG_Print -> Com_Print -> trap_Print -> CgameSyscalls (pass arguments etc) -> Sys_Print ... or we could just call cgi.Print which points to Sys_Print

If we plan on officially supporting JO, we'll likely need multiple versions of the imp/exp tables for binary compatibility -- or just one large imp/exp table with all necessary functions?

We can also have a simplified syscall layer for legacy purposes (e.g. existing JA+ builds)

From the game/cgame/ui perspective, *_syscalls.c is all that needs changing, it's very easy to port existing code to the new API.

[Question] Platforming

I've been looking for source code for years because I've been developing a project based off JA, and wrote to devs many times to ask for the source but eh, anyway, it's finally released.[/offtopic]
What I'm actually asking about is if OpenJK project is going to be compatible with other two popular platforms - Linux and OS X? This is a thing that have been stopping me from further development of my project for months.
I'd personally love to see support for latest GCC in Linux and Xcode 4.6.1 (possibly clang?).
And so I'd love to suggest that it would be a good idea to use CMake to generate project files for Linux and Mac.

P.S. I'm pretty sure there are many people who are ready to work on Linux stuff if OpenJK aims for cross-platform support. However, not sure if there are any people who are going to port this on Mac, and so I'd love to contribute to this project too by helping with cross-platform code porting. Though my C/C++ knowledge is not more than 'a bit below average', I can test building and fixing some stuff for Mac and Linux support since that one really bothers me.
Thanks in advance.

P.P.S. I am completely new to GitHub, just registered, forked this and posted here for the first time in 5 minutes while being asleep at nighttime. So please, if I posted this in wrong place, don't be angry and explain where to post it in, and I'll fix that.

Ghoul2 Format

Note: This issue is to do with the ghoul2 format, not something that is wrong with the OpenJK project itself.

GLA doesn't allow a 1:1 copy of an animation from XSI ModTool/3DS Max/Blender. Instead, you will get slight 'jitters' in the animation where the bone will 'jump' around at the bone pivot when it is being played. Any high detailed animations will look horrible.

Suggestions: Try to fix the format (start with modview first, before carrying it on into game as it's easier to see fixes) or replace the format entirely with something that is XSI ModTool/3DS Max/Blender friendly.

Adding to levels

It would be nice if at least the entities of a level could be modified, like having any file in <levelname>/*.ent be added to it or something like that.

This would also allow for making changes to original levels (say, showcase a new feature) without getting asset redistribution problems.

"Unable to start program" Error

When I try to run the JediAcademy solution in Visual Studio 2012, I keep on getting a "Unable to start program 'C:\Users\pakn\Desktop\OpenJK\code\game...\Debug\game.dll'." error message. Is anybody else having this issue, or is it just me?

Assets not being loaded from mod folder without fs_game flag

I don't know if this has been fixed yet, but in the original jamp.exe, mod assets weren't loaded properly from the mod folder (e.g. animations, language files, etc) unless the game was launched specifically for that mod using +set fs_game "modname".

SP: Improve "Hub" levels

By using the HUB Spawnflag on a target_level_changer, you can save a level's state and restore that on a subsequent load. This allows for a lot of cool stuff in mods, like splitting big levels in multiple parts.

The technical realization leaves room for improvement though: The level's state as you exit it is saved to save/hub_.sav - the obvious problem here being having multiple parallel playthroughs - you can't save two different states of the map.

I propose a playthrough GUID that is kept across level changes and saved/loaded, but renewed when starting a map via console or the New Game option. This would be used for the hub savegame names, and could incidentally also be used for auto- and quicksaves.

Icarus: Add CVar access (SP)

The set()/get() functions in scripts should be able to operate on cvars to give mod authors more power. This does not require changes to the .ibi format, we could just check if a given name matches a cvar before doing other tests. Optionally, a prefix ("cvar_g_speed") could be added, which would especially make adding new cvars from within scripts easier without changing the format.

64 Bit support

We might want to investigate 64 bit compatibility at some point.

Bink files need purging... which breaks every fork.

Short version: We're illegally redistributing binkw32.lib and bink.h

As Rich Whitehouse noted here, they accidentally included the Bink library. We might face legal issues in the future for having that in our history. For that we'd need to rewrite history, as described here.

As mentioned there though, this will break every single fork done before the rewrite, and users will have to do a rebase as described here under "Recovering from upstream rebase". That makes me a bit reluctant to just do it.

If we're going to do it, it should be done ASAP though, before we get even more forks. (50 is already far too many though...)

There are also still BinkVideo files in client/, those should be removed as well.

Full list of people who forked (We can't know who just downloaded it locally of course.)

SP: Fix SET_PLAYERMODEL in Icarus

I remember a playermodel that got changed via

set("SET_PLAYERMODEL", "...")

from Icarus would lose its textures after saving and reloading. (Needs verification?) Let's fix that.

New GUI/Menu system

The current menu system has a couple of drawbacks, including:

  • Defining looks and data in the same file - Model View Controller could help?
  • Only knowing relative coordinates - having both absolute and relative coordinates would help support different aspect ratios and would add the option to have constant-sized (in pixels) elements, i.e. HUD is smaller on higher resolutions. (Keep high DPI screens in mind though (Retina or whatever apple calls theirs?) - maybe make the Virtual Menu Resolution configurable in the options.
  • Not being very extensible - if two mods want to add to the HUD, they'll conflict.
  • Not being easily customizable - an MMO-like interface that users can rearrange would be nice?

I can look into this at some point, though that's some time off still.

Have multiple quicksaves

In singleplayer, alternate between multiple quicksave slots in case something goes wrong while saving or the player quicksaves in an unwinnable situation (e.g. accidentally saving instead of loading while falling to their death).

SP Combile broken?

We've received reports of SP being broken due to lack of Force Feedback files, which might just be true since they were recently always have been removed. Could somebody check if jasp.exe/jagamex86.dll/jk2gamex86.dll still compile, and see Rich Whitehouse's Commits (particularily the "Fixed all JAMP errors and warnings in Visual Studio 2010, added new project files and upgraded solution file." one) for potential fixes.

JK2 SP merging with JKA SP

What are we going to do about merging the playerState and game_import_t/game_export_t from JK2? I suggest using the JKA one in JK2, and adding all missing fields from JK2 back in, but I'm not totally for sure on that.

Allow additional animations

It would be useful if mods could add additional animations without having to change the original .gla. (Incidentally, that would also help with redistribution, since the new files are no longer modified versions of Raven's assets.)

It could work like this: When loading a .gla, all animations from .gla files in the folder with the name of the .gla get loaded as well. So to add a climbing animation to _humanoid, you'd have

  • models/players/_humanoid/_humanoid.gla/climbing.gla
  • models/players/_humanoid/_humanoid.gla/climbing.cfg

The latter is akin to animation.cfg, but since there can be multiple additional files we obviously need to use a recognizable name.

An obvious problem here is MAX_QPATH - when adding to the animations with already long filenames, the path could easily get longer than 64 characters. As long as the filesystem is able to cope with that it won't be apparent to anybody once the additional animations have been added though.

Some groundwork for this has already been done in SP, where _models/players/humanoid/humanoid<levelname>/humanoid<levelname>.gla is added when playing maps/<levelname>.bsp. (Which also easily reaches MAX_QPATH, by the way.)

This is the XBox Code

Apparently Raven did an Oops and shipped the XBox version's code in the jediAcademy.zip archive, which has a couple of things stripped out and in general does not compile on Windows anymore.

Meanwhile, the jediOutcast.zip archive contains the actual Jedi Academy PC source code. We should use that for this Repo instead.

Some problems with code

Ran Visual Studio 2012's static code analysis on the code, and found these problems:

common.cpp, line 1696

    buf = new char [length + 1];
    FS_Read( buf, length, f );
    buf[length] = 0;

    bufParse = buf;
    parser.Parse(&bufParse, cleanFirst);
    delete buf;

The delete should be delete[]

common.cpp, line 1721:

    buf = new char [length + 1];
    FS_Read( buf, length, f );
    FS_FCloseFile( f );
    buf[length] = 0;

    bufParse = buf;

    parse = new CGenericParser2;
    if (!parse->Parse(&bufParse, cleanFirst, writeable))
    {
        delete parse;
        parse = 0;
    }

    delete buf;

Same as above.

CVec.h, line 595:

    float& radius()                                                         {return v[3];}

v has type float[3] - it has no fields following it.

tr_bsp.cpp, line 1774:

            out->parms.color[3] = 0.0f;

color has type float[3], with a float field following it (which is set in the line below anyway).

General Mind Trick Level 4 Improvements

  • can't control people on speeders properly (buuuuugs!)
  • controlling people = bad prediction mojo
  • viewmodels on tuskens = MESSED UP
  • Remove spacebar from mind control dismount, instead use force powers
  • Add weapon switching to NPC
  • Add force power usage for Jedi

Missing Ghoul2 library

I finally got Jedi Outcast to compile under Visual Studio 2012, but now I am getting linking errors for SG_read (I have no idea which library could this be) and Ghoul2 (I can't find a lib or dll file anywhere, not even the source but its source lies somewhere in the code folder).
As soon as #5 is merged, I will upload my fixes here

Jedi AI avoiding cliffs/pits?

So in JA and I'm assuming JK2, jedi/reborn NPCs have no recognition of pitfalls or lack of ground when they're moving, and often run/jump off cliffs/into pits without any regard if there in an open area.

Now I know Jedi don't use waypoints, but they're smart enough to know when they can leap up/down after you, so is it possible similarly they could have some awareness of areas where they could fall? It's beat you can't really have jedi in open areas because they won't pay attention to cliffs and stuff.

Electrobinoculars and 1st-person lightsaber/melee for JA from JK2 SP?

So the electro-binoculars view is messed up in JKA SP, works fine for everything except lightsabers/melee which have no 1st person view, so it forces it to stay in 3rd person.

Any chance this could be fixed, and maybe the 1st person lightsaber view could be brought back from JK2?

I heard JK2 used it's own special transparent model for 1st person sabers, but JA could just use some variation of the cg_thirdpersonalpha cvar to some extent, which doesn't work but I think is supposed to make the playermodel look transparent...

Also, I would love to see the screenshotted save games return from JK2...

SP: "Death menu" doesn't show when killed by friends (after betrayal)

After playtesting for a few minutes, being the person I am, I decided to repetitively stab Kyle on yavin2 (training grounds), who in turn killed me. However, after I died the death menu that has the load save, quick load, change level thing did not appear.

After multiple tests, the same bug recurred. Also, I should note, that after betraying your friends, you can get the epic slow-mo shots while killing them. I particularly enjoyed killing Rosh in slow motion. >:)

pic of no menu
pic of me epically killing Rosh
another pic of me epically killing Rosh

Prebuilt Binaries

How soon are we going to distribute prebuilt binaries? How far along is Mac/*nix compat?

crash on startup bug

If the mp binary is not called jamp.exe, it crashes due to stack trashing or something like that. Apparently some driver-level application-specific legacy-hacking going on. Let's find out what the problem is (OpenGL Extensions?) and fix it.

IRC channel for openjk

I couldn't find any IRC channel about this project, perhaps I simply missed it.
It might be worth creating one and mention it on the main page of the project to help people involved getting in touch.

forget this

Meant to create a milestone, not an issue.

Recognise new CPU models

Probably want to add some code to allow modern CPUs to be recognized. JKA still thinks I'm using a Pentium IV (I'm using a Core i5).

libpng for PNG loading

We should use libpng for PNG loading, since it's likely better than what Raven hacked together.

Old message:

Just opening this so people see they do not have to do this. I'm on it in my CMake branch, which will be merged back once I'm done with it.

Supported ROQ resolutions?

What video resolutions does the ROQ format support? Are HD videos possible? Can the ROQ creator handle higher resolutions? (I think we've got its source?)

Integrating SP into MP

Just thought I'd create an issue regarding this. We're evaluating adding the SP features to MP in order to have only one codebase. I'd be willing to look into this at some point, I think it would be very useful. It would likely be done through a mod.

Default cvar values

com_maxFPS 85 -> 125 see http://jkhub.org/topic/1669-/?p=19939
rate 4000 -> 25000 because 4kB/s is not enough for up+down
sv_fps 20 -> 40 to improve saber collisions and general responsiveness (50msec vs 25msec)
snaps 20 -> 40 and/or synchronise with broadcast sv_fps ala CPMA
r_picmip 1 -> 0 if people want low resolution textures, they'll do that themselves. 0 is not unreasonable on hardware in the last 10 years.
r_mode 4 -> -2 with native res support @ensiform :D?
sv_master2 N/A -> master.jkhub.org
g_maxForceRank 6 -> 7 (real max)
cl_maxpackets 30 -> 63 (~2 usercmd/packet with 125fps/8msec)

Objections?

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.