Further lighting optimization, fixed (railgun) controller movement, physicsbody collisioncategory changes, command room reactor controls in Vellamo
This commit is contained in:
@@ -26,9 +26,9 @@
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\WindowsGL\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;WINDOWS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
Tags="smallitem"
|
||||
pickdistance="150">
|
||||
|
||||
<Sprite texture ="lamp.png" sourcerect="0,0,16,32" depth="0.8"/>
|
||||
<Sprite texture="lamp.png" sourcerect="0,0,16,32" depth="0.8"/>
|
||||
|
||||
<LightComponent color="1.0,1.0,1.0,1.0" range ="1000.0" powerconsumption="50"/>
|
||||
<LightComponent color="1.0,1.0,1.0,1.0" range ="800.0" powerconsumption="50"/>
|
||||
|
||||
<ConnectionPanel canbeselected = "true" msg="Rewire [Screwdriver]">
|
||||
<requireditem name="Screwdriver,Wire" type="Equipped"/>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
<Sprite texture ="railguncontroller.png" depth="0.8"/>
|
||||
|
||||
<Controller userpos="-1" direction ="Right" canbeselected = "true">
|
||||
<Controller UserPos="-1.0" direction ="Right" canbeselected = "true">
|
||||
<limbposition limb="Head" position="0,-124"/>
|
||||
<limbposition limb="LeftHand" position="38,-125"/>
|
||||
<limbposition limb="RightHand" position="38,-125"/>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -163,14 +163,7 @@ namespace Subsurface
|
||||
if (ignorePlatforms == value) return;
|
||||
ignorePlatforms = value;
|
||||
|
||||
foreach (Limb l in Limbs)
|
||||
{
|
||||
if (l.ignoreCollisions) continue;
|
||||
|
||||
l.body.CollidesWith = (ignorePlatforms) ?
|
||||
Physics.CollisionWall | Physics.CollisionProjectile | Physics.CollisionStairs
|
||||
: Physics.CollisionAll & ~Physics.CollisionCharacter & ~Physics.CollisionMisc;
|
||||
}
|
||||
UpdateCollisionCategories();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -514,12 +507,33 @@ namespace Subsurface
|
||||
|
||||
public void FindHull()
|
||||
{
|
||||
Limb torso = GetLimb(LimbType.Torso);
|
||||
if (torso==null) torso = GetLimb(LimbType.Head);
|
||||
|
||||
currentHull = Hull.FindHull(
|
||||
ConvertUnits.ToDisplayUnits(torso.SimPosition),
|
||||
Hull newHull = Hull.FindHull(
|
||||
ConvertUnits.ToDisplayUnits(refLimb.SimPosition),
|
||||
currentHull);
|
||||
|
||||
if (newHull == currentHull) return;
|
||||
|
||||
currentHull = newHull;
|
||||
|
||||
UpdateCollisionCategories();
|
||||
}
|
||||
|
||||
private void UpdateCollisionCategories()
|
||||
{
|
||||
Category wall = currentHull == null ?
|
||||
Physics.CollisionLevel | Physics.CollisionWall
|
||||
: Physics.CollisionWall;
|
||||
|
||||
Category collisionCategory = (ignorePlatforms) ?
|
||||
wall | Physics.CollisionProjectile | Physics.CollisionStairs
|
||||
: wall | Physics.CollisionPlatform | Physics.CollisionStairs;
|
||||
|
||||
foreach (Limb limb in Limbs)
|
||||
{
|
||||
if (limb.ignoreCollisions) continue;
|
||||
|
||||
limb.body.CollidesWith = collisionCategory;
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(Camera cam, float deltaTime)
|
||||
|
||||
@@ -160,39 +160,21 @@ namespace Subsurface
|
||||
|
||||
public static void DrawRectangle(SpriteBatch sb, Vector2 start, Vector2 size, Color clr, bool isFilled = false, float depth = 0.0f)
|
||||
{
|
||||
if (isFilled)
|
||||
{
|
||||
sb.Draw(t, new Rectangle((int)start.X,(int)start.Y,(int)size.X,(int)size.Y),null,clr);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector2 p2 = new Vector2(start.X + size.X, start.Y);
|
||||
Vector2 p4 = new Vector2(start.X, start.Y + size.Y);
|
||||
|
||||
DrawLine(sb, start, p2, clr, depth);
|
||||
DrawLine(sb, p2, start + size, clr, depth);
|
||||
DrawLine(sb, start + size, p4, clr, depth);
|
||||
DrawLine(sb, p4, start, clr, depth);
|
||||
}
|
||||
DrawRectangle(sb, new Rectangle((int)start.X, (int)start.Y, (int)size.X, (int)size.Y), clr, isFilled, depth);
|
||||
}
|
||||
|
||||
public static void DrawRectangle(SpriteBatch sb, Rectangle rect, Color clr, bool isFilled = false, float depth = 0.0f)
|
||||
{
|
||||
if (isFilled)
|
||||
{
|
||||
sb.Draw(t, rect, null, clr);
|
||||
sb.Draw(t, rect, null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector2 p1 = new Vector2(rect.X, rect.Y);
|
||||
Vector2 p2 = new Vector2(rect.X + rect.Width, rect.Y);
|
||||
Vector2 p3 = new Vector2(rect.X + rect.Width, rect.Y + rect.Height);
|
||||
Vector2 p4 = new Vector2(rect.X, rect.Y + rect.Height);
|
||||
|
||||
DrawLine(sb, p1, p2, clr, depth);
|
||||
DrawLine(sb, p2, p3, clr, depth);
|
||||
DrawLine(sb, p3, p4, clr, depth);
|
||||
DrawLine(sb, p4, p1, clr, depth);
|
||||
sb.Draw(t, new Rectangle(rect.X, rect.Y, rect.Width, 1), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
|
||||
sb.Draw(t, new Rectangle(rect.X, rect.Y+rect.Height-1, rect.Width, 1), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
|
||||
sb.Draw(t, new Rectangle(rect.X, rect.Y, 1, rect.Height), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
|
||||
sb.Draw(t, new Rectangle(rect.X+rect.Width-1, rect.Y, 1, rect.Height), null, clr, 0.0f, Vector2.Zero, SpriteEffects.None, depth);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,10 @@ namespace Subsurface.Items.Components
|
||||
|
||||
Character character;
|
||||
|
||||
[HasDefaultValue(1.0f,false)]
|
||||
[HasDefaultValue(0.0f, false)]
|
||||
public float UserPos
|
||||
{
|
||||
get { return userPos; }
|
||||
set { userPos = value; }
|
||||
}
|
||||
|
||||
@@ -80,26 +81,24 @@ namespace Subsurface.Items.Components
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, character);
|
||||
|
||||
if (userPos != 0.0f && character.AnimController.Anim != AnimController.Animation.UsingConstruction)
|
||||
{
|
||||
Limb torso = character.AnimController.GetLimb(LimbType.Torso);
|
||||
float torsoX = ConvertUnits.ToDisplayUnits(torso.SimPosition.X);
|
||||
float torsoX = ConvertUnits.ToDisplayUnits(character.AnimController.RefLimb.SimPosition.X);
|
||||
|
||||
if (Math.Abs(torsoX - item.Rect.X + userPos) > 10.0f)
|
||||
Vector2 diff = new Vector2(item.Rect.X + UserPos - torsoX, 0.0f);
|
||||
|
||||
if (diff!= Vector2.Zero && diff.Length() > 10.0f)
|
||||
{
|
||||
character.AnimController.Anim = AnimController.Animation.None;
|
||||
|
||||
character.AnimController.TargetMovement =
|
||||
new Vector2(
|
||||
Math.Min(Math.Max(item.Rect.X + userPos - torsoX, -1.0f), 1.0f),
|
||||
0.0f);
|
||||
character.AnimController.TargetDir = (Math.Sign(torsoX - item.Rect.X + userPos) == 1) ? Direction.Right : Direction.Left;
|
||||
character.AnimController.TargetMovement = new Vector2(Math.Sign(diff.X), 0.0f);
|
||||
character.AnimController.TargetDir = (Math.Sign(diff.X) == 1) ? Direction.Right : Direction.Left;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, character);
|
||||
|
||||
if (limbPositions.Count == 0) return;
|
||||
|
||||
character.AnimController.Anim = AnimController.Animation.UsingConstruction;
|
||||
@@ -118,20 +117,13 @@ namespace Subsurface.Items.Components
|
||||
fmj.Enabled = true;
|
||||
fmj.WorldAnchorB = position;
|
||||
}
|
||||
|
||||
//foreach (MapEntity e in item.linkedTo)
|
||||
//{
|
||||
// Item linkedItem = e as Item;
|
||||
// if (linkedItem == null) continue;
|
||||
// linkedItem.Update(cam, deltaTime);
|
||||
//}
|
||||
|
||||
|
||||
item.SendSignal(ToolBox.Vector2ToString(character.CursorPosition), "position_out");
|
||||
}
|
||||
|
||||
public override bool Use(float deltaTime, Character activator = null)
|
||||
{
|
||||
if (character==null || activator!=character || character.SelectedConstruction != item)
|
||||
if (character == null || activator != character || character.SelectedConstruction != item)
|
||||
{
|
||||
character = null;
|
||||
return false;
|
||||
|
||||
@@ -101,9 +101,10 @@ namespace Subsurface.Items.Components
|
||||
|
||||
foreach (Connection c in connections)
|
||||
{
|
||||
if (!c.IsPower) continue;
|
||||
foreach (Connection recipient in c.Recipients)
|
||||
{
|
||||
if (recipient == null) continue;
|
||||
if (recipient == null || !recipient.IsPower) continue;
|
||||
|
||||
Item it = recipient.Item;
|
||||
if (it == null) continue;
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Subsurface.Items.Components
|
||||
public override void ReceiveSignal(string signal, Connection connection, Item sender, float power)
|
||||
{
|
||||
if (currPowerConsumption == 0.0f) voltage = 0.0f;
|
||||
if (connection.Name == "power_in" || connection.Name == "power") voltage = power;
|
||||
if (connection.IsPower) voltage = power;
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Subsurface.Items.Components
|
||||
item.body.FarseerBody.IsBullet = true;
|
||||
|
||||
item.body.CollisionCategories = Physics.CollisionProjectile;
|
||||
item.body.CollidesWith = Physics.CollisionCharacter | Physics.CollisionWall;
|
||||
item.body.CollidesWith = Physics.CollisionCharacter | Physics.CollisionWall | Physics.CollisionLevel;
|
||||
|
||||
item.Drop();
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace Subsurface.Items.Components
|
||||
|
||||
item.body.FarseerBody.IsBullet = false;
|
||||
item.body.CollisionCategories = Physics.CollisionMisc;
|
||||
item.body.CollidesWith = Physics.CollisionWall;
|
||||
item.body.CollidesWith = Physics.CollisionWall | Physics.CollisionLevel;
|
||||
|
||||
ignoredBodies.Clear();
|
||||
|
||||
|
||||
@@ -30,6 +30,12 @@ namespace Subsurface.Items.Components
|
||||
|
||||
public readonly int[] wireId;
|
||||
|
||||
public bool IsPower
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public List<Connection> Recipients
|
||||
{
|
||||
get
|
||||
@@ -69,6 +75,8 @@ namespace Subsurface.Items.Components
|
||||
IsOutput = (element.Name.ToString() == "output");
|
||||
Name = ToolBox.GetAttributeString(element, "name", (IsOutput) ? "output" : "input");
|
||||
|
||||
IsPower = Name == "power_in" || Name == "power" || Name == "power_out";
|
||||
|
||||
effects = new List<StatusEffect>();
|
||||
|
||||
wireId = new int[MaxLinked];
|
||||
|
||||
@@ -63,6 +63,21 @@ namespace Subsurface.Items.Components
|
||||
light.Position += amount;
|
||||
}
|
||||
|
||||
public override bool IsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.IsActive;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (base.IsActive == value) return;
|
||||
base.IsActive = value;
|
||||
light.Color = value ? lightColor : Color.Transparent;
|
||||
}
|
||||
}
|
||||
|
||||
public LightComponent(Item item, XElement element)
|
||||
: base (item, element)
|
||||
{
|
||||
@@ -122,10 +137,11 @@ namespace Subsurface.Items.Components
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, bool editing)
|
||||
{
|
||||
if (!IsActive)
|
||||
{
|
||||
light.Color = Color.Transparent;
|
||||
}
|
||||
if (!editing) return;
|
||||
|
||||
//Vector2 center = new Vector2(item.Rect.Center.X, -item.Rect.Y + item.Rect.Height/2.0f);
|
||||
|
||||
//GUI.DrawLine(spriteBatch, center - Vector2.One * range, center + Vector2.One * range, lightColor);
|
||||
}
|
||||
|
||||
public override void Remove()
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace Subsurface.Items.Components
|
||||
GUI.DrawRectangle(spriteBatch, new Rectangle((int)Nodes[i].X - 3, (int)-Nodes[i].Y - 3, 6, 6), Color.Red, true, 0.0f);
|
||||
|
||||
if (GUIComponent.MouseOn != null ||
|
||||
Vector2.Distance(GameMain.EditMapScreen.Cam.ScreenToWorld(PlayerInput.MousePosition), Nodes[i]) > 20.0f)
|
||||
Vector2.Distance(GameMain.EditMapScreen.Cam.ScreenToWorld(PlayerInput.MousePosition), Nodes[i]) > 10.0f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace Subsurface
|
||||
|
||||
protected void DrawSlot(SpriteBatch spriteBatch, Rectangle rect, Item item, bool isHighLighted, bool isSubSlot)
|
||||
{
|
||||
GUI.DrawRectangle(spriteBatch, rect, (isHighLighted ? Color.Red : Color.White)*((isSubSlot) ? 0.1f : 0.3f), true);
|
||||
GUI.DrawRectangle(spriteBatch, rect, (isHighLighted ? Color.Red : Color.White) * ((isSubSlot) ? 0.1f : 0.3f), true);
|
||||
|
||||
if (item == null) return;
|
||||
|
||||
@@ -263,8 +263,8 @@ namespace Subsurface
|
||||
Vector2 pos = new Vector2(rect.X + rect.Width / 2, rect.Y - rect.Height + 20) - GUI.Font.MeasureString(item.Name) * 0.5f;
|
||||
pos.X = (int)pos.X;
|
||||
pos.Y = (int)pos.Y;
|
||||
spriteBatch.DrawString(GUI.Font, item.Name + " - " + item.ID, pos - new Vector2(1.0f, 1.0f), Color.Black);
|
||||
spriteBatch.DrawString(GUI.Font, item.Name + " - " + item.ID, pos, Color.White);
|
||||
spriteBatch.DrawString(GUI.Font, item.Name, pos - new Vector2(1.0f, 1.0f), Color.Black);
|
||||
spriteBatch.DrawString(GUI.Font, item.Name, pos, Color.White);
|
||||
}
|
||||
|
||||
if (item.Condition < 100.0f)
|
||||
|
||||
@@ -587,7 +587,7 @@ namespace Subsurface
|
||||
|
||||
foreach (ItemComponent component in components) component.Draw(spriteBatch, editing);
|
||||
|
||||
if (!editing || (body!=null && !body.Enabled))
|
||||
if (!editing || (body != null && !body.Enabled))
|
||||
{
|
||||
isHighlighted = false;
|
||||
return;
|
||||
|
||||
@@ -664,7 +664,7 @@ int currentTargetIndex = 1;
|
||||
edgeBody.UserData = cell;
|
||||
edgeBody.SleepingAllowed = false;
|
||||
edgeBody.BodyType = BodyType.Kinematic;
|
||||
edgeBody.CollisionCategories = Physics.CollisionWall | Physics.CollisionLevel;
|
||||
edgeBody.CollisionCategories = Physics.CollisionLevel;
|
||||
|
||||
cell.body = edgeBody;
|
||||
bodies.Add(edgeBody);
|
||||
@@ -674,7 +674,7 @@ int currentTargetIndex = 1;
|
||||
{
|
||||
Body shaftBody = BodyFactory.CreateRectangle(GameMain.World, 100.0f, 10.0f, 5.0f);
|
||||
shaftBody.BodyType = BodyType.Kinematic;
|
||||
shaftBody.CollisionCategories = Physics.CollisionWall | Physics.CollisionLevel;
|
||||
shaftBody.CollisionCategories = Physics.CollisionLevel;
|
||||
shaftBody.SetTransform(ConvertUnits.ToSimUnits((i==0) ? startPosition : endPosition), 0.0f);
|
||||
shaftBody.SleepingAllowed = false;
|
||||
bodies.Add(shaftBody);
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Subsurface.Lights
|
||||
public Color AmbientLight;
|
||||
|
||||
RenderTarget2D lightMap;
|
||||
|
||||
|
||||
private static Texture2D alphaClearTexture;
|
||||
|
||||
private List<LightSource> lights;
|
||||
@@ -21,10 +21,10 @@ namespace Subsurface.Lights
|
||||
|
||||
public bool LightingEnabled = true;
|
||||
|
||||
public RenderTarget2D LightMap
|
||||
{
|
||||
get { return lightMap; }
|
||||
}
|
||||
//public RenderTarget2D LightMap
|
||||
//{
|
||||
// get { return lightMap; }
|
||||
//}
|
||||
|
||||
public LightManager(GraphicsDevice graphics)
|
||||
{
|
||||
@@ -34,7 +34,8 @@ namespace Subsurface.Lights
|
||||
|
||||
var pp = graphics.PresentationParameters;
|
||||
|
||||
lightMap = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight, false,
|
||||
lightMap = new RenderTarget2D(graphics,
|
||||
GameMain.GraphicsWidth, GameMain.GraphicsHeight, false,
|
||||
pp.BackBufferFormat, pp.DepthStencilFormat, pp.MultiSampleCount,
|
||||
RenderTargetUsage.DiscardContents);
|
||||
|
||||
@@ -81,8 +82,10 @@ namespace Subsurface.Lights
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawLightmap(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam)
|
||||
public void UpdateLightMap(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam)
|
||||
{
|
||||
if (!LightingEnabled) return;
|
||||
|
||||
Matrix shadowTransform = cam.ShaderTransform
|
||||
* Matrix.CreateOrthographic(GameMain.GraphicsWidth, GameMain.GraphicsHeight, -1, 1) * 0.5f;
|
||||
|
||||
@@ -96,7 +99,7 @@ namespace Subsurface.Lights
|
||||
|
||||
foreach (LightSource light in lights)
|
||||
{
|
||||
if (light.Color.A < 0.01f || light.Range < 0.01f || light.hullsInRange.Count == 0) continue;
|
||||
if (light.hullsInRange.Count == 0 || light.Color.A < 0.01f || light.Range < 1.0f) continue;
|
||||
if (!MathUtils.CircleIntersectsRectangle(light.Position, light.Range, viewRect)) continue;
|
||||
|
||||
//clear alpha to 1
|
||||
@@ -126,7 +129,7 @@ namespace Subsurface.Lights
|
||||
|
||||
//foreach (LightSource light in lights)
|
||||
//{
|
||||
// if (light.Color.A < 0.01f || light.Range < 0.01f || light.hullsInRange.Count > 0) continue;
|
||||
// if (light.hullsInRange.Count > 0 || light.Color.A < 0.01f || light.Range < 1.0f) continue;
|
||||
// if (!MathUtils.CircleIntersectsRectangle(light.Position, light.Range, viewRect)) continue;
|
||||
|
||||
// light.Draw(spriteBatch);
|
||||
@@ -145,6 +148,16 @@ namespace Subsurface.Lights
|
||||
spriteBatch.Draw(alphaClearTexture, new Rectangle(0, 0,graphics.Viewport.Width, graphics.Viewport.Height), Color.White);
|
||||
spriteBatch.End();
|
||||
}
|
||||
|
||||
public void DrawLightMap(SpriteBatch spriteBatch, Camera cam)
|
||||
{
|
||||
if (!LightingEnabled) return;
|
||||
|
||||
//multiply scene with lightmap
|
||||
spriteBatch.Begin(SpriteSortMode.Immediate, CustomBlendStates.Multiplicative);
|
||||
spriteBatch.Draw(lightMap, Vector2.Zero, Color.White);
|
||||
spriteBatch.End();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Subsurface.Lights
|
||||
public void UpdateHullsInRange()
|
||||
{
|
||||
hullsInRange.Clear();
|
||||
if (range < 1.0f) return;
|
||||
if (range < 1.0f || color.A < 0.01f) return;
|
||||
|
||||
foreach (ConvexHull ch in ConvexHull.list)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Subsurface.Networking
|
||||
myCharacter = Character.Controlled;
|
||||
|
||||
// Create new instance of configs. Parameter is "application Id". It has to be same on client and server.
|
||||
NetPeerConfiguration config = new NetPeerConfiguration("subsurface");
|
||||
NetPeerConfiguration config = new NetPeerConfiguration("barotrauma");
|
||||
|
||||
#if DEBUG
|
||||
config.SimulatedLoss = 0.1f;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Subsurface.Networking
|
||||
this.name = name;
|
||||
this.password = password;
|
||||
|
||||
config = new NetPeerConfiguration("subsurface");
|
||||
config = new NetPeerConfiguration("barotrauma");
|
||||
|
||||
#if DEBUG
|
||||
config.SimulatedLoss = 0.2f;
|
||||
@@ -82,7 +82,7 @@ namespace Subsurface.Networking
|
||||
|
||||
if (config.EnableUPnP)
|
||||
{
|
||||
server.UPnP.ForwardPort(config.Port, "subsurface");
|
||||
server.UPnP.ForwardPort(config.Port, "barotrauma");
|
||||
|
||||
GUIMessageBox upnpBox = new GUIMessageBox("Please wait...", "Attempting UPnP port forwarding", new string[] {"Cancel"} );
|
||||
upnpBox.Buttons[0].OnClicked = upnpBox.Close;
|
||||
@@ -304,7 +304,7 @@ namespace Subsurface.Networking
|
||||
if (sender.version != GameMain.Version.ToString())
|
||||
{
|
||||
DisconnectClient(sender, sender.name+" was unable to connect to the server (nonmatching game version)",
|
||||
"Subsurface version " + GameMain.Version + " required to connect to the server (Your version: " + sender.version + ")");
|
||||
"Version " + GameMain.Version + " required to connect to the server (Your version: " + sender.version + ")");
|
||||
}
|
||||
else if (connectedClients.Find(x => x.name == sender.name && x != sender)!=null)
|
||||
{
|
||||
@@ -460,7 +460,7 @@ namespace Subsurface.Networking
|
||||
}
|
||||
else if (version != GameMain.Version.ToString())
|
||||
{
|
||||
inc.SenderConnection.Deny("Subsurface version " + GameMain.Version + " required to connect to the server (Your version: " + version + ")");
|
||||
inc.SenderConnection.Deny("Version " + GameMain.Version + " required to connect to the server (Your version: " + version + ")");
|
||||
DebugConsole.NewMessage(name + " couldn't join the server (wrong game version)", Color.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -220,15 +220,13 @@ namespace Subsurface
|
||||
this.radius = radius;
|
||||
|
||||
dir = 1.0f;
|
||||
|
||||
//items only collide with the map
|
||||
|
||||
body.CollisionCategories = Physics.CollisionMisc;
|
||||
body.CollidesWith = Physics.CollisionWall;
|
||||
body.CollidesWith = Physics.CollisionWall | Physics.CollisionLevel;
|
||||
|
||||
body.Friction = ToolBox.GetAttributeFloat(element, "friction", 0.3f);
|
||||
body.Restitution = 0.05f;
|
||||
|
||||
|
||||
|
||||
body.BodyType = BodyType.Dynamic;
|
||||
//body.AngularDamping = Limb.LimbAngularDamping;
|
||||
|
||||
|
||||
@@ -49,12 +49,12 @@ namespace Subsurface
|
||||
StreamWriter sw = new StreamWriter(filePath);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("Subsurface crash report (generated on " + DateTime.Now + ")");
|
||||
sb.AppendLine("Barotrauma crash report (generated on " + DateTime.Now + ")");
|
||||
sb.AppendLine("\n");
|
||||
sb.AppendLine("Subsurface seems to have crashed. Sorry for the inconvenience! ");
|
||||
sb.AppendLine("Barotrauma seems to have crashed. Sorry for the inconvenience! ");
|
||||
sb.AppendLine("If you'd like to help fix the bug that caused the crash, please send this file to the developers on the Undertow Games forums.");
|
||||
sb.AppendLine("\n");
|
||||
sb.AppendLine("Subsurface version " + GameMain.Version);
|
||||
sb.AppendLine("Game version " + GameMain.Version);
|
||||
sb.AppendLine("Selected content package: " + GameMain.SelectedPackage.Name);
|
||||
sb.AppendLine("Level seed: "+ ((Level.Loaded == null) ? "no level loaded" : Level.Loaded.Seed));
|
||||
sb.AppendLine("Loaded submarine: " + ((Submarine.Loaded == null) ? "none" : Submarine.Loaded.Name +" ("+Submarine.Loaded.MD5Hash+")"));
|
||||
|
||||
@@ -158,7 +158,8 @@ namespace Subsurface
|
||||
|
||||
public void DrawMap(GraphicsDevice graphics, SpriteBatch spriteBatch)
|
||||
{
|
||||
if (GameMain.LightManager.LightingEnabled) GameMain.LightManager.DrawLightmap(graphics, spriteBatch, cam);
|
||||
|
||||
GameMain.LightManager.UpdateLightMap(graphics, spriteBatch, cam);
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
//1. draw the background, characters and the parts of the submarine that are behind them
|
||||
@@ -167,7 +168,6 @@ namespace Subsurface
|
||||
graphics.SetRenderTarget(renderTarget);
|
||||
graphics.Clear(new Color(11, 18, 26, 255));
|
||||
|
||||
|
||||
spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque, SamplerState.LinearWrap, DepthStencilState.Default, RasterizerState.CullNone);
|
||||
|
||||
Vector2 backgroundPos = cam.Position;
|
||||
@@ -274,14 +274,7 @@ namespace Subsurface
|
||||
GameMain.GameSession.Level.SetObserverPosition(cam.WorldViewCenter);
|
||||
}
|
||||
|
||||
if (GameMain.LightManager.LightingEnabled)
|
||||
{
|
||||
//multiply scene with lightmap
|
||||
spriteBatch.Begin(SpriteSortMode.Immediate, CustomBlendStates.Multiplicative);
|
||||
spriteBatch.Draw(GameMain.LightManager.LightMap, Vector2.Zero, Color.White);
|
||||
spriteBatch.End();
|
||||
}
|
||||
|
||||
GameMain.LightManager.DrawLightMap(spriteBatch, cam);
|
||||
//----------------------------------------------------------------------------------------
|
||||
//3. draw the sections of the map that are on top of the water
|
||||
//----------------------------------------------------------------------------------------
|
||||
@@ -294,12 +287,8 @@ namespace Subsurface
|
||||
foreach (Character c in Character.CharacterList) c.DrawFront(spriteBatch);
|
||||
|
||||
Submarine.DrawFront(spriteBatch);
|
||||
|
||||
if (GameMain.GameSession != null && GameMain.GameSession.Level != null)
|
||||
{
|
||||
GameMain.GameSession.Level.Draw(spriteBatch);
|
||||
//Game1.GameSession.Level.SetObserverPosition(cam.WorldViewCenter);
|
||||
}
|
||||
|
||||
GameMain.GameSession?.Level?.Draw(spriteBatch);
|
||||
|
||||
spriteBatch.End();
|
||||
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Subsurface.Networking;
|
||||
using System.IO;
|
||||
using System.Xml.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Subsurface
|
||||
{
|
||||
@@ -385,7 +383,7 @@ namespace Subsurface
|
||||
|
||||
GUI.Draw((float)deltaTime, spriteBatch, null);
|
||||
|
||||
spriteBatch.DrawString(GUI.Font, "Subsurface v"+GameMain.Version, new Vector2(10, GameMain.GraphicsHeight-20), Color.White);
|
||||
spriteBatch.DrawString(GUI.Font, "Barotrauma v"+GameMain.Version, new Vector2(10, GameMain.GraphicsHeight-20), Color.White);
|
||||
|
||||
spriteBatch.End();
|
||||
}
|
||||
@@ -410,7 +408,7 @@ namespace Subsurface
|
||||
|
||||
GameMain.LobbyScreen.Select();
|
||||
|
||||
new GUIMessageBox("Welcome to Subsurface!", "Please note that the single player mode is very unfinished at the moment; "+
|
||||
new GUIMessageBox("Welcome to Barotrauma!", "Please note that the single player mode is very unfinished at the moment; "+
|
||||
"for example, the NPCs don't have an AI yet and there are only a couple of different quests to complete. The multiplayer "+
|
||||
"mode should be much more enjoyable to play at the moment, so my recommendation is to try out and get a hang of the game mechanics "+
|
||||
"in the single player mode and then move on to multiplayer. Have fun!\n - Regalis, the main dev of Subsurface", 400, 350);
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace Subsurface
|
||||
|
||||
|
||||
var request = new RestRequest("masterserver.php", Method.GET);
|
||||
request.AddParameter("gamename", "subsurface"); // adds to POST or URL querystring based on Method
|
||||
request.AddParameter("gamename", "barotrauma"); // adds to POST or URL querystring based on Method
|
||||
request.AddParameter("action", "listservers"); // adds to POST or URL querystring based on Method
|
||||
|
||||
|
||||
@@ -327,8 +327,6 @@ namespace Subsurface
|
||||
|
||||
public override void Update(double deltaTime)
|
||||
{
|
||||
|
||||
|
||||
menu.Update((float)deltaTime);
|
||||
|
||||
GUI.Update((float)deltaTime);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
SUBSURFACE
|
||||
BAROTRAUMA
|
||||
|
||||
www.undertowgames.com/subsurface
|
||||
Copyright © Undertow Games 2015
|
||||
@@ -29,9 +29,9 @@ guide for your particular router/application on portforward.com or by
|
||||
practicing your google-fu skills.
|
||||
|
||||
These are the values that you should use when forwarding a port to your
|
||||
Subsurface server:
|
||||
Barotrauma server:
|
||||
|
||||
Service/Application: subsurface
|
||||
Service/Application: barotrauma
|
||||
External Port: The port you have selected for your server (14242 by default)
|
||||
Internal Port: The port you have selected for your server (14242 by default)
|
||||
Protocol: UDP
|
||||
|
||||
Reference in New Issue
Block a user