Skip to content

Nomagno/stk-code

 
 

Repository files navigation

SuperTuxKart Tyre Mod Edition by Nomagno, based on STK 2.X Alpha

+ Command Manager (CM) by Kimden

Or in short, STK 2.Xue TME + CM :P

SuperTuxKart is a free kart racing game. The SuperTuxKart homepage can be found at https://supertuxkart.net/.

Installing

Grab the latest binary for your system here

Building from source

Building instructions can be found in INSTALL.md

To compile SuperTuxKart TME, you will need to install custom assets. Check out the releases tab for the latest version of stk-assets.zip.

A shorter and clearer version of the info below can be found in a new "Tyres" tab in the in-game help menu.

STK Tyre Mod Edition

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.


What is SuperTuxKart 2.0 Tyre Mod Edition (TME)?

STK TME is a SuperTuxKart mod by Nomagno that introduces some limited race simulation elements, namely arcade versions of tyre degradation and fuel systems. Its overall aim is to arrive at configurable and that can improve long (6 laps all the way to 200 laps) races and provide more opportunities for tournament formats and friendly competitions. It is not concerned with casual players in its default configuration, though it makes sure not to make any casual-unfriendly choices that can not be disabled easily enough through configuration files or the (currently very primitive) in game UI.

Features:

  • Revised handicap: it works more like an engine limiting system, where each handicap step reduces base topspeed, acceleration and braking power by 0.5% from no handicap. There are 48 handicap levels, from 0% to 24% penalty in 0.5% steps. As a quick reference, in tracks with a laptime of 50 seconds each handicap step might result in 2-4 tenths of a second lost per lap, though experienced players might be able to partially compensate for small handicap levels as it ever so slightly improves ease of cornering.
  • Backplunger patch: In STK 2.0 and 1.0, the plunger item, when shot backwards, blocks the hit player's viewport. This sucks. It has been changed to instead remove the items of the hit player. It hence changes from an annoying item to a disarment item if the player behind takes too long to aim their cake or bowl.
  • UI: the tyre compound code (or PIT if pitting) is shown on the leaderboard on the top left, inside the kart icon. The tyre lifes in bar form and the fuel are shown in the bottom right in this order: traction turning fuel. These bars/meters will show their 0 position as the configured minimum kart_characteristics.xml, and will not go below their 0 position. However, know the tyres can and do degrade more even when the bars don't show it! However, if both degradation bars are empty, it's very likely you should pit for new tyres if possible. The fuel is replaced by desired fuel to refill during fuel pit stops.
  • The tyres: the main tyres are:
    • Soft: Starts out VERY fast, but also degrades very fast, specially by high-speed turning (in Hacienda, one of the least demanding tracks on tyre degradation, it can be useful for around 5 laps only if you don't manage it)
    • Medium: Starts out at the kart's normal speed, and degrades at a normal rate.
    • Hard: Starts out at a lowish speed, gets slightly faster as it warms up, and then degrades very slowly.
    • CHEAT: It does degrade but it has no effect in the kart's speed, meaning it effectively is the same as disabling tyre degradation.
    • New tyres can be easily created in kart_characteristics.xml, see below instructions.
  • Full online support. Obviously, though, the server must be compiled from TME as well.
  • Initial tyre compounds (the ones you have when you start the race) are configured by selecting them in the kart selection screen. Online, it's accessed by double clicking your username along with accessing handicap config.
  • Fuel can be configured offline from the race setup menu, and online from the wrench icon in the server lobby. Initial fuel can not be configured on a per-player basis yet.
  • Tyre compounds, configurable from kart_characteristics.xml with the response curves generated with the help of the compound_response_curves.ods spreadsheet. Each compound has several parameters:
    • Traction tyre life: reduced by two factors, the current speed being a minor factor and the current front-back center of mass (or centerofmassY = mass*acceleration) being a major factor. The acceleration used is the smallest acceleration from the current time instant to the latest past 6 speed snapshots taken 0.3s apart. In spite of this, changing speed passively by using too many boosts without spacing them out adequately, or braking too hard, can still affect the degradation noticeably. Going offroad and braking multiply the degradation rate of the tyre life by a configurable factor. Additionally, a mode can be enabled where bumping into track obstacles reduces the tyre life by a fixed percentage (part of the gradual braking mitigation talked about in the 2.0 section along with the offroad muliplication).
    • Turning tyre life: degrades faster based onthe the center of mass left-right of the kart, taken as the mass times the centripetal force the kart is experiencing right now (centerofmass X = mass*(speed^2)/turnRadius). Multiplied by a configurable factor when skidding. If the track bumping penalty is enabled, it will also be reduced by the same percentage as the traction life.
    • Transfer: turning limiting transfer is how much the traction tyre life is degraded for each 1% of the turning degradation, when turningLife < tractionLife. The regular transfer is the same, but for when turningLife > tractionLife. Same for the traction limiting and turning transfers.
    • Topspeed, traction, and turning response curves: each compound can react differently at each percentage of its tyre life by reducing/increasing the kart's traction and topspeed (different curves both using the same traction tyre life) and reducing/increasing how much the kart turns. These curves can be seen as functions affecting the kart stats dynamically finalStat(Percentage, baseStat) = baseStat*curve(Percentage) or finalStat(Percentage, baseStat) = baseStat - curve(Percentage). It can be configured if the numbers in these curves will be substracted from the base stat, or multiplied by the base stat.
  • There are no plans for temperature or grip simulation at the moment, but it wouldn't be particularly hard to add, just impractical for the wide variety of STK tracks and its physics.
  • Tyre allocation: During a race, the current tyre allocation will be showed as a table of compounds S M H and numbers XXX XXX XXX, above the tyre life and fuel bars. It can be configured before the race. The allocation has the following meaning for each compound: -1 is the same as INF, and it means that any amount of tyres can be used. 0 means that no tyres of that type can be used anymore for the remainder of the race. X where X is a number greater than 0 means that the tyre can be used X more times. When you use a tyre changer, the allocation of the corresponding compound will be reduced by 1. If you try to pit for a new tyre of a specific compound when you have none left, you will receive a 50% tyre life tyre, which is basically useless, so be careful! Can also be configured by the server host with the wrench icon, along with the fuel settings.
  • Tyre changers: they will, when passed over, change your tyres to a fresh set. They have the model of a tyre stack. They can be added in the same place where the items and nitro are in each track's scene.xml, in the form <tyre-changer compound="1" stop-time="30" id="tc0" x="234.35" y="44.3" z="24.5" h="20"> where the parameters configure respectively the compound ID (see kart_characteristics.xml, by default SOFT=2 MEDIUM=3 HARD=4), the pit stop time penalty applied to the kart, the unique object id (must be unique and different from the other nitro and items!), the xyz coordinates and the height from the ground (I think!). I recommend simply using the coordinates of an existing object if you do not know how to use blender to position the tyre changers, though basic geometry can allow you to position them decently enough if you use the coordinates of known items to construct their positions.
  • Fuel pumps: tyre changers with compound ID 123, which is specially reserved to indicate a fuel pump. When going over a fuel pump, a fixed time penalty will be applied. During this time penalty, in the UI your fuel will instead be replaced by the fuel you wish to put into the kart. You can hold the nitro button to increase this amount, though careful you don't run out of time to input your desired number! The amount of liters will be put into the car at a fixed pump speed, so will still be slow until the tank is full! Your time penalty will still take the wasted fuel into account, though, so 100 liters will still take 10 seconds even if only 50L were actually put into the tank.
  • Fuel can be enabled/disabled in the race setup menu along with allocation. Heavier classes have more fuel tank capacity. With fuel mode on WEIGHTLESS, fuel doesn't impact performance. With fuel mode on "ON", a full fuel tank slows the kart and increases degradation.

What is SuperTuxKart 2.0? (A non-official and perhaps not perfectly uncontroversial guide)

SuperTuxKart 2.0 is the upcoming verion of SuperTuxKart, and its development branch is used (along with upstream merges) as the basis for the TME.

For SuperTuxKart 2.0, one of the main points of interest was identifying weak points in the balancing that was done for the 1.0 release, and fix them. This process is still ongoing, but the initial positions that were taken by Alayan after the evaluation process of pro-level gameplay trends are these:

  1. The karts handle too well, to the point only a couple dozen of tracks out of the several hundreds developed in STK history have truly been optimal for 1.0 light class' insanely good acceleration and turning. As a result, the vast majority of tracks are best played competitively with medium, but mostly heavy karts. A minority of players even considers the light kart a handicap in its current state. This is further exaggerated by the fact a majority of standard tracks favour heavies, and only two (XR and Minigolf) can actually
  2. The rubberbanding is inconsistent and weak. The players in the back are given boosts, and if the players are not very good, they will naturally crash and lose even more time. The players in the front are given weak and defensive items that mostly allow them to defend from any attempts to pass or from basketballs, and make for uninsteresting gameplay even for the ones in first. The specific probabilities of receiving each item at each position are such that quite frequently there will be ridiculously lucky or unlucky streaks where a player in first that isn't supposed to get many zippers will get enough to cement their lead for the rest of the race, or a player in the back will get no help and be left to dro peven further behind.
  3. There is a distinct lack of boosts. This has led to STK 2.0 being called "the boost update" by some (What? Just me? Okay...).
  4. There are several inconsistencies with the item system and questionable choices when a game must allow both skillfulness and for everyone to win.

This said, Alayan's choices and the lack of available testers so far has resulted in a meta that is much more tailored to making mistakes as well as comebacks more easy. If I may use as a comparison STK's distant cousing project Sonic Robo Blast 2 Kart, STK 2.0 seems to be shaping up to be to STK 1.0 what Dr. Robotnik's Ring Racers has been to SRB2Kart, an update that raises the skill ceiling and is only incidentally balanced to not leave behind the casual players.

A quick run-down of the added, removed and modified features with a rough crediting of who came up with them (mostly to leave written down somewhere which I participated in lmao). A fitting name for this update might also be "The Technological Update" based on what is to come. Note most of this was implemented by Alayan regardless of the design credits, except when noted otherwise:

  • New item: Nitro Hack. This item hacks the karts in front, stealing nitro from them and potentially leaving them with negative nitro that they must remove by collecting more nitro. The user then recieves all of the stolen nitro, potentially with a multiplier, and is given a huge temporary boost to nitro usage represented by the nitro aura turning green from its normal blue. The initial purpose of this item was to encourage nitro stockpiling from the race leaders to avoid dropping into negative nitro which might be very hard to recover from, at the same time it provides a boost that can be dosified by the user (unlike zippers).
  • New item: Mini-wish. Gives players in the first positions tons of options and spices up their play time while also not making these players tangibly more powerful as compared to before unless they strategize its usage heavily. It gives a choice between a weaker version of the cake, zipper and bubblegum powerups
  • New item: Electro-shield. It gives a multiplication to the engine force, gives a slight top speed boost, does not shield from bubblegums on the floor, but otherwise acts as a perfect shield.
  • Item behaviour change: Bubblegum. The bubblegum shield now doesn't stack infinitely when deployed on top of an existing bubblegum shield, instead it only adds half its duration. Crucially, it now pops when using any offensive items, making it a solely defensive item and relegating the electro-shield as its offensive cousin.
  • Interaction change: deploying a swatter when a bubblegum shield is active now pops the bubblegum shield instead of simply erasing it.
  • New feature: Impulse-based collision system. When two karts collide, the heavier one will make the lighter one yield, and they will both get a proportional impulse to one side, minimizing the actual time they spend in contact. The main benefit of this approach is it allows wheel bumping and "bumper cars" much more, as opposed to the purely physical approach of 1.0 that meant karts engaged in fierce battles would often interlock, lose their steering autonomy, and have a double crash into the wall. Needs some tuning or a rework though, as it's good but looks ugly.
  • New feature: Boosts make the slowdown from going offtrack be reduced, allowing players to freestyle their own cuts. THIS WAS REMOVED FOR TME BECAUSE IT'S A TERRIBLE FEATURE
  • New feature (stolen from a more popular game for no obvious reason): Purple skids. Not BAD I guess? But might be tuned in TME in the future.
    • Feature modification: basketballs are now inescapable. I personally hate this, but it has its merit. In 1.0 the basketballs can be outran indefinitely in most tracks by a good enough player. Mostly changed back to the 1.0 behaviour in TME.
  • Anti-glitch fix and new feature: Identified, designed and implemented by Nomagno. In SuperTuxKart 1.0, the fact that on-track zipper boosts occupy the same slot as the item zippers mean that you can't use item zippers tracks that have big, long-lasting ground zipper pad sections. This seemingly small issue has become a huge deal for most of the 1.0 lifecycle, specially with the proliferation of track ports from racing simulators such as STK's Italian, open-source older brother TORCS turned Speed Dreams. These tracks are mostly so big they need ground zippers to be any fun. The separation makes it so that on-track zippers are a distinct boost that is not overridden by item zippers, and viceversa. However, their effects are not cumulative. Instead, the best engine force of either active boost and the best top speed of either active boost will be separately applied at any given time, automatically giving the player the best combination while ensuring they can't reach absurd speeds that slightly break the physics simulation.
  • Gradual braking: Suggested by Nomagno. Basically, now braking will be applied, even with a keyboard, as a separate entity from acceleration, and gradually at a maximum fixed rate. This drops braking points up to a dozen meters back in the tighter tracks, and consequently raises the skill cap a bit while. An as-of-yet unfixed issue (though severely mitigated by my auxiliary changes in TME, as I was the one who identified the issue in the first place) is the fact that it now becomes sometimes faster to take the grass/gravel/etc on the side of tracks than to brake for corners.
  • New handicap system: handicaps don't change the feel of the karts, only their boosts and speeds. There are four handicap levels, 6%, 12%, 18% and 24%. For TME, online support for all handicap levels was added. The higher handicap levels make for a proper way for good players to have fun with more casual gamers, and it even has potential in tournament rulesets.

About

The codebase of SuperTuxKart: Tyre Mod Edition

Resources

License

Stars

Watchers

Forks

Languages

  • C++ 54.6%
  • C 40.6%
  • CMake 2.3%
  • HTML 0.4%
  • GLSL 0.4%
  • ISPC 0.4%
  • Other 1.3%