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
clockwork automaton
May 2, 2007

You've probably never heard of them.

Fun Shoe
So, this is as far as I got with my little basic rogue-like before the end of the hackathon thing. Not sure I really like rust enough to continue with it after, but it's a playable thing.

https://www.youtube.com/watch?v=_JFH8a4bNM4

Adbot
ADBOT LOVES YOU

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
I built a side project revisiting Chip8 and to tinker a bit with Javascript. This is the second project I've built with the language and while it is still quite flaky and irritating it's hard to argue with how easy it is to share your results. In addition to a chip8 emulator, I rewrote a high-level assembler of my own design and put everything together into a self-contained IDE of sorts. You can load chip8 binaries you may have locally, export your work and compile and run your own Octo programs. While running, escape will bring you back to the editor and [1,2,3,4,q,w,e,r,a,s,d,f,z,x,c,v] on the keyboard correspond to the Chip8 hex keypad. I represent the Chip8 buzzer visually by flashing the background color of the screen.

http://johnearnest.github.io/Octo/

Here's an example of a program using my assembler:
code:
: main
    v0 := 20
    v1 := 10
    loop
        v2 := key
        clear
        i  := hex v2
        sprite v0 v1 5
    again
;
And here it is in action:



Thrilling, I know.

I know a few people in here have implemented Chip8 interpreters- do you folks think there would be interest in a Chip8 thread and/or a homebrew game jam?

Internet Janitor fucked around with this message at 07:11 on May 15, 2014

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Went ahead and published a new article in Xplain: http://magcius.github.io/xplain/article/window-tree.html

Has a bunch of words about "the window tree" and other stuff. Doesn't contain all of the WM stuff I'd liked it to have contain, but oh well. I'm currently in the process of writing up that one.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
I also put together a very simple pixel editor for creating the 8x1-8x15 sprites used by the Chip8:



You can edit/paste the text or toggle the pixels and the changes will be reflected in the image.

http://johnearnest.github.io/Octo/pixel.html

Mata
Dec 23, 2003
Here's a little strategy game I'm making. I will never finish it, but that's okay, because it's pretty mesmerizing to watch the AI build little cities, build awful road networks and carry about its business :)

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Just in case anyone was interested, I created a Chip8 thread to discuss homebrew dev:

http://forums.somethingawful.com/showthread.php?threadid=3634812

ambushsabre
Sep 1, 2009

It's...it's not shutting down!
I wrote a one liner to tell me how many twitter followers I have whenever I start a terminal, without having to use the lovely twitter api:

MrMoo
Sep 14, 2000

Making progress, here's a HTML 5 ticker working on 8 HDTV's connected through way too much crap to a single box with pick a random high end nVidia dual card system and Ubuntu. Something like 11188 x 768px with bevel adjustments, in total ½ billion pixels per second running at smooth 59.8fps. Why it isn't 60fps is a good question, some random box on the desk is showing signal sync of 59.9Hz which may explain why.



7/8 of the ticker on the floor, the screen on the left is the old system being replaced. One nifty device to get up that high because the ladders are too short. News isn't working because the signage engineers haven't heard of HTTP 1.1 vhosts and thus skipping DNS and using the IP address is not valid. The quotes are coming through Web Sockets which is somehow working without fault, odd as it is usually more finicky.



News finally up after some magic by someone else, the picture is overly messed up because of way too many intermediate boxes scaling and discaling the video signal, it starts of as Display Port, then HDMI then VGA then CAT5 and back to either RGB or VGA. The red cables in the first picture actually carry extra wires for signal synchronisation, a speciality of the Magenta boxes.



About 90% of the problems with this are all hardware based. Amazing.

MrMoo fucked around with this message at 01:14 on May 18, 2014

Azazel
Jun 6, 2001
I bitch slap for a living - you want some?

ambushsabre posted:

I wrote a one liner to tell me how many twitter followers I have whenever I start a terminal, without having to use the lovely twitter api:



I like your motd there. Could you post a snippet somewhere for that?

Edit: Ah, a tool called "archey" with the -c option for colors. Got it.

Azazel fucked around with this message at 07:02 on May 18, 2014

PleasureKevin
Jan 2, 2011

Here's what you can make in 3 days of learning PHP and jQuery while sick in bed.

hendersa
Sep 17, 2006

I have been very busy wrapping up several projects, but I had a few minutes to take a look at my voxel metadata pipeline for the NES PPU:



I have some logic in-place within the PPU core that hooks into the register activity to dump out information on the current name table entry that is rendered to the screen. Matching the tile being rendered to the metadata is the first step in matching a pattern's metadata to a pixel on the screen. To understand this information, look at the 2-digit hex numbers. The location of each number corresponds to one 8x8 pixel background tile on the screen. If you unfocus your eyes and look at the numbers, you'll see a pattern that mimics what you see in the game screenshot. Each hex number matches a tile in the PPU memory, which is seen on the bottom left. The more significant hex digit denotes the row in the PPU memory, and the least significant hex digit denotes the column. Match the pattern to the metadata and you now have what information you need to apply the appropriate voxels to a particular pixel.

The first row of hex numbers is actually off the screen in the actual hardware NES, though it does show up in the PPU.

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.

hendersa posted:

I have been very busy wrapping up several projects, but I had a few minutes to take a look at my voxel metadata pipeline for the NES PPU:



I have some logic in-place within the PPU core that hooks into the register activity to dump out information on the current name table entry that is rendered to the screen. Matching the tile being rendered to the metadata is the first step in matching a pattern's metadata to a pixel on the screen. To understand this information, look at the 2-digit hex numbers. The location of each number corresponds to one 8x8 pixel background tile on the screen. If you unfocus your eyes and look at the numbers, you'll see a pattern that mimics what you see in the game screenshot. Each hex number matches a tile in the PPU memory, which is seen on the bottom left. The more significant hex digit denotes the row in the PPU memory, and the least significant hex digit denotes the column. Match the pattern to the metadata and you now have what information you need to apply the appropriate voxels to a particular pixel.

The first row of hex numbers is actually off the screen in the actual hardware NES, though it does show up in the PPU.

That's awesome. And crazy.

Haha, now try playing the game looking only at the hex values!



All I see is blonde, brunette, redhead...

Suspicious Dish
Sep 24, 2011

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

hendersa posted:

I have been very busy wrapping up several projects, but I had a few minutes to take a look at my voxel metadata pipeline for the NES PPU:

How is scrolling done if the tiles match up to grid lines?

hendersa
Sep 17, 2006

Suspicious Dish posted:

How is scrolling done if the tiles match up to grid lines?

There is actually a vertical and horizontal offset for the "origin" of the grid of tiles. The PPU hardware looks at the current offset (0-7 pixels) and uses that when rendering to the screen. So, the individual tiles aren't rendered starting at (0,0) and then only set down on an 8-pixel boundary. They actually start rendering at (-x_offset,-y_offset) and then are set down on an 8-pixel boundary based on that offset origin. Parts of tiles that fall off the edges of the screen just aren't rendered. The name table is bigger than the size of the screen, so the next row of tiles are just pulled in as needed to fill the incoming row or column.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Ah, so that's why there's an extra "unseen" line at the top. I assume anything "dynamic" like Mario, enemies, powerups on the floor are like overlays, in a separate hardware layer?

hendersa
Sep 17, 2006

Suspicious Dish posted:

Ah, so that's why there's an extra "unseen" line at the top. I assume anything "dynamic" like Mario, enemies, powerups on the floor are like overlays, in a separate hardware layer?

Yeah, they all fall under the category of "sprites", which is a whole different ball of wax. Sprites are also 8x8 tiles (small Mario/Luigi is a set of 4 blocks, for example) and have attributes for transparency, in-front/behind the background, etc. There are lots of weird corner cases for them. Hit detection for sprites, for example, is all done in hardware. You can't have pixels from more than 8 8x8 sprite pattern tiles on the same scanline, which is why old NES games flicker when lots of enemies get on the screen. Stuff like that.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Hit detection? Is that for rasterization only (what's in front / in back with transparency), or can the CPU use the results of that?

hendersa
Sep 17, 2006

Sprite collisions detected by the PPU set a flag that marks that a collision occurred. The game logic running on the CPU checks that PPU flag. If it is set, the game logic does the appropriate checks to see who hit what. So, the detection of collisions is "free" from the CPU's view, but the CPU needs to take a look at what is happening to make the proper decision on what to do next.

LP0 ON FIRE
Jan 25, 2006

beep boop
So what's with the weird column of tiles on the far right of Super Mario Bros. 3? I know it must be some sort of optimization, but I'm not really sure what it could do.

Germstore
Oct 17, 2012

A Serious Candidate For a Serious Time
The NES can only scroll in one axis at a time. The weird column is an artifact of the fake scrolling on the horizontal axis.

hendersa
Sep 17, 2006

LP0 ON FIRE posted:

So what's with the weird column of tiles on the far right of Super Mario Bros. 3? I know it must be some sort of optimization, but I'm not really sure what it could do.

The NES hardware is designed to scroll backgrounds either vertically or horizontally. The name tables that list the background tiles are laid out to scroll smoothly on only one axis at a time via mirroring. You'll notice that most NES games may scroll horizontally and vertically, but not both at the same time. Legend of Zelda screens snap up/down or left/right one screen at a time. Metroid and Kid Icarus (which use almost the same underlying game engine) also scroll horizontally and vertically, but not both at the same time.

SMB3 gets those weird artifacts on the right edge because the name table is being scrolled through diagonally. Instead of smoothly scrolling into the next column of tiles to the right, those tiles are shoved into place to simulate the diagonal movement through the name table.

Edit: What Germstore said.

LP0 ON FIRE
Jan 25, 2006

beep boop
Thanks for the explanation. That is really cool and interesting. :)

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I don't understand. The game has an extra column and row, and X/Y offsets from 0-7 for the scrolling, right? Doesn't that allow for smooth scrolling in both directions? If I wanted to smoothly scroll diagonally, then when I reach a seam I just "shift" the nametables in the directions and add in the new row from my ROM and reset the seam, right?

hendersa
Sep 17, 2006

Suspicious Dish posted:

I don't understand. The game has an extra column and row, and X/Y offsets from 0-7 for the scrolling, right? Doesn't that allow for smooth scrolling in both directions? If I wanted to smoothly scroll diagonally, then when I reach a seam I just "shift" the nametables in the directions and add in the new row from my ROM and reset the seam, right?

That extra row on top is more like the difference between PAL and NTSC. On the NTSC NES, you will never see it and it is waste. You don't actually get an extra column at all for scrolling purposes. So, there isn't padding around the edges to cover up these scrolling issues.

Think of the 256x240 pixel screen as a set of 32x30 tiles that are each 8x8 pixels. The hardware on the NES lets you lock the scrolling to either horizontal or vertical. If horizontal, the PPU lets you slide a 256x240 window sideways through a channel of tiles. This channel is always 30 tiles tall, though it can be quite wide (depending on how often you swap tiles in and out of the name table). So, the window slides back and forth and everyone is happy. Same with the vertical scrolling: 32 tiles wide and however many tiles tall.

To simulate diagonal scrolling, SMB3 uses vertical scrolling. It adjusts the horizontal position slightly at the same time, but the PPU is only capable of bringing in fractional tiles on the top and bottom of the screen in vertical scrolling mode. Once you adjust the horizontal position 1-7 pixels (player moves to the right and the leftmost column of tiles start to fall off the screen), you get garbage on the right side of the screen because the PPU is not capable of displaying a fractional tile there. Once the background moves a full 8 pixels, the game logic rewrites the tile name table to shift the whole name table to the left one column. Now it appears that the screen has scrolled over one tile horizontally, though it really hasn't.

Like you said, you just add in the new data into the name table to fill the seam. You just don't get a buffer tile row or column to help you make it appear seamless.

hendersa
Sep 17, 2006

The colors are being pulled from the screen pixels, rather than the actual tile attributes and colors, but you get the picture:



I'm not looking forward to picking apart the sprite rendering code...

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Ah, so there just isn't an extra row / column. That seems like a wasted opportunity.

Is there actually any rhyme or reason to the junk that's in the fractional tile slot? Could you vaguely influnence it, or is it just always blank or garbage?

Tann
Apr 1, 2009

Testing how many sprites I can render at once and this turned up!

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
I'm guessing you forgot to restore the transformation after rendering? Looks pretty cool

I just added fog of war to my RTS:

hendersa
Sep 17, 2006

Suspicious Dish posted:

Ah, so there just isn't an extra row / column. That seems like a wasted opportunity.

Is there actually any rhyme or reason to the junk that's in the fractional tile slot? Could you vaguely influnence it, or is it just always blank or garbage?

Looks the data displayed in that horizontal garbage column is just whatever happens to be lurking in the PPU at the time. I glanced at a few gameplay videos on youtube for SMB3 and saw lots of stuff pop up in that column while the screen was scrolling. The data shown is always a legit tile of some sort, but it might be a whole row of them, the wrong color, etc. Looks like it is whatever happens to be left over in some internal latch register.

Ferg
May 6, 2007

Lipstick Apathy

hendersa posted:

Looks the data displayed in that horizontal garbage column is just whatever happens to be lurking in the PPU at the time. I glanced at a few gameplay videos on youtube for SMB3 and saw lots of stuff pop up in that column while the screen was scrolling. The data shown is always a legit tile of some sort, but it might be a whole row of them, the wrong color, etc. Looks like it is whatever happens to be left over in some internal latch register.

Yup, this is correct. It's one of the scroll latches if I remember correctly. The coloring is because the palette assigned is for an attribute arena that the garbage tile wasn't intended to use. So you'll see blue grass if a garbage grass tile is being rendered around sky for example.

bobua
Mar 23, 2003
I'd trade it all for just a little more.

I was getting increasingly frustrated with outputting debug info to the console, and I'm not smart enough to figure out how to add something like a qt window\gui to an existing console application yet, so I broke down last night and started rolling my own output window monstrosity. I'm sure there are a billion things that already do this way better\easier and with an actual semblance of correctness, but I think it's fun so screw you.

Outputting dynamic lines(right side) scroll like a normal console, left side and status bars(top and bottom) just get updated in place.

window.AddDynamicLine("test", Color);
window.AddStaticLine("Line 2", Color, 2);


Literally Elvis
Oct 21, 2013



http://www.porktrack.com/

I've made a site that determines the Billboard Hot 100 song for the week of your estimated conception. The idea is that if any song is most likely to be the song your parents did the business to, it's the #1 song in the country at that particular time.

So if you input your birthdate, and add any modifiers in the case that you were born early/late, it should return a porktrack to you.

This is my first time doing anything in PHP, HTML, CSS, or SQL. I posted earlier in this thread with a really rough draft of the Python script that populated the database with the song information. I used a secondary script to populate a table full of YouTube links so that the videos will autoload based on your results. Those were my first attempts at Python, too. I've learned a lot.

Still need to work on making the site look at all good, but first I'm hoping to get a complimentary Android app up and running.

(note: while the results page does contain Amazon Associate links, the purpose of this post is not a sad attempt at a moneygrab.)

Drastic Actions
Apr 7, 2009

FUCK YOU!
GET PUMPED!
Nap Ghost

Literally Elvis posted:



http://www.porktrack.com/

I've made a site that determines the Billboard Hot 100 song for the week of your estimated conception. The idea is that if any song is most likely to be the song your parents did the business to, it's the #1 song in the country at that particular time.

Nice stuff! It's a pretty cool idea. I did notice a few bugs though. First, if you just click through without changing anything, you get this



which i'm guessing is not what you want.

Also you use "-webkit-appearance" and "-moz-appearance" to hide the button styles.



Of course, this won't work in IE or other browsers like it, but I don't think "appearance" has an official spec, so it's probably not a good idea to use it at all. I'm not sure what to use in its place though. Also the button width for month is too short, so if you select a longer month title it will get cut off. They all seem to use the same style though, so it should not be too hard to fix.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I wish I was conceived to The Chipmunk Song... :(

Literally Elvis
Oct 21, 2013

Drastic Actions posted:

Nice stuff! It's a pretty cool idea. I did notice a few bugs though. First, if you just click through without changing anything, you get this



which i'm guessing is not what you want.
You are correct, sir, and I have fixed that (by removing 1959 as an option :v: ).

Drastic Actions posted:

Also you use "-webkit-appearance" and "-moz-appearance" to hide the button styles.



Of course, this won't work in IE or other browsers like it, but I don't think "appearance" has an official spec, so it's probably not a good idea to use it at all. I'm not sure what to use in its place though. Also the button width for month is too short, so if you select a longer month title it will get cut off. They all seem to use the same style though, so it should not be too hard to fix.
This might take some time. I simply wanted the site to be functional at first, but as time goes on I'm going to add features and improve the design.

Lemur Crisis
May 6, 2009

What will you do?
Where can you run?
Well, I finally finished reading every post in this thread. Very motivational; thanks to everyone who's posted!

For content, I'm taking a class about finite automata and stuff, and so I wrote a program that takes a string, parses it as a regular expression, constructs a nondeterministic finite automaton with epsilon transitions from it, constructs a deterministic finite automaton from that, and minimizes it. It's really slow, the parsing isn't actually fully implemented, and it still has a couple of bugs, but it sure helped me remember the algorithms!

Zsa Zsa Gabor
Feb 22, 2006

I don't do drugs, if I want a rush I just get out of the chair when I'm not expecting it
I've been toying with the idea of looking for hidden patterns in black metal lyrics, using machine learning algorithms and other data sciency type things.
I'm also using this project as a way of learning to make graphs and charts with d3.

Here's a D3 force directed graph where each node is a black metal topic, and each link reflects to some degree the relationship (similarity/dissimilarity) between a pair of topics. By the way, these topics were generated with Stanford's Topic Modeling tool and a lyrics data set I harvested from metal-archives.




If anyone's remotely interested in this (I suspect data-science-meets-black-metal might be a very niche hobby), check my blog and let me know what you think.

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

Literally Elvis posted:

You are correct, sir, and I have fixed that (by removing 1959 as an option :v: ).

This might take some time. I simply wanted the site to be functional at first, but as time goes on I'm going to add features and improve the design.

This is fun, good work. Unfortunately, Rod Stewart's Tonight's the Night absolutely dominated around the time of my conception. However, if I go back two weeks, I get Rock'n Me by The Steve Miller Band, which is much better.

Edit: Hahaha, my little sister was fertilized to Funkytown by Lipps, Inc.

Centripetal Horse fucked around with this message at 13:18 on May 27, 2014

EAT THE EGGS RICOLA
May 29, 2008

Zsa Zsa Gabor posted:

I've been toying with the idea of looking for hidden patterns in black metal lyrics, using machine learning algorithms and other data sciency type things.
I'm also using this project as a way of learning to make graphs and charts with d3.

Here's a D3 force directed graph where each node is a black metal topic, and each link reflects to some degree the relationship (similarity/dissimilarity) between a pair of topics. By the way, these topics were generated with Stanford's Topic Modeling tool and a lyrics data set I harvested from metal-archives.




If anyone's remotely interested in this (I suspect data-science-meets-black-metal might be a very niche hobby), check my blog and let me know what you think.

You can probably do something super hilarious with this and Semantria or AlchemyAPI.

Adbot
ADBOT LOVES YOU

Zsa Zsa Gabor
Feb 22, 2006

I don't do drugs, if I want a rush I just get out of the chair when I'm not expecting it

EAT THE EGGS RICOLA posted:

You can probably do something super hilarious with this and Semantria or AlchemyAPI.

Thanks, sounds like something worth trying, I'll definitely look into Alchemy.

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