Skip to content

Commit

Permalink
Force reset, fix dependencies and merge #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Coppertine committed Mar 27, 2020
2 parents 6be0d24 + 09c43b3 commit 26dbde7
Show file tree
Hide file tree
Showing 12 changed files with 144 additions and 17 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
[![tau](https://cdn.discordapp.com/attachments/680267083606655030/688688294329843732/the.png)](https://github.com/Altenhh/tau "tau")
# osu!tau

<div>
<a href="https://discord.gg/7Y8GXAa"><img src="https://canary.discordapp.com/api/guilds/689728872282849313/widget.png?style=banner2" alt="Join Discord Server"/></a>
</div>

[![release](https://img.shields.io/badge/build-1.0.4-brightgreen?style=flat-square)](https://github.com/Altenhh/tau/releases)
[![GitHub license](https://img.shields.io/github/license/Altenhh/tau.svg?style=flat-square)](https://github.com/Altenhh/tau/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/Altenhh/tau.svg?style=flat-square)](https://github.com/Altenhh/tau/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/Altenhh/tau.svg?style=flat-square)](https://github.com/Altenhh/tauE/network)
[![GitHub issues](https://img.shields.io/github/issues/Altenhh/tau.svg?style=flat-square)](https://github.com/Altenhh/tau/issues)

A customized [osu!](https://github.com/ppy/osu) mode surrounding a paddle and some notes. Original credit to the idea belonging to *pizzapip*.
A customized [osu!](https://github.com/ppy/osu) mode surrounding a paddle and some notes. [Original](https://deadlysprinklez.itch.io/tau) credit to the idea belonging to *pizzapip*.

## Running the Gamemode
We have [prebuilt libraries](https://github.com/Altenhh/tau/releases) for users looking to play the mode without creating a development environment. All releases will work on all operating systems that *osu!* supports.
### [Latest Releases](https://github.com/Altenhh/tau/releases)

### Instructions
##### Windows
On Windows, the library must be put in `%localappdata%\osulazer`, inside the directory of the current osu!lazer version. osu!lazer will automatically work with the `.dll` when you open it, so nothing else needs to be done.
On Windows, the library must be put in `%localappdata%\osulazer\app-(Current osu!lazer Version)`, inside the directory of the current osu!lazer version. osu!lazer will automatically work with the `.dll` when you open it, so nothing else needs to be done.

*If instructions for your platform isn't listed above, then it's either being written, or is unsupported. At this very time, not operating system is known to be unsupported.*
*If instructions for your platform isn't listed above, then it's either being written, or is unsupported. At the very time of writing this (March 15th, 2020), no operating system is known to be unsupported.*

## Development
When developing or debugging the osu!tau codebase, a few prerequisites are required as following:
Expand All @@ -27,7 +32,7 @@ When developing or debugging the osu!tau codebase, a few prerequisites are requi
You are able to clone the repository over command line, or by downloading it. Updating this code to the latest commit would be done with `git pull`, inside the osu!tau directory.
```sh
git clone https://github.com/Altenhh/tau.git
cd tau/tau
cd tau
```

### Building the Gamemode
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.tau/Beatmaps/tauBeatmapConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected override IEnumerable<TauHitObject> ConvertHitObject(HitObject original
default:
return new TauHitObject
{
Samples = original.Samples,
Samples = original is IHasCurve ? ((IHasCurve)original).NodeSamples[0] : original.Samples,
StartTime = original.StartTime,
PositionToEnd = position,
NewCombo = comboData?.NewCombo ?? false,
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.tau/Mods/TauModBlinds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class DrawableTauBlinds : Container
private const float target_clamp = 1;

private readonly float targetBreakMultiplier = 0;
private const float easing = 1;
private readonly float easing = 1;

private readonly CompositeDrawable restrictTo;

Expand Down Expand Up @@ -123,7 +123,7 @@ private void load()
private float calculateGap(float value) => Math.Clamp(value, 0, target_clamp) * targetBreakMultiplier;

// lagrange polinominal for (0,0) (0.6,0.4) (1,1) should make a good curve
private static float applyAdjustmentCurve(float value) => 0.6f * value * value + 0.4f * value;
private static float applyAdjustmentCurve(float value) => (0.6f * (value * value)) + (0.4f * value);

protected override void Update()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osuTK;
using osuTK.Graphics;
using System.Linq;
using osu.Game.Rulesets.Tau.UI;

namespace osu.Game.Rulesets.Tau.Objects.Drawables
{
Expand Down Expand Up @@ -44,6 +45,7 @@ public DrawabletauHitObject(TauHitObject hitObject)
Size = new Vector2(TauHitObject.SIZE);
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
RelativePositionAxes = Axes.Both;

AddInternal(Box = new Box
{
Expand All @@ -67,7 +69,7 @@ protected override void UpdateInitialTransforms()
var a = b *= (float)(Math.PI / 180);

Box.FadeIn(HitObject.TimeFadeIn);
this.MoveTo(new Vector2(-(215 * (float)Math.Cos(a)), -(215 * (float)Math.Sin(a))), HitObject.TimePreempt);
this.MoveTo(new Vector2(-(TauPlayfield.UNIVERSAL_SCALE * 0.8f * (float)Math.Cos(a)), -(TauPlayfield.UNIVERSAL_SCALE * 0.8f * (float)Math.Sin(a))), HitObject.TimePreempt);
}

protected override void CheckForResult(bool userTriggered, double timeOffset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected Vector2 Position

Debug.Assert(CurrentTime != null);

return Interpolation.ValueAt(CurrentTime.Value, frame.Position, NextFrame.Position, frame.Time, NextFrame.Time);
return NextFrame != null ? Interpolation.ValueAt(CurrentTime.Value, frame.Position, NextFrame.Position, frame.Time, NextFrame.Time) : frame.Position;
}
}

Expand Down
8 changes: 5 additions & 3 deletions osu.Game.Rulesets.tau/UI/Cursor/tauCursor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ private void load(IBindable<WorkingBeatmap> beatmap)
public bool CheckForValidation(DrawabletauHitObject h) => h.ScreenSpaceDrawQuad.AABBFloat.IntersectsWith(defaultCursor.HitReceptor.ScreenSpaceDrawQuad.AABBFloat);

private class DefaultCursor : CompositeDrawable
{
{
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;

public readonly Box HitReceptor;

public DefaultCursor(float cs = 5f)
Expand Down Expand Up @@ -79,7 +81,7 @@ public DefaultCursor(float cs = 5f)
const double d = 25;

// Thank you AlFas for this code.
double convertValue(double value) => c + (d - c) * (value - a) / (b - a);
double convertValue(double value) => c + (((d - c) * (value - a)) / (b - a));

AddInternal(new GameplayCursor(cs));

Expand Down Expand Up @@ -159,7 +161,7 @@ public GameplayCursor(float cs)
const double d = 0.05;

// Thank you AlFas for this code.
double convertValue(double value) => c + (d - c) * (value - a) / (b - a);
double convertValue(double value) => c + (((d - c) * (value - a)) / (b - a));
}
}

Expand Down
49 changes: 49 additions & 0 deletions osu.Game.Rulesets.tau/UI/TauPlayfieldAdjustmentContainer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.UI;
using osuTK;

namespace osu.Game.Rulesets.Tau.UI
{
public class TauPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer
{
protected override Container<Drawable> Content => content;
private readonly Container content;

private const float playfield_size_adjust = 1f;

public TauPlayfieldAdjustmentContainer()
{
Anchor = Anchor.Centre;
Origin = Anchor.Centre;

// Calculated from osu!stable as 512 (default gamefield size) / 640 (default window size)
Size = new Vector2(playfield_size_adjust);

InternalChild = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,
FillAspectRatio = 1,
Child = content = new ScalingContainer { RelativeSizeAxes = Axes.Both }
};
}

/// <summary>
/// A <see cref="Container"/> which scales its content relative to a target width.
/// </summary>
private class ScalingContainer : Container
{
protected override void Update()
{
base.Update();

Scale = new Vector2(Parent.ChildSize.X / TauPlayfield.BASE_SIZE.X);

Size = Vector2.Divide(Vector2.One, Scale);
}
}
}
}
23 changes: 23 additions & 0 deletions osu.Game.Rulesets.tau/UI/TauReplayRecorder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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.Collections.Generic;
using osu.Game.Replays;
using osu.Game.Rulesets.Tau.Replays;
using osu.Game.Rulesets.Replays;
using osu.Game.Rulesets.UI;
using osuTK;

namespace osu.Game.Rulesets.Tau.UI
{
public class TauReplayRecorder : ReplayRecorder<TauAction>
{
public TauReplayRecorder(Replay replay)
: base(replay)
{
}

protected override ReplayFrame HandleFrame(Vector2 mousePosition, List<TauAction> actions, ReplayFrame previousFrame)
=> new TauReplayFrame(Time.Current, mousePosition, actions.ToArray() );
}
}
6 changes: 5 additions & 1 deletion osu.Game.Rulesets.tau/UI/tauDrawableRuleset.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// 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.Collections.Generic;
Expand Down Expand Up @@ -31,5 +31,9 @@ public DrawabletauRuleset(TauRuleset ruleset, IBeatmap beatmap, IReadOnlyList<Mo
public override DrawableHitObject<TauHitObject> CreateDrawableRepresentation(TauHitObject h) => new DrawabletauHitObject(h);

protected override PassThroughInputManager CreateInputManager() => new TauInputManager(Ruleset?.RulesetInfo);

public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new TauPlayfieldAdjustmentContainer();

protected override ReplayRecorder CreateReplayRecorder(Replay replay) => new TauReplayRecorder(replay);
}
}
25 changes: 21 additions & 4 deletions osu.Game.Rulesets.tau/UI/tauPlayfield.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public class TauPlayfield : Playfield
private JudgementContainer<DrawableTauJudgement> judgementLayer;
private readonly Container<KiaiHitExplosion> kiaiExplosionContainer;

public const float UNIVERSAL_SCALE = 0.6f;
public static readonly Vector2 BASE_SIZE = new Vector2(768, 768);

public TauPlayfield()
{
cursor = new TauCursor();
Expand All @@ -42,13 +45,15 @@ public TauPlayfield()
{
RelativeSizeAxes = Axes.Both,
Depth = 1,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
new VisualisationContainer(),
playfieldBackground = new Circle
{
Colour = Color4.Black,
RelativeSizeAxes = Axes.Both,
Size = new Vector2(0.6f),
Size = new Vector2(UNIVERSAL_SCALE),
FillAspectRatio = 1,
FillMode = FillMode.Fit,
Anchor = Anchor.Centre,
Expand All @@ -57,7 +62,7 @@ public TauPlayfield()
new Container
{
RelativeSizeAxes = Axes.Both,
Size = new Vector2(0.6f),
Size = new Vector2(UNIVERSAL_SCALE),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Children = new Drawable[]
Expand All @@ -81,7 +86,19 @@ public TauPlayfield()
},
}
},
HitObjectContainer,
new Container
{
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fit,
FillAspectRatio = 1,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(UNIVERSAL_SCALE),
Children = new Drawable[]
{
HitObjectContainer,
}
},
cursor,
kiaiExplosionContainer = new Container<KiaiHitExplosion>
{
Expand Down Expand Up @@ -168,7 +185,7 @@ private class VisualisationContainer : BeatSyncedContainer
private void load(TauRulesetConfigManager settings)
{
RelativeSizeAxes = Axes.Both;
Size = new Vector2(0.6f);
Size = new Vector2(UNIVERSAL_SCALE);
Anchor = Anchor.Centre;
Origin = Anchor.Centre;

Expand Down
4 changes: 4 additions & 0 deletions osu.Game.Rulesets.tau/tauRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
using osu.Game.Rulesets.Difficulty;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Replays.Types;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Tau.Beatmaps;
using osu.Game.Rulesets.Tau.Configuration;
using osu.Game.Rulesets.Tau.Mods;
using osu.Game.Rulesets.Tau.Replays;
using osu.Game.Rulesets.Tau.Scoring;
using osu.Game.Rulesets.Tau.UI;
using osu.Game.Rulesets.UI;
Expand Down Expand Up @@ -106,5 +108,7 @@ public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) =
{
Texture = new TextureStore(new TextureLoaderStore(CreateResourceStore()), false).Get("Textures/tau"),
};

public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new TauReplayFrame();
}
}
21 changes: 21 additions & 0 deletions tau/osu.Game.Rulesets.tau/osu.Game.Rulesets.tau.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Project">
<TargetFramework>netcoreapp3.0</TargetFramework>
<AssemblyTitle>osu.Game.Rulesets.Sample</AssemblyTitle>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCPU</PlatformTarget>
<RootNamespace>osu.Game.Rulesets.Tau</RootNamespace>
<LangVersion>8</LangVersion>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Framework" Version="2020.305.0" />
<PackageReference Include="ppy.osu.Game" Version="2020.306.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\Samples\Gameplay" />
<Folder Include="Resources\Textures" />
</ItemGroup>
</Project>

0 comments on commit 26dbde7

Please sign in to comment.