Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411518 Posts in 69377 Topics- by 58431 Members - Latest Member: Bohdan_Zoshchenko

April 28, 2024, 02:46:37 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsApple and Worm: Patching Holes In Spacetime
Pages: 1 ... 8 9 [10] 11 12 ... 33
Print
Author Topic: Apple and Worm: Patching Holes In Spacetime  (Read 69310 times)
JobLeonard
Level 10
*****



View Profile
« Reply #180 on: February 06, 2017, 01:07:37 AM »

I'm still a little skeptical all these transformations won't limit the game's performance too much.
Can't you precalc projections into a faster LUT or something?
Logged
diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #181 on: February 06, 2017, 09:20:41 AM »

There might be room for more precalculations. I never used Look-up tables but always wondered about where they can be used.
Logged

diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #182 on: February 06, 2017, 01:54:47 PM »

Sneaky monday update. I should really be working on real life stuff but some mondays are harder than others.

I'll talk about tileset and art style

Another thing that bothered me about this project is how I approached creation of visual elements of a level, like platforms. With that knowledge I hope to make things a lot easier for me, and make the game look better too.

What I want is to make levels using a tileset system. Click to define ground here, click there to define water etc, then the engine picks the appropriate sprite to make it seamless with its surrounding tiles. Unlike before, now I have a grid! and I can use it to pull this off! except it's not that simple. A simple illustration of the problem:



The upper part of the image is the illustration of the problem. My tiles would have to be tileable from every direction, or I should make special tiles to bridge tiles that are in different orientations. I haven't made the calculation of how many tiles I need for the latter approach but I don't like it already. The lower part of the image illustrates the solution I used before! just make it all a big polygon with a tileable texture and create the contour with a stripe of polygons. I'll come back to it later.

Making the tiles tileable from any orientation imposes strong limitations to how it looks, Therefore it will either have a very symmetric look to it that allows every tile to be rotated at will or sport a very minimalistic pixel art visual. But it could work. Comes with the bonus of being even smaller than your average tileset, because it only needs two corners pieces which are rotated accordingly.

Very minimal:


Very symmetric. My symmetric would have to be even more so, because there is no shading direction.


Considering I already have some art done for the game and I would like to use them if possible and it's not THAT minimalistic, the second approach is appealing. Then again, I rebooted this project with a specific mindset of not being afraid of ditching things that are an obstacle, despite how much I like it. So I'll do some experiments with the minimalistic look as well.

Things I want to do now: See if I can create a symmetric tileset that doesn't look like a FEZ mockup. See if I can pull off a minimalistic look for the tileset and how much I have to change of my other sprites. Maybe build a quick mockup scene.

Another thing I want to do, again with the hindsight of what I did before, is test strategies to add depth perception. Normal map and lighting, or maybe even 3D objects. The hindsight is that I noticed a strong tendency of everything looking very flat with this game. The absence of tiles informing up and down, the lack of consistent shading on objects, and things spinning around seem to give away a very flat aspect to the game. What I did before was layer the contour strips and move them a little as the camera rotates so it creates a depth effect. It's subtle but I really like it, but it only attenuates the problem.



I would really like to keep things simpler this time around though, and this one is not simple. It's a composite of objects; comes with a bunch of complications. So I'll only fall back to this system if all else fails.

« Last Edit: February 06, 2017, 06:38:42 PM by diegzumillo » Logged

diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #183 on: February 13, 2017, 08:30:29 AM »

BROTHERS AND SISTERS. Hello. Here's a little post weekend late update.

I remade the level mesh system. Instead on being centered on vertices and trying to form quads from its connections, it's now centered on quads. Makes more sense considering what I need it for. The new code is much shorter, much simpler, and the editor is easier to use and improve on.



I'm a little concerned about deforming sprites now. Static sprites are easy enough to replace with a textured quad, where I can move the vertices at will. Animated sprites are a little trickier. Ideally it would use Unity's animation system, where I can import images as 'multiple' and it automatically generates animations by just dragging on the scene. Unfortunately it uses its own sprite renderer system and I don't know how to access that geometry, if I even have access to it. Bottom line is I might need to make my own animation system, by scrolling around the UV etc, but I would like to avoid that if possible.

I also made a grass tileset to replace the old system. I  might edit it to match the bluer tone I was using.



Notice the absence of any texture on center tiles. That's by necessity, because of the orientation problem. The border tiles are fine, except for the case where there are tiles on opposite sides (like a corridor) then the situation where they are one is 180 degrees in relation to the other could happen, so that tile must be 'extra tiling'!
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #184 on: February 13, 2017, 09:37:45 AM »

Getting a "constraint based programming" vibe from that editor gif




(7m40s)
Logged
diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #185 on: February 13, 2017, 10:22:55 AM »

Hah, that was fascinating. The beginnings of CAD. In a way that's what I'm going for, I guess. I let the computer decide where exactly to put things and just nudge it in the direction I want.
Logged

Zorg
Level 9
****



View Profile
« Reply #186 on: February 13, 2017, 05:00:15 PM »

The mesh gif looks like you need a minimum distance between two vertices to prevent the mesh to collapse and build triangles. Feels very 'organic', like foam. :D
Logged
diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #187 on: February 13, 2017, 08:35:34 PM »

Yes! It still needs a lot of love. And constraints. But I do like how it feels, it's kinda fun. Maybe the game could have a built in editor Smiley

I came from work today with my head still on this project so I spent a few hours trying to figure out how to solve this problem:



I'm already accepting that I'll have to make everything a texture quad and make the animation system too. Thus I started looking into what I'm gonna need. Making a quad is simple enough but, as you can see above, affine mapping is the problem. It looks like crap, basically. I could never wrap my head around shader programming but that's what I'm gonna have to do if I want to solve this problem. Amazingly the internet doesn't have a shader for that, with a projective mapping or anything else better than affine. Well, it does have one but it doesn't work. Something changed from previous unity versions and that particular shader is now broken.

But one step at a time! I'll stick with ugly mapping for now. OK, now I'm done until next weekend.
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #188 on: February 14, 2017, 12:07:51 AM »

The "ugly" mapping does have readability benefits
Logged
oahda
Level 10
*****



View Profile
« Reply #189 on: February 14, 2017, 01:09:34 AM »

Woah, a lot has happened since I last looked at this! Very nice. ε:

Would love to hear more technical details about the level mesh thing.
Logged

Zorg
Level 9
****



View Profile
« Reply #190 on: February 14, 2017, 03:06:26 AM »

The GIF looks like you want to solve the problem globally for a quad with any 4 vertices in 3D space. But your game is 2D, isn't it? Sorry if my questions sound dumb. I don't get what you are doing there.  Embarrassed
Logged
surt
Level 7
**


Meat by-product.


View Profile
« Reply #191 on: February 14, 2017, 03:48:48 AM »

Stuff about correct quad rendering here: http://www.informit.com/articles/article.aspx?p=2120983&seqNum=2
Logged

Real life would be so much better with permadeath.
PJ Gallery - OGA Gallery - CC0 Scraps
diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #192 on: February 14, 2017, 02:54:52 PM »

Woah, a lot has happened since I last looked at this! Very nice. ε:

Would love to hear more technical details about the level mesh thing.

More details incoming!

The GIF looks like you want to solve the problem globally for a quad with any 4 vertices in 3D space. But your game is 2D, isn't it? Sorry if my questions sound dumb. I don't get what you are doing there.  Embarrassed

It's stuck to a plane but since every vertex can still move in the plane is creates distortion. I mean, I want the distortion! but I a smooth one.



Mine is the one in the middle. I think the right quad is projective, since the squares look smaller on the upper part. There are others.


Thanks! I'm sure not eager to start reading that, but it will come in handy eventually.
Logged

Zorg
Level 9
****



View Profile
« Reply #193 on: February 14, 2017, 04:24:17 PM »

In your case, i thought that the grid of a quad (even in its distorted state) would always have to be distributed evenly at all sides of the quad to ensure a smooth connection to neighbor quads.



Edit: I added the diagonals and now i'm seeing the problem.  Facepalm
« Last Edit: February 14, 2017, 04:34:12 PM by Zorg » Logged
diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #194 on: February 14, 2017, 04:32:14 PM »

Exactly. I also only noticed the problem when I was right at its nose lol
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #195 on: February 14, 2017, 04:36:45 PM »

Isn't there a standardised way of dealing with this that is totally out of your way? Who, Me?

I mean, it sounds like something that would be such a common problem
Logged
diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #196 on: February 14, 2017, 04:45:33 PM »

I know, right! I made a post directly at the unity forums asking for help but so far nothing. What happens is that people usually overcome this problem with more polygons and adjusting the UVs of the model until it looks good... Yeah, now that I wrote that with my own fingers, that does sound like a solution, doesn't it? Fun fact: my level mesh is using a transformation that could very well be in a shader, it's inverse bilinear interpolation, but I can't use on every pixel because it's not optimized enough, but I could use it to position a few more vertices on the mesh.

I really shouldn't work on this during the week, but it's haaard not to Embarrassed
Logged

Zorg
Level 9
****



View Profile
« Reply #197 on: February 15, 2017, 02:20:58 AM »

Sorry, i can't get this problem out of my head, because i have the impression that it should not be that difficult to solve.



I don't have any idea how to write a shader, but the distortion from P to Q looks pretty straightforward, doesn't it?
« Last Edit: February 15, 2017, 02:31:47 AM by Zorg » Logged
diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #198 on: February 15, 2017, 05:13:21 AM »

But have you seen the inside of a shader code? It's alien! ALIEN I TELL YOU!

I'll get to it eventually Tongue
Logged

diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #199 on: February 20, 2017, 03:59:00 PM »

I wish I had a cool gif to post this weekend but I got nothing.

I'm still struggling with this new implementation. I'm not a good programmer (some might argue I'm not a programmer at all) and this is really putting my lack of skills to the test. Here's a quick overview of how things are organized:

I tried having a centralized system where a class holds a list of quads and an adjacency matrix (given i and j, the matrix value would define whether i and j are connected). But it turns out to not work for non-square lattices. So everything needs to be local. So I have a class called LevelGrid, that holds a list of Quads. Quads know which quads are around it. Then there is also a thing called map layer, which holds your usual tiles. Level grid holds a list of map layers, so you can have... layers. Layers of tiles. Is everyone following or is my rich english vocabulary blowing your minds too much? anyway, so these tiles don't have any information about the surroundings, necessary for things like auto-tiling, but it does have its own quad. It can ask the quad "hey, which quad is around us?" and the quad will give all the neighbor quads. But quads don't have a list of tiles that belong to it, so that information is not very useful, because the tile needs to know which tiles are around it. Then I told the devil I wanted him to teach me how to play the guitar in exchange for my eternal soul which is made of cookies is anyone still reading this nonsense?

Bottom line is I could hammer the information I need on the quads. But it introduces so much redundancy in the system, the maplayer contains a list of tiles, then the quads contain a list of tiles for each map layer. Again, I'm not a programmer and elegance is not my priority, but the code is dangerously complicated right now, which will definitely make debugging a nightmare, so I might need to plan it a little better before proceeding.

All right, just one tiny gif!

Logged

Pages: 1 ... 8 9 [10] 11 12 ... 33
Print
Jump to:  

Theme orange-lt created by panic