@TommyRefenes YEAH John Hammond was able to place a copyright strike on the painting after google bought it :( (Today)

@Marshall2Re hey thanks! ;D (Today)

Anonymous inside sources confirmed that Google has purchased a pretty cool painting of a Stegosaurus at a yard sale for 0.000000001 billion (Today)

@TommyRefenes dang you got like 9999 pills (Today)

@Livelyivy Oh nooooo I thought we sealed off the murder hole once and for all (Today)

@fncwill I wasn't playing, only saw the screen. (Today)

Nobody is a loser at the Saratoga Casino and Raceway! (You could be a "looser" though.) t.co/b6HOTas7eR (Today)

@PuppyWarrior @MattThorson When the only thing that the reviews mention is the addiction, and it's a mobile game, I don't have high hopes. (Today)

@MattThorson At least when looking at mobile games seeing a bunch of "5/5 so addicting!" reviews is a giant red flag. (Today)

@ChevyRay @ADAMATOMIC Oh really? I was given false info then! Plus resharper defaulted to making private stuff have a _ when I tried it :I (Today)

@codeapparat HMM interessting. I have seen some code bases with initials at the start of variables. I might try this in a quick jam thing. (Today)

@championchap Yeah I think FP is the first place I saw it. (Today)

@ADAMATOMIC Yeah right now I'm just doing lowercase for all private stuff, but I think the C# "official" standard is starting them with _ (Today)

@zenasprime Local scope I just make lower case and try to make them as shortly named a possible. (Today)

@ADAMATOMIC A chill runs down your spine as your sock begins to absorb whatever you just stepped in. Let the games begin. (Today)

@MoviusC I mean underscores to start though. Like private int _speed = 0; or something like that. (Today)

@zenasprime Ah, yeah that's what I'm using for my projects now. (Today)

Experimenting with using underscores for private things in C# and I'm still not sure if I like it or not. DO YOU USE UNDERSCORES?! WHY?! (Today)

@0SCUR0 @konjak I dont think you could guarantee it to be visible or invisible on the video or stream though. (Today)

@konjak Shovel Knight revealed how much of a problem it can be. Flickering every other frame at 60fps makes something invisible at 30fps :O (Today)

follow
search
posts tagged with: dev log

2014 - 7 - 8 / 3:54 pm / general

Dev Log: Enemy Wave HUD

Dev Log: Enemy Wave HUD

Here's something that has been on my task list since forever: showing incoming enemy waves on the HUD! Originally the bottom right spot was going to be something different, but for now the incoming wave information felt like it was more important than anything else that could be there.

Image

Now you can see how many enemies are going to be coming at you in the future. The little blips on the hud scroll from right to left as time marches on.

Image

The enemies are arranged vertically depending on which spawn point they're coming from. I'm not sure how much information will be available to the player from here, but for now you can tell the size of the enemy and how many are coming up. I feel like this took me way too long to figure out, and I'm still not 100% happy with how I implemented it, but hey it works!

No Comments

2014 - 7 - 5 / 3:56 pm / general

Dev Log: Overworlds

Dev Log: Overworlds

Getting back into the swing of game development has been a little tougher than I thought. Especially since July isn't exactly going to be a calm month for me to really dig into stuff. This 4th of July weekend is pretty busy, and I'm still right in the middle of it. After I'm heading up to EVO with a bunch of folk, and then I'm spending some time on the east coast after that. Traveling and getting work done doesn't really go hand in hand for me, so hopefully I can still salvage some time to get some game development in.

Anyway, my recent developments have lead me into making some sort of overworld map for my game. As I started to work on it, I quickly realized that I have no clue what I'm doing. I haven't really worked on anything like this before, and I'm slowly figuring out how to properly structure and manage it all.

Image

Basically the map screen is going to be some kind of turn based system that will determine what kind of encounter you go into next. The player will be able to choose where to go with their character, and there will also be enemy forces moving about in the area attacking things. The main issue I have right now is that I think I know how I want everything to work, but I have no idea how to code it.

I've never done any sort of turn based anything before, so I've been spending some time researching the internet for any leads. I found a few quick examples, but not really any sort of examples that come with source code to look at. I find it very difficult to go from an abstract concept to actual code, and a lot of times these examples or tutorials I find just explain the broad concepts of a system and don't really dig into the details which is where I always get lost... but hopefully with enough just messing around in a code window I can stumble onto the right answer.

No Comments

2014 - 6 - 11 / 4:06 pm / general

Dev Log: Shader Follow Up

Dev Log: Shader Follow Up

My last post went over some of my recent shader developments with displacement maps, and using gradient maps to recolor portions of the screen. I had a couple of questions of what exactly was going on behind the scenes with the render textures that I was using to tell the shader how to actually manipulate the image, so I thought I would address that now!

Here's an example image from the game with a lot of explosions going on:

Image

Each explosion has a shockwave ripple coming out of it which distorts the area around it. The explosion also changes the color of the screen around to a gradient map with pink and yellow. This makes it look like an intense heat, or something.

For reference, here's the shader again (it's been slightly modified since yesterday.)

uniform sampler2D texture;
uniform sampler2D displacementMap;
uniform sampler2D paletteMap;
uniform sampler2D gradientMap;

void main() {
// Get the pixels off of the maps.
vec4 displacementPixel = texture2D(displacementMap, gl_TexCoord[0]);
vec4 palettePixel = texture2D(paletteMap, gl_TexCoord[0]);

// Read the pixel from the displaced position.
vec2 pos = gl_TexCoord[0];
pos.x += (displacementPixel.r * 2.0 - 1.0) * 0.025;
pos.y -= (displacementPixel.g * 2.0 - 1.0) * 0.025;

// Get the displaced pixel.
vec4 pixel = texture2D(texture, pos);

// Proper grayscale conversion.
float gray = dot(pixel.rgb, vec3(0.299, 0.587, 0.114));

// Get the color from the gradient.
float gradientPos = mod(gray + palettePixel.g, 1);

// Get the actual color from the gradient.
vec4 gradientMapPixel = texture2D(gradientMap, new vec2(gradientPos, palettePixel.r));

// Mix the gradient with the pixel color based on the palette pixel.
pixel = mix(pixel, gradientMapPixel, palettePixel.a);

// Apply the final color multiplied by the gl color.
gl_FragColor = pixel * gl_Color;
}

From this point on there's going to be a lot of images and some hefty animated gifs, so I'll hide the rest of this post behind the read more button! read more

3 Comments

2014 - 6 - 10 / 7:48 pm / general

Dev Log: Shaders All Day

Dev Log: Shaders All Day

I've been taking an extended vacation in shader town lately, and so far I've been having a lot of fun! One of the things I was figuring out was how to take an image and remap all the colors to a gradient based on their luminosity (well, a sloppy way of estimating the luminosity.) This seems like a pretty powerful effect that could be used to really spice up effects. Yeah, I'm always thinking about how to make explosions better.

First I'll share the actual shader code that I'm working with right now. This is the shader that's being used for all of my full screen effects.

uniform sampler2D texture;
uniform sampler2D displacementMap;
uniform sampler2D paletteMap;
uniform sampler2D gradientMap;

void main() {
vec4 displacementPixel = texture2D(displacementMap, gl_TexCoord[0]);
vec4 palettePixel = texture2D(paletteMap, gl_TexCoord[0]);

vec2 pos = gl_TexCoord[0];
pos.x += (displacementPixel.r * 2.0 - 1.0) * 0.025 * displacementPixel.a;
pos.y -= (displacementPixel.g * 2.0 - 1.0) * 0.025 * displacementPixel.a;

// Get the displaced pixel.
vec4 pixel = texture2D(texture, pos);

// Proper grayscale conversion.
float gray = dot(pixel.rgb, vec3(0.299, 0.587, 0.114));

// Get the color from the gradient.
float gradientPos = mod(gray + palettePixel.g, 1);

vec4 gradientMapPixel = texture2D(gradientMap, new vec2(gradientPos, palettePixel.r));

// Mix the gradient with the pixel color based on the palette pixel.
pixel = mix(pixel, gradientMapPixel, palettePixel.a);

gl_FragColor = pixel * gl_Color;
}

Using Otter I can just apply this shader to the game's main Surface object and I'm ready to roll with special effects. This post is going to be image heavy, so I'll hide the rest of it behind the jump! read more

6 Comments

2014 - 6 - 2 / 4:09 pm / general

Dev Log: Shader Experiments

Dev Log: Shader Experiments

Since my break to work on the remaining bits of Otter I haven't really fallen back into the groove on working on my big game project yet. Yesterday I dedicated the day to playing around with shaders since I'm really interested in using them for all kinds of cool visual effects.

Image

This is what I ended up coming up with at the end of the day. First I was playing around with gradient maps for recoloring an image, and then I started to mess with displacement to make cool waves in the image. Finally I wanted to experiment with having a render texture that could be passed to the shader for dynamic effects.

Basically how this little program works is that there is the static image with a shader loaded. Then there's a Surface object that can be painted on with the mouse. The shader uses the texture from that Surface to affect the image in different ways.

Here's the full C# source:

using Otter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ShaderTesting {
class Program {
static void Main(string[] args) {
var image = new Image("pic.jpg");
var game = new Game("ShaderZ", image.Width, image.Height);

game.FirstScene = new TestScene();

game.Start();
}
}

class TestScene : Scene {

Image image = new Image("pic.jpg");
Image circle = new Image("circle.png");
Surface distortion;

public TestScene() {
AddGraphic(image);
distortion = new Surface(image.Width, image.Height);
circle.CenterOrigin();
circle.Blend = BlendMode.Add;
AddGraphic(distortion);
circle.Alpha = 0.1f;
distortion.Visible = false;
distortion.AutoClear = false;
}

public override void Update() {
base.Update();

if (Timer % 30 == 0) {
try {
image.Shader = new Shader("../../shader.frag");
}
catch(Exception e) {
Console.WriteLine("Shader error:");
Console.WriteLine(e.Message);
}
image.Shader.SetParameter("gradient", new Texture("gradient.png"));
}
if (Input.MouseButtonPressed(MouseButton.Right)) {
distortion.Clear();
}
image.Shader.SetParameter("time", Timer);
image.Shader.SetParameter("distortion", distortion.Texture);
image.Shader.SetParameter("offset", Util.SinScale(Timer, 0, 1));

if (Input.MouseButtonDown(MouseButton.Left)) {
Draw.SetTarget(distortion);
Draw.Graphic(circle, MouseX, image.Height - MouseY);
Draw.ResetTarget();
}
}

public override void Render() {
base.Render();

Draw.Circle(MouseX - 15, MouseY - 15, 30, Color.None, Color.Red, 2);
}
}
}


And the GLSL shader source:

sampler2D texture;
sampler2D gradient;
sampler2D distortion;
uniform float offset;
uniform float time;
uniform float mixfactor;

void main() {
vec2 pos = gl_TexCoord[0];
vec2 distortColor = texture2D(distortion, pos);
pos.x += distortColor.r * (sin(time * 0.1 + pos.x * 10) * 0.05);
pos.y -= distortColor.g * (cos(time * 0.1 + pos.y * 10) * 0.05);
vec4 color = texture2D(texture, pos);

float gray = (color.r + color.g + color.b) / 3;

vec4 gradientColor = texture2D(gradient, vec2(gray, offset));

gl_FragColor = mix(color, gradientColor, distortColor.r + distortColor.g);
}


You can download everything here. Note that you'll have to give it a reference to Otter to compile and run it yourself.

2 Comments

2014 - 5 - 9 / 1:38 pm / general

Dev Log: To Batch or not to Batch

Dev Log: To Batch or not to Batch

One of the things gnawing at me over the past few months is the rendering performance of Otter. So far it hasn't really been a problem, but I've only made a couple of low resolution prototypes and a game jam game with it so far. For my current project, a 1920 x 1080 resolution game, I started to worry about the rendering time as I add more and more assets to it.

So I was thinking "Hey maybe I can add some kinda sprite batching to Otter like XNA or Monogame has!" The basic concept is that it is very expensive to switch textures when rendering things with a GPU, so you take a bunch of sprites that all share the same texture and try to mash them together into one draw call from the video card. This way you can render all your sprites but you don't have to switch textures for every single one of them.

To start on this I basically tore down a bunch of rendering code in Otter. This was a few days ago, and since then I do have some sort of basic sprite batch working. In a little example I have 1000 sprites rendering with the same texture and as far as the video card knows it's actually only 2 renders... but so far I actually don't think this has affected performance at all!

I'm using SFML.Net for the core rendering of Otter. Everything that goes to the video card to show up on the screen goes through SFML's Draw functions. So far according to my small tests it seems that the video card isn't really having any issue switching textures a thousand times, but something before that is actually causing the slow down.

It seems that just going through and appending vertices to a vertex array in SFML.Net is just really slow. For example Otter's RichText class suffers from a pretty big performance hit if it's used to render a lot of text, like enough letters to cover the entire screen. This is pretty odd since RichText.cs in Otter is pretty much a copy of SFML's own text class from the C++ source! Almost the same code in C# runs almost 10x slower than C++, and of course this is not a big surprise since C# has a bunch of extra stuff with the managed memory and garbage collection. Still, it is pretty discouraging to realize. (Another tough one is the Tilemap class, which will suffer from big slow down during real time modification of a huge tilemap due to the rebuilding of the VertexArray!)

So right now I'm still reorganizing a bunch of code in Otter's rendering stuff. Hopefully the API will remain mostly unchanged, but right now my hope is that using texture atlases in Otter becomes smoother and actually has a performance benefit. Yay programming.

5 Comments

about

About

Hi there, my name is Kyle, and I'm a 27 year old kid with adult powers. I'm making video games and living the indie game developer life in Tempe, Arizona. Here you will find my thoughts, games, websites, doodles, and other stuff like that. I worked on Snapshot, Offspring Fling, and a whole bunch of other games. I also created and maintain Otter, a 2d game making framework. If you want to get a hold of me use the form on the bottom of the page, leave a comment, or just tweet at me. I try to post three times a week. Thanks for stoppin' by! You're the coolest.

facebook

videos

Do you want to make a Let's Play of one of my games, or a just a video featuring footage of my games? You have my full permission to do so! Even if you are monetizing your videos, you still have my full permission to use any footage from any of my games. Go for it!

contact

Your message has been sent! Thanks :)
SEND MESSAGE