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
Scaevolus
Apr 16, 2007

Shalinor posted:

As I am about to dive in head-first, does anyone happen to know of a Hello World-esque walkthrough of all of the back-end PHP et al that typically drives a web/Facebook game?
I strongly recommend using Python instead of PHP if at all possible.

Adbot
ADBOT LOVES YOU

Hughlander
May 11, 2005

Scaevolus posted:

I strongly recommend using Python instead of PHP if at all possible.

I'd go as far as to say a Python framework, Django, Pyramid, etc... I've done FB projects both ways and PHP is such an abortion of a language that you'll spend far more time on it then you ever wished to if you want to write bug-free code without side-effects.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Scaevolus posted:

I strongly recommend using Python instead of PHP if at all possible.
I know almost no PHP and absolutely nothing about Python (I used TCL back in the day), so... uh, sure, why not. It's arbitrary to me. Though I've no idea what would prevent one from using Python.

EDIT: Oh, hey, Python / Flash / Facebook finally lead me to a likely looking candidate as far as facebook app examples go. Wunderbar. It's 2 years old, so doubtless the API has changed, but this should be fine as a starting point.

EDIT: VV Yes to both. Even if not, new languages are seldom a problem, and Python's one that's pretty worth learning in general.

Shalinor fucked around with this message at 06:23 on Jan 25, 2012

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
If you know how to use Lua or JavaScript then Python isn't really a far cry from them.

Piglips
Oct 9, 2003

PDP-1 posted:

This is pretty much what I ended up doing for my timing loop. The clock is a Win32 TimerQueueTimer that blocks the main game thread until some delta t has elapsed and signals when it's ok to proceed by releasing a shared dummy variable. Maybe there is a better way to do it, but on my system it stayed at 60 +/- 1FPS up to about 90% steady state processor load. The only thing that really tripped it up was stuff like Alt+tabbing through other applications or moving windows around to force lots of re-draw activity. That isn't much of a practical issue though, since you'd likely pause the game if it didn't have focus.

I did play with thread priority by bumping the game thread up one notch and pushing the worker thread pool down one notch. It helped a bit but wasn't a really radical improvement. One thing that did seem to help was intentionally sleeping the worker pool threads periodically. This gives the OS room to take care of whatever work it has queued up at a steady rate instead of letting it all pile up and then getting a spike of OS activity all at once.

Cool... I guess I'll switch over to this method once I've read up a little more on the guts of thread implementation. Thanks.

Just A Friend
Jan 11, 2010

I apologise if it's been discussed recently but what are the general thoughts on Construct 2?

I've used Construct 1 during SA Gamedev 2010 and it wasn't really all that bad despite it getting less and less stable the bigger the project became. Construct 2 looks to be more polished but the main appeal to me is that it exports to HTML5 (and facebook and the chrome webshop), so you can play in a browser.

I imagine it's still poo poo for large projects and stuff that needs a lot of unique stuff.

Who's tried it? I feel like getting my gamedev on.

Snackmar
Feb 23, 2005

I'M PROGRAMMED TO LOVE THIS CHOCOLATY CAKE... MY CIRCUITS LIGHT UP FOR THAT FUDGY ICING.
Anyone at the Toronto Global Game Jam? I'm going to be trying Construct 2 for the first time, probably to make some kind of endless runner no matter what the theme is. :)

ScirraTom
Aug 29, 2011

Just A Friend posted:

I apologise if it's been discussed recently but what are the general thoughts on Construct 2?

I've used Construct 1 during SA Gamedev 2010 and it wasn't really all that bad despite it getting less and less stable the bigger the project became. Construct 2 looks to be more polished but the main appeal to me is that it exports to HTML5 (and facebook and the chrome webshop), so you can play in a browser.

I imagine it's still poo poo for large projects and stuff that needs a lot of unique stuff.

Who's tried it? I feel like getting my gamedev on.

Tom here from Scirra! (We make Construct 2)

One of the main reasons Construct 2 has been written from the ground up is to address stability issues in Construct Classic.

We're also in the advantageous position where this is our second game engine, a lot of competitors are writing their first ones and we're spotting a few problems encumbering them that we had when developing Construct Classic, that's all behind us now though!

The free edition isn't time restricted so it's worth taking a look at probably and if you have any feedback I'd love to hear it. So far we've had very positive (overwhelmingly positive!) feedback from everyone that uses it.

The Glumslinger
Sep 24, 2008

Coach Nagy, you want me to throw to WHAT side of the field?


Hair Elf
I wish I had time for the game jam :smith:

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?
We be jammin' - http://www.ustream.tv/channel/globalgamejam2012-denver

(though our group has dwindled - where once there were 4, now sit 2... well, 1.8 at least)

... probably going to head home soon. Not to actually sleep, just to work all night in the comfort of my own office, and like, shower and stuff.

Snackmar
Feb 23, 2005

I'M PROGRAMMED TO LOVE THIS CHOCOLATY CAKE... MY CIRCUITS LIGHT UP FOR THAT FUDGY ICING.

Shalinor posted:

We be jammin' - http://www.ustream.tv/channel/globalgamejam2012-denver

(though our group has dwindled - where once there were 4, now sit 2... well, 1.8 at least)

... probably going to head home soon. Not to actually sleep, just to work all night in the comfort of my own office, and like, shower and stuff.

Nice. We don't have shower facilities here, so although folks have slept over there's a fair amount of "oh god i'm going home for a few hours".

It's a pretty swank setup though.. I think our stream is off, but all of the rooms have other game jam feeds on the projectors:



diamond dog
Jul 27, 2010

by merry exmarx
Just got home from the Sydney GGJ. Our site was at a racecourse and we got to shower in little jockey showers in a little jockey change room.

Our game was nominated in the Technical and Theme categories, but the awards aren't until next weekend. Game page and webplayer are here and we have a kinda cryptic video too. Good luck to everyone still jamming around the world--I'm going to bed.



ps the controls are terrible

Snackmar
Feb 23, 2005

I'M PROGRAMMED TO LOVE THIS CHOCOLATY CAKE... MY CIRCUITS LIGHT UP FOR THAT FUDGY ICING.
My game is as done as it's going to be.. ScirraTom, sorry that it isn't a better ad for Construct 2, but it was really easy to make! :)

http://www.snakesnack.com (works best for me in Chrome, a little choppy in Firefox because I never restart it..)

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?
Huh, I had no idea everyone was that off-kilter with everyone else. We've got until 2ish PM today - I suppose we must have started later, too.

EDIT: (this is us btw: http://www.glassbottomgames.com/SpiraSolarisGGJ12/ )

Shalinor fucked around with this message at 01:07 on Jan 30, 2012

diamond dog
Jul 27, 2010

by merry exmarx
Yeah, everyone goes by local time so it's staggered. So Hawaii starts and ends something like 23 hours after the New Zealand jammers. We were asked nicely not to tweet the theme~

ScirraTom
Aug 29, 2011

techknight posted:

My game is as done as it's going to be.. ScirraTom, sorry that it isn't a better ad for Construct 2, but it was really easy to make! :)

http://www.snakesnack.com (works best for me in Chrome, a little choppy in Firefox because I never restart it..)

Hah! I enjoyed it, it's quite tricky though was stuck on 700 for a while but got to nearly 2k :)

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

techknight posted:

http://www.snakesnack.com (works best for me in Chrome, a little choppy in Firefox because I never restart it..)
Why does he keep going into more snakes?!! (Got to 3600.)

ShinAli
May 2, 2003

The Kid better watch his step.
I... don't know if I liked my first game jam. I really wanted to work in Unity/XNA/something I know well but was thrown into working with Java (which I'm completely unfamiliar with in terms of programming games) because the CS student assistant programmer only knew Java. Also, the "designer" invented some arbitrary scripting language in his Tiled maps that I had to spend most of my time writing a parser for.

What's extra terrible is that the sound/music guy was REALLY talented and I felt really bad seeing most of the work he did gone mostly to wasted for a lovely unfinished game.

It's mostly my fault for not saying much. Next time I should just say "No gently caress you we're working in Unity also we're not making a loving Metroid clone."

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
ShinAli: That sounds like a pretty crummy experience. Did you just get randomly paired with people?

I've never been to a "big" game jam, but I've run a few small local ones. My general experience has been that you should come up with a prudent, concise game design that fits the theme, and then cut out 3/4 of it. Fiddle with that to make sure it has something resembling gameplay. (Is there challenge? Are there choices? Can you make progress? Can you fail?) Pound that out, taking a little break every few milestones, and then hopefully you'll still have a few hours for polish and adding a few shiny baubles that complement the core game.

ShinAli
May 2, 2003

The Kid better watch his step.

Internet Janitor posted:

ShinAli: That sounds like a pretty crummy experience. Did you just get randomly paired with people?

I've never been to a "big" game jam, but I've run a few small local ones. My general experience has been that you should come up with a prudent, concise game design that fits the theme, and then cut out 3/4 of it. Fiddle with that to make sure it has something resembling gameplay. (Is there challenge? Are there choices? Can you make progress? Can you fail?) Pound that out, taking a little break every few milestones, and then hopefully you'll still have a few hours for polish and adding a few shiny baubles that complement the core game.

Yeah, the %90 of people that shown up arrived grouped up and there wasn't that whole shopping ideas around to people thing I've read about on the website. The people that organized it was all "oh heh well here are some other dudes."

I'm sure I've over estimated on how much I'd able to get done, though. I thought I can get a hang of whatever library I find for Java and poo poo out a decent enough game.

ether
May 20, 2001

I went to the local GGJ to get a feel for the atmopshere (a couple of friends attended) and ended up coding a bit for one of them. All in all it was a very positive experience and fully intend to sign up properly next year, as I wasn't aware of it until the day it started. Great time to spend with like-minded people.

Thorougly enjoyable even for people like me stuck with bussiness-app programming.

Snackmar
Feb 23, 2005

I'M PROGRAMMED TO LOVE THIS CHOCOLATY CAKE... MY CIRCUITS LIGHT UP FOR THAT FUDGY ICING.

roomforthetuna posted:

Why does he keep going into more snakes?!! (Got to 3600.)

Haha, I went into the jam hoping that the theme would work with an endless runner because I figured I could make one solo in a couple of days. Luckily the theme was an image of an ouroboros: http://globalgamejam.org/news/2012/01/27/and-ggj-2012-theme

Shalinor, do you have your game up to play?

I didn't get to try everyone's games (there's a party for that next month), but my fave from Toronto so far is this Princess Peach vs Daisy game where two players have to throw animals at each other's castles:



http://globalgamejam.org/2012/royal-rumble

Snackmar fucked around with this message at 12:45 on Jan 30, 2012

Wolfsbane
Jul 29, 2009

What time is it, Eccles?

Does anyone have any experience with Esenthel? It has amazing reviews on Devmaster, and from what I've seen so far it's pretty much a simplified version of Unity that lets you actually write proper code instead of loving around with scripts. To be fair I would probably use Unity if the free version would let me link dlls.

It also has the most amazingly programmer interface this side of Blender. Who the hell uses right click for the default action and left click to reverse that action? Why are there menu items that just pop up a message telling me which hotkey to press?

e: Actually, the more I learn about it, the weirder it seems.

Wolfsbane fucked around with this message at 13:26 on Jan 30, 2012

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

techknight posted:

Shalinor, do you have your game up to play?
Yep. Main page is here: http://globalgamejam.org/2012/spira-solaris

Web version of the game itself is here: http://www.glassbottomgames.com/SpiraSolarisGGJ12/WebPlayer.html

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

Shalinor posted:

Yep. Main page is here: http://globalgamejam.org/2012/spira-solaris

Web version of the game itself is here: http://www.glassbottomgames.com/SpiraSolarisGGJ12/WebPlayer.html

Just looking at that screenshot is :pwn:. I can't wait to get home this afternoon and see how it looks in motion.

HolyJewsus
Jun 26, 2006
Disgruntled By Flashing and Blinking Lights.

Wolfsbane posted:

Does anyone have any experience with Esenthel? It has amazing reviews on Devmaster, and from what I've seen so far it's pretty much a simplified version of Unity that lets you actually write proper code instead of loving around with scripts. To be fair I would probably use Unity if the free version would let me link dlls.

It also has the most amazingly programmer interface this side of Blender. Who the hell uses right click for the default action and left click to reverse that action? Why are there menu items that just pop up a message telling me which hotkey to press?

e: Actually, the more I learn about it, the weirder it seems.

I'm pretty sure you can use .net dlls in unity as long as they're supported in mono, in the free version I mean.

PalmTreeFun
Apr 25, 2010

*toot*

Shalinor posted:

Yep. Main page is here: http://globalgamejam.org/2012/spira-solaris

Web version of the game itself is here: http://www.glassbottomgames.com/SpiraSolarisGGJ12/WebPlayer.html

This looks cool. Gonna play this when I get home and make a snake kill itself. :lsd: :pcgaming:

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

PalmTreeFun posted:

This looks cool. Gonna play this when I get home and make a snake kill itself. :lsd: :pcgaming:
Unfortunately, you can't. We didn't have time to finish it (is there ever a "finished" game jam game?). All you can do is fly the snake through an infinite world and :pcgaming:

This is the video we put together (also within the 48 hours :suicide: - though the artists were mostly waiting on me by then) for the GGJ page:

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

Shalinor fucked around with this message at 18:47 on Jan 30, 2012

The Glumslinger
Sep 24, 2008

Coach Nagy, you want me to throw to WHAT side of the field?


Hair Elf
We didn't have a great GGJ at my school this year :( Most of the people who generally make amazing things sat this one out due to heavy workloads due to being seniors and working on our final projects.

I do want to give a shoutout to this one, http://globalgamejam.org/2012/snake2, mainly because the spritesheet for it made me laugh way too much.

EDIT: fixed the link

The Glumslinger fucked around with this message at 02:11 on Feb 1, 2012

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

crazylakerfan posted:

We didn't have a great GGJ at my school this year :( Most of the people who generally make amazing things sat this one out due to heavy workloads due to being seniors and working on our final projects.

I do want to give a shoutout to this one, http://globalgamejam.org/2012/snake2, mainly because the spritesheet for it made me laugh way too much.

Hey, take out the comma in the url tag. It's broken otherwise.

Contero
Mar 28, 2004

A year ago I had written a small game in C++ that used TCP for network communication. My simple game protocol worked like this:

1. Read two 32b ints worth of data, first one is opcode for type of packet, and second is how many bytes of data follow.
2. Read the number of bytes specified in step 1

The bytes were then passed to the appropriate constructor function which initialized the proper data structure.

This seemed like a foolproof protocol to me, since even if you messed up the serialization code it didn't matter and you couldn't get out of sync on how many bytes were written to or read from the socket.

And it worked about 99% of the time, but sometimes it would get out of sync. The code would somehow read or write too many or too few bytes and I'd start reading bytes that weren't supposed to be headers. I debugged my code forever and I never figured out what was wrong.

I haven't looked at the code in forever, but I'm going to start writing something similar and I thought I'd ask:

Is there some bad assumption I'm making about TCP here? Is there a way that this could get out of sync due to TCP not flushing, packet size or MTU or something? I'd think the worst possible case would be a server or client hanging waiting for bytes to be sent if the other end's OS didn't send them right away.

Uncle Kitchener
Nov 18, 2009

BALLSBALLSBALLSBALLS
BALLSBALLSBALLSBALLS
BALLSBALLSBALLSBALLS
BALLSBALLSBALLSBALLS
Welp, GGJ loving sucked this year. Our artists were a bunch of poo poo heads. We also switched to XNA to get a junior on board, but from now on I will never work with that guy ever again. gently caress him, gently caress his dumb rear end girlfriend and her retarded furry friends.

Important lessons learnt.

Hughlander
May 11, 2005

Contero posted:

A year ago I had written a small game in C++ that used TCP for network communication. My simple game protocol worked like this:

1. Read two 32b ints worth of data, first one is opcode for type of packet, and second is how many bytes of data follow.
2. Read the number of bytes specified in step 1

The bytes were then passed to the appropriate constructor function which initialized the proper data structure.

This seemed like a foolproof protocol to me, since even if you messed up the serialization code it didn't matter and you couldn't get out of sync on how many bytes were written to or read from the socket.

And it worked about 99% of the time, but sometimes it would get out of sync. The code would somehow read or write too many or too few bytes and I'd start reading bytes that weren't supposed to be headers. I debugged my code forever and I never figured out what was wrong.

I haven't looked at the code in forever, but I'm going to start writing something similar and I thought I'd ask:

Is there some bad assumption I'm making about TCP here? Is there a way that this could get out of sync due to TCP not flushing, packet size or MTU or something? I'd think the worst possible case would be a server or client hanging waiting for bytes to be sent if the other end's OS didn't send them right away.

Probably you sent multiple packets and your receive got cut off mid packet. What you want is something more like:

code:

// These 3 will return false if the socket would block before reading in the max amount
bool GetPacketIDFromSocket(int& nPacketID);
bool GetPacketLenFromSocket(int& nPacketLen);
bool GetPacketFromSocket(char* szPacketBuffer, const int nMaxAmount, int& nActualAmountRead);

...
    while(try_readpacket())
    {
        do_packet();
    }
...
bool ClassName::try_readpacket()
{
    if(!m_bGotPacketId())
    {
        bool bWouldBlock = GetPacketIDFromSocket(m_CurrentPacket);
        if(bWouldBlock) return false;

        m_bGotPacketId = true;
    }

    if(!m_bGotPacketLen)
    {
        bool bWouldBlock = GetPacketLenFromSocket(m_PacketLen);
        if(bWouldBlock) return false;
    }

    int nAmountToRead = m_PacketLen - m_AmountRead;
    int nAmountActuallyRead = 0;
    bool bWouldBlock = GetPacketFromSocket(m_PacketBuffer[m_AmountRead], nAmountToRead, nAmountActuallyRead);
    if(bWouldBlock)
    {
        m_AmountRead += nAmountActuallyRead;
        return false;
    }

    // Got the entire packet
    m_AmountRead = 0;
    m_bGotPacketId = false;
    m_bGotPacketLen = false;
    return true;
}
     

brian
Sep 11, 2001
I obtained this title through beard tax.

uncleKitchener posted:

Welp, GGJ loving sucked this year. Our artists were a bunch of poo poo heads. We also switched to XNA to get a junior on board, but from now on I will never work with that guy ever again. gently caress him, gently caress his dumb rear end girlfriend and her retarded furry friends.

Important lessons learnt.

I've heard a lot of horror stories about GGJ so i've never taken part, in general if you're looking for a really cool jam to go to and don't mind travelling, look up the TIGJam or jam forum on TIGSource.com. I went to TIGJam UK2 or 3 and it was a great experience and everyone was really nice, you tend to do stuff on your own as opposed to in teams but there's no hard and fast rules.

You basically want to avoid as many students and recently graduated dudes looking to pad their portfolio as possible as they tend to have awful ideas and no idea how to approach doing very quick work. You basically want to go to one that is all ethusiasts who have probably attempted to do a ludum dare or an experimental gameplay challenge before.

PalmTreeFun
Apr 25, 2010

*toot*

uncleKitchener posted:

Welp, GGJ loving sucked this year. Our artists were a bunch of poo poo heads. We also switched to XNA to get a junior on board, but from now on I will never work with that guy ever again. gently caress him, gently caress his dumb rear end girlfriend and her retarded furry friends.

Important lessons learnt.

Sometimes I look CS as a whole and wonder why I didn't go find a career path where everyone is relatively normal. :smith:

Don't get me wrong, I don't mind working with other people, but I hate having to work with total goons.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Hughlander posted:

Probably you sent multiple packets and your receive got cut off mid packet.
Both can happen. send can potentially send less than the amount of data you provide if the output queue is full, recv can potentially receive less than than requested if a packet fragments.

It can be helpful to create buffers for both to allow for atomic packet reads and writes. That is, stream data into or out of the buffers as necessary, but only allow packets to be inserted or extracted if the entire read/write request is available.

My Rhythmic Crotch
Jan 13, 2011

I was wondering if anyone had a recommendation of a good scripting language that can be bound to a game written in C++? I would like to use it for AI scripting. I think Lua might be a good choice, but I'm not really sure. I have looked around for a sort of practical guide to integrating Lua with C++ but I just haven't really found much. Probably because I just suck at googling or something.

Thanks for any ideas!

Pfhreak
Jan 30, 2004

Frog Blast The Vent Core!

My Rhythmic Crotch posted:

I was wondering if anyone had a recommendation of a good scripting language that can be bound to a game written in C++? I would like to use it for AI scripting. I think Lua might be a good choice, but I'm not really sure. I have looked around for a sort of practical guide to integrating Lua with C++ but I just haven't really found much. Probably because I just suck at googling or something.

Thanks for any ideas!

Is your AI ready to be bound to the language? Why not just try a few and figure out which one you prefer?

feedmegin
Jul 30, 2008

Contero posted:

Is there some bad assumption I'm making about TCP here? Is there a way that this could get out of sync due to TCP not flushing, packet size or MTU or something? I'd think the worst possible case would be a server or client hanging waiting for bytes to be sent if the other end's OS didn't send them right away.

Make sure to check your send() call's return to see if it sent all the bytes. Usually it will but it doesn't have to (so you can send() an 8 byte buffer and it only sends the first 4, so you need to send() again for the last 4 bytes of the buffer).

Adbot
ADBOT LOVES YOU

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal

My Rhythmic Crotch posted:

I was wondering if anyone had a recommendation of a good scripting language that can be bound to a game written in C++? I would like to use it for AI scripting. I think Lua might be a good choice, but I'm not really sure. I have looked around for a sort of practical guide to integrating Lua with C++ but I just haven't really found much. Probably because I just suck at googling or something.

Thanks for any ideas!

luabind will mostly automatically bind C++ to lua, if you don't mind terrifying template based abominations. It's easy to USE but understanding how it works is beyond me.

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