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
akadajet
Sep 14, 2003

Doh004 posted:

I don't understand anything about what you've just posted.

I'm losing weight just looking at those images.
http://en.wikipedia.org/wiki/ECA_stack

Adbot
ADBOT LOVES YOU

Deus Rex
Mar 5, 2005

Doh004 posted:

I don't understand anything about what you've just posted.

yep, sorry, I was in a bit of a weird state of mind when I posted that (and coded it). It's a web service written in Ruby with Sinatra which takes requests to run elementary cellular automata over HTTP and spits back either a PNG, JSON, or ASCII-art representation of the automaton. I'm not really bringing anything new to the table, cellular automata are just really neat (Conway's Game of Life is a more complex example with two-dimensional state) and the elementary types are easy enough for me to get my head around them. :) By the way, Rule 110 (which is the rule that generated the image in my earlier post) is especially cool because it's Turing complete and could produce the result of an arbitrary calculation in principle :catdrugs:

edit: I also may be confusing because I think I'm importing some non-standard terminology from my past life as a bad computational chemist, things like referring to an automaton's "trajectory"

Deus Rex fucked around with this message at 07:28 on Nov 29, 2011

Pardot
Jul 25, 2001





Since you don't have a Procfile, your app is probably running on webrick instead of thin on cedar, even though you have it in your gemfile.

See: http://devcenter.heroku.com/articles/procfile

You want something like web: bundle exec thin start -p $PORT

Doh004
Apr 22, 2007

Mmmmm Donuts...

Deus Rex posted:

yep, sorry, I was in a bit of a weird state of mind when I posted that (and coded it). It's a web service written in Ruby with Sinatra which takes requests to run elementary cellular automata over HTTP and spits back either a PNG, JSON, or ASCII-art representation of the automaton. I'm not really bringing anything new to the table, cellular automata are just really neat (Conway's Game of Life is a more complex example with two-dimensional state) and the elementary types are easy enough for me to get my head around them. :) By the way, Rule 110 (which is the rule that generated the image in my earlier post) is especially cool because it's Turing complete and could produce the result of an arbitrary calculation in principle :catdrugs:

edit: I also may be confusing because I think I'm importing some non-standard terminology from my past life as a bad computational chemist, things like referring to an automaton's "trajectory"

Don't worry, it wasn't meant as a slight or anything. It just sounds really smart and way over my head :downs:

shrughes
Oct 11, 2008

(call/cc call/cc)
This is a multithreaded echo server running with an epoll loop on each thread.

Only registered members can see post attachments!

iopred
Aug 14, 2005

Heli Attack!

shrughes posted:

This is a multithreaded echo server running with an epoll loop on each thread.



Dude, props for using Dvorak! :)

bobthecheese
Jun 7, 2006
Although I've never met Martha Stewart, I'll probably never birth her child.


My html5/canvas 3D port of Conway's Game Of Life.

It still needs things like... interaction... and stuff like that.

Anyway, you can see it's current state here: http://gameoflife.samuellevy.com/

ImDifferent
Sep 20, 2001

shrughes posted:

This is a multithreaded echo server running with an epoll loop on each thread.
How does the multi-threading figure in? I take it you're not creating a thread per connection - otherwise you wouldn't be that much better off than just using blocking sockets.

shrughes
Oct 11, 2008

(call/cc call/cc)

ImDifferent posted:

How does the multi-threading figure in? I take it you're not creating a thread per connection - otherwise you wouldn't be that much better off than just using blocking sockets.

There are a fixed number of threads (probably the number of cores or twice that number) and connections are assigned randomly to a thread.

This is completely going to bottleneck on the network connection, even if you ran it on one CPU, of course.

ImDifferent
Sep 20, 2001

shrughes posted:

There are a fixed number of threads (probably the number of cores or twice that number) and connections are assigned randomly to a thread.

This is completely going to bottleneck on the network connection, even if you ran it on one CPU, of course.

Cool cool.

blorpy
Jan 5, 2005

shrughes posted:

There are a fixed number of threads (probably the number of cores or twice that number) and connections are assigned randomly to a thread.

This is completely going to bottleneck on the network connection, even if you ran it on one CPU, of course.

Have you considered running in kernel space instead? It seems kind of silly to suffer so much latency due to the network stack and context switches and the like.

shrughes
Oct 11, 2008

(call/cc call/cc)

Markov Chain Chomp posted:

Have you considered running in kernel space instead? It seems kind of silly to suffer so much latency due to the network stack and context switches and the like.

No. I am not actually interested in making the most optimized echo server.

blorpy
Jan 5, 2005

shrughes posted:

No. I am not actually interested in making the most optimized echo server.

I feel as though I've been deceived.

shrughes
Oct 11, 2008

(call/cc call/cc)

Markov Chain Chomp posted:

I feel as though I've been deceived.

Go program your FPGA an echo server.

blorpy
Jan 5, 2005

shrughes posted:

Go program your FPGA an echo server.

Actually, I won't, because echo servers are dumb.

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

Markov Chain Chomp posted:

Actually, I won't, because echo servers are dumb.

Quote of the Day servers, on the other hand...

dangerz
Jan 12, 2005

when i move you move, just like that
In the spirit of servers, I started working on adding multiplayer support to my game.


My little server.


My 2 little test players (me on 2 different machines).

I've never done multiplayer work before and now that I'm into it, I feel like this should've been one of the first things I did. A lot of the work is going to have to be offloaded to the server, so I'm wondering if I should have single player also launch a small local server so I'm not duplicating code between client and server. When the player launches in single player, they would just the only person on their server. When they get to the multiplayer stage of the game, the server can start allowing connections in.

I don't know. Either way, it's fun to program.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
100% yes to having single-player be local-only multiplayer. It's so annoying in a game to start single-player and then go "sorry friend, you can't join me because I didn't tick the 'multiplayer' checkbox when I started this game last week".

dangerz
Jan 12, 2005

when i move you move, just like that
The concept of how I want to make multiplayer in my game also leans me in that direction. When the player gets to the 'multiplayer' stage (after they've terraformed the asteroid they're on, have built a successful base that can defend itself and have a good air seal), they can create 'portals'. Each portal can dial into another server and will allow people to come into your personal world while you're playing (if you keep it turned on).

So ya, the single-player = local-multiplayer idea is more appealing. I just wish I would've done that from the beginning instead of building most of the game out first and then switching to it.

lord funk
Feb 16, 2004

Getting very, very close to the release of my next app for iPad. Some action shots:



and of course, 219.theme:

Cowcatcher
Dec 23, 2005

OUR PEOPLE WERE BORN OF THE SKY

lord funk posted:

Getting very, very close to the release of my next app for iPad. Some action shots:



and of course, 219.theme:


That is pretty sweet, but what does it do?

akadajet
Sep 14, 2003

Cowcatcher posted:

That is pretty sweet, but what does it do?

What does this look like? "Post explanations of stuff you're working on"?

lord funk
Feb 16, 2004

Cowcatcher posted:

That is pretty sweet, but what does it do?

:downs: It's a multi-touch synthesizer. You're looking at the data display for all the controllers generated by touching the screen. In the third shot you can see the five touches splayed out, with distances and angles drawn in. These shots have all the bells & whistles turned on - normally it only shows which controllers are currently active for the patch you're playing.

More info soon - I'm sooooo close to releasing it. Just wanted to post in this thread while it's still 'in progress.'

Deus Rex
Mar 5, 2005

I live in Los Angeles without a car, so I'm almost totally reliant on the public transit system. Finding Metro-accessible things to do, doctors, restaurants, etc. on sites like Yelp, Google Maps, FourSquare, etc. was a horrible crapshoot, so I made an app which will do it for me!

yumMetro





Twitter Bootstrap kicks serious rear end, especially since I'm an awful designer but hate to use ugly sites. I would have loved to keep this closed-source and try to (seriously) monetize it but I need to be able to show off the source to prospective employers. It's actually still pretty inconvenient to use (search for 'butts' near every blue line station? good luck with that) but I have some ideas to work on to make it much more awesome :). In fact, right now, you can pretty much do everything on Yelp! already (search for 'butts' near 'wilshire / western station, CA') :v:

Deus Rex fucked around with this message at 23:14 on Dec 5, 2011

Stiggs
Apr 25, 2008


Miles and miles of friends!

dangerz posted:

In the spirit of servers, I started working on adding multiplayer support to my game.

You and your blog inspired me to try my hand at writing a little game using XNA.

This is what I've managed so far:

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

I'm fairly new to programming in general, so it's been tough but enjoyable! I'm trying to sort out the collision detection right now, you can see from that video that it's not working so great. Each time the character passes in between two tiles it levitates up by one pixel or so which is pretty annoying. I feel I need to get this movement/collision stuff working properly before I can move on to more interesting parts of the game.

Stiggs fucked around with this message at 00:13 on Dec 6, 2011

PDP-1
Oct 12, 2004

It's a beautiful day in the neighborhood.

Stiggs posted:

I'm fairly new to programming in general, so it's been tough but enjoyable! I'm trying to sort out the collision detection right now, you can see from that video that it's not working so great. Each time the character passes in between two tiles it levitates up by one pixel or so which is pretty annoying. I feel I need to get this movement/collision stuff working properly before I can move on to more interesting parts of the game.

Collision detection is always tough. Just eyeballing it I'd guess that you are checking to see if the character collides with a solid box below, and if so you're moving the character up one pixel. Then when the character transitions between two solid boxes you're getting two collision hits - one from the left box and one from the right box - in one frame and moving the character up twice. Up twice due to collisions, down once due to gravity and you get hovering or bouncing.

FYI, we have a game programming thread you might want to check out. There are lots of people there who can help out with this kind of thing.

Stiggs
Apr 25, 2008


Miles and miles of friends!

PDP-1 posted:

Collision detection is always tough. Just eyeballing it I'd guess that you are checking to see if the character collides with a solid box below, and if so you're moving the character up one pixel. Then when the character transitions between two solid boxes you're getting two collision hits - one from the left box and one from the right box - in one frame and moving the character up twice. Up twice due to collisions, down once due to gravity and you get hovering or bouncing.

FYI, we have a game programming thread you might want to check out. There are lots of people there who can help out with this kind of thing.

I think you're exactly right. :)

I have a feeling I'll be posting in that thread pretty soon if I can't fix this by myself. Thanks!

dangerz
Jan 12, 2005

when i move you move, just like that

Stiggs posted:

You and your blog inspired me to try my hand at writing a little game using XNA.
That's pretty cool dude, nice job. Looks like the others already commented on your collision detection issue. Do you have a dev log? If not, you should start one. It's neat to look back and see your progress throughout the months.

Jewel
May 2, 2009

dangerz posted:

So ya, the single-player = local-multiplayer idea is more appealing. I just wish I would've done that from the beginning instead of building most of the game out first and then switching to it.

This is the same thing that happened to Notch (although he couldn't fix it and ended up just making singleplayer and multiplayer seperate (BAD IDEA)), and is the reason why mods for the game either work in single player, or multiplayer, not both. This is pretty much the first thing you want to do if you even have the thought of multiplayer in mind!

dangerz
Jan 12, 2005

when i move you move, just like that

Tw1tchy posted:

This is the same thing that happened to Notch (although he couldn't fix it and ended up just making singleplayer and multiplayer seperate (BAD IDEA)), and is the reason why mods for the game either work in single player, or multiplayer, not both. This is pretty much the first thing you want to do if you even have the thought of multiplayer in mind!
Ya, the deeper I get into this the worse the situation becomes and the more I realize how big my mistake was.

Stiggs
Apr 25, 2008


Miles and miles of friends!

dangerz posted:

Do you have a dev log? If not, you should start one. It's neat to look back and see your progress throughout the months.

That sounds like a good idea, I'll look into setting something up.

Impotence
Nov 8, 2010
Lipstick Apathy
If you're going to add multiplayer for serious thing, do it properly and not like Terraria's horrible poo poo.

Vulnerable to denial of service and running every core 100% plus mem leaking from a single telnet client, trusting client for everything including attributes like "can this thing explode" = expected results on every public server.

Oh, and the (windows only binary) dedicated server requires an actual GPU excluding it from being run on any actual server.

dangerz
Jan 12, 2005

when i move you move, just like that

Biowarfare posted:

If you're going to add multiplayer for serious thing, do it properly and not like Terraria's horrible poo poo.

Vulnerable to denial of service and running every core 100% plus mem leaking from a single telnet client, trusting client for everything including attributes like "can this thing explode" = expected results on every public server.

Oh, and the (windows only binary) dedicated server requires an actual GPU excluding it from being run on any actual server.
I'm not doing any of that. I'm doing quite the opposite actually.

The server is written in generic c# and MonoGame, so I can build for Windows/Linux/Mac. It will not require a GPU at all and almost all of the game update work will be done on the server. The client will only be a graphical representation of the status of the server. Even when you're in single player, the server will be launched locally but it'll allow only you to join it.

Anyway, I don't want to keep hijacking this thread so here's a screenshot of the calm before the storm:

The server now has all of the in-game objects and managers built in. It doesn't throw any errors (although there are lots of warnings), so now I need to integrate all of the manager's update() methods, form the packets for each individual player and start sending them out.

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.

Biowarfare posted:

If you're going to add multiplayer for serious thing, do it properly and not like Terraria's horrible poo poo.
Terraria is an excellent example of "How to be a terrible coder and yet still make millions of dollars". Tons of sales with horrible code quality.

On the upside it isn't obfuscated and as far as I can tell the devs give no real fucks about the reverse-engineered dedicated server mods.
On the downside the code is so bad that both teams creating dedicated server mods are considering quitting.

Toady
Jan 12, 2009

It generates theft-resistant passwords using the Pwdhash algorithm. Simple.

Free on the Mac App Store. Runs on 32-bit Snow Leopard and up.

UraniumAnchor
May 21, 2006

Not a walrus.
Yeah, yeah, babby's first raytracer, but I wrote the core in python and then turned the matrix math into a C module (making it about 10x faster), so it's a learning experience for multiple reasons.


UraniumAnchor fucked around with this message at 09:51 on Dec 7, 2011

Foiltha
Jun 12, 2008

UraniumAnchor posted:

Yeah, yeah, babby's first raytracer, but I wrote the core in python and then turned the matrix math into a C module (making it about 10x faster), so it's a learning experience for multiple reasons.




What sort of render times are you getting for the teapot scene? If you're brute-forcing the intersection tests (i.e. testing each ray for intersection with each polygon), you should look into bounding volume hierarchies or k-d trees. They make a huge difference in scenes with more than a few polygons/primitives.

UraniumAnchor
May 21, 2006

Not a walrus.
It's using a sphere tree. The teapot takes about 15 minutes, most of which is taken up in sphere-ray intersections, because that part's still in python.

Jo
Jan 24, 2005

:allears:
Soiled Meat
Finally made my tileset editor usable. I love sprite games and there are a bunch of good options for map editors (like Tiled), but very few for tileset editors. Pixothello was awesome, but it ran like poo poo on my machine and couldn't import/export png.



Adbot
ADBOT LOVES YOU

Volte
Oct 4, 2004

woosh woosh

UraniumAnchor posted:

Yeah, yeah, babby's first raytracer, but I wrote the core in python and then turned the matrix math into a C module (making it about 10x faster), so it's a learning experience for multiple reasons.



What's up, baby's first raytracer buddy? This one is written in C++:



Finally got the k-d tree working yesterday, so I implemented triangle meshes today. Total render time, about 20 seconds (with 8 cores) with the k-d tree on and (judging by how slow it is when I run it) about 2 hours with them off. It also uses an embedded Lua interpreter with bindings to my scene objects instead of parsing scene files so I can do things like generate geometry on the fly (see: the ring of spheres).

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