Merge remote-tracking branch 'origin/master'

This commit is contained in:
Benau 2018-11-27 15:17:48 +08:00
commit 7d1e7df010
13 changed files with 1759 additions and 1642 deletions

View File

@ -6,25 +6,53 @@ It should be kept in mind that some versions have a less complete changelog than
For similar reasons, and because some features are vastly more complex than others, attributions of main changes should not be taken as a shorcut for overall contribution.
## Unreleased
* New game mode Capture the Flag for online multiplayer by Benau
* New game mode Free for All for online multiplayer by Benau
* Networking game for normal race, time trial, free for all, capture the flag and soccer
* Better random item distribution for various numbers of karts by Alayan and hiker
* Numerous improvements to input on Android by deveee
* Gyroscope support for Android by Pelya
* Unlockable SuperTux challenges in Story Mode by Alayan
* Race UI improvements (new speedometer, nitro gauge, bigger minimap) by Alayan
* Improvements to ghost replays (more data saved, live time difference, replay comparison, UI improvements, egg hunt replays) by Alayan
* Improvements to ghost replays (more data saved, live time difference, replay comparison, egg hunt replays) by Alayan
* Kart color customization by Benau
* Improved powerup handling in AI by Alayan
* Multithreading contention fixes by Benau
* Improved powerup and nitro handling in AI by Alayan
* Local multiplayer improvements by Fantasmos
* New coal skin by Alayan
* Revised kart characteristics for better balance between light, medium and heavy karts by Alayan
* Fix kart being uncontrollable and hovering when landing on some downward slopes by hiker
* Mitigate a physics issue which could send a kart flying on collisions by hiker
* Make kart turn radius based on kart class instead of kart model length (which made Adiumy unplayable and caused AI issues) by Alayan
* Major revamp of the achievement system to make adding new achievements much easier and flexible, also fixing some related bugs by Alayan
* Fix position interpolation causing some incorrect lapline validation by Auria
* Store up to 5 highscores for a track/difficulty/mode/kart number combination, instead of 3
* Start boost/penalty moved to the set phase for smoother networking
* Visual improvements (new skidding particles, better rescue, bubblegum flashing before ending)
* Audio improvements (crash sound depending on speed/direction, sound cue in nitro challenges)
* Gameplay improvements (much better slipstreaming, GP points...)
* Gameplay improvements (level 1 skid boost doesn't interrupt level 2 boost, fairer rubber-banding in low difficulties, boosted AI for some karts for more challenge in GPs, much better slipstreaming, small balance change of GP points, more useful and consistent handicap option...)
* Terrain slowdown works again as intended on several tracks where it was missing
* Fix STK incorrectly connecting to the server when the internet option is disabled by Auria
* Many bugfixes
### User Interface
* Race UI improvements (new speedometer, nitro gauge, bigger minimap, minimap display options, more legible text with outlines and for some bigger font) by Alayan
* New coal skin by Alayan
* New networking user interface by Benau and hiker
* Multidirectional keyboard navigation in menus by Alayan
* Support text breaks into multiple line in lists, e.g. in the addons menu, by Alayan
* Improved help menu with lateral tabs and a lot more information by Alayan
* Improved option menu with lateral tabs by Alayan
* Many improvements to the ghost replay selection list (give access to egg hunt replays, kart icon shown in the list, replay's game version shown, hide player number column by default) and dialog (allow replay comparison, show track picture, show information about the selected replays) by Alayan
* Other significant enhancements (detailed progress of multi-goal achievements, reset password button, clearer checkbox status, milliseconds displayed in time-trials and egg hunts, nitro efficiency in the kart selection screen, better track info screen, better warnings when trying to do an online action with internet access disabled, control configurations can be disabled without being deleted...)
* Many bugfixes and small enhancements mostly by deveee and Alayan
### Tracks and modeling
#### Tracks
* Many unwanted shortcuts and exploits fixed by Auria
* Las Dunas Soccer by samuncle
* Candela City arena by Benau based on samuncle's track
* Unwanted shortcuts and exploits fixed by Auria in many tracks :
* Around the Lighthouse, Fort Magma Grand Paradisio Island, Hacienda, Minigolf, Nessie's Pond, Northern Resort, Oliver's Math Class, Shifting Sands, STK Enterprise, XR591
* Smoothness issues causing collisions and kart slowdown fixed by Auria :
* Nessie's Pond, Old Mine, Shifting Sands, Volcano Island, XR591
## SuperTuxKart 0.9.3 (28. October 2017)
* Reduced RAM and VRAM usage, reducing load times by Auria and Benau
@ -42,8 +70,9 @@ For similar reasons, and because some features are vastly more complex than othe
* Various improvements (starting boost effect, wall driving fixes, parachutes, GP points, help page for bananas, cannon fixes, colorization shader)
### Tracks and modeling
#### Karts
* New kart Wilber and Hexley by Jymis
* New kart Kiki and updated Konqi by Benau
* Kiki by Benau
* New versions of Wilber and Hexley by Jymis
* New version of Konqi by Benau
#### Tracks
* All tracks drivable in reverse, with arrows pointing in the correct direction
* Candela City by samuncle (replace Shiny Suburbs)

View File

@ -470,7 +470,7 @@ else()
find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIRS})
find_path(NETTLE_INCLUDE_DIRS nettle/gcm.h nettle/sha.h nettle/base64.h nettle/version.h nettle/yarrow.h)
find_path(NETTLE_INCLUDE_DIRS nettle/version.h)
find_library(NETTLE_LIBRARY NAMES nettle libnettle)
if (NOT NETTLE_INCLUDE_DIRS OR NOT NETTLE_LIBRARY OR USE_CRYPTO_OPENSSL)

View File

@ -2,11 +2,13 @@
<stkgui>
<div x="1%" y="1%" width="98%" height="99%" layout="vertical-row" >
<header width="80%"
<header width="80%" height="7%"
I18N="In the kart selection (player setup) screen"
text="Choose a Kart"
align="center" text_align="center" />
<spacer height="1%" width="25"/>
<placeholder id="playerskarts" width="100%" align="center" proportion="4">
<!-- Contents is added programatically -->
</placeholder>

File diff suppressed because it is too large Load Diff

View File

@ -157,11 +157,13 @@ public:
// Note: GO_PHASE is both: start phase and race phase
bool isStartPhase() const { return m_phase<GO_PHASE; }
// ------------------------------------------------------------------------
bool isRacePhase() const { return m_phase>=GO_PHASE &&
m_phase<FINISH_PHASE; }
bool isRacePhase() const { return (m_phase>=GO_PHASE &&
m_phase<FINISH_PHASE) ||
m_phase == GOAL_PHASE; }
// ------------------------------------------------------------------------
bool isActiveRacePhase() const { return m_phase>=GO_PHASE &&
m_phase<DELAY_FINISH_PHASE; }
bool isActiveRacePhase() const { return (m_phase>=GO_PHASE &&
m_phase<DELAY_FINISH_PHASE) ||
m_phase == GOAL_PHASE; }
// ------------------------------------------------------------------------
/** While the race menu is being displayed, m_phase is limbo, and
* m_previous_phase is finish. So we have to test this case, too. */

View File

@ -265,19 +265,25 @@ void GameSetup::sortPlayersForGrandPrix()
} // sortPlayersForGrandPrix
//-----------------------------------------------------------------------------
void GameSetup::sortPlayersForTeamGame()
void GameSetup::sortPlayersForGame()
{
std::lock_guard<std::mutex> lock(m_players_mutex);
if (!isGrandPrix())
{
std::random_device rd;
std::mt19937 g(rd());
std::shuffle(m_players.begin(), m_players.end(), g);
}
if (!race_manager->teamEnabled() ||
ServerConfig::m_team_choosing)
return;
std::lock_guard<std::mutex> lock(m_players_mutex);
for (unsigned i = 0; i < m_players.size(); i++)
{
auto player = m_players[i].lock();
assert(player);
player->setTeam((KartTeam)(i % 2));
}
} // sortPlayersForTeamGame
} // sortPlayersForGame
// ----------------------------------------------------------------------------
std::pair<int, int> GameSetup::getPlayerTeamInfo() const

View File

@ -165,7 +165,7 @@ public:
// ------------------------------------------------------------------------
void sortPlayersForGrandPrix();
// ------------------------------------------------------------------------
void sortPlayersForTeamGame();
void sortPlayersForGame();
// ------------------------------------------------------------------------
void setHitCaptureTime(int hc, float time)
{

View File

@ -535,7 +535,7 @@ void ServerLobby::asynchronousUpdate()
// Remove disconnected player (if any) one last time
m_game_setup->update(true);
m_game_setup->sortPlayersForGrandPrix();
m_game_setup->sortPlayersForTeamGame();
m_game_setup->sortPlayersForGame();
auto players = m_game_setup->getConnectedPlayers();
for (auto& player : players)
player->getPeer()->clearAvailableKartIDs();
@ -1663,7 +1663,7 @@ void ServerLobby::handleUnencryptedConnection(std::shared_ptr<STKPeer> peer,
}
unsigned player_count = data.getUInt8();
auto red_blue = m_game_setup->getPlayerTeamInfo();
auto red_blue = STKHost::get()->getAllPlayersTeamInfo();
for (unsigned i = 0; i < player_count; i++)
{
core::stringw name;

View File

@ -25,6 +25,7 @@
#include "network/game_setup.hpp"
#include "network/network_config.hpp"
#include "network/network_console.hpp"
#include "network/network_player_profile.hpp"
#include "network/network_string.hpp"
#include "network/network_timer_synchronizer.hpp"
#include "network/protocols/connect_to_peer.hpp"
@ -1248,3 +1249,20 @@ void STKHost::initClientNetwork(ENetEvent& event, Network* new_network)
if (pm && !pm->isExiting())
pm->propagateEvent(new Event(&event, stk_peer));
} // replaceNetwork
// ----------------------------------------------------------------------------
std::pair<int, int> STKHost::getAllPlayersTeamInfo() const
{
int red_count = 0;
int blue_count = 0;
auto pp = getAllPlayerProfiles();
for (auto& player : pp)
{
if (player->getTeam() == KART_TEAM_RED)
red_count++;
else if (player->getTeam() == KART_TEAM_BLUE)
blue_count++;
}
return std::make_pair(red_count, blue_count);
} // getAllPlayersTeamInfo

View File

@ -337,6 +337,9 @@ public:
// ------------------------------------------------------------------------
void setNetworkTimer(uint64_t ticks)
{ m_network_timer.store(StkTime::getRealTimeMs() - ticks); }
// ------------------------------------------------------------------------
std::pair<int, int> getAllPlayersTeamInfo() const;
}; // class STKHost
#endif // STK_HOST_HPP

View File

@ -73,9 +73,12 @@ FocusDispatcher::FocusDispatcher(KartSelectionScreen* parent) : Widget(WTYPE_BUT
m_parent = parent;
m_supports_multiplayer = true;
m_is_initialised = false;
Widget* kartsAreaWidget = parent->getWidget("playerskarts");
assert(kartsAreaWidget);
m_x = 0;
m_y = 0;
m_y = kartsAreaWidget->m_y;
m_w = 1;
m_h = 1;

View File

@ -490,9 +490,8 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
if(UserConfigParams::m_internet_status!=RequestManager::IPERM_ALLOWED)
{
new MessageDialog(_("You can not play online without internet access. "
"If you want to play online, go to options, select "
" tab 'User Interface', and edit "
"\"Connect to the Internet\"."));
"If you want to play online, go in the options menu, "
"and check \"Connect to the Internet\"."));
return;
}
OnlineScreen::getInstance()->push();
@ -506,18 +505,16 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
if (!addons_manager->anyAddonsInstalled())
{
new MessageDialog(_("You can not download addons without internet access. "
"If you want to download addons, go to options, select "
"the 'User Interface' tab, and check "
"\"Connect to the Internet\"."));
"If you want to download addons, go in the options menu, "
"and check \"Connect to the Internet\"."));
return;
}
else
{
AddonsScreen::getInstance()->push();
new MessageDialog(_("You can not download addons without internet access. "
"If you want to download addons, go to options, select "
"the 'User Interface' tab, and check "
"\"Connect to the Internet\".\n\n"
"If you want to download addons, go in the options menu, "
"and check \"Connect to the Internet\".\n\n"
"You can however delete already downloaded addons."));
return;
}

View File

@ -1180,18 +1180,33 @@ void RaceGUI::drawLap(const AbstractKart* kart,
if (ctf || sw)
{
if (score_limit != -1)
pos.UpperLeftCorner.X -= 80;
int red_score = ctf ? ctf->getRedScore() : sw->getScore(KART_TEAM_RED);
int blue_score = ctf ? ctf->getBlueScore() : sw->getScore(KART_TEAM_BLUE);
gui::ScalableFont* font = GUIEngine::getHighresDigitFont();
font->setBlackBorder(true);
font->setScale(scaling.Y < 1.0f ? 0.5f: 1.0f);
font->setScale(1.0f);
core::dimension2du d;
if (score_limit != -1)
{
d = font->getDimension(
(StringUtils::toWString(red_score) + L"-"
+ StringUtils::toWString(blue_score) + L" "
+ StringUtils::toWString(score_limit)).c_str());
pos.UpperLeftCorner.X -= d.Width / 2;
int icon_width = irr_driver->getActualScreenSize().Height/19;
core::rect<s32> indicator_pos(viewport.LowerRightCorner.X - (icon_width+10),
pos.UpperLeftCorner.Y,
viewport.LowerRightCorner.X - 10,
pos.UpperLeftCorner.Y + icon_width);
core::rect<s32> source_rect(core::position2d<s32>(0,0),
m_champion->getSize());
draw2DImage(m_champion, indicator_pos, source_rect,
NULL, NULL, true);
}
core::stringw text = StringUtils::toWString(red_score);
font->draw(text, pos, video::SColor(255, 255, 0, 0));
core::dimension2du d = font->getDimension(text.c_str());
d = font->getDimension(text.c_str());
pos += core::position2di(d.Width, 0);
text = L"-";
font->draw(text, pos, video::SColor(255, 255, 255, 255));
@ -1199,13 +1214,11 @@ void RaceGUI::drawLap(const AbstractKart* kart,
pos += core::position2di(d.Width, 0);
text = StringUtils::toWString(blue_score);
font->draw(text, pos, video::SColor(255, 0, 0, 255));
font->setScale(1.0f);
pos += core::position2di(d.Width, 0);
if (score_limit != -1)
{
text = L" (";
text = L" ";
text += StringUtils::toWString(score_limit);
text += L")";
font->draw(text, pos, video::SColor(255, 255, 255, 255));
}
font->setBlackBorder(false);