Skip to content

Instantly share code, notes, and snippets.

@smoogipoo
smoogipoo / offsets.md
Last active September 28, 2023 04:52
Master doc on offsets in osu!

Last updated: 2021-07-27

How offsets and latency work

This is the pictorial representation that I'll use to explain how a player's timings could come about:

            hitobject     track latency    beat (track)
               vvv             vvv             vvv
Track: ---------H---T---------H---T---------H---T---------H---T-------------
User: -------------K---S---------K---S---------K---S---------K---S---------
.class nested private auto ansi sealed beforefieldinit '<>c__DisplayClass25_0'
extends [netstandard]System.Object
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
)
// Fields
.field public class osu.Framework.Graphics.Cursor.TooltipContainer '<>4__this'
.field public float64 appearDelay
.field public float64 alphaModifiedAppearDelay
[MemoryDiagnoser]
public class BenchmarkMethodDelegateAllocations
{
private readonly List<int> list = new List<int> { 1, 2, 3 };
private int field = 2;
[Benchmark(Baseline = true)]
public int SafeMethod()
{
int res = 0;
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Runtime.CompilerServices;
namespace osu.Framework.Graphics.OpenGL
{
/// <summary>
/// The depth value used to draw 2D objects to the screen.
/// Starts at -1f and increments to 1f for each <see cref="Drawable"/> which draws a opaque interior through <see cref="DrawNode.DrawOpaqueInterior"/>.
if (UpsideDown)
{
if (ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Hidden))
hiddenFade.Position.Y = HitPosition + hiddenMask.VectorScale.Y / 1.6f;
else
hiddenFade.Position.Y = WindowManager.DEFAULT_HEIGHT - hiddenMask.VectorScale.Y / 1.6f;
}
else
{
if (ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Hidden))
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osuTK;
using System;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace Benchmarks
{
class Program
{
static void Main(string[] args)
=> BenchmarkRunner.Run<BenchmarkClass>();
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace Benchmarks
{
class Program
{
static void Main(string[] args)
=> BenchmarkRunner.Run<BenchmarkClass>();
}
@smoogipoo
smoogipoo / ScoresDb.grammar
Created September 21, 2019 09:43
Synalize It! grammar for reading osu! scores.db files
<?xml version="1.0" encoding="UTF-8"?>
<ufwb version="1.17">
<grammar name="scoresdb" start="id:1" author="smoogipoo">
<description>osu! scores dbb</description>
<structure name="ScoreDB" id="1" length="0" encoding="ISO_8859-1:1987" endian="little" signed="no">
<number name="Version" id="2" type="integer" length="4"/>
<number name="GroupCount" id="3" type="integer" length="4"/>
<structure name="Group" id="4" repeat="id:3" repeatmin="0" repeatmax="-1">
<structref name="BeatmapHash" id="53" structure="id:48"/>
<number name="ScoreCount" id="6" type="integer" length="4"/>
@smoogipoo
smoogipoo / on-mapping-commissions.md
Created June 13, 2019 01:10
Re: on mapping commission

Disclaimer: These are my personal opinions and don't represent the views of the osu! team.

It destroys/diminishes the act of creation

Mapping is an art, but that does not mean that it is inherently free from money. There are many forms of art - drawing, architecture, programming, and even mathematics; though rarely are new concepts innovated. In-fact, most forms of careers are "art" in their own ways. For this reason you have to decide what form of art mapping is closest to, and I personally liken it to drawing.

So let's consider mapping and henceforth the definition of "art" as if it were drawing.

Commissioning an artist to draw something definitely does not destroy the value of said artwork - we've commissioned works for osu! and I'm sure you can't honestly say they're irrelevant because they were commissioned.