Commit Graph

18484 Commits

Author SHA1 Message Date
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
auria.mg
a384866e6a Attempt for #3164 2018-03-29 19:23:51 -04:00
auria.mg
e2645c1060 Fix leak 2018-03-28 19:45:24 -04:00
Deve
0093a8eaab Fixed mingw compilation 2018-03-27 23:03:47 +02:00
Deve
756ec632ae Fixed windows compilation 2018-03-27 23:02:39 +02:00
Deve
eb28126f56 Avoid some code duplication 2018-03-27 23:02:09 +02:00
Deve
3666d1a2ec Allow to use scripting on arm64 2018-03-27 23:01:46 +02:00
auria.mg
b778b91b5e More UI scaling improvements, see #3146 2018-03-26 21:24:48 -04:00
Deve
be037781b8 Tweak screen keyboard layout 2018-03-21 23:06:15 +01:00
auria.mg
41cd33ce55 Fix Wrong Way message, fixes #3159 2018-03-20 20:05:34 -04:00
Alayan-stk-2
a27dd674a0 Change camera view in debug to the previous/next kart (#3158)
* Change camera view from one kart to the previous/next with F5-6 keys or with menu buttons

* Simplify code

The kart_num/real_num distinction was part of the base code Benau did ; but it is completely redundant after the changes I did to the way kart_num is calculated (it was previously a static int, it's now an unsigned int).
2018-03-20 19:39:18 -04:00
Deve
db3399500f Better scaling initial android dialog 2018-03-20 21:38:06 +01:00
Deve
0471202c9c Fixed stupid isAccelerometerActive condition 2018-03-20 20:55:26 +01:00
Alayan-stk-2
1dedd915ad Update the track list and reorder it to alphabetic order (#3154) 2018-03-19 20:50:31 -04:00
Deve
193ba6909f Represet special keys on screen keyboard by symbols 2018-03-20 00:10:13 +01:00
Deve
f559627951 Allow to repeat backspace key on screen keyboard 2018-03-19 23:06:20 +01:00
Deve
900beae4b2 Allow to create x86_64 android package.
64-bit packages will be required by google.
2018-03-18 21:56:36 +01:00
Deve
203d045485 More improvements for gui on android 2018-03-17 22:28:45 +01:00
Deve
26419e5ee0 Better gui scaling on android 2018-03-16 23:00:58 +01:00
Deve
98a7b5a03e Send text message when pressing enter on android keyboard 2018-03-15 21:35:29 +01:00
Deve
38a4e06a6c Avoid window size to be larger than available space.
When window size is equal to screen resolution and user selected windowed mode, we can assume that he wants maximized window.
2018-03-14 22:47:31 +01:00
Deve
9c3998be0e Fixed server_only compilation 2018-03-14 21:43:28 +01:00
Deve
4f51c9c915 One more valgrind fix 2018-03-14 21:02:25 +01:00
Deve
a3c0254f81 Better fix for login screen 2018-03-14 20:49:05 +01:00
Deve
6621196266 Don't close STK after login screen 2018-03-13 21:22:21 +01:00
Deve
952b973b89 Valgrind complains about changing variable after closeScreen 2018-03-12 23:03:15 +01:00
Deve
fd14c7fa91 Update android tv banner.
Thanks to Mr.XX99 for his work.
2018-03-12 21:49:09 +01:00
Benau
ffd6e84759 Stop threads of texture loading before destroying shader manager 2018-03-12 09:21:30 +08:00
auria.mg
48f2aa3da4 Fix bubblegum flashing, fixes #3133 2018-03-11 19:35:59 -04:00
auria.mg
361e03c375 Fix more keyboard issues, fixes #3131 2018-03-11 19:06:48 -04:00
Deve
d271e27590 Show progress bar before new data is extracting. It will at least show that the game is not hanged and is doing something. 2018-03-08 21:45:20 +01:00
hiker
fa624c90e1 Merge remote-tracking branch 'origin/master' into fix-timestep 2018-03-08 09:50:14 +11:00
Deve
022dd68a17 Some fixes for gamepad on android 2018-03-06 23:23:15 +01:00
Deve
e00074cb14 Some work on gamepad support on android.
Still it works only for single gamepad, but at least it's preconfigured and google shouldn't complain about stupid button names.
2018-03-06 00:19:01 +01:00
Deve
8f78d4e891 Add a popup on first run on android, so that user can choose if accelerometer should be enabled 2018-03-04 00:08:24 +01:00
Deve
975fc8f84a Don't show screen keyboard when hardware keyboard is available 2018-03-03 21:06:59 +01:00
Deve
41ba4395d9 Don't spam with old drivers popup on android 2018-03-02 22:34:20 +01:00
Deve
729e508027 Disable accelerometer in options if it's not available 2018-03-02 22:30:22 +01:00
Deve
4157eef894 Get device orientation only if accelerometer is used 2018-03-02 21:38:15 +01:00
Deve
a00c1cadc8 Simplify accelerometer selection in settings 2018-02-28 22:01:30 +01:00
Deve
0ee00ad1e5 Make accelerometer values relative to device orientation 2018-02-28 22:01:30 +01:00
samuncle
0c23e6063d Merge branch 'master' of https://github.com/supertuxkart/stk-code 2018-02-27 23:39:28 +01:00
samuncle
7db4ef8056 Add a shader to use the day/night cycle for lamps, etc 2018-02-27 23:38:28 +01:00
Deve
6b4fb50876 Convert tabs to spaces 2018-02-27 23:24:29 +01:00
Deve
36c6ea52ae Allow to detect device rotation for better accelerometer support 2018-02-27 23:24:29 +01:00
samuncle
39c50c838f Make access to the time of the track in the shader to react to day/night cycle 2018-02-27 23:20:49 +01:00
Deve
4cc56aec1b Detect system language on android 2018-02-26 21:25:08 +01:00
Deve
78bb9e78ac Fixed version number for nvidia gles.
It uses gl version string: OpenGL ES 3.2 NVIDIA 384.111
2018-02-25 22:40:15 +01:00
Deve
34f0f8c239 Fixed a bug with red light in thunderbird model on android 2018-02-25 22:17:53 +01:00
Ethan Uzarowski
b782af2949 Remove "Final lap!" message in one-lap races (#3127)
* Fix "Final lap!" message on one-lap races

When starting a one-lap race, the game gives the message "Final lap!". This should only be given when there is more than one lap in the race. This commit changes linear_world.cpp so that this message is only given when the number of laps in the race is greater than 1.

* Fix spacing

I accidentally changed the spacing when making my last commit. This commit fixes that accident.
2018-02-23 20:43:46 -05:00