Commit Graph

825 Commits

Author SHA1 Message Date
Benau
982220daf8 Fix rubber ball in network 2018-07-29 15:59:34 +08:00
Benau
3f27a04bd1 Fix plunger in network 2018-07-28 16:02:46 +08:00
Benau
5f90a61c3d Improve item firing sound in network 2018-07-28 01:00:41 +08:00
Benau
f0b46d08b2 Fix swatter in network 2018-07-27 13:32:19 +08:00
Benau
05f5663888 Save the uncompressed physics values to objects in server 2018-07-26 13:32:41 +08:00
Benau
1e53349f52 Rewind bowling and cake in network game 2018-07-25 15:33:49 +08:00
Benau
4a9a0fba0f Make flyable to work with shared_ptr 2018-07-24 15:43:31 +08:00
Benau
60bfc1840b Port rewinders to use shared_ptr 2018-07-24 14:22:20 +08:00
Benau
bbf5c54f87 Use rewinder with shared_ptr for easier item destroy handling 2018-07-24 14:21:42 +08:00
Benau
5e7ec89002 Fix more override warnings 2018-07-19 00:35:56 +08:00
Benau
d5168691e1 Dont't send item event confirmation if empty state 2018-07-18 13:33:37 +08:00
Benau
c72db7099d Synchronized random arena item in network game 2018-07-14 08:11:35 +08:00
Benau
49d7a2fbbc Use count up ticks on rewinding for time limit in soccer game 2018-07-13 23:34:50 +08:00
Benau
1333fe2d19 Use minimum size for uid of rewinder 2018-07-13 15:05:07 +08:00
Benau
565dfcef96 Only send state for moving track object 2018-07-13 10:47:30 +08:00
Benau
ab528e2840 Add a unique identity to each rewinder 2018-07-12 12:41:06 +08:00
Benau
11d9090039 Add initial kart local state saving with correct attachment rewind 2018-07-12 07:08:02 +08:00
Benau
908735b1b1 Remove local state saving at t = 0
A proper same frequency local state saving for client will come later
2018-07-11 13:29:30 +08:00
Benau
2d6c45f65e Fix attachment rewind with passing bomb 2018-07-11 01:36:20 +08:00
Benau
8931d90813 Merge remote-tracking branch 'origin/master' into curved 2018-07-06 23:49:04 +08:00
Benau
3f47c650e8 Allow smoothing for skidmarks 2018-07-06 19:01:13 +08:00
Deve
872f214c41 Fixed a crash when using rubber band in legacy pipeline.
Fixes #3338
2018-07-02 21:41:48 +02:00
hiker
8428603150 Removed exec permission (I need to get that #*$*#$* issue fixed). 2018-06-19 18:38:52 +10:00
hiker
60c9994e29 Fixed documentation and typo, thanks to Alayan. 2018-06-19 18:27:33 +10:00
hiker
714665f444 Improved 'randomness' of item selection while keeping exploitability
very low. Added documentation, moved item-distribution logging to
get more detailed information.
2018-06-19 10:19:10 +10:00
hiker
2859265545 Applied Alayan's fix for properly handling weight 0, some minor
other fixes, added two unit tests.
2018-06-18 22:24:52 +10:00
hiker
41ed9fc332 Removed execute permission. 2018-06-18 13:55:55 +10:00
hiker
34bfb2d868 Simplified loop structure, fixed other minox code issues. 2018-06-18 08:47:31 +10:00
hiker
de44b2aaf9 Made configuration files with missing or too many entries abort STK. 2018-06-18 08:14:30 +10:00
hiker
48aca2f70f Started to address comments from the reviewer. 2018-06-17 23:48:47 +10:00
hiker
8cf52b4c7c Updated documentation. 2018-06-17 11:43:35 +10:00
hiker
6bcd1b4c58 Merge remote-tracking branch 'origin/master' into STK-helper-ItemWeights 2018-06-17 01:05:07 +10:00
hiker
5207e9a38b Improved implementation of powerup collection weight. 2018-06-17 01:03:37 +10:00
hiker
87da438bf3 Fixed comment. 2018-06-17 01:01:44 +10:00
Benau
d9ede4f213 Add state to avoid deadlock when finishing the race 2018-06-08 22:59:07 +08:00
Benau
9af27d93c4 Remove unneeded header 2018-06-08 14:56:49 +08:00
Benau
01dc948247 Fix #3286
In the future move trigger to check structure
2018-06-08 14:31:55 +08:00
Benau
b9bf3fa125 Use map to store peer and ticks in network item manager 2018-06-08 14:24:21 +08:00
hiker
6496289707 Added missing virtual destructor. 2018-06-08 15:28:38 +10:00
hiker
ea229b4e5e Merge branch 'ItemWeights' of git://github.com/STK-helper/stk-code into STK-helper-ItemWeights
A very rough merge to solve conflicts, not expected to even work.
2018-06-08 15:03:27 +10:00
hiker
cd80101bdf Removed execute permission (for unknown reasons VS makes source files
executable when it saves them).
2018-06-08 10:59:13 +10:00
hiker
b0da0f640a Merge remote-tracking branch 'origin/master' into network-items,
fixed conflicts.
2018-06-08 10:55:14 +10:00
hiker
8cca845dde Hopefully fixed item collection prediction. 2018-05-31 09:48:33 +10:00
hiker
50425ef59f Moved item position into ItemState. 2018-05-29 19:21:34 +10:00
hiker
d0e95d0d63 Removed debug code (always get bubble gum as powerup). 2018-05-27 23:44:51 +10:00
hiker
ab3a3e1155 Combined event handler and emitter in item into one object (since
they are the same anyway).
2018-05-27 23:42:38 +10:00
hiker
079b5abe2a Started to use ItemState instead of Item in the attachment and
powerup callbacks on item collection.
2018-05-27 00:42:21 +10:00
hiker
227572809a Synch attachments of bananas between client and server, some
code cleanup.
2018-05-22 00:00:38 +10:00
hiker
9108934c18 Added handling of predicted item drops. 2018-05-21 10:09:10 +10:00
Alayan-stk-2
b8d2dc9034 Fix #3182 (#3260)
Checklines validation is for karts only, so having it true for the basket ball made the ball_distance always equal to zero. Setting it to false make the basket ball work again.
2018-05-19 18:23:58 -04:00
hiker
cdea16f81d Fixed kart id being received as unsigned int (needs to be signed since
the sign indicates the event type).
2018-05-16 08:55:18 +10:00
hiker
ad82dca6cc Created separate file for ItemEventInfo. 2018-05-15 18:05:46 +10:00
hiker
0d850201fb Renamed and split the two newItem () functions into three functions:
placeItem(), placeTrigger(), dropNewItem(). Started to add support
for networked bubble gum (though that's not working, i.e. will crash
atm ;) ).
2018-05-15 10:40:25 +10:00
Alayan-stk-2
7f84dd39a6 Numerous improvements related to ghost replays (#3244)
* Update GUI files for replay improvements

* Updated replay capabilities

* Improve timer formatting possibilities

Mainly, the ability to choose to display or not minutes, and to choose how many digits are shown after seconds (from 0 : second as smallest timestep - to 3 : ms as smallest timestep)

Also displays "mm:ss.ms" rather than "mm:ss:ms".

* Some new list widget possibilities

Like the ability to update the header while the list is displayed (useful to add or remove columns)

* Update ghost kart for the new replay data

* Also update the ghost controller

* Live differences with ghost replays in linear worlds

* Replay-related UI changes

Big changes to the replay selection screen, and small change to the race UI (add the live timer in ghost races) and the race result UI (add the option to directly race against a newly saved ghost).

* Improves the replay action modal dialog

* Fix time-to-ticks regression

* Several requested improvements

* Improved ghost icon

Also updates the license

* GUI changes and improvements to accomodate multi-mode support

* Additional recorded data

* More functions to get the current race state

* Update replay variables to match what is used

* Updated replay-related config values

* Add ghost kart support to easter egg hunt mode

* Transparent attachments for ghost karts

* Use new stored data (color, item type)

Also :
- Interpolate speed for smoother display in watch-only mode
- Coding style improvements

* Fix coding style issues and add UI support for modes

* Fix coding style issues & support for easter egg mode

* Remove leftover prints

* Use getDifficultyName to remove hardcoded values

* Fix attach_ticks and coding style fixes

* Make the position of the timers fully relative

Otherwise, they would tend to touch each other in some resolutions

Also add a comment about the 59.9995f

* Make the list filling code clearer

Also use getDifficultyName

Most of the line changes shown by git correspond to moving around some bits or adjusting indentation.

* Remove a TODO as requested

* Fix dialog being dismissed too soon

* Remove a fixme

* Small clean up

* Fix logging

* Partial #3249 fix
2018-05-13 20:51:52 -04:00
hiker
8c4158c139 Removed option to set item etc type via additional parameter for
networking. Now networking relies on deterministically determined
'random' item types and state updates.
2018-05-14 08:46:50 +10:00
hiker
d2dc99f859 Added --disable-item-collection command line flag, which is useful
for evaluating client/server 'disagreements'.
2018-05-13 23:43:29 +10:00
hiker
af0495848a Use client prediction for item collection. 2018-05-13 01:04:45 +10:00
hiker
d88ce3b3b6 Removed unused code, coding style fixes. 2018-05-11 09:41:46 +10:00
hiker
5f8dc7b641 Added debug comment to let the server not connect any items
(--> client predictions wrong, useful for debugging).
2018-05-10 23:24:07 +10:00
hiker
ff6d5119b4 CLients now predict item (predictions are not synched with server,
so the item will chance once the server update is received atm).
2018-05-10 23:23:23 +10:00
hiker
8f2b991e6a Code cleanup. 2018-05-10 09:31:21 +10:00
hiker
4e37c1388b Item collection on a client now works, though it is not predicted yet.
Other things (dropping bubble gum, switch, synchronised banana collection)
still do be done.
2018-05-10 01:09:23 +10:00
hiker
c98df155a6 Change item visibility always in Item::updateGraphics, which (except
for listener) makes it unnecessary to call collect for Item (only
for ItemState).
2018-05-10 01:05:38 +10:00
hiker
e1530267f3 Fixed compilation error and some warnings. 2018-05-09 00:48:20 +10:00
hiker
9d60112e65 Started to implement proper item handling: the server now sends
updates of all collected items to the clients as part of a state.
A client confirms the received states. Once all clients have
confirmed a certain event, that event is deleted on the server
and not sent anymore. WIP, item collection kind of works, but only
because of kart state updates which include attachment (but not
e.g. nitro).
2018-05-08 19:12:06 +10:00
hiker
eb647124e8 Split the item update into update and updateGraphics() parts. 2018-05-04 16:41:03 +10:00
hiker
3e518968b3 Added a generic collectedItem() virtual function to world
instead of a special case of easter eggs only.
2018-05-04 10:29:44 +10:00
hiker
10ce48b86f Moved notification of easter egg collectoin from Item to ItemManager. 2018-05-04 09:48:54 +10:00
hiker
5ba79bddd7 Removed m_confirmed, renamed m_disappear_counter to m_used_up_counter. 2018-05-04 09:31:50 +10:00
hiker
9392354663 Split Item into two classes: ItemState which contains the non-graphical
and changing properties (e.g. collected,item type etc), and Item (using
ItemState as base class) which contains graphical and constant values.
2018-05-04 01:01:15 +10:00
Alayan-stk-2
a1e19f3692
Fixes weight computation at reference points 2018-04-29 07:23:33 +02:00
Alayan-stk-2
1545c10328
Split loadAllPowerups in two functions 2018-04-28 23:00:23 +02:00
Alayan-stk-2
5e749901f3
New loadPowerupsModels function 2018-04-28 22:58:03 +02:00
Alayan-stk-2
c785a45e93
Fixes ordering error 2018-04-27 23:46:13 +02:00
Alayan-stk-2
5f994204ab
Use only one random number for item selection 2018-04-27 23:25:08 +02:00
Alayan-stk-2
acf9ed1eab
Remove unused default value
Also corrects a comment typo
2018-04-26 05:35:12 +02:00
Alayan-stk-2
ae21cfe8d7
Fix log reporting 2018-04-25 23:18:02 +02:00
Alayan-stk-2
e10e56a962
Various improvements requested in review 2018-04-25 11:43:46 +02:00
hiker
8a8b954bf9 Fixed more ticks vs time issues. 2018-04-24 17:44:39 +10:00
Alayan-stk-2
4d4fff690d
Support for multiple reference weight lists 2018-04-23 03:51:39 +02:00
Alayan-stk-2
d79e4a1509
Use referenc 2018-04-23 03:49:48 +02:00
Deve
e0a5bd1027 Restore dropping bubblegum after shield explosion 2018-04-20 22:04:29 +02:00
hiker
78f96d4818 Temporary 'fixed' banana handling. 2018-04-21 01:32:03 +10:00
Benau
e5c991e3d2 Merge remote-tracking branch 'origin/master' into kobato 2018-04-20 13:03:34 +08:00
Benau
6eaa88a3f5 Remove the unknown 255 attachment which caused by Endcontroller replacement 2018-04-20 12:19:58 +08:00
hiker
98555a8f35 Merge remote-tracking branch 'origin/master' into game_protocol 2018-04-19 10:57:37 +10:00
hiker
95bba525c5 Refacotring: instead of Moveable::update calling updateGraphics,
this is now called separately once per rendered frame from
the main loop. Started to split other objects to have separate
updateGraphics functions (e.g. to fix skid marks issues caused
by previously updating skidmarks even in rewind).
2018-04-18 22:27:06 +10:00
auria.mg
7543240db0 Merge branch 'Fix_3167_attempt' 2018-04-08 20:51:54 -04:00
auria.mg
61469a6806 Mitigate AI-related edge cases of original fx 2018-04-08 20:47:24 -04:00
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
hiker
17200d7809 Merge remote-tracking branch 'origin/master' into game_protocol 2018-03-30 22:47:30 +11:00
Benau
85895074aa Merge branch 'origin/master' 2018-03-24 09:31:06 +08:00
hiker
c456edd9f2 Convert more time handling to handling ticks. 2018-03-20 09:25:39 +11:00
hiker
d3a60356c9 Merge remote-tracking branch 'origin/fix-timestep' into game_protocol.
Started to use ticks instead of time floating point values in networking.
2018-03-13 18:37:12 +11:00
auria.mg
48f2aa3da4 Fix bubblegum flashing, fixes #3133 2018-03-11 19:35:59 -04:00
hiker
ae111d3cfb Fixed item rotation in network mode. 2018-03-05 22:42:01 +11:00
hiker
95f0bf9e3b Used functions in stk_config to convert between ticks and times. 2018-02-23 23:22:49 +11:00
hiker
cb712411e0 Converte some pararchute values to use ticks. 2018-02-23 10:01:22 +11:00
hiker
81342ddd00 Fixed several mixups of ticks and time. 2018-02-22 19:25:11 +11:00
hiker
797e35c674 Bugfix, forgot to change the type from float to int. 2018-02-22 09:23:45 +11:00