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

Login with username, password and session length

 
Advanced search

1357831 Posts in 62997 Topics- by 54838 Members - Latest Member: SirTrashyton

March 26, 2019, 05:15:56 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsNegspace
Pages: [1] 2 3 ... 14
Print
Author Topic: Negspace  (Read 51581 times)
pnch
Level 1
*



View Profile WWW
« on: May 07, 2014, 10:19:11 AM »





2D physics based hotseat dogfighting @byPencha

Currently featuring:

  • 4 players split-screen, fast paced and responsive.
  • Full translational and rotational inertia, tame that space-y feeling!
  • Inmersive 2d field of view.
  • Three completely different ship classes.
  • Killcams, and various kind of deaths. (be stranded, irradiated, incinerated or exploded).
  • Mines, homing missiles (actually fun to avoid) and countermeasures.
  • Ship boardings and escape pods.
  • Battery level affects the general handling of your systems and engines.
  • Friction chargers.
  • Playable menus and a minimalist approach to UI and controls
  • Some other bits hidden around the devlog Smiley

Negspace is in early development, stay tuned to see the list grow!

Press mentions:



Mandatory gif mountain:























--------------------------------------------------------------------

Actual first post:

Hello World!
Reading and learning from the (huge) Rain World devlog made me want to share some progress of my own.
I´ve been working solo on this as a side project for a while. It´s also my first gamedev, which I started mainly as a learning project.

I plan to steadily post "old" updates until I catch up with the actual dev, and to carry it from there. So:

What is Negspace?



In order to get things done, I´m gravitating towards having functional bare-bones 4 player hotseat deathmatch as the next milestone, but due to the nature of the project I´m not too worried about sticking to a preset path. To be continued!
« Last Edit: August 19, 2015, 02:01:04 PM by pnch » Logged

pnch
Level 1
*



View Profile WWW
« Reply #1 on: May 08, 2014, 07:21:54 AM »

The stencyl prototype
I started with this quick prototype, also featuring a couple of large exploratory levels (but the enemies lacked the AI to navigate them) and a basic "dialogue" system.

Then, mainly because I wanted to do at least hotseat multiplayer, lots of raycasting for FOV and camera zoom+rotation, I realized I had to leave Stencyl behind.
I decided to move on to Unity3D.
Porting character movement and logic was straightforward, but Unity has no built-in solution for tileset based level creation, something stencyl excels at.
So I opted for the not so fun Lips Sealed task of writing a mess of a custom importer to read levels made with Tiled in Unity.

e.g. this shape, previously drawn in Tiled:
is actually composed of those game objects:

Notice the shape and the way the tiles are cropped matches the marching squares algorithm, for which I previously decided to redraw my tileset  Facepalm. More on that on the next post! Going back to gamedev.
« Last Edit: May 08, 2014, 09:00:55 AM by pnch » Logged

SolarLune
Level 10
*****


Hmm.


View Profile WWW
« Reply #2 on: May 08, 2014, 08:11:01 AM »

Oh, hey, this looks cool. Nice simple art so far!
Logged

Scott
Level 2
**


View Profile WWW
« Reply #3 on: May 08, 2014, 08:19:02 AM »

What you ended up with is very cool. I've never liked the type of ship controls it looks like it's going to have (with the exception of Solar Winds), but the art style is fresh enough to me that I would certainly give it a fair try.
Logged

pnch
Level 1
*



View Profile WWW
« Reply #4 on: May 08, 2014, 09:41:01 AM »

woot! first comments, couldn´t wait till tomorrow to answer:

@ Solarlune:
Thanks! The art it´s becoming even more radically minimalist I think.
PS checked your devlog but image links are broken!

@Scott:
Thank you! Also... Solar Winds! I looked it up in Wikipedia and it happens to be one of my favourite childhood games, from which I had completely forgotten the name, so thanks a lot for that! Now i´ll have to replay it somehow.

About the controls, as a lover of boats and sailing, I´m trying to convey a little bit of that feeling to the player by respecting inertia as much as possible without breaking the gameplay. Granted, traversing a level without hitting every wall is not an easy task, and most of the time you are grinding one, but it makes it so much more enjoying when you nail a long stretch of smooth drifting. Also, spaceships weren´t designed for small corridors Grin so the feeling of clunkiness and disorientation is a big element of the gameplay, somewhat like a wannabe 2D Descent demake, with physics  Beer!.
Logged

pnch
Level 1
*



View Profile WWW
« Reply #5 on: May 09, 2014, 11:45:27 AM »

My levels were being drawn, but without any kind of colliders!
I tried the one tile / one collider route, but the ship got it´s nose stuck on the line between colliders often. Besides, it would really hurt performance on large levels.

This was the tileset used for walls on stencyl.

After finding this VERY helpful article on getting contours:
http://devblog.phillipspiess.com/2010/02/23/better-know-an-algorithm-1-marching-squares/
I did some tests and a couple headaches later I got a working "Marching Tiles" algorithm. Instead of working on pixels, it got it´s step direction straight from the tileset.
See the tileset containing the 16 cases (the last one is not used) and a shape done with it.

Next, I added a LUT function on top of the algorithm, which would tell the algorithm where to look for direction given any tile in any tileset.

On red, superimposed, are marching squares cases (the tileset of the previous image)for each tile.

The big amount of small squares Huh? will be explained soon.

And here is how it looks like:

sample level
Top: result. Bottom: result after linear interpolation

Result after checking for collinear points, note the reduced amount of polys.


Unity is still generating a lot of unnecesary polygons, but I don´t know if I can help it anymore without doing ugly hacks or I´m missing something. Still, I´ve been building large enough levels without problems.

At this point, the algorithm only supported 45º angles, as traditional marching squares does.
90º angles generation on the next post, then hopefully we´ll be done with The Boring World of Level Building for a while and catch up with real gameplay dev!
Logged

Scott
Level 2
**


View Profile WWW
« Reply #6 on: May 09, 2014, 12:11:18 PM »

Hmm cool application with the tiles. What was the step from "original" to "linearly interpolated"? The first one started with the marching squares right?
Logged

pnch
Level 1
*



View Profile WWW
-
« Reply #7 on: May 09, 2014, 12:35:16 PM »

Thanks, the first colliders image is the result of the algorithm without any postprocessing... Not sure  if that does answer your question ...?
Logged

Scott
Level 2
**


View Profile WWW
« Reply #8 on: May 09, 2014, 12:37:58 PM »

No I get that... I was wondering what you did in the post processing. Just curious Smiley
Logged

pnch
Level 1
*



View Profile WWW
« Reply #9 on: May 09, 2014, 12:54:04 PM »

The post processing is just applying linear interpolation to a set of points in space, and then erasing all collinear points. Generating the polygon colliders in the last step directly from the postprocessed list of points was my key to not overcomplicate everything.

linear interpolation (somethimes just lerp) it´s kind of splitting the difference in values between sequential data (in this case a series of points in 2D space).

both methods (bolded) are kind of standard procedure, you can google them in your language of choice with high chances of a jackpot, or you can try wikipedia if feeling adventurous.

just curious are welcome!
Logged

mickmaus
Level 1
*


walkying waylking


View Profile
« Reply #10 on: May 09, 2014, 01:32:44 PM »

Looking cool!
Logged

SolarLune
Level 10
*****


Hmm.


View Profile WWW
« Reply #11 on: May 09, 2014, 10:49:58 PM »

Oh, hey, that sounds cool. I'll have to bookmark this; always good to see how procedural / code-based approaches to things are done.

P.S. I hit the bandwidth limit for Photobucket, which is why it crapped out on me. :p I'll start switching over to another host from now on.
Logged

pnch
Level 1
*



View Profile WWW
« Reply #12 on: May 12, 2014, 10:58:38 AM »

@Solarlune
Sure, procedural level generation is a topic i´m interested on,
I have some ideas but not sure they´ll make it into this game yet.

@Mickmaus
Thanks!


We left at:

90º Angles support.

Note the selected tile is the 16th, the error case in "standard" marching squares.
the next 8 tiles were added to support 90º angles.
When the algorithm is drawing the contour, if the LUT points to one of those eight cases, it will generate two extra points in the center of the current tile. Being two points ensures the corner will stay sharp after linear interpolation. Then, before checking for collinearity I´m checking for and deleting similar points.


Result.




Pixel bleeding (Unity specific).

Highlighted, you can see a 1 pixel wide line between tiles.

In Unity, you always need to have at least one pixel between sprites, or the border of the next tile will appear on the current one when displaying it (depending on video card + resolution + camera width + luck, of course). Also, the built-in slicing algorithm doesn´t support padding (pixel offset between tiles).

To solve this, I´m actually exporting a squares array, slicing with the automatic slicing feature, which cuts the tileset based on the alpha value, and then replacing the file with the one containing the tileset.


On black, superimposed: the tileset.
On green, background: squares array.

The small black squares and lines were placeholders, to keep the index of the tiles constant  before figuring the slicing/replacing file method (if a tile was empty, before this method the algorithm would skip it, messing the indexes of the following tiles).
Before figuring this method, I had to pay attention to not draw two tiles together if they didn´t share a border, or draw lots of placeholder almost-empty tiles between useful tiles (as you can see).

Also, to prevent the opposite (thin empty lines between tiles) you have to make them slightly overlap each other - and yes, it´s a mess when they are semi transparent.

FOV raycasting tomorrow, over and out!
« Last Edit: May 15, 2014, 08:56:54 AM by pnch » Logged

McMutton
Level 10
*****


McMutton


View Profile
« Reply #13 on: May 12, 2014, 12:36:12 PM »

This seems neat. The perspective in those first gifs is pretty awesome.
Logged
pnch
Level 1
*



View Profile WWW
« Reply #14 on: May 13, 2014, 07:43:43 AM »

@McMutton:
Thanks! This post will cover some of it.
Also, I was thinking on ways to enhance it yesterday, stay tuned.

Recap #4: Field of view
From the beginning I wanted to be able to convey a sense of claustrophobia while you traverse small spaces, also, I wanted players to be able to ambush each other by hiding, making the gameplay more tense.

Raycasting the level colliders was an obvious choice, but I also wanted to be able to preserve detailed interiors of the walls, which would be completely blackened.

I solved it by first doing the standard "raycast a bunch of rays around the player", and then offsetting the contact points by a small multiple of the distance to the player, in a direction opposite to it (this is what creates the feeling of an upward perspective). Also, I setted a minimum distance from the player, effectively creating a soft rounding when the player is near a wall (see the circle around the ship on the thinner corridor). This enables reading inside near walls, and seeing the other side of thin walls.


Raycast final shape.

I´d like to implement all this on a shader instead of using that many polys, but not sure it´s possible on Unity Free yet.

Feel your lungs filling with space-air once you get to open space:

PS: Enough purple for a year, caught me in the middle of a visual overhaul.
Logged

Scott
Level 2
**


View Profile WWW
« Reply #15 on: May 13, 2014, 07:51:19 AM »

The effect works well. At first I was thinking how I don't usually enjoy games that limit view in 2d, but it works very well here and definitely makes you feel like ah man I can't wait to get to an open area! Looks nice too.
Logged

Hempuli‽
Level 10
*****


Sweet potatoes.


View Profile WWW
« Reply #16 on: May 13, 2014, 10:43:30 AM »

I love the look of this and your explanations on how & why you did things makes it all the more impressive. The controls look as to be a bit tricky but the game seems to have great potential Smiley
Logged

pnch
Level 1
*



View Profile WWW
« Reply #17 on: May 14, 2014, 07:58:02 AM »

Getting closer to actual game dev!

Recap #5: Hotseat splitscreen + multiplane

I´ve got splitscreen working, up to 4 players.
I´m reusing the original ship´s sprites through a hueshift shader.



Also, all the derived objects use the same shader and it´s color it´s passed to them when created. So, a green ship, throws a green laser that on impact creates a green explosion,and accelerates with green thrust, despite all three objects being originally red.


Notice the extra amount of space confetti today, with planets and lo-fi glare.
I´ve just put together a multiplane object, that allows me to easily setup as many  background and foreground objects and their parallax as I wish.
I went overboard with it, and messed up the color scheme [EDIT: re-upped gif, fixed], but it´s nice to know I can easily set this up on a per-level basis now.

Also, while doing it I noticed that each of the players must have a duplicate of all parallax objects for them to give the illusion of space! So, all the games with parallax you played in multiplayer had duplicates of it´s parallaxed backgrounds, never thought about it before.

The little zeros are placeholders for scoring. More on GUI and giant induction chargers tomorrow!
« Last Edit: May 14, 2014, 11:02:41 AM by pnch » Logged

pnch
Level 1
*



View Profile WWW
« Reply #18 on: May 14, 2014, 11:28:07 AM »

How very impolite of me, I left you without answering, sorry:

@Scott: Thank you!

@Hempuli: Thanks! that´s what I love about devlogs so I plan to continue like this, on the other side, if anyone thinks I´m going overboard with technobabble please DO point it out!

And for the sake of it, more updates - with spoilers:

I had the first hotseat 4 player deathmatch test runs this weekend and realized the labyrinth sections were too labyrinthic to be fun in this mode, and also lacked prominent reference points, so, here are both layouts:


Note how the bottom left space changed and the overall added decorations.
Also, red thingies are spawn points. See how they all point in different directions, there´s no up in space!
Logged

pnch
Level 1
*



View Profile WWW
« Reply #19 on: May 15, 2014, 10:16:08 AM »

While there are still plenty of things already developed I haven´t showed, they are mostly half-implemented. Since I´m sure I´ll have to revisit them for fixes, I´m confident I´ll introduce them  here in that moment. Being at a point where I can start posting current development, here´s finally with you:

Update #1 Hand Metal Left : Fuel, Friction Charger and thoughts on UI

I plan the conservation of fuel to have an important impact on gameplay and level design, with throttle and firing eating up your fuel, giving way to emergent situations, e.g.

-The most fiery combats will most likely happen close to refuelling points.
-Having a full tank will allow you to outlast an opponent in a chase.
-Getting lost evading another player could leave you stranded without oxygen  Smiley.
-You´ll drive your ship more carefully to preserve momentum and economize fuel.
-You´ll only shoot when really needed.
etc.

Behold the giant friction charger of ships!


The number on the top is the remaining amount of fuel your ship has, note how it progressively recharges the ship when you grind the charger. The faster you grind it, the faster it charges, simulating charging by friction (like lighting a matchstick).
Also notes how it stops flickering random colors and turns to red, giving feedback that you are actually being charged. When many players charge at the same time, it flickers with the color of all players being charged.

The number is just there for debugging, I´m thinking on using a super minimal UI, only noticeable if you know how the game works. For example, flickering pixels over your ship indicates your weapon is ready to fire.
An the las gif, notice the rate of the flickering is different before/after grinding the charger, the rate of the flickering indicates your fuel level.

It´s still pretty hard to read, but I´m thinking on delving deeper in this direction with UI for the moment.

Back to gamedev!
Logged

Pages: [1] 2 3 ... 14
Print
Jump to:  

Theme orange-lt created by panic