Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1109964 Posts in 46251 Topics- by 37868 Members - Latest Member: Sierus

April 18, 2015, 07:11:24 am
TIGSource ForumsFeedbackDevLogsGeeky Second (working title)
Pages: [1]
Print
Author Topic: Geeky Second (working title)  (Read 256 times)
omgnoseat
Level 4
****



View Profile
« on: April 13, 2015, 02:20:04 pm »

We've just finished up our first game Samudai, and we're starting to come up with some ideas for our second game.

The Team
I'm the programmer, with some game design along the sidelines.
Hoghren is our artist and generally comes up with the game's theme and atmosphere.
Naishin takes care of all the business stuff that no one likes to do, and lends a helping hand in unity and game design whenever he can.

Summary
Geeky Second is a 2D brawler playable with 1 to 4 players. The goal of the game is to survive as long as possible whilst advancing through a prodecurally generated world.

Graphics
Can't say alot about the graphics yet, but the theme will be inspired by saturday morning cartoons.


We're still not really sure on a lot of things, but we are trying to keep the scope small, we've learned that things can blow up easily in our last project.

Right now we're still debating whether or not to make multiple classes with unique playstyles, or give every character the same skillset, or something in between.
We like the idea of swap-able skills, as it is a good fit for the procedural/endless nature of the game. But we have to see how much work that will be to implement.
« Last Edit: April 15, 2015, 04:51:30 pm by omgnoseat » Logged

omgnoseat
Level 4
****



View Profile
« Reply #1 on: April 13, 2015, 02:26:06 pm »

Right now I'm working on a tool for the terrain.
We used some 3rd party tools for the terrain in Samudai, but after some prototyping I quickly realized I need more freedom and performance for a procedural environment

The terrain consists of a bunch of points connected by flat meshes. To make it look a bit nicer you can add some offset and stuff. I also added a basic UV selector so we can put all the environmental graphics in 1 spritehseet. The current art is just placeholder btw.
It still needs alot of work, but it's a start I guess.



The game will keep generating new terrain, so performance is very important, we don't want any hiccups while you're walking along. Unfortunately Unity does not support multi-threading very well either Sad
Logged

MikeD
Level 0
*


liebe ist fuer alle da


View Profile WWW Email
« Reply #2 on: April 13, 2015, 03:59:36 pm »

Sounds cool, are you doing anything special with the procedural environment or will it be based on a endless runner style framework?
Logged
omgnoseat
Level 4
****



View Profile
« Reply #3 on: April 13, 2015, 04:45:48 pm »

Sounds cool, are you doing anything special with the procedural environment or will it be based on a endless runner style framework?
I think most typical runners just have horizontal terrain at different heights with gaps in between. Our terrain will truly have slopes, and consist of a solid piece.

To generate the environment I will use perlin noise. A city-esque environment will be flatter than a mountain-esque environment , so I will have to tweak the values I throw in the perlin noise for each type of environment.

I think the hardest part will be to place enemies in a logical place, just from looking at data from the perlin noise. It would be silly to put a jumping enemy in a flat piece of environment for example.
Logged

omgnoseat
Level 4
****



View Profile
« Reply #4 on: April 15, 2015, 04:51:20 pm »

I've always sucked at math, but the vector math I'm using right now is going along smoothly. I thought I'd share a bit for my fellow programmers with poor maths.

You can see some of the problems I have encountered here.

the transitions between segments is incorrect, but it turned out to be a logical fix.
The code might be hard to read, but I'll just add it there for completion's sake.

When I was re-factoring my rectangle mesh creation I noticed I was using some pretty inflexible code, the rectangles would only work if their width is longer than their height.

I actually just want to draw a rectangle based on a vector, but I never did anything like that. I was thinking about it for like an hour, the solution was actually super simple.

Let's grab a vector



If you look at the vector, you pretty much just want to extrude the 2 edges outwards, so you get a pretty rectangle.
What you do, is simply grabbing the right perpendicular angle of the vector, and that to the starting and ending points.



do the same thing with the left perpendicular, and add a bunch of points with length X at the end.
Connect all the points, and you have a rectangle Beer!
It's height is X / 2, and it's length is the the vector's magnitude.



In my case, the 4 points are the vertices
Code:
Vector2 topLeftPoint = currentPoint + (rightPerp.normalized * 1);
Vector2 topRightPoint = nextPoint + (rightPerp.normalized * 1);
Vector2 bottomLeftPoint = currentPoint + (leftPerp.normalized * 1);
Vector2 bottomRightPoint = nextPoint + (leftPerp.normalized * 1);

vertices[ i * 4 ] = new Vector3( topLeftPoint.x, topLeftPoint.y, 0);
vertices[ (i * 4) + 1 ] = new Vector3( topRightPoint.x, topRightPoint.y, 0);
vertices[ (i * 4) + 2 ] = new Vector3( bottomRightPoint.x, bottomRightPoint.y, 0);
vertices[ (i * 4) + 3 ] = new Vector3( bottomLeftPoint.x, bottomLeftPoint.y, 0);

Now we can piece together a bunch of rectangles to make our terrain tool, awesome.
But things don't look quite right.



That's because we need to align point 2 and 3 of rectangle 1 to point 1 and 2 of of rectangle 2. Or in other words, connect the end of rectangle 1, to the start of rectangle 2.



Code:
Vector2 prevVec = path.getPos( i ) - path.getPos( i-1 );
Vector2 prevPerpRight = prevVec.rightNormal();
Vector2 prevPerpLeft = prevVec.leftNormal();

topLeftPoint = currentPoint + (prevPerpRight.normalized * 1);
bottomLeftPoint = currentPoint + (prevPerpLeft.normalized * 1);

Looking good, right? Not quite, it's not very noticeable on straight connections, but you can see that something is definitely off on a bend.

This is because we're basing the angle of the connection solely on rectangle 1. While we should take both angles into account.
To be precise;

combinedAngle = vector1.rightPerpendicular.normalized + vector2.leftPerpendicular.normalized.
point2 (most upper point) = rectangleVector.endPoint + combinedAngle * X (for rectangle height);

same thing for the bottom point, but grab the inversed perpendiculars.



Code:
if( i > 0 )
{
Vector2 prevVec = path.getVector( i -1 );
Vector2 curVecReversed = path.getReversedVector( i );

Vector2 averageAngleTop = curVecReversed.leftNormal().normalized + prevVec.rightNormal().normalized;
topLeftPoint = currentPoint + ( averageAngleTop.normalized * 1 );

Vector2 averageAngleBottom = curVecReversed.rightNormal().normalized + prevVec.leftNormal().normalized;
bottomLeftPoint = currentPoint + ( averageAngleBottom.normalized * 1 );
}

//smooth the end
if( i < path.Length -1 )
{
//top point
Vector2 nextVecReverse = path.getReversedVector( i + 1 );
Vector2 averageAngleTop = nextVecReverse.leftNormal().normalized + rightPerp.normalized;

topRightPoint = nextPoint + (averageAngleTop.normalized * 1);

Vector2 averageAngleBottom = nextVecReverse.rightNormal().normalized + leftPerp.normalized;
bottomRightPoint = nextPoint + ( averageAngleBottom.normalized * 1);
}

Endresult, pretty connected rectangles, woohoo.


I added some other terrain types aswell.


Far from done, but it's coming along.
Logged

omgnoseat
Level 4
****



View Profile
« Reply #5 on: Today at 05:30:54 am »

Our artist made some sketches for the character designs.
The game is going to be themed around a super-sentai style. Our animal of choice will probably be foxes this time around.



What do you think? I link the mechanical bottom ones a bit more personally  Smiley
Logged

MereMonkey
Level 1
*



View Profile WWW Email
« Reply #6 on: Today at 07:02:06 am »

The one above the bottom left is my favourite, though they are all awesome looking!!
Logged

Creator of Music | Sound Designer | Can Hold Breath For 10 Minutes
Website  -  Soundcloud  -  Portfolio
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic