Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice
All of my sprites aren't rotated. They look like diamonds with some ground under them. I also need to offset every other across the x axis so that they line up and tile correctly. Doing such means that for any given tile, the tile above it in the text file will correlate to either the tile in the northwest or northeast direction. I have sets of tiles with black borders too. That means I need to iterate through and detect neighbors so that I know what sides have the black borders. I have two separate pieces of logic now checking for neighbors depending on which row it falls on.

I get that you are saying I can store my 2d array in just a big square. That's what I'm doing as seen here: https://github.com/poemdexter/Landscape/blob/master/test.wd

When I read it in, I slap it in a normal 2d array. It's when I draw, I start to offset everything. There's no rotation going on or camera trickery. I was just hoping there was some trick that would make it a bit easier.

I get that storing it in a txt file that mirrored how they are oriented on the screen would help but man, I had to look at your example 3 times before I realized what you were doing and it would make iterating through it to draw a lot more difficult since I'd have to grab the last element of each row first but only so far down as I have elements in a row. :pwn:

Adbot
ADBOT LOVES YOU

Polio Vax Scene
Apr 5, 2009



Maybe I'm stupid and missing something but do you want something like renderx=(x/2-y/2), rendery=(x/4+y/4-z)?

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

Manslaughter posted:

Maybe I'm stupid and missing something but do you want something like renderx=(x/2-y/2), rendery=(x/4+y/4-z)?

It's ruby and a game lib. So it ends up being sprite.draw(x,y,zorder). I really am trying not to deal with opengl or rendering things in 3d since its just a prototype and i don't ever really want to touch buffers or rendering or matrices or any of that not fun stuff.

Mata
Dec 23, 2003

poemdexter posted:

It's ruby and a game lib. So it ends up being sprite.draw(x,y,zorder). I really am trying not to deal with opengl or rendering things in 3d since its just a prototype and i don't ever really want to touch buffers or rendering or matrices or any of that not fun stuff.
Not to be rude or anything but the method you've chosen to do this with has some limitations, if you're fine with that then good :) otherwise:
To make isometric perspective in my game, I just rotate by 45 degrees, squish the Y axis and make the Z axis "point upward" like this:
code:
float alpha = 0.785398163F;      // 45 degs in rads
float sin = Math.Sin(alpha);

Matrix TileRotation = Matrix.CreateRotationZ(alpha); 
Matrix TileScale = Matrix.CreateScale(1f, 0.5f, 1f);
Matrix Oblique = new Matrix(1,   0,    0,   0,
                            0,   1,    0,   0,
                            0,   sin, -1,   0,
                            0,   0,    0,   1);
The oblique matrix is maybe not immediately clear what it does, but if you don't wanna learn, I'm not gonna force you...

Mata fucked around with this message at 19:19 on May 8, 2012

seiken
Feb 7, 2005

hah ha ha

poemdexter posted:

All of my sprites aren't rotated. They look like diamonds with some ground under them. I also need to offset every other across the x axis so that they line up and tile correctly. Doing such means that for any given tile, the tile above it in the text file will correlate to either the tile in the northwest or northeast direction. I have sets of tiles with black borders too. That means I need to iterate through and detect neighbors so that I know what sides have the black borders. I have two separate pieces of logic now checking for neighbors depending on which row it falls on.

I get that you are saying I can store my 2d array in just a big square. That's what I'm doing as seen here: https://github.com/poemdexter/Landscape/blob/master/test.wd

When I read it in, I slap it in a normal 2d array. It's when I draw, I start to offset everything. There's no rotation going on or camera trickery. I was just hoping there was some trick that would make it a bit easier.

I get that storing it in a txt file that mirrored how they are oriented on the screen would help but man, I had to look at your example 3 times before I realized what you were doing and it would make iterating through it to draw a lot more difficult since I'd have to grab the last element of each row first but only so far down as I have elements in a row. :pwn:

Nah you're totally not understanding what I'm saying. I know what your sprites look like. I understand that right now you're storing it in a (2d array) text file. The way you'e storing it now mirrors how they are oriented on the screen. Since it mirrors how it appears on the screen you've got this weird not-quite-grid structure which is why the directions are inconsistent. What I'm saying is you can solve this by still storing it in a 2d array text file, but using a different coordinate system, so that moving one character right in the text file always corresponds to moving one step southeast on the visual display, moving left in the text file corresponds to northwest, up corresponds to northeast and down to southwest. No matter how you display the world, its geometry is the same as a run-of-the-mill 2d grid on which you move horizontally and vertically so that's the most sane way to store it. It doesn't matter that you're not using openGL, you can do some simple maths to work out how to display it. It does make drawing things in the correct order, if you're doing it manually 2d-blitting style, slightly more involved.

Again: this is about the data structure for the tiles that you have in memory and / or a file, whatever. It has nothing to do with how the world is rendered. Mata's post above is about rendering stuff, this is just about how you store the data in memory in a sane way.

edit: first result on google for "isometric coordinate system" http://www.wildbunny.co.uk/blog/2011/03/27/isometric-coordinate-systems-the-modern-way/
I mean, you can keep doing it how you're doing, perhas you've made a lot of assumptions about how you store things that it would mean rewriting everything to change to a new system. But it's weird and bad. Your data is structured around how you're going to display it rather than any natural way for it to be structured.

seiken fucked around with this message at 19:38 on May 8, 2012

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

Mata posted:

Not to be rude or anything but the method you've chosen to do this with has some limitations, if you're fine with that then good :) otherwise:
To make isometric perspective in my game, I just rotate by 45 degrees, squish the Y axis and make the Z axis "point upward" like this:
code:
float alpha = 0.785398163F;      // 45 degs in rads
float sin = Math.Sin(alpha);

Matrix TileRotation = Matrix.CreateRotationZ(alpha); 
Matrix TileScale = Matrix.CreateScale(1f, 0.5f, 1f);
Matrix Oblique = new Matrix(1,   0,    0,   0,
                            0,   1,    0,   0,
                            0,   sin, -1,   0,
                            0,   0,    0,   1);
The oblique matrix is maybe not immediately clear what it does, but if you don't wanna learn, I'm not gonna force you...

Yah, I don't want to touch cameras or matrices. Thanks though. It's actually beyond the scope of my problem since I'm using Ruby and gosu/chingu which are extremely immature libraries compared to what I'm used to.

seiken posted:

Nah you're totally not understanding what I'm saying. I know what your sprites look like. I understand that right now you're storing it in a (2d array) text file. The way you'e storing it now mirrors how they are oriented on the screen. Since it mirrors how it appears on the screen you've got this weird not-quite-grid structure which is why the directions are inconsistent. What I'm saying is you can solve this by still storing it in a 2d array text file, but using a different coordinate system, so that moving one character right in the text file always corresponds to moving one step southeast on the visual display, moving left in the text file corresponds to northwest, up corresponds to northeast and down to southwest. No matter how you display the world, its geometry is the same as a run-of-the-mill 2d grid on which you move horizontally and vertically so that's the most sane way to store it. It doesn't matter that you're not using openGL, you can do some simple maths to work out how to display it. It does make drawing things in the correct order, if you're doing it manually 2d-blitting style, slightly more involved.

Again: this is about the data structure for the tiles that you have in memory and / or a file, whatever. It has nothing to do with how the world is rendered. Mata's post above is about rendering stuff, this is just about how you store the data in memory in a sane way.

edit: first result on google for "isometric coordinate system" http://www.wildbunny.co.uk/blog/2011/03/27/isometric-coordinate-systems-the-modern-way/
I mean, you can keep doing it how you're doing, perhas you've made a lot of assumptions about how you store things that it would mean rewriting everything to change to a new system. But it's weird and bad. Your data is structured around how you're going to display it rather than any natural way for it to be structured.

I get what you're saying now. I should really be looking at storing the data in the txt file in a better way so that the programming is easier. The link you gave is kinda alright, but assumes that you'll have a nice square world tilted 45 degrees. I'll give a shot at what you suggested originally which is storing it in txt file in a more sane way. Thanks.

seiken
Feb 7, 2005

hah ha ha
Any world you make will always fit within (i.e. be bounded by) a nice square world, so you can just pretend you have a square world and use something like blank spaces in the text file to signify "there's nothing there". Anyway, no worries, sorry if I was harsh, don't mean to put you off.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

seiken posted:

Any world you make will always fit within (i.e. be bounded by) a nice square world, so you can just pretend you have a square world and use something like blank spaces in the text file to signify "there's nothing there". Anyway, no worries, sorry if I was harsh, don't mean to put you off.

No big deal. I don't think you were being harsh, I just thought I was not explaining myself correctly but it turned out I wasn't reading what you were explaining correctly.

Jo
Jan 24, 2005

:allears:
Soiled Meat

Roflex posted:

Maybe I'm misunderstanding the Ortho view but the way I did it, it's still 3d/perspective at the core, allowing free view from any angle.

I'm not one to comment on your implementation -- I haven't seen it. My curiosity is why would one bother doing strange tricks to make a perspective camera into an orthographic one? Why not use an orthographic one in the first place?

I assert the following:
  • Orthographic projection will accomplish the isometric viewpoint you desire.
  • Orthographic projection will allow this viewpoint to be achieved without moving a camera to optical infinity. (Or close to it.) Additionally, with orthographic views, you don't have to compensate for the huge draw distance by zooming.
  • Orthographic cameras offer greater numeric stability over perspective cameras under these circumstances.

Water under the bridge, though, since the implementation is done and fun was had doing it.

akadajet
Sep 14, 2003

Roflex posted:

Maybe I'm misunderstanding the Ortho view but the way I did it, it's still 3d/perspective at the core, allowing free view from any angle.

You can still rotate things and move the camera around with an orthographic projection. It's pretty trippy.

Take Fez for example: http://www.youtube.com/watch?v=--gpfYwo5a4

Note the spinning logo at the end.

Contains Acetone
Aug 22, 2004
DROP IN ANY US MAILBOX, POST PAID BY SECUR-A-KEY

Contains Acetone fucked around with this message at 17:52 on Jun 24, 2020

Jo
Jan 24, 2005

:allears:
Soiled Meat

Contains Acetone posted:

:science:

I'm probably about a month or two away from putting it up on Google code for those of you that were interested.

:flashfap:

Oh god yes please.

Wheelchair Stunts
Dec 17, 2005
Out of curiosity, what is the advantage of using a neural network over image processing for image data?

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



Contains Acetone posted:

Got back to working on my RBM trainer. Mostly a lot of refactoring/bug fixes/performance tweaks. Also some usability tweaks. I improved the speed and look of the feature and reconstruction visualizations (using a raw byte buffer rather than a billion calls to SetPixel). I also added a third visualization to the 'Visible Reconstruction' Tab. Now it shows original, reconstruction, and reconstruction error. I've also added color visualization of data (only RGB at the moment)!

Learning image patches from a wood texture (12x12 pixels):

Early stages of MNIST training:


I also added a thin border around all of the features/visible images, but now it does that terrible "black dot that's not really there" optical illusion .

Early stages of MNIST Features:


I'm probably about a month or two away from putting it up on Google code for those of you that were interested.

Took a course taught by one of the guys who created restricted boltzmann machines, interesting stuff, probably not going to pass that.

Canine Blues Arooo
Jan 7, 2008

when you think about it...i'm the first girl you ever spent the night with



Grimey Drawer
Browsing this thread has really made me appreciate the talent of a lot of the people who post here. A lot of the 'small projects' people post are pretty impressive, and far beyond me. I'm at best, an amatuer programmer, but it gives me something to aspire to when people create some really neat stuff.

On that note, one of my major projects has taken a major setback. I didn't think things all the way through and coded myself into a corner and now am facing down what will likely be a complete rewrite.

What we learned today: The planning phase of the software development life cycle is very important and should not be taken lightly.

Wheelchair Stunts
Dec 17, 2005
I guess the image is really just the medium of conveyance. It's not about actually processing the image for image processing sake. I am a bit dense.

Contains Acetone
Aug 22, 2004
DROP IN ANY US MAILBOX, POST PAID BY SECUR-A-KEY

Contains Acetone fucked around with this message at 17:52 on Jun 24, 2020

Winkle-Daddy
Mar 10, 2007
You may remember I was working on a minecraft/Team Fortress 2/Tron clone a few months ago. I'm still plugging away at that, however, some of the advanced engine features I plan on using I wasn't very familiar with. So I decided to start a smaller proof of concept game where I'll be focusing on those areas of the engine I need to get better at.

I started working on a game I'm tentatively calling "Dante: The Inferno." It's a simple platformer where the poem I'm taking the namesake from scrolls across the bottom of the screen as you move in the right direction. I'm going for a 3D retro look, all the models are 3D, however, the main player is made up of a series of individual cubes with the RGB values for the textures set manually. I just got some of the controls working, a menu working and a basic collision with a piece of a larger level loaded in.



The animation is done like old school sprite animation. Each frame is a keyframe, and I set all of the cube positions on every frame. During gameplay I simply call the correct frame. For example, a snippit of the walking code:

code:
        if (self.keymap["right"] != 0):
            if(self.player.getH() != 0):
                self.player.setH(0)
            self.player.setX(self.player, self.dtMove * 100)
            if(float(globalClock.getFrameTime()) - float(self.ft) >= .1):
                frame = self.player.getCurrentFrame('dante_anim')
                if (frame == 0 or frame == 1):
                    self.player.pose("dante_anim",2)
                    self.ft = globalClock.getFrameTime()
                elif (frame == 2):
                    self.player.pose('dante_anim',1)
                    self.ft = globalClock.getFrameTime()

Sneaking Mission
Nov 11, 2008

I threw together an updated version of SAARS.

http://esarahpalinonline.com/soap



It shows avatars bought with the new forums store system after 2010 and it also includes avatars from before 2004 that SAARS didn't look for.

http://esarahpalinonline.com/soap/?username=shadowhawk

vs

http://www.muddledmuse.com/saars/?goon=shadowhawk


Same sort of disclaimers as the old one. It uses whatever date the server sends back which may or may not be right. Any avatars set by mods or admins probably won't show up.

It will continue to show post-2010 avatars if you change your username but before that you need to search for each name.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Whoa, I didn't know that existed! Helped me find my old avatar that I lost after I stupidly autobanned myself. :saddowns:

Thanks :)

captain_g
Aug 24, 2007
.

Somebody fucked around with this message at 21:44 on May 11, 2012

Jonnty
Aug 2, 2007

The enemy has become a flaming star!

captain_g posted:

.

At least post an actual screenshot.

Somebody fucked around with this message at 21:44 on May 11, 2012

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Panic! At The cisco posted:

Same sort of disclaimers as the old one. It uses whatever date the server sends back which may or may not be right. Any avatars set by mods or admins probably won't show up.

It will continue to show post-2010 avatars if you change your username but before that you need to search for each name.
I can confirm that it shows at least some avatars set by mods/admins.

Very very cool.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
Working on a browser based RTS

captain_g
Aug 24, 2007
Sorry.. I was too exhilerated, my friends are not exactly working on this anymore, as it was just released. We did bunch of stuff together, but I haven't personally contributed to this game.

It is an IPad / IPhone game.


There is also a Youtube video here:
http://www.youtube.com/watch?feature=player_embedded&v=NOKcCSWQD6w

It is free, so you can download it and try it out.

Edit: I posted it here, because I've been following the project since about a year ago and I think it is awesome they finally finished it, even though the game won't be a massive hit on the stores.

captain_g fucked around with this message at 11:02 on May 12, 2012

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

captain_g posted:

Sorry.. I was too exhilerated, my friends are not exactly working on this anymore, as it was just released. We did bunch of stuff together, but I haven't personally contributed to this game.

It is an IPad / IPhone game.


There is also a Youtube video here:
http://www.youtube.com/watch?feature=player_embedded&v=NOKcCSWQD6w

It is free, so you can download it and try it out.

Edit: I posted it here, because I've been following the project since about a year ago and I think it is awesome they finally finished it, even though the game won't be a massive hit on the stores.
This... actually looks kind of cool. Hopefully they didn't just drop it out, and are submitting it around to TouchArcade and the like?

I dig the art, and the stationary shooter'y gameplay with diffent powers looks kind of cool. Like a combination of Galaga and Missile Command.

captain_g
Aug 24, 2007

Shalinor posted:

This... actually looks kind of cool. Hopefully they didn't just drop it out, and are submitting it around to TouchArcade and the like?

I dig the art, and the stationary shooter'y gameplay with diffent powers looks kind of cool. Like a combination of Galaga and Missile Command.

They are trying to bring some attention to this to see if it is worth developing more, but I am pretty sure they are fairly burnt out, having worked on this more than a year and all that. Perhaps if there's enough interest.

I think they are exploring new projects. Perhaps to figure out more interesting gameplay / concept to work on.

Van Kraken
Feb 13, 2012

I decided to learn about jQuery, so the first thing I made was a Chrome extension to change all images to pictures of kittens.



Safe at last!

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Van Kraken posted:

I decided to learn about jQuery, so the first thing I made was a Chrome extension to change all images to pictures of kittens.
Does it use one of the fancy services that provide properly-sized kitten images to match the target image resolution?

EDIT: VV Schweet.

Shalinor fucked around with this message at 02:49 on May 13, 2012

Van Kraken
Feb 13, 2012

Shalinor posted:

Does it use one of the fancy services that provide properly-sized kitten images to match the target image resolution?

Yeah it just uses placekitten.com for the images. Most of the time went into figuring out chrome's extension format, the script itself is pretty much a one-liner.

LordKaT
Mar 16, 2011
I'm making a thing.

Red Mike
Jul 11, 2011

LordKaT posted:

I'm making a thing.

I like the look of it all. Also, you've got a stone wall in your inventory?

What language/libraries are you using?

LordKaT
Mar 16, 2011

Red Mike posted:

I like the look of it all. Also, you've got a stone wall in your inventory?

What language/libraries are you using?

Yeah, a stone wall in the inventory. There's a crafting system in there, as well as a magic combination system that makes nearly random items. It's p. hosed up.

It's in a retarded C++ without using classes because I was just throwing it together in haste. I'm using libtcod for graphics.

kertap
Mar 13, 2010
I've been getting to know the canvas element better. I love using HSL to set the colors and decided to roll my own color picker instead of looking for on on the internet.



The H, S and L boxes are canvas elements with tons of lines in them and each line has a small change in the color. The sliders are positioned well enough to match the color of what they are over. When the sliders and text boxes change everything else changes with them, so if I change the value of the hue, that updates the hue used in the saturation and luminosity canvases. This was a great little project to work on as it didn't take long to put together.

Marsol0
Jun 6, 2004
No avatar. I just saved you some load time. You're welcome.

Van Kraken posted:

Yeah it just uses placekitten.com for the images. Most of the time went into figuring out chrome's extension format, the script itself is pretty much a one-liner.

How soon will this be available?

Van Kraken
Feb 13, 2012

I put what I've got so far on github, if you want to try it out. Currently, it only works on fully loaded images, so it can't actually protect you from the goatman. I'm trying to figure out how to detect when a page loads new images so that I can hide them and replace them without the originals being seen. I'm also trying to figure out how to resize and crop images in-browser, rather than relying on placekitten. It's currently finals right now, so I'll probably have to put it off for a while.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Van Kraken posted:

I put what I've got so far on github, if you want to try it out. Currently, it only works on fully loaded images, so it can't actually protect you from the goatman. I'm trying to figure out how to detect when a page loads new images so that I can hide them and replace them without the originals being seen. I'm also trying to figure out how to resize and crop images in-browser, rather than relying on placekitten. It's currently finals right now, so I'll probably have to put it off for a while.
If you made it rely on placekitten, you could probably pass it to that dude when it's done, to become the official placekitten wotsit - and then most of the internet would start using your plugin, at least for a little while.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Van Kraken posted:

Currently, it only works on fully loaded images, so it can't actually protect you from the goatman.

Nothing can protect you from the goatman.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Van Kraken posted:

I put what I've got so far on github, if you want to try it out. Currently, it only works on fully loaded images, so it can't actually protect you from the goatman. I'm trying to figure out how to detect when a page loads new images so that I can hide them and replace them without the originals being seen. I'm also trying to figure out how to resize and crop images in-browser, rather than relying on placekitten. It's currently finals right now, so I'll probably have to put it off for a while.

You could replace all image requests with 1x1px images with the onBeforeRequest API by redirecting to a data URI:

code:
// transparent 1x1px png image
var blank = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==";

chrome.webRequest.onBeforeRequest.addListener(function(details) {
    if (details.type == "image")
        return {redirectUrl: blank};
    else
        return {};
}, {urls: ["http://*/*", "https://*/*"]}, ["blocking"]);

Adbot
ADBOT LOVES YOU

Van Kraken
Feb 13, 2012

Suspicious Dish posted:

You could replace all image requests with 1x1px images with the onBeforeRequest API by redirecting to a data URI:

Oh cool, this is just what I was looking for. I still need the display size of each image, though, and I can't seem to find a reliable way of finding it without actually loading each image, then acting on it once it loads.

If I can't make this work, I'll fall back to using css, swapping the src once the image loads:
CSS code:
img { visibility: hidden; }
img.cat {visibility: visible !important; }

Van Kraken fucked around with this message at 06:29 on May 27, 2012

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply