45 Commits

Author SHA1 Message Date
Benau
0cf0002c08 Header clean up 2017-02-21 12:09:22 +08:00
Benau
e2030dabbc Disable AI debug 2016-10-03 09:54:02 +08:00
Benau
c434cb80f4 Significantly improve turning and bad items avoidance for ArenaAI 2016-10-01 07:58:14 +08:00
Benau
3659ad9068 Try to make determineTurnRadius works with any plane 2016-09-26 00:11:49 +08:00
Benau
eeac5668d9 Rename QuadGraph to DriveGraph, make it use the new Graph interface 2016-09-17 14:30:28 +08:00
Benau
21dc569f70 Start to clean up quad and graph node 2016-09-04 11:56:03 +08:00
Benau
6dc05a1ec7 Merge remote-tracking branch 'origin/master' into walldriving 2016-04-08 13:42:58 +08:00
Benau
df9dc5ff34 Make AI really bends it like Beckham
Notice: AI will only try to skid to save the ball from being scored
when expert and supertux mode.
2016-01-22 22:01:22 +08:00
Benau
f4b723de82 Merge remote-tracking branch 'origin/battleAI' into battleAI 2015-11-15 12:29:01 +08:00
hiker
aff41a25b5 Disabled AI debug, which was left enabled by mistake - sorry :) 2015-08-19 13:07:13 +10:00
hiker
cf464f1ed8 Fixed various crashes when enabling AI debug (e.g. missing textures,
heap corruption because the hpp file did not know about AI_DEBUG
and so did not declare some variables).
2015-08-18 10:30:42 +10:00
Flakebi
fbf26df23d Merge branch 'master' into fixes
Conflicts:
	src/graphics/2dutils.cpp
	src/graphics/graphics_restrictions.cpp
	src/graphics/render_skybox.cpp
	src/graphics/rtts.hpp
2015-07-03 15:29:53 +02:00
hiker
8d07d26c25 Updated (c) year to include 2015. 2015-03-30 11:42:50 +11:00
Flakebi
32a044e292 Fix some clang warnings and bugs 2015-02-04 18:30:27 +01:00
deve
bf79df9e88 Fixed typo 2014-11-26 10:54:44 +01:00
nixt
6fc144dd8a Item collection and avoidance now works with 3D tracks!
Also improved AI steering where it would cut corners too aggressively.
2014-07-09 23:22:20 +05:30
konstin
7cc83e1475 running whitespaces.py update 1 2014-03-29 11:33:43 +01:00
konstin
663fffdebb Revert "Running whitespaces.py; no more trailing whitespaces & tabs -> 4 spaces"
This reverts commit 65e2dcf2f09e979b39f8d115da7d17dabac0b957.
2014-03-29 11:32:04 +01:00
konstin
65e2dcf2f0 Running whitespaces.py; no more trailing whitespaces & tabs -> 4 spaces 2014-03-28 20:08:39 +01:00
nixt
43f1c59a6e Huge merge from trunk, part 1.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/battleAI@14659 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-12-08 03:45:57 +00:00
hikerstk
c5b8732087 Probably biggest commit (in terms of number of files) ever -
updated the (c) line of all files to -2013, added missing (c), 
changed format in some cases so that it will be easier in
the future to change them by script. No actualy code change.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14447 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-11-15 11:43:21 +00:00
nixt
d3f92542df Split AIBaseController to AIBaseLapController and AIBaseController.
AIBaseLapController inherits from AIBaseController. 

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/battleAI@14223 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-10-09 07:26:55 +00:00
hikerstk
b7e5480fb6 More work on improving documentation.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12572 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-03-21 10:46:35 +00:00
hikerstk
4c33490a78 Improved doxygen documentation.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12570 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-03-20 23:02:12 +00:00
hikerstk
fb84565bf8 Added probability to collect an item for the AI, to allow us
to make it a bit less competitive.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11811 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-10-29 22:06:17 +00:00
hikerstk
c5720e7925 Fixed sing a skidding probability (before the random number
was tested each frame, making it mostly certain that skidding
was done).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11748 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-10-23 21:13:17 +00:00
hikerstk
ecc1212c11 Allow changing the various levels of AI mostly using
the stk_config file.
Note at this stage no tuning of easy or medium level was
done, this version should behave the same as the hard-coded
version.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11736 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-10-22 21:51:05 +00:00
hikerstk
b04194303a AIs will now reduce their speed if they are too far ahead of the
player.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11697 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-10-17 06:14:43 +00:00
hikerstk
ef2a1524c4 Added a skidding probability which is dependent on the to the
first player (i.e. slightly rubber-banding the AI).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11682 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-10-14 20:59:51 +00:00
hikerstk
376252d953 1) Added 2 different findNonCrashingPoint algorthm - one which fixes a known
bug in the default algorithm, and one replacement. Unforatunately, the old
   (and somewhat buggy) algorithm is stil the best.
2) Improved handling of 90 degree corner for the default AI. Now the karts shouldn't
   have any more endless rescue loops.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11669 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-10-08 06:04:30 +00:00
hikerstk
72044141d8 Correctly handle a case in which bad items are in front of items-to-collect
(previously the AI sometimes decided to aim for the good items, then to avoid
then ... and this undecided behaviour resulted in actually hitting the bad item).
Documented the item collection and avoidance code.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11574 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-09-10 22:49:43 +00:00
hikerstk
18d77b9da1 Improved handling of zippers: zippers will now be selected earlier (previously
a kart needed 2.0 nitro in order to use a zipper), but won't be used if items
to avoid are close by (since zipper make it harder to avoid them).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11571 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-09-09 22:41:49 +00:00
hikerstk
5b6002fd8b Fixed code for debugging, made it easier to compare various version
of the AI (findNonCrashing old vs new; collecting vs non-collecting).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11568 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-09-07 06:17:24 +00:00
auria
bfc1a5e14c Give nolok some special powers in the last fight against him. Changing the swatter and bubble gum to different models might help make it more dramatic of course
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11538 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-09-04 00:39:14 +00:00
hikerstk
35c7cf0848 Added first version of item avoidance to the AI.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11537 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-09-03 22:49:30 +00:00
hikerstk
7e2b9abc6e Fixed release mode compilation and removed some compiler warnings.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11524 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-08-27 23:05:44 +00:00
hikerstk
a1c51d61a5 Added first and early version of an item-collecting AI (within
SkiddingAI).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11517 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-08-23 22:00:36 +00:00
hikerstk
f756c9c981 Split skidding handling into three separate functions:
determineTrackDirection, handleCurve, doSkid (the latter
was already implement, but didn't do anything).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11445 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-07-27 06:34:25 +00:00
hikerstk
fb5ae0a566 First version of the new AI that can skid. It's still behaving
quite stupid, but can sometimes compete with the old AI (unless
the new AI is behaving stupid ... as I've said). This is still
disabled by default (and if you want to test it, make sure
to adjust stk_config.xml as well).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11438 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-07-25 23:58:30 +00:00
hikerstk
3ec6682fb4 Added alternative implementation of findNoNCrashingPoint
which should be faster and 'more correct' (the old implemenation
only tests discrete points for being on/off track, which means
AI can cut corner and not realise that it will be off track).
The new implementation uses lines and intersections to detect
this condition correctly. Since the new implementation is
as a result not as aggressive in cutting corner, it's not
as fast as the old AI, and is for now disabled (see end of
SiddingAI::handleSteering if you want to switch).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11405 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-07-19 07:00:57 +00:00
hikerstk
9a823b64b0 Removed dead code.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11389 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-07-12 07:05:02 +00:00
hikerstk
c592be45df Instead of computing two different radius, detect if the kart
is not facing in the right direction (and if so, brake to allow
it to quicker get facing in the right direction again), and
only compute the turn radius otherwise. Print some useful
information when --ai-debug is specified, atm when and why
a kart is braking.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11386 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-07-11 23:05:16 +00:00
hikerstk
b3c0eeab80 Skidding AI now estimates the turn radius of a curve, and is
able to brake if it should be too fast. Avoid using nitro
when braking (otherwise AI might be pushed out of curve).
Added new --ai-debug command line option that will display
the name of the AI on top of each kart (when compiled with
debug). See world.cpp lines 249 on how to select the new 
(or any other AI, including the option to use all AIs,
which is nice to compare them).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11368 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-07-05 22:37:57 +00:00
hikerstk
ec797b68e8 Minor code cleanup (replaced loop to find closest karts with
corresponding function in world; fixed bug when trying to hit
a kart ahead when having a bomb; removed unused code). No
change of actual functionality.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11255 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-05-21 12:41:47 +00:00
hikerstk
1398184b35 Removed unused new AI controller, and created
new skidding ai which is at this stage a copy
of the default AI controller.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11254 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-05-21 06:57:05 +00:00