Skip to main content

News

Topic: The Screenshot Thread (Read 69161 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: The Screenshot Thread
Reply #120

Hey Radnen, that's a nice font, any chance I could get a copy of that?


Umm, not really. It's my handmade font from Blockman. I want it to be unique to that game before others get to use it. I was just using it to test font drawing with.
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

Re: The Screenshot Thread
Reply #121

Well, GradientRectangles seem to be the thing slowing down the KH2 demo. I have a plan though... It involves creating a static gradient texture, preferably the size of the screen and then scaling it to the places I want it blitted... It might just do well enough or completely fail. The bad thing is the worst case secnario is that each frame the colors change: such as a gradient background fading from one color to the next. I don't know what else... I might have to create a custom GLSL shader for fast gradients.

I have no idea how you are doing it, but in ye-olde software-rendering TurboSphere I was doing pretty well with just doing a pixel-by-pixel, line-by-line gradient rectangle. Just vertical gradient lines, each one having the top and bottom colors of the top and bottom colors respectively blended with weighting.

Also...in OpenGL I am now just using array drawing and four unsigned byte colors. Of course, the array drawing technique (which I use exclusively, unfortunately) is very fast approaching (if not already) deprecated OpenGL. But it is very, very fast. I'm 100% sure there is a way to do this using buffer objects and GL, no custom shaders just for it (and still very fast). But I really need to learn to properly use buffers before I could show how it would be done!


Well, at least I'm happy that windowstyles don't have an off by one issue, even on 2x scaling. However, lines are not scaling. In OpenGL, lines are not pixels per-se they are entities. I'll need to find a good way of drawing pixel-sized lines.


I hear you, I've got the same problem. It really bothers me that the end points of lines simply cannot be specified as pixels proper, and so all my lines go to pixel corners (this causes off-by-one problems in very certain circumstances in TurboSphere, but only with lines that aren't straight). But what really grinds my gears, and this is my only complaint against OpenGL, is how line drawing affects scaling.

You can set the GL Line Size. But it changes the width, which is not precisely what I expect from 2x scaling, I want each 'pixel' as the engine sees it to be a 2x2 pixel block, and draw the same with that in mind as it would without scaling.

My best solution so far is to just use Bresenham's algorithm (with an assumed half resolution), double the point size, and blit a series of points...but even then, things like triangles, circles (any poly, really), transform or rotate blits, and textures still aren't properly drawn as if the whole resolution is just half what it actually is. Honestly I think that a shader is the best solution to this, I've come to the conclusion that there's nothing built directly into OpenGL that does this properly (and fast enough!)

I did try doing all drawing on a framebuffer and drawing that to the screen at double res, but that is one: slower than I expected (by far) and two: still not perfect.
  • Last Edit: July 13, 2013, 05:06:01 am by Flying Jester

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: The Screenshot Thread
Reply #122
How the hell does Sphere do it?
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: The Screenshot Thread
Reply #123

How the hell does Sphere do it?


GradientRectangle? Check source/common/primitives.(hpp|cpp)

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: The Screenshot Thread
Reply #124
I don't even understand what's going on in primitives.hpp, but from the logic it seems to do what Jest mentioned, drawing an interpolated color line by line (from source to destination). But it seems to draw it on a surface, then that surface to the screen? How can that be any fast?

Anyways to not go completely off-topic, here's a demonstration of all of the text functions. WordWrapString was not too hard to figure out, by looking at the source. In fact I had a different implementation but it wasn't exactly the same (it stripped whitespace on words that begun a new line like what most word processors do). But to be exact, it needs to behave the exact same way or I could in some weird way break a game entirely by wrapping the text wrong.
  • Last Edit: July 13, 2013, 05:04:36 pm by Radnen
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here

Re: The Screenshot Thread
Reply #125
But it seems to draw it on a surface, then that surface to the screen? How can that be any fast?


It's better to make a lot of small accesses to software memory than to hardware memory, and I'm guessing Sphere was written back when SDL 1 could actually get hardware surfaces--that was possible back in the day!

Plus, in SDL you really do need to do that to get alpha blending, the SDL blit operations (which are in fact hand written assembly routines that use vector instructions) are very fast for alpha blending. And accesses to surface pixels are just as fast as access to any system memory.

It's fast enough, that's how I did it back in the software rendering plugin for TurboSphere (and those were my reasons, perhaps Sphere was written that way for different reasons).

Re: The Screenshot Thread
Reply #126
Thanks to forum support, I was able to create a Necromancy Bullets script!
You can catch the souls of your enemies and use them as your slaves, mwahaha  ::)

I'm not sure I understand what you where talking about with alpha blending but there is a slight blur on the bullets when they are shot, whatever it is I'm NOT fixing it. What artists call a happy mistake.

Re: The Screenshot Thread
Reply #127
Ripped tiles from FFII and Faria make everything look more official lol.
I was testing out my textbox window skin and main character sprite. I'm satisfied enough with how it turned out (^_^)

Re: The Screenshot Thread
Reply #128
@Xenso Looks awesome!very retro :D

My textbox window and main sprite is done too.

Re: The Screenshot Thread
Reply #129
nice text box too, your game looks cyberpunk!  8)
I envy your choice selection. I'm learning how to do that, any links/tips?

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: The Screenshot Thread
Reply #130

I envy your choice selection. I'm learning how to do that, any links/tips?


Most old choicebox scripts basically run a highly-customized menu script. Fundamentally, it's really just a specialized menu.

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: The Screenshot Thread
Reply #131
It would be nice if you could adapt the window height to the amount of text that's there. There's some space being wasted on the screen right now! ;)

  • Rukiri
  • [*]
Re: The Screenshot Thread
Reply #132

It would be nice if you could adapt the window height to the amount of text that's there. There's some space being wasted on the screen right now! ;)

I used to just do  screenheight and screenwidth and just minus the pixels until it looked right.
yea gotta agree that is once HUGE textbox...

Re: The Screenshot Thread
Reply #133
Hey guys, here's a couple screenshots of an old project that I decided to begin working on again. I started it originally for a game competition but never did get the chance to complete it. It'll be a different story than what it was gonna be originally but the good news is that a lot of the systems are working so it shouldn't take me long to get something up and going. Graphics are placeholders for the most part :) Just gives you an idea of the menu screen and early battle system.








Enjoy!
  • Last Edit: August 07, 2013, 05:29:09 pm by Legaia
It's super effective!

  • Radnen
  • [*][*][*][*][*]
  • Senior Staff
  • Wise Warrior
Re: The Screenshot Thread
Reply #134
Are my eyes failing or is that Sphere 1.7 being used? Also I remember this! We were going to do this as a compo game, but then you had to stop. I'd say this is a great start and I'd love to see where this project goes.

But please don't make it about a goat. :P
If you use code to help you code you can use less code to code. Also, I have approximate knowledge of many things.

Sphere-sfml here
Sphere Studio editor here