My STK mod, still WIP.
Go to file
Alayan-stk-2 8fae521a94 AI item handling improvements (#3143)
* Prepares for advanced item and nitro usage strategy

Replace the bool determining if usage is random or not by an int allowing several levels of AI item usage.

Add NITRO_ADVANCED mode for nitro usage.

* Adapt for more item and nitro levels

The XML files have to be changed. The logic for the item_skill still has to be done.

* Preparation for the preferred kart in GP

* Preparation for the preferred kart in GP

* Preparation for the preferred kart in GP

* Prepares for advanced item and nitro usage strategy

*  Prepares for advanced item usage strategy

* Preparation for the preferred kart in GP

* Parametrized AI_skill level

* Fix typo

* Fix typo

* Fix typo

* Fire items with a shield on in unrestricted mode

* New function allowing AI to know what flyable is incoming

* New function allowing AI to know what flyable is incoming

* Fix typo

* Update bubble gum AI to new system

In addition of making some functionality depends on AI levels, there are a few overall improvements for the better AIs :
1)Remove the "drop the gum in the last lap" logic. Bad strategy since ever the shield has been added to the gum
2)The protection against flyable is not used if the user holds a swatter and the flyable is a plunger 
3)Holding a swatter no longer blocks the AI from using the shield against a flyable nor from using the gum behind
4)The shield is used to remove bad attachments (bomb, parachute, anvil)
5)Reduce the distance with the kart behind when dropping the gum to reduce misses

* Update swatter AI to new system

The swatter could benefit from several kind of usage improvement. This patch introduce only one, but probably the more important : the better AIs now use it to remove bad attachments

* Fixing #3139

* Fix compile error

* Fix

* Fix compilation

* Fix compilation

* Fix compilation

* Update variable

* Update variable

* Fix non-breaking space issue

* Fix typos

* Revert for compilation

* Revert for compilation

* Update cake AI to new system

* Redefine HandleItems to be position aware

* Redefine HandleItems to be position aware

Also changes bowling ball for the new system.

* Activate shield before hitting box or bad item

Meant for higher AIs.

* Increase lookup distance

Some distance will be needed for the switch

* Temporary fix to avoid a nitro regression

* Fix typo

* Fix typo

* Bubble gum improvements ; explicitely calculate distances to items

* Update Switch to the new system ; use item-distance awareness

Also fix a missing parenthesis

* Change nitro-usage to a numerical parameter

* Change nitro-usage to a numerical parameter

Also update comments to explain the new item-skill

* Change nitro-usage to a numerical parameter

* Change nitro-usage to a numerical parameter

* Change nitro-usage to a numerical parameter

* Update handleNitroAndZipper to the new system

Also fix a naming error, remove the 95% speed limitation on nitro usage

* Adds a small engine boost to nitro

Currently, nitro is very counter-intuitive as it only affects max_speed. This change corrects it. The effect remains small to not upset balance. It is mostly felt when below max_speed, so the can of nitro potential power doesn't change much.

* Improve AI nitro handling

Summary :
1)Makes the AI use nitro by bursts, greatly improving its efficiency
2)Makes the AI use nitro when close to max speed (to unlock the max speed increase)
3)Remove the overtaking logic as the AI will now use its nitro anyway
4)The AI tries to keep a reserve of nitro for use towards the end of the race.

* Allows estimated finish time to be checked at any lap, fix a crash

* Makes the AI use its nitro reserves

* Better tuning for nitro reserve usage to reduce the probability of unused nitro

* Remember last used powerup for AI

* Remember last used powerup for AI

* Remember last used powerup for AI

* Remember last used powerup for AI

* Remember last used powerup for AI

* Remember last used powerup for AI

* Fix compilation

* AI don't wait between usage of items of different types

* Use floats for Parachute duration

* Revert

* Nitro use when trying to pass a bomb improved

* Fix broken time check

* Take into account the kart-specific fadeout to calculate time between bursts

* Improvements to bursts and to use of the reserve at the end

* Improve comments explaining item_usage_skill and nitro_usage

* Make LastUsedPowerup a PowerupType

* Make LastUsedPowerup a PowerupType

* Make LastUsedPowerup a PowerupType

* Make LastUsedPowerup a PowerupType

* Make last_used_powerup a PowerupType

* Make last_used_powerup a PowerupType

* Fix compilation

* Fix compilation

* Revert

* Revert

* Finally fix compilation

* Finally fix compilation

* Change shield radius per difficulty

A reduced non-null shield radius reduces false positives as long as it is big enough to get a few frames during which the object is inside the radius.

* Improve Projectile closeness management

* Improve projectileCloseType

* Improve projectileCloseType

* Fixes indentation

* Fix lastUsedPowerup initialization

* Fix the last used powerup type

* Rename projectileCloseType

* Rename projectilCloseType

* Clarify comment and update projectileCloseType to new name

* Reuse a member RandomGenerator

* Fixes getLastUsedPowerup type

* Fixes comparison

* Fixes type
2018-03-31 21:09:57 -04:00
android Allow to create x86_64 android package. 2018-03-18 21:56:36 +01:00
cmake Fixed mingw compilation 2018-03-27 23:03:47 +02:00
data AI item handling improvements (#3143) 2018-03-31 21:09:57 -04:00
doc Remove unused documentation and tool files 2016-08-23 01:58:53 +02:00
lib Fixed stupid isAccelerometerActive condition 2018-03-20 20:55:26 +01:00
src AI item handling improvements (#3143) 2018-03-31 21:09:57 -04:00
tools Update the track list and reorder it to alphabetic order (#3154) 2018-03-19 20:50:31 -04:00
.appveyor.yml Fix appveyor build 2017-10-17 11:04:28 +08:00
.gitignore Allow to install debug version without uninstalling release version on android 2017-12-22 21:51:41 +01:00
.travis.yml Remove libwebm and recorder code 2017-04-12 11:51:59 +08:00
CHANGELOG.md Update Changelog 2017-10-27 14:31:10 +08:00
CMakeLists.txt Allow to use dependencies for vs and mingw without changing the names every time. 2018-02-01 21:36:28 +01:00
COPYING Replced unicode characters with ascii characters. 2017-10-24 10:27:00 +11:00
ISSUE_TEMPLATE.md Add a github issue template to the project (#3071) 2018-01-05 20:10:16 -05:00
README.md README.md:correct spelling of 2 words [skip ci] 2018-01-25 21:04:58 -06:00
sources.cmake Some work on gamepad support on android. 2018-03-06 00:19:01 +01:00

SuperTuxKart

Build Status AppVeyor Build Status #supertuxkart on the freenode IRC network

SuperTuxKart is a free kart racing game. It focuses on fun and not on realistic kart physics. Instructions can be found on the in-game help page.

The SuperTuxKart homepage can be found at https://supertuxkart.net/. There is also our FAQ and information on how get in touch with the community

Hardware Requirements

To run SuperTuxKart, make sure that your computer's specifications are equal or higher than the following specifications:

  • A graphics card capable of 3D rendering - NVIDIA GeForce 8 series and newer (GeForce 8100 or newer), AMD/ATI Radeon HD 4000 series and newer, Intel HD Graphics 3000 and newer. OpenGL >= 3.3
  • You should have a CPU that's running at 1 GHz or faster.
  • You'll need at least 512 MB of free VRAM (video memory).
  • Minimum disk space: 800 MB
  • Ideally, you'll want a joystick with at least 6 buttons.

License

The software is released under the GNU General Public License (GPL) which can be found in the file COPYING in the same directory as this file. Information about the licenses for the artwork is contained in data/licenses.

3D coordinates

A reminder for those who are looking at the code and 3D models:

SuperTuxKart: X right, Y up, Z forwards

Blender: X right, Y forwards, Z up

The export utilities perform the needed transformation, so in Blender you just work with the XY plane as ground, and things will appear fine in STK (using XZ as ground in the code, obviously).

Building from source

In order to build SuperTuxKart from source, you'll need both the code and the assets (See https://supertuxkart.net/Source_control for more information):

git clone https://github.com/supertuxkart/stk-code stk-code
svn co https://svn.code.sf.net/p/supertuxkart/code/stk-assets stk-assets

Building SuperTuxKart on Linux

Dependencies

To build SuperTuxKart from source, you'll need to install the following packages:

  • OpenGL (mesa)
  • OpenAL (recommended: openal-soft-devel)
  • Ogg (libogg-dev)
  • Vorbis (libvorbis-dev)
  • Freetype (libfreetype6-dev)
  • libcurl (libcurl-devel)
  • libbluetooth (bluez-devel)
  • libpng (libpng-devel)
  • zlib (zlib-devel)
  • jpeg (libjpeg-turbo-devel)

Ubuntu command:

sudo apt-get install build-essential cmake libbluetooth-dev \
libcurl4-gnutls-dev libfreetype6-dev libfribidi-dev libgl1-mesa-dev \
libjpeg-dev libogg-dev libopenal-dev libpng-dev libvorbis-dev libxrandr-dev \
mesa-common-dev pkg-config zlib1g-dev

In-game recorder

In order to build the in-game recorder for STK, you have to install libopenglrecorder from your distribution, or compile it yourself from here. Compilation instruction is explained there. If you don't need this feature, pass -DBUILD_RECORDER=off to cmake.

Compiling

Run the following commands inside stk-code directory to compile SuperTuxKart:

mkdir cmake_build
cd cmake_build
cmake ..
make -j4

STK can then be run from the build directory with bin/supertuxkart

Further options

To create a debug version of STK, run:

cmake .. -DCMAKE_BUILD_TYPE=Debug

You can install your build system-wide:

sudo make install

The default install location is /usr/local, i.e. the data files will be written to /usr/local/share/games/supertuxkart, the executable will be copied to /usr/local/bin. To change the default installation location, specify CMAKE_INSTALL_PREFIX when running cmake, e.g.: cmake .. -DCMAKE_INSTALL_PREFIX=/opt/stk

Building SuperTuxKart on Windows

To Build SuperTuxKart on Windows, follow these instructions:

  1. Download and install Visual Studio from here: Visual Studio - Download. The free Visual Studio Community edition works fine.
  2. Download the SuperTuxKart source package from either SuperTuxKart download area - SourceForge.net or SuperTuxKart.net - Source Control, and unpack it. Note: If you downloaded the source package from here: SuperTuxKart.net - Source Control, then both stk-code and stk-assets must be in the same directory, otherwise the build can result in failure
  3. Download the Windows dependencies package from either SuperTuxKart download area: Dependencies - SourceForge.net or SuperTuxKart on GitHub - Dependencies, and unpack it; then, copy the dependencies directory from either the windows or the windows_64bit directories into the stk-code directory, rename it to dependencies-64bit if you want to compile a 64bit build.
  4. Download CMake from here: CMake - download page, install it; once CMake is installed, double click on the CMake icon on your desktop, and point it towards your stk-code directory in the 'Where is the source code' field, and point it to a directory called build or bld inside the stk-code directory.
  5. Press 'Configure'; CMake will ask you if it is OK to create the aforementioned directory, press Yes. CMake will then ask you about your version of Visual Studio. Confirm your selection; Please look at the table below to avoid confusion between version numbers and releases of Visual Studio; CMake will begin creating the required files for the build in the directory.
  6. Navigate to your build directory and open the SuperTuxKart.sln file; Visual Studio will now load the solution.
  7. In the 'Solution Explorer', right click on the supertuxkart project and select "Set as StartUp project"
  8. Open the 'Build' menu and select 'Build Solution'; or, press the default keyboard shortcut: CTRL + SHIFT + B to build the solution.

Note: To avoid confusion between releases and versions, refer to this table:

Visual Studio Release Version
Visual Studio 2017 15
Visual Studio 2015 14
Visual Studio 2013 13

Building SuperTuxKart on Windows (from PowerShell/Command line)

  1. Download and install Visual Studio from here: Visual Studio - Download, the free Visual Studio Community edition works fine.

  2. Download a source package from either SuperTuxKart 0.9.2 download area - SourceForge.net or SuperTuxKart.net - Source Control NOTE: the stk-code and stk-assets directories must be in the same directory

  3. Download the Windows dependencies package from either SuperTuxKart download area - SourceForge.net or SuperTuxKart on GitHub - Dependencies and unpack the archive; once unpacked, copy the dependencies directory from either the windows or the windows_64bit directories into the stk-code directory

  4. Download CMake from here: CMake - download page; and install it. Navigate to the stk-code directory; and create an directory called "build":

mkdir build
cd build
  1. Once inside the build directory; run CMake to start the compilation process:
cmake ..
  1. Now that CMake finished configuring and creating the necessary files for the build, run the build command in the same directory:
msbuild.exe SuperTuxKart.sln 

SuperTuxKart can now be run as bin\Debug\supertuxkart.exe or bin\Release\supertuxkart.exe

Building SuperTuxKart on macOS

Getting Started

Install the developer tools, either from the OS X Install DVD or from Apple's website.

If you have never built anything before, you have create /usr/local/include/ first:

sudo mkdir -p /usr/local/include/

Symlink the include-folder of OpenGL framework to /usr/local/include/GL (Unix programs have an easier time finding it this way):

sudo ln -s /System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/ /usr/local/include/GL

On OS X 10.9.5, you might need the following workaround:

sudo ln -s `xcrun --show-sdk-path`/usr/include/ /usr/include
sudo ln -s `xcrun --show-sdk-path`/System/Library/Frameworks/OpenGL.framework/Headers/ /usr/local/include/OpenGL

The first link is required in order to find libcurl, the second to find opengl.

Download pre-built dependencies from here and put the frameworks in [hard disk root]/Library/Frameworks

CMake

CMake is used to build STK. At this time CMake will not make a binary that is ready for distribution.

You'll have to run these commands inside your stk-code directory.

Building

With clang:

mkdir cmake_build
cd cmake_build
cmake ..
make

With GCC:

mkdir cmake_build
cd cmake_build
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_C_COMPILER=/usr/bin/gcc
make

Building on 10.10 with 10.9 compatibility:

cmake .. -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk  -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9

Xcode

Place an additional copy of the dependencies into Users/<YOUR_USERNAME>/Library/Frameworks. Then cd to your cloned stk-code directory and execute the following commands:

mkdir xcode_build && cd xcode_build
cmake .. -GXcode

Use Finder to navigate to your stk-code/xcode_build folder and open the newly generated Xcode project (SuperTuxKart.xcodeproj).

You can then build the project in Xcode using Product -> Build

Note: Xcode is much less well tested than makefiles, so there may be issues when trying to use Xcode.