vegastrike / Vega-Strike-Engine-Source

Vega Strike Engine
Other
260 stars 44 forks source link

Vega Strike Space Simulation Engine

CI - GitHub Actions - CodeQL Gitter Vega Strike

#====================================
# @file   : README.md
# @brief  : quick repo guide
#====================================

Vega Strike Space Simulation Engine

Vega Strike is a Space Flight Simulator that allows a player to explore, trade, and fight in the vast open space. You start in an old beat up cargo ship, with endless possibilities in front of you and just enough cash to scrape together a life. Yet danger lurks in the space beyond.

Features

How to Run

Either install Vega Strike from the binary installer for your platform, if available, or follow the instructions for compiling from source. (Compiling Vegastrike, below.)

Vegastrike command line parameters allow for different start settings and are as follows

  vegastrike-engine -ddata_dir [-px,y,z] [-jsector/starsystem] missionname

OPTIONS
  -d/my/data/dir
    specifies /my/data/dir as the path for finding the vega strike data.  De-
    fault is /usr/local/share/vegastrike/data

  -p1024,2405,1245090101
    Forces  the  player's  starting  location  to  be  at  x=  1024, y= 2405,
    z=1245090101

  -jgemini_sector/troy
    Forces the player to start in the troy system in gemini sector.

  missionname
    Specifies  a  mission  for  vegastrike  to  run.   Default  is   /usr/lo-
    cal/share/vegastrike/data/mission/exploration/explore_universe.mission.

Vegastrike takes a single command parameter indicating which mission it should load

bin/vegastrike mission/explore_universe.mission -d../Assets-Production

is an example of a valid mission call

the -l flag (must be flushed with the system) will force a player to begin in a star system.

bin/vegastrike -lvega_sector/vega mission/bomber.mission -d../Assets-Production

will force the bomber mission to run in the vega sector.

Executable Name Changes

Note that the executable names have changed since the 0.5.x releases. Now, you configure game settings using vegasettings, and run the game itself using vegastrike-engine. With the latter, the data directory (-d...) is now a required parameter. This is to allow using the Vega Strike Game Engine with multiple games (asset sets), including Upon the Coldest Sea (vsUtCS), PWCU, and others.

Also note that when you install vsUtCS, it comes with a script called vsettings that automatically runs vegasettings with the correct data directory, and another script called vs that automatically runs vegastrike-engine with the correct data directory. These scripts are the recommended way to run the game Vega Strike: Upon the Coldest Sea. You should see shortcuts to them on your desktop, Start Menu, or similar.

If you encounter any issues while playing, please create an issue with the Vega Strike development team by posting a new issue.

REQUIRED FILES

  /usr/bin/vegastrike-engine
      The vegastrike engine, requires `-d` to specify the data set.
  /usr/bin/vegastrike
      The vegastrike engine with legacy data set search support
  /usr/local/bin/vsinstall
      The Setup utility.
  /usr/local/bin/vslauncher
      The vegastrike save game and mission selection utility
  /usr/local/bin/vegasettings
      Internal installer program
  /usr/local/share/vegastrike
      The vegastrike data files
  /usr/local/lib/man/man1
      Directory containg the manual files
  ~/.vegastrike
      Directory containing user specific data managed by vegastrike.
  ~/.vegastrike/vegastrike.config
      User-specific configuration file

Compiling Vegastrike

Compiling On Linux

  1. Install the development dependencies:

    a. Run sudo script/bootstrap

    b. OR install the dependencies manually. Something like this:

    sudo apt-get -y install cmake g++ python-dev libboost-python-dev libboost-log-dev \
                   libboost-regex-dev libgl1-mesa-glx freeglut3-dev libopenal-dev \
                   libsdl-gfx1.2-dev libvorbis-dev libjpeg-dev libpng-dev libgtk-3-dev

    On Debian 10 "buster":

    sudo apt-get -y install git cmake python-dev build-essential automake autoconf libpng16-16 \
                   libpng-dev libpng-tools libjpeg62-turbo-dev libexpat1-dev libgtk-3-dev \
                   libopenal-dev libogg-dev libvorbis-dev libgl1-mesa-dev libsdl1.2-dev \
                   libpostproc-dev freeglut3-dev libboost-python1.67-dev libboost-log1.67-dev \
                   libboost-regex1.67-dev

    On Ubuntu 20.04 LTS "focal":

    sudo apt-get -y install git cmake python-dev build-essential automake autoconf libpng16-16 \
                   libpng-dev libpng-tools libjpeg62-dev libexpat1-dev libgtk-3-dev libopenal-dev \
                   libogg-dev libvorbis-dev libgl1-mesa-dev libsdl1.2-dev libopengl0 \
                   libpostproc-dev freeglut3-dev libboost-python1.67-dev libboost-log1.67-dev \
                   libboost-regex1.67-dev

    On openSUSE Leap 15.2:

    sudo zypper install libboost_log1_66_0-devel \
                       libboost_python-py2_7-1_66_0-devel \
                       libboost_python-py3-1_66_0-devel \
                       libboost_system1_66_0-devel \
                       libboost_filesystem1_66_0-devel \
                       libboost_thread1_66_0-devel \
                       libboost_regex1_66_0-devel \
                       libboost_chrono1_66_0-devel \
                       libboost_atomic1_66_0-devel \
                       cmake \
                       gcc-c++ \
                       freeglut-devel \
                       libopenal0 \
                       openal-soft-devel \
                       libSDL-1_2-0 \
                       libSDL-devel \
                       libvorbis-devel \
                       libjpeg-turbo \
                       libjpeg62-devel \
                       libpng16-devel \
                       expat \
                       libexpat-devel \
                       libgtk-2_0-0 \
                       gtk2-devel \
                       libgtk-3-0 \
                       gtk3-devel \
                       python-devel \
                       python3-devel \
                       git \
                       rpm-build

    On Fedora 30-34:

    sudo dnf install    git \
                       cmake \
                       boost-devel \
                       boost-python3-devel \
                       freeglut-devel \
                       gcc-c++ \
                       openal-soft-devel \
                       SDL-devel \
                       libvorbis-devel \
                       libjpeg-turbo-devel \
                       libpng-devel \
                       expat-devel \
                       gtk3-devel \
                       python2-devel \
                       python3-devel \
                       rpm-build \
                       make

    On Fedora 30 or 31, also install boost-python2-devel. (Apparently not available on Fedora 32 or later.)

    On Funtoo(-current):

    Most dependencies are already met with a standard desktop Funtoo install. In particular, you want to make sure your "flavor" is set to desktop, and that you have a proper "mix-in" depending on the desktop manager you use. Check your current profile:

     sudo epro show

    and if you don't have the desktop flavor enabled, enable it with

     sudo epro flavor desktop

    Also enable the proper mix-in for your desktop manager; for instance xfce:

     sudo epro mix-in +xfce (or gnome, kde etc)

    All of the steps above are outlined in the Funtoo installation guide at https://www.funtoo.org/Install/Profiles and you should have done it already in the process of installing desktop Funtoo. The only dependency that you have to install manually is OpenAL:

     sudo emerge media-libs/openal

    After that you are ready to compile.

  2. Build Vega Strike:

    a. Use the build bash script in the script directory.

    b. OR configure and compile VS manually, using the ncurses ccmake frontend:

    mkdir build & cd build
    ccmake ../engine
    # (configure/edit options to taste in ccmake, press 'c' to save the selected options
    # and press 'g' to update the build configuration files used by the make build tool)
    cmake --build ./build -j $(getconf _NPROCESSORS_ONLN) # (where the getconf clause returns the number of available CPU threads/cores on the system)
    mkdir ../bin && cp vegastrike-engine ../bin/ && cp setup/vegasettings ../bin/ && cd ..

    c. OR configure and compile VS manually, using the command-line cmake frontend:

    mkdir build & cd build
    cmake ../engine
    cmake --build ./build -j $(getconf _NPROCESSORS_ONLN) # (where the getconf clause returns the number of available CPU threads/cores on the system)
    mkdir ../bin && cp vegastrike-engine ../bin/ && cp setup/vegasettings ../bin/ && cd ..

    TIPS:

    To enable verbose output for debugging purposes (will show compilation commands), pass the --verbose argument, where supported:

    cmake --build ./build --verbose

    To enable/disable compile-time options with cmake, use cmake -D<option>=<value>. Example:

    cmake ../engine -DENABLE_PIE=ON -DUSE_PYTHON_3=ON -DCPU_SMP=2 -DCPUINTEL_native=ON -CMAKE_BUILD_TYPE=Debug

    NOTE:

    On some Ubuntu versions and derivatives, a bug exists whereby enabling PIE compilation (Position Independent Executables) results in the file utility incorrectly recognising the compiled vegastrike binary as a shared library instead of a position independent shared executable object.

    The effect of the bug is that vegastrike can still be started from the command line but that it will not be recognised as an executable by GUI file managers such as Nautilus and Dolphin.

    To avoid this scenario, turn off this flag by default and let packagers on other distributions turn this on if their OS is able to correctly deal with Position Independent Executables.

    For more info, see:

  3. Download a copy of the assets/game data from here. You can either git clone this repository, or download it as a ZIP file and unzip it.

  4. When you run vegasettings, specify the path to the assets/game data on the command line with --target followed by a space. E.g.:

    ./bin/vegasettings --target ../Assets-Production

    Absolute path may need to be supplied when running vegasettings for the first time.

    Do the same with vegastrike-engine using -d and no space. E.g.:

    ./bin/vegastrike-engine -d../Assets-Production

Link to list of dependencies in wiki

If there are any problems with this installation method, please create an issue with the Vega Strike development team by posting a new issue.

If you get compilation issues with the system libboost, download it manually from here to ./ext/boost/ and run ./script/build -DUSE_SYSTEM_BOOST=NO

Compiling On Windows

Vega Strike is now compiling on Windows! If you want to compile it, try it out, and perhaps offer feedback, that would certainly be welcome.

To compile Vega Strike on Windows, start by installing either Visual Studio 2019 or just the Visual Studio 2019 Developer Tools. When selecting the Workloads and Components to install, include at least "C++ for Desktop" and a recent build of the Windows SDK. Probably Git and the GitHub for Windows extension also. Install the latest Visual Studio updates as well.

Once the Visual Studio Installer finishes, reboot your computer. Then, find Developer PowerShell for VS 2019 on the Start menu; alt-click it ("right-click"); and choose "Run as Administrator." Run Set-ExecutionPolicy RemoteSigned (or another suitable PowerShell Execution Policy of your choice). Type Y and press Enter to confirm. Exit PowerShell. Now reopen Developer PowerShell for VS 2019, this time without Admin privileges, and run script/bootstrap.ps1. Once that finishes, reboot your computer again. Finally, open Developer PowerShell for VS 2019 one more time, and run script/build.ps1.

Assuming all the above steps succeed, you are now ready to run Vega Strike. Note that vegasettings is not currently building on Windows, so you will need to edit vegastrike.config manually as needed. Also note: Windows installer is still pending.

Finally, note that the location of the .vegastrike folder has changed since v0.5.1r1. It will now be located here: C:\Users\<YourUserName>\AppData\Local\.vegastrike.

Compiling On MacOS

VegaStrike is now compiling on MacOS. However, it's currently experiencing segfaults. Any help will be appreciated to get it fixed. For more information go here

To install the required build dependencies:

If you have Homebrew, follow the steps in the GitHub action:

.github/workflows/macos-ci.yml

If you have MacPorts, install the following:

sudo port install cmake expat jpeg libpng libvorbis boost gtk3 gtkglext libsdl mesa libGLU freeglut

Also set the environment variables to match those in the GitHub action.

  1. Packaging Vega Strike:

After building Vega Strike, then packages can be built using:

make package

Gameplay

Interstellar Warp Transit (Jump Drive)

Most starships come equipped with a warp drive. Unfortunately they can only be used at large singularities in the space-time continuum. Your computer signals these points by placing green donut-shaped wireframes in those areas.

To engage a jump drive, position your ship inside and press 'j'.

Regulations state that starships should be stopped before jumping-- disasters have resulted from starships travelling at any great speed into a jump point.

Intrastellar SPEC Drive

To travel inside star system, the ships are equiped with a SPEC drive that allow faster-than-light travel. This allows efficient travel between planets and stations inside the same star system. To toggle it press 'Shift-A'. To activate auto-pilot, that will handle this automatically, press 'A'.

Respawn

If you sadly lose your life in combat you may respawn by pressing ';'

A new starship will be created for you by Bob.

Transfer Ship Command

If you wish to transfer command to another starship, simply press '[' to switch over. This is useful if you have died and do not wish to call on Bob for help.

Controls

Modding Vega Strike

How to make Vegastrike Missions

An example mission (this is stored in the test1.mission file)

A mission must begin with the headers:

<mission>
    <variables>
        <var name="defaultplayer" value="blue"/>
        <var name="mission_name" value="4 versus 4" />
        <var name="splashscreen" value="bad_guys_vs_good_guys.bmp" />
        <var name="system" value="sol" />
        <var name="description" value="4vs4.txt" />
    </variables>

Currently all of these options are ignored except for the "system". It loads sol.system as the star system (which is in XML and stores all present planets)

The only other system included in this beta release is the blank.mission

which has 1 planet, 1 sun and 2 starbases.

After this, comes the actors in the mission, the flightgroups of fighters.

        <flightgroups>

You must begin the flight group tag as above, and terminate it after all of your flight groups

                <flightgroup name="blue" faction="confed" type="nova" ainame="default" waves="8" nr_ships="3">

The name will be used later for targetting and offset purposes. The faction is a faction listed in factions.xml (should be self explanatory 0 is neutral 1 is happy -1 is mad) Currently confed and aera are the two active factions. AI must be default in this version as no other AI scripts are yet written. nr_ships indicates how many starships will be in this flight squadron.

            <pos x="10000.0" y="0.0" z="3000.0"/>

This indicates the flight group's position... be sure it is unique

            <rot x="180.0" y="180.0" z="180.0"/>
            <order order="tmptarget" target="omikron"/>
            <order priority="0" order="superiority" target="enemy"/>
            <order priority="1" order="bomber" target="omikron"/>
            <order priority="2" order="escort" target="blue"/>

the rest is in development

        </flightgroup>

you must end all flight group tags

continue with any other flightgroups... you can have as many as you want from as many named factions are you want...

      </flightgroups>
</mission>

Editing AI

The AI is completely scriptable, and I have not spent all that long perfecting it. There are included instructions about editing the AI scripts yourself.

Currently there is only 1 AI personality. In the future there will be a method to assign different personalities to different starships.

it's the "default" personality.

2 files are responsible for the control of the "default" personality

default.agg.xml

and

default.int.xml

default.agg.xml means the "aggressive" AI. it controls what it does to aggressively bring its vengeance upon its target.

When editing this file in notepad, you'll notice some tags and various numbers.

The first tag, AggressiveAI has a parameter time="4"

that's how often the AI checks if it should change its strategy. This time can be any integer value... it can revise its plan more often or less often. 4 has been good because most maneuvers can mostly complete in 4 seconds and it's a good time to revise plans

underneath the beginning tag exist a list of tags that describes the logic the AI uses to figure out its next strategy.

there are a number of tags you can specify for the aggressive AI: distance, threat, hull, fshield, lshield, rshield, bshield, rand.

Each tag asserts if one of the tag-values above is between min and max.

The AI needs to make a CHOICE about what it does next, so it takes a look at the list of tags and determines if any of the assertions is true.

Nested statements mean that BOTH must be true. so you can say "if the distance is at most .5 and the hull is between .25 and .75 by writing:

<distance max=".5">
  <hull min=".25" max=".75" script="afterburnerslide.xml">
  </hull>
</distance>

this means "if the distance is at most half the range of my guns and the hull is between 1/4 and 3/4 of its capacity, then perform an afterburner slide.

It goes down the list of such assertions and chooses the appropriate AI script to run.

The facing and movement tags fill in the gaps where NONE of the list of the assertions are true and the ship is not either turning or moving anywhere:

<facing script="turntowards.xml">
</facing>

at the very bottom the </AggressiveAI> must show up to indicate that the AIscript has terminated.

The aggressive.int.xml is written out exactly the same as the aggressive.agg.xml

the difference is that scripts listed here INTERRUPT the current action!

An example from the game is:

<AggressiveAI close=".05">
  <hull max = ".5" script="evade.xml">
   <threat min=".4" script="afterburnerslide.xml">
   </threat>
  </hull>

  <distance max=".03" script="turnaway.xml">
  <!-- distance less than .1-->
  </distance>

</AggressiveAI>

this says:

If the hull is at most half and someone is threatening me with a 40% chance to hit... then evade and then afterburner slide

OR

if someone is at most .03 of my max range away from me TURN AWAY!

this will interrupt the current progress of any scripts

So that's how to use AI scripts.

If you want to know more about writing actual maneuvers (like turnaway.xml which as you can see is in the directory) please contact me at hellcatv@hotmail.com

you need to have a heavy background in vector math.

Hacking Vega Strike

In this guide, any coding is located in square brackets ([]). Number values may not be accurate.

Guide 1: Hacking cash

Step 1 Locate you saved files. (Windows XP: Program files/VegaStrike/Vegastike-0.5.0/.vegastrike-0.5.0/save||||Mac: (disk)>Users>(user)>.vegastrike-0.5.0>saves>(savefile))

Step 2 Open the files using a word document editing program (preferably Notepad++)

Step 3 On the first line, you should see something roughly resembling this: [Crucible/Cephid_17^200000.000000^Llama.begin 119990000070.992740 -8999928.351833 -109989999927.749450] On this line, find the numbers surrounded by carets “^”. This is your cash. Change it to what you want, preferably in the high millions. Or possibly even trillions. Go nuts.

Step 4 In order for the game not to go mad about this, you need to add this ending:[.000000] Basically, if you have, say a quadrillion cash (1000000000000000) you still need to add .000000 on the end, making it stupidly long. Yes, we know, its annoying.

Step 5 Now you need to check if you are using commas or “‘” in your cash. Don’t. Then save the file. .txt files work, however when you see them on the loading screen they end in .txt.

Step 6 You’re now richer than a very rich man on International very rich day! Yay!

Guide 2: Getting the ship of your dreams

Step 1 Get your saved file from Guide 1.

Step 2 Now, find the cash (numbers in carets “^”). There is a name after this. At the start of the game, it is always “Llama.begin”

Step 3 Now you can change this name into any ship you like. However, it must be in the same format.

Step 4 Here are some good ships: Goddard.milspec Clydesdale.stock Hyena.stock (Light, weak fighter. Good for getting used to combat with other fighters.) Mule.stock (trader)

Step 5 There is a ship list either in the game files or on the internet, check that out for some good models. (remember: add .stock or .milspec on the end!!!! (milspec is only on some specialised ships)) Finally, save the file as before.

This guide was created by Munno 2010-10-08

Vega Strike Information

Submit comments or suggestions by opening an issue

And if you can design some missions it would rock!

Vega Strike Contacts

Vega Strike is the product of many contributors from all around the world. If you need help, find a bug, want to request a feature, etc then please contact us all using one of the following methods:

Bugs can be sent to one of the following:

Vega Strike on Social Media

Vega Strike Code Repository

https://github.com/vegastrike/Vega-Strike-Engine-Source

Contributors

This project exists thanks to all the people who contribute. [Contribute]. Our Contributors

Backers

Thank you to all our backers! 🙏 [Become a backer]

Our Backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

Become a Sponsor

EOF