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

Login with username, password and session length

 
Advanced search

1377709 Posts in 65441 Topics- by 57754 Members - Latest Member: Devillia59

June 01, 2020, 10:05:04 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityJams & EventsCompetitionsWholesomeStory Time
Pages: [1]
Print
Author Topic: Story Time  (Read 659 times)
polkapanda
Level 0
*


View Profile
« on: October 18, 2018, 02:39:45 PM »

Howdy,

Thinking of an idea I was happy with took a little but better late than never. The general idea is to use the mouse to drag a character around and go through a simple adventure game. In my mind it's kind of like a pop-up book which can be poked a bit. Below is a very rough example of it. Ideally I will have an editor done by the 31st, but who knows.



While I was thinking of what to do I worked on stuff more universal stuff like text rendering, so I'll dive into that a little. In the past whenever I've had to render text I just used one font atlas jpg, but it ends up looking really bad. I decided to use freetype and have gotten to a fairly good place with it (as far as I can tell :/ ). Initially I drew every word one letter at a time which caused me to repeat a lot of work every frame. When moving to a cached system I got a kind of fun visual bug because I used triangle fans to draw each letter. Once the bug was fixed, I decided to just cache all the points and draw with triangles instead of fans. I didn't really look to much into the trade offs (outside of the memory cost of saving two more points per letter), but thinking about that is for later when I've used too much memory Smiley

Whoops:

Fixed:


Currently I'm working on getting buttons working. I have a GUI from a different project I did, but it was kind of messy and in a different language so hopefully I'm cleaning it up a bit when porting it over. Right now I have buttons mostly in place. I'll thinking I'll need sliders and text inputs, so adding them is something to do. Once the GUI code is in place I can start the 'actual' thing so that's exciting.

Clicking the 'Hello' button prints the number of times it has been clicked:


If anyone has any questions feel free to ask and I'll try my best to answer without rambling too too much. I can also link my repo if anyone is interested, but it is a little too messy for me to do it voluntarily.

Logged
Lurk
Super Artistic
Level 5
*


....


View Profile WWW
« Reply #1 on: October 19, 2018, 04:46:09 AM »

Have you given some thoughts to using Distance Fields for rendering text?
http://www.codersnotes.com/notes/signed-distance-fields/

I had to do some graphic work using this technique, and the results were really impressive and smooth, compared to using a regular texture(we did text and pictures using it)
Logged
polkapanda
Level 0
*


View Profile
« Reply #2 on: October 19, 2018, 07:18:59 AM »

Have you given some thoughts to using Distance Fields for rendering text?
http://www.codersnotes.com/notes/signed-distance-fields/

I had to do some graphic work using this technique, and the results were really impressive and smooth, compared to using a regular texture(we did text and pictures using it)

I haven't heard of it before, but I don't tend to do a ton of research into things. It looks really cool and smooth text is something I would like so hopefully later I can implement it Smiley I'm always surprised how interesting 'mundane' stuff ends up being when actually you actually dive into it.

Also thank you for taking the time to link to it, I appreciate that.

Logged
Lurk
Super Artistic
Level 5
*


....


View Profile WWW
« Reply #3 on: October 19, 2018, 10:22:58 AM »

I would'nt know how to code it  Tongue , but the way to create the texture files I used this tutorial which was pretty straightforward - needed a bit of experimentation to get the textures right because we did some complex images using it(fonts are pretty easy but a lot of curves and small details can get lost in the process)
http://www.horde3d.org/wiki/index.php5?title=Preprocessing_Technique_-_Distance_Field_Vector_Textures

 what was interesting to me in the process was the other uses you could derive from the way it calculates between pixels and interpolate this calculation to recreate some complexity (some of the documentation papers even used the r-g-b channels to give a more precise shape to the letters, really impressive)
valve's paper
https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf

other examples
https://computergraphics.stackexchange.com/questions/306/sharp-corners-with-signed-distance-fields-fonts
Logged
polkapanda
Level 0
*


View Profile
« Reply #4 on: October 21, 2018, 02:29:24 PM »

@Lurk
Thanks for more resources on SDFs! I bookmarked them all to go Hand Metal Left wild Hand Metal Right later.

~~

My last few days were spent sorting out how OpenGL textures work. I didn't really have a firm grasp on it, but I am in a better place now (I probably still am missing some stuff but that's okay). As for visible progress I built a very rough example (i.e. hardcoded) which is playing in the GIF below.



The text is labeling the person and house because the bounding boxes aren't really great and it helped me visualize what was happening. The text is outlined now too which is exciting so you can see it on a white background. That was done by checking if a fragment is right next to a letter.

Next I need to work on a way to store 'scenes' (backgrounds and objects) and read them in. Smiley
Logged
polkapanda
Level 0
*


View Profile
« Reply #5 on: October 22, 2018, 02:26:25 PM »

I built a rough transition system. Basically a vector of backgrounds and objects on them. Objects can link to other background and object pairings so when the character and an object overlap the scene can change. All the stuff is read from a text file so the the scenes can be modified outside of the code, but it can be a bit unwieldy. Hand Thumbs Up Right

Logged
polkapanda
Level 0
*


View Profile
« Reply #6 on: October 31, 2018, 05:27:39 PM »



I have this fairly finished. It's a pain in the butt to actually make anything in it which is disappointing but you can make things in it which is nice-ish. I have a lot of code clean up to do before I do anything else feature wise so this is 'finished' for the compo.

Something I wish I got done was to allow new areas to open up after giving a character an item. I might be able to hack it together, but there has already been enough of that.

I also haven't been able to get this running on my sort of crappy laptop so I'm going to hold off on posting to the finished thread until that's fixed. I don't really know whats wrong which is kind of annoying Sad
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic