Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


Akitsune

Member Since 06 Nov 2008
Offline Last Active Apr 01 2012 05:03 AM

Topics I've Started

Astraios - Online Space RPG [Trailer]

12 March 2012 - 06:11 AM

http://www.youtube.com/watch?v=HSiFdj0nzsw


Astraios is an independent online multiplayer PC game. Astraios was designed to be an immersive vast world, where you can customize your playstyle, play with friends, and change your world.

Astraios is focused on giving players unique skills and an open world where players can fly to distant semi-procedural planets, explore, and compete for supremacy.

The game is written in C#. I have been designing, programming, and creating visual and audio assets since I was in high school in 2009.

If you're interested, check out the website or join the forums or reply here. Thanks!


Posted Image

Posted Image

Domain name I've been using for years trademarked by a popular large company

28 May 2011 - 10:11 PM

I've been working on my indie RPG project for a few years with the ultimate goal of monetization and it looks like I could be ready for launch by the end of the year. My excitement has been through the roof lately. Unfortunately, I've just now checked and it appears a certain large social game development company has trademarked the name of my project (however, mine is plural and theirs is singular) last year. Considering how both of our projects are definitely "computer video game software", I don't think getting a trademark of my own of the pluralization would work. I'm a bit afraid to release my project as well - they could probably sue me even though I've had the domain name for years! What's the best plan here - find a new name & domain ( :( ) while of course still keeping this one just in case or try and get a trademark?

2D blur artifact

16 November 2010 - 06:45 AM

I've been working on porting my ORPG to 2D and have this painful issue with my blur. There's a giant artifact that stretches across the screen quad - it looks like a diagonal line from UV(1, 1) to UV(0, 0).

Of course, it only shows up in my blur. Sampling just the world doesn't have this artifact. I tried not downsampling my blur and I still get the artifact. I've exaggerated the blur to show you the artifact.

http://img687.imageshack.us/i/18979256.jpg/


//////////////////////////////////////////////////
//
// BlurX
//
//////////////////////////////////////////////////

float Pixel;

texture Texture0:TEXTURE0;
sampler2D Sampler0 = sampler_state
{
texture = (Texture0);
MIPFILTER = LINEAR;
MAGFILTER = LINEAR;
MINFILTER = LINEAR;
ADDRESSU = CLAMP;
ADDRESSV = CLAMP;
};


struct IN0
{
float4 Position : POSITION;
float2 UV : TEXCOORD0;
};

struct OUT0
{
float4 Position : POSITION;
float2 UV : TEXCOORD0;
};

OUT0 VS(IN0 IN)
{
OUT0 OUT;
OUT.Position = IN.Position;
OUT.UV = IN.UV;
return OUT;
}

float4 PS(OUT0 IN) : COLOR
{
float2 UV = IN.UV;
float4 RGBA = tex2D(Sampler0, UV);
UV.x += Pixel;
RGBA += tex2D(Sampler0, UV);
UV.x += Pixel;
RGBA += tex2D(Sampler0, UV);
UV.x += Pixel;
RGBA += tex2D(Sampler0, UV);
UV.x += Pixel;
RGBA += tex2D(Sampler0, UV);
UV.x -= Pixel * 8;
RGBA += tex2D(Sampler0, UV);
UV.x += Pixel;
RGBA += tex2D(Sampler0, UV);
UV.x += Pixel;
RGBA += tex2D(Sampler0, UV);
UV.x += Pixel;
RGBA += tex2D(Sampler0, UV);
RGBA /= 9;
return RGBA;
}

technique T0
{
pass P0
{
VertexShader = compile vs_2_0 VS();
PixelShader = compile ps_2_0 PS();
}
}






//////////////////////////////////////////////////
//
// Render
//
//////////////////////////////////////////////////

float time : TIME;
float2 BlurPixel;
float2 BlurCenter;

texture Texture0:TEXTURE0;
sampler2D Sampler0 = sampler_state
{
texture = (Texture0);
MIPFILTER = LINEAR;
MAGFILTER = LINEAR;
MINFILTER = LINEAR;
ADDRESSU = CLAMP;
ADDRESSV = CLAMP;
};

texture Texture1:TEXTURE1;
sampler2D Sampler1 = sampler_state
{
texture = (Texture1);
MIPFILTER = LINEAR;
MAGFILTER = LINEAR;
MINFILTER = LINEAR;
ADDRESSU = CLAMP;
ADDRESSV = CLAMP;
};



struct IN0
{
float4 Position : POSITION;
float2 UV : TEXCOORD0;
};

struct OUT0
{
float4 Position : POSITION;
float2 UV : TEXCOORD0;
};

OUT0 VS(IN0 IN)
{
OUT0 OUT;
OUT.Position = IN.Position;
OUT.UV = IN.UV;
return OUT;
}

float4 PS(OUT0 IN) : COLOR
{
float2 UV = IN.UV;
float4 RGBA = tex2D(Sampler0, UV);
float4 Blur = tex2D(Sampler1, IN.UV + BlurPixel);

float2 BlurDistance = IN.UV - BlurCenter;
float BlurStrength = min(4 * dot(BlurDistance, BlurDistance), 1);
RGBA = lerp(RGBA, Blur, BlurStrength);

RGBA = max(Blur - 0.95f, 0) * 1.0f + RGBA;

float2 CenterDistance = IN.UV - float2(0.5f, 0.5f);
float VignetteStrength = 1.0f - dot(CenterDistance, CenterDistance);
RGBA *= VignetteStrength;

return RGBA;
}

technique T0
{
pass P0
{
VertexShader = compile vs_2_0 VS();
PixelShader = compile ps_2_0 PS();
}
}





Any ideas are appreciated :)

Horizontally-Flying AABBs

04 October 2010 - 12:48 PM

I've been writing a physics engine (okay, you can BARELY call it that) which supports AABB collision, gravity, friction, and bouncing. It's in 2D and very simplistic. I would use Box2D's C# port or something but this is much more efficient, and I plan on using this with 10+ scenes running at the same time.

It works well for the most part, but my problem is that when 2+ boxes collide at such a velocity, rather than falling, they slide along in the middle of the air horizontally until they separate. This is pretty unrealistic and unacceptable.



Friction method:

protected Single CalculateFriction(Single NewVelocity)
{
if (NewVelocity > Scene.Friction)
{
return (NewVelocity - Scene.Friction * Scene.Timestep);
}
else
{
if (NewVelocity < -Scene.Friction)
{
return (NewVelocity + Scene.Friction * Scene.Timestep);
}
else
{
return 0;
}
}
}






This is the update code:

//bounds update / check for collision / bounce gets run first, for efficiency's sake I'm not going through the list twice, could this be a problem?
Position = Position + Velocity * Scene.Timestep;

if (Gravity == true)
{
Velocity.Linear.Y += ObjectWorld.GravityStrength;
}

Velocity.Linear.Length = CalculateFriction(Velocity.Linear.Length);






This gets run whenever there's a collision:

public void Bounce(Physics Other)
{
Vector Normal;

Single d0 = Other.Corner[1].X - Corner[0].X;
Single d1 = Corner[1].X - Other.Corner[0].X;
Single Depth = (d0 < d1) ? d0 : -d1;
bool Axis = false;

d0 = Other.Corner[1].Y - Corner[0].Y;
d1 = Corner[1].Y - Other.Corner[0].Y;
Single d = (d0 < d1) ? d0 : -d1;
if (Math.Abs(d) < Math.Abs(Depth))
{
Depth = d;
Axis = true;
}

Single DepthSquared = Depth * Depth;

if (Axis == false)
{
Normal = new Vector(Depth, 0);
}
else
{
Normal = new Vector(0, Depth);
}

Single OldVelocity = Velocity.Linear.Length;
Single OldOtherVelocity = Other.Velocity.Linear.Length;

if (Axis == false)
{
Velocity.Linear = new Vector(Normal.X, CalculateFriction(Velocity.Linear.Y));
}
else
{
Velocity.Linear = new Vector(CalculateFriction(Velocity.Linear.X), Normal.Y);
}

Single NewVelocity = ((OldVelocity - OldOtherVelocity) * Scene.Restitution * Other.Mass + Mass * OldVelocity + Other.Mass * OldOtherVelocity) / (Mass + Other.Mass);

Velocity.Linear.Length = NewVelocity;

if (Velocity.Linear.Y < ObjectWorld.GravityStrength && Other.Velocity.Linear.Y > 0 && DepthSquared < Scene.DepthTolerance)
{
Velocity.Linear.Y = 0;
}

if (Other.Movable == true)
{
if (Axis == false)
{
Other.Velocity.Linear = new Vector(-Normal.X, CalculateFriction(Other.Velocity.Linear.Y));
}
else
{
Other.Velocity.Linear = new Vector(CalculateFriction(Other.Velocity.Linear.X), -Normal.Y);
}

Single NewOtherVelocity = ((OldOtherVelocity - OldVelocity) * Scene.Restitution * Mass + Mass * OldVelocity + Other.Mass * OldOtherVelocity) / (Mass + Other.Mass);
Other.Velocity.Linear.Length = NewOtherVelocity;

if (Other.Velocity.Linear.Y < ObjectWorld.GravityStrength && Other.Velocity.Linear.Y > 0 && DepthSquared < Scene.DepthTolerance)
{
Other.Velocity.Linear.Y = 0;
}
}
}






I don't seriously expect anyone to go through all that code, so even any tips would be nice.

I have a sneaking suspicion that this is a frictional issue, but it might not be.

Thanks!

EDIT: Oops, slight miscalculation in friction method

[Edited by - Akitsune on October 5, 2010 10:23:04 AM]

C# object design

21 July 2010 - 11:41 AM

I've been working on a C# project for a while now and have been running into some problems with my object model. My world has online persistence and uses a serialization library, which just adds more complication to the whole situation.

My current model is that all objects fall into some very brief categories, the most troublesome being my node category. Nodes are grid-aligned, collision affecting entities with a non-static string property representing 3d model path. This means that every single Node can have a different 3d model. Nodes are intended to be used in a similar fashion to structures, doodads, and destructibles in the WC3 editor.

My nodes feel VERY weakly typed (I know this isn't the proper term). The alternative (and arguably proper way) is to make a class derived from Node, but this also can be a pain to do. I would presumably need a List generic for each new class, right? Considering how many new classes (50+) I would be implementing, this seems counter-intuitive.

Is there a better way to organize my objects? An ID-based system, perhaps?

PARTNERS