Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates speed #57

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Server/GameModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
private CollisionDetection m_systemCollisionDetection = new CollisionDetection();
private CollisionHandler m_systemCollisionHandler = new CollisionHandler();
Systems.Network m_systemNetwork = new Server.Systems.Network();
private int mapSize = 5000;
private int mapSize = 3000;

/// <summary>
/// This is where the server-side simulation takes place. Messages
Expand All @@ -27,7 +27,7 @@
/// </summary>
public void update(TimeSpan elapsedTime)
{
m_systemNetwork.update(elapsedTime, MessageQueueServer.instance.getMessages());

Check warning on line 30 in src/Server/GameModel.cs

View workflow job for this annotation

GitHub Actions / buildProject

Possible null reference argument for parameter 'messages' in 'void Network.update(TimeSpan elapsedTime, Queue<Tuple<int, Message>> messages)'.
m_systemCollisionDetection.update(elapsedTime);
m_systemCollisionHandler.update(elapsedTime);
m_systemWormMovement.update(elapsedTime);
Expand Down Expand Up @@ -178,7 +178,7 @@
var headStartLocation = getLeastDenseStartLocation();
var segmentStartLocation = new Vector2(headStartLocation.X - 75, headStartLocation.Y);
var rotationRate = (float) Math.PI / 1000;
var moveRate = 0.1f;
var moveRate = 0.3f;
var headSize = 100;
var bodySize = 80;

Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Systems/WormMovement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void applyThrust(Entity wormHead, TimeSpan elapsedTime)
var headPosition = head.get<Position>();
var frameTotalMovement = movement.moveRate * (float)elapsedTime.TotalMilliseconds;
var orientation = headPosition.orientation;
float LOCATION_THRESHOLD = 2f;
float LOCATION_THRESHOLD = movement.moveRate * 20;
const float MIN_SEGMENT_SPACING = 30f;
const float IDEAL_SEGMENT_SPACING = 40f;

Expand Down
Loading