Skip to content

Commit

Permalink
Upload core-dump files
Browse files Browse the repository at this point in the history
  • Loading branch information
Soneoylys committed Oct 27, 2023
1 parent 870a2b7 commit adc4d7e
Show file tree
Hide file tree
Showing 30 changed files with 2,206 additions and 46 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ We initially intended for AstroDX to be fully open-source after it's uploaded to

However, If you have issues, please don't hesitate to point it out in issues and we'll try to answer them as best as we can.

This game is a clean-room implementation of maimai, and has been developed without using any original arcade data.

- For simai interpreter and serializer used in AstroDX: [SimaiSharp](https://github.com/reflektone-games/SimaiSharp)
- For game open-source parts: [AstroDX core-dump](https://github.com/2394425147/maipaddx/tree/main/core-dump)

# Q&A

## Which version should I download?
Expand All @@ -31,6 +36,8 @@ Due to restriction of Apple, developer must be 18 (or 19 depends on local law) t

Each public link only can hold 10k players (count by Apple ID), so please NOT duplicate join the test if you already have AstroDX installed.

Since both of those slots are full again, we are planning on create another one soon, but ETA is not guaranteed on this.

## Are there any tutorials on importing?

Yep, they should be on the [wiki](https://github.com/2394425147/maipaddx/wiki/Importing-levels) of this repo.
Expand All @@ -43,7 +50,11 @@ We **don't recommend** doing this, as it violates SEGA's policies.

You can open an issue [here](https://github.com/2394425147/maipaddx/issues).

We welcome issues written in Mandarin, Japanese and English. However, it would be strongly suggested to provide translations (even using online translator) to English when submitting them, thus other people could understand as well.

When submitting issues, please always ensure that you are running the latest released version. We also recommend reviewing existing issues to avoid duplication of questions or concerns.

[![Discord](https://img.shields.io/discord/892807792996536453)](https://discord.gg/6fpETgpvjZ)
Alternatively, on our Discord server, we also have a help forum dedicated for issues, an faq, as well as a suggestions channel for feedback.

Happy playing!
Happy playing!
98 changes: 98 additions & 0 deletions core-dump/Scripts/CurveCcwGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using System.Collections.Generic;
using AstroDX.Contexts.Gameplay.PlayerScope;
using AstroDX.Utilities;
using SimaiSharp.Structures;
using UnityEngine;

namespace AstroDX.Contexts.Gameplay.SlideGenerators
{
public sealed class CurveCcwGenerator : SlideGenerator
{
private const float CurveRadius = RenderManager.CenterRadius;
private const float RingRadius = RenderManager.PlayFieldRadius;
private readonly float _curveLength;
private readonly float _endForward;
private readonly Vector2 _endPoint;

private readonly float _startForward;

private readonly float _startLength;

private readonly Vector2 _startPoint;
private readonly Vector2 _tangentInPoint;
private readonly float _tangentInRotation;
private readonly Vector2 _tangentOutPoint;
private readonly float _totalLength;

public CurveCcwGenerator(IReadOnlyList<Location> vertices)
{
var startRotation = GetRotation(vertices[0]);
var endRotation = GetRotation(vertices[1]);

_tangentInRotation = startRotation +
Trigonometry.GetTangentAngleDelta(CurveRadius, RingRadius, false);
var tangentOutRotation = endRotation +
Trigonometry.GetTangentAngleDelta(CurveRadius, RingRadius, true);

_startPoint = GetPositionRadial(startRotation);
_tangentInPoint = GetPositionRadial(_tangentInRotation, CurveRadius);
_tangentOutPoint = GetPositionRadial(tangentOutRotation, CurveRadius);
_endPoint = GetPositionRadial(endRotation);

var startSegment = _tangentInPoint - _startPoint;
_startLength = startSegment.magnitude;
_startForward = Mathf.Atan2(startSegment.y, startSegment.x);

_curveLength = Trigonometry.GetAngleSpan(_tangentInRotation, tangentOutRotation,
false) * CurveRadius;

var endSegment = _endPoint - _tangentOutPoint;
var endLength = endSegment.magnitude;
_endForward = Mathf.Atan2(endSegment.y, endSegment.x);

_totalLength = _startLength + _curveLength + endLength;
}

public override float GetLength()
{
return _totalLength;
}

public override void GetPoint(float t, out Vector2 position, out float rotation)
{
var distanceFromStart = t * _totalLength;

if (distanceFromStart < _startLength)
{
position = Vector2.Lerp(_startPoint,
_tangentInPoint,
Mathf.InverseLerp(0,
_startLength,
distanceFromStart));

rotation = _startForward;
}
else if (distanceFromStart < _startLength + _curveLength)
{
var localT = Mathf.InverseLerp(_startLength, _startLength + _curveLength, distanceFromStart);
position = new Vector2(Mathf.Cos(_tangentInRotation + _curveLength / CurveRadius * localT) *
CurveRadius,
Mathf.Sin(_tangentInRotation + _curveLength / CurveRadius * localT) *
CurveRadius);

var forward = position.Rotate(Trigonometry.Tau / 4);
rotation = Mathf.Atan2(forward.y, forward.x);
}
else
{
position = Vector2.Lerp(_tangentOutPoint,
_endPoint,
Mathf.InverseLerp(_startLength + _curveLength,
_totalLength,
distanceFromStart));

rotation = _endForward;
}
}
}
}
98 changes: 98 additions & 0 deletions core-dump/Scripts/CurveCwGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using System.Collections.Generic;
using AstroDX.Contexts.Gameplay.PlayerScope;
using AstroDX.Utilities;
using SimaiSharp.Structures;
using UnityEngine;

namespace AstroDX.Contexts.Gameplay.SlideGenerators
{
public sealed class CurveCwGenerator : SlideGenerator
{
private const float CurveRadius = RenderManager.CenterRadius;
private const float RingRadius = RenderManager.PlayFieldRadius;
private readonly float _curveLength;
private readonly float _endForward;
private readonly Vector2 _endPoint;

private readonly float _startForward;

private readonly float _startLength;

private readonly Vector2 _startPoint;
private readonly Vector2 _tangentInPoint;
private readonly float _tangentInRotation;
private readonly Vector2 _tangentOutPoint;
private readonly float _totalLength;

public CurveCwGenerator(IReadOnlyList<Location> vertices)
{
var startRotation = GetRotation(vertices[0]);
var endRotation = GetRotation(vertices[1]);

_tangentInRotation = startRotation +
Trigonometry.GetTangentAngleDelta(CurveRadius, RingRadius, true);
var tangentOutRotation = endRotation +
Trigonometry.GetTangentAngleDelta(CurveRadius, RingRadius, false);

_startPoint = GetPositionRadial(startRotation);
_tangentInPoint = GetPositionRadial(_tangentInRotation, CurveRadius);
_tangentOutPoint = GetPositionRadial(tangentOutRotation, CurveRadius);
_endPoint = GetPositionRadial(endRotation);

var startSegment = _tangentInPoint - _startPoint;
_startLength = startSegment.magnitude;
_startForward = Mathf.Atan2(startSegment.y, startSegment.x);

_curveLength = Trigonometry.GetAngleSpan(_tangentInRotation, tangentOutRotation,
true) * CurveRadius;

var endSegment = _endPoint - _tangentOutPoint;
var endLength = endSegment.magnitude;
_endForward = Mathf.Atan2(endSegment.y, endSegment.x);

_totalLength = _startLength + _curveLength + endLength;
}

public override float GetLength()
{
return _totalLength;
}

public override void GetPoint(float t, out Vector2 position, out float rotation)
{
var distanceFromStart = t * _totalLength;

if (distanceFromStart < _startLength)
{
position = Vector2.Lerp(_startPoint,
_tangentInPoint,
Mathf.InverseLerp(0,
_startLength,
distanceFromStart));

rotation = _startForward;
}
else if (distanceFromStart < _startLength + _curveLength)
{
var localT = Mathf.InverseLerp(_startLength, _startLength + _curveLength, distanceFromStart);
position = new Vector2(Mathf.Cos(_tangentInRotation - _curveLength / CurveRadius * localT) *
CurveRadius,
Mathf.Sin(_tangentInRotation - _curveLength / CurveRadius * localT) *
CurveRadius);

var forward = position.Rotate(-Trigonometry.Tau / 4);
rotation = Mathf.Atan2(forward.y, forward.x);
}
else
{
position = Vector2.Lerp(_tangentOutPoint,
_endPoint,
Mathf.InverseLerp(_startLength + _curveLength,
_totalLength,
distanceFromStart));

rotation = _endForward;
}
}
}
}
116 changes: 116 additions & 0 deletions core-dump/Scripts/EdgeCurveCcwGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
using System.Collections.Generic;
using AstroDX.Contexts.Gameplay.PlayerScope;
using AstroDX.Utilities;
using SimaiSharp.Structures;
using UnityEngine;

namespace AstroDX.Contexts.Gameplay.SlideGenerators
{
public sealed class EdgeCurveCcwGenerator : SlideGenerator
{
private const float CurveRadius = RenderManager.CenterRadius * 1.2f;
private const float CenterAngularOffset = Trigonometry.Tau / 4 - Trigonometry.Tau / 16;
private const float CenterRadialOffset = RenderManager.PlayFieldRadius * 0.4662f;

private readonly Vector2 _centerPosition;
private readonly float _curveLength;
private readonly Vector2 _endPoint;

private readonly float _startRotation;
private readonly float _endRotation;

private readonly float _startLength;
private readonly Vector2 _startPoint;
private readonly Vector2 _tangentInPoint;
private readonly float _tangentInRotation;
private readonly Vector2 _tangentOutPoint;
private readonly float _totalLength;

public EdgeCurveCcwGenerator(IReadOnlyList<Location> vertices)
{
var startRotation = GetRotation(vertices[0]);
var endRotation = GetRotation(vertices[1]);

var centerAngle = startRotation - CenterAngularOffset;
_centerPosition = new Vector2(CenterRadialOffset * Mathf.Cos(centerAngle),
CenterRadialOffset * Mathf.Sin(centerAngle));

_startPoint = GetPositionRadial(startRotation);

var relativeStartRotation = Trigonometry.ToPolarAngle(_startPoint, _centerPosition);

var magnitude = (_centerPosition - _startPoint).magnitude;
var startDelta = Trigonometry.GetTangentAngleDelta(CurveRadius, magnitude, false);

_tangentInRotation = relativeStartRotation + startDelta;
_tangentInPoint = GetPositionRadial(_tangentInRotation, CurveRadius) +
_centerPosition;

_endPoint = GetPositionRadial(endRotation);

var relativeEndRotation = Trigonometry.ToPolarAngle(_endPoint, _centerPosition);
var endMagnitude = (_endPoint - _centerPosition).magnitude;
var endDelta = Trigonometry.GetTangentAngleDelta(CurveRadius, endMagnitude, true);

var tangentOutRotation = relativeEndRotation + endDelta;
_tangentOutPoint = GetPositionRadial(tangentOutRotation, CurveRadius) +
_centerPosition;

var startSegment = _tangentInPoint - _startPoint;
_startLength = startSegment.magnitude;
_startRotation = Mathf.Atan2(startSegment.y, startSegment.x);

_curveLength = Trigonometry.GetAngleSpan(_tangentInRotation, tangentOutRotation,
false, Trigonometry.Tau / 4f) * CurveRadius;

var endSegment = _endPoint - _tangentOutPoint;
var endLength = endSegment.magnitude;
_endRotation = Mathf.Atan2(endSegment.y, endSegment.x);

_totalLength = _startLength + _curveLength + endLength;
}

public override float GetLength()
{
return _totalLength;
}

public override void GetPoint(float t, out Vector2 position, out float rotation)
{
var distanceFromStart = t * _totalLength;

if (distanceFromStart < _startLength)
{
position = Vector2.Lerp(_startPoint,
_tangentInPoint,
Mathf.InverseLerp(0,
_startLength,
distanceFromStart));

rotation = _startRotation;
}
else if (distanceFromStart < _startLength + _curveLength)
{
var localT = Mathf.InverseLerp(_startLength, _startLength + _curveLength, distanceFromStart);
position = new Vector2(Mathf.Cos(_tangentInRotation + _curveLength / CurveRadius * localT) *
CurveRadius,
Mathf.Sin(_tangentInRotation + _curveLength / CurveRadius * localT) *
CurveRadius);

var forward = position.Rotate(Trigonometry.Tau / 4);
rotation = Mathf.Atan2(forward.y, forward.x);
position += _centerPosition;
}
else
{
position = Vector2.Lerp(_tangentOutPoint,
_endPoint,
Mathf.InverseLerp(_startLength + _curveLength,
_totalLength,
distanceFromStart));

rotation = _endRotation;
}
}
}
}
Loading

0 comments on commit adc4d7e

Please sign in to comment.