mewse
|
|
« Reply #60 on: January 19, 2011, 03:19:05 AM » |
|
I like the bold section
I should have put it up at the top of my post, instead of buried in the middle! XD
|
|
|
Logged
|
|
|
|
ink.inc
Guest
|
|
« Reply #61 on: January 19, 2011, 03:25:03 AM » |
|
There's always the Edit button. And thanks a bunch for the tips, by the way.
|
|
|
Logged
|
|
|
|
brog
|
|
« Reply #62 on: January 19, 2011, 07:17:59 AM » |
|
An idea: allow a game to notify Twitter when a new game is hosted. Then people can follow it and know when someone wants to play, to try to fix the usual emptiness of servers for indie multiplayer games. I don't know if this idea is good or not because I haven't used Twitter. Would people use something like this?
|
|
|
Logged
|
|
|
|
J. Kyle Pittman
|
|
« Reply #63 on: January 19, 2011, 07:48:30 AM » |
|
An idea: allow a game to notify Twitter when a new game is hosted. Then people can follow it and know when someone wants to play, to try to fix the usual emptiness of servers for indie multiplayer games. I don't know if this idea is good or not because I haven't used Twitter. Would people use something like this?
I like that idea. The other option would be to let the game access a player's own Twitter feed, but that could get spammy and annoying for followers who aren't interested in the game. Keeping all that spam on a single Twitter feed for the users who do care would be a lot cleaner. It used to be fairly easy to access the Twitter API back when they allowed basic authentication. They switched over to OAuth last year, though, and it's somewhat more complicated now. Details here: http://dev.twitter.com/pages/basic_to_oauth
|
|
|
Logged
|
|
|
|
Riley Adams
|
|
« Reply #64 on: January 19, 2011, 09:09:43 AM » |
|
<snip for quote size...>
In C, here's how I'd do it:
float myValue = 2.0f; uint32_t myPretendIntegerValue = *(uint32_t*)&myValue; uint32_t myByteSwappedValueForSending = htonl(*myPretendIntegerValue);
Then to convert back on the other side:
uint32_t *myPretendIntegerValue; uint32_t myReceivedByteSwappedValue = <whatever I received>; myPretendIntegerValue = ntohl(myReceivedByteSwappedValue); float myValue = *(float*)&myPretendIntegerValue;
At this point, 'myValue' now contains the transmitted floating point value. At all times when the float was byte-swapped, its bytes were being stored inside a 32-bit integer, which kept it from ever being loaded into a float register and thereby becoming invalidated. Yay, complicated! But you'll find that there are no standard network functions for manipulating floats, so this is pretty much the best I've been able to come up with..
Thanks! that really helps.
|
|
|
Logged
|
|
|
|
Sos
|
|
« Reply #65 on: January 19, 2011, 10:31:03 AM » |
|
Typeless define for endian conversion GO! #define SWAP_HL(v) \ __asm { \ mov eax,v; \ bswap eax; \ mov v,eax; \ }
This should work for any 32bit value.
|
|
|
Logged
|
|
|
|
Will Vale
|
|
« Reply #66 on: January 19, 2011, 03:18:17 PM » |
|
Big-endian is the defined network format (and has been for decades). uint32_t myPretendIntegerValue = *(uint32_t*)&myValue; Great advice on byte order, but watch out for that cast if you compile with strict aliasing turned on. A so-called union cast is safer and should work on all current compilers, or for complete peace of mind read/write through a char pointer, which is allowed to alias (and makes sense when doing Endian swaps anyway...) http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.htmlCheers, Will
|
|
|
Logged
|
|
|
|
Sos
|
|
« Reply #67 on: January 19, 2011, 03:28:04 PM » |
|
Typecasting is bullshit, use the asm! No types, no worries!
|
|
|
Logged
|
|
|
|
xhunterko
|
|
« Reply #68 on: January 21, 2011, 02:08:58 PM » |
|
Hi all! While I'm obviously not participating in this contest, I have been interested in multiplayer gamers recently. Through out my tedious searches on finding not much, I stumbled up this a while back. This is: http://flixel.org/forums/index.php?topic=2636.0Note I have yet to test it out myself and see if it can work for me. But you all are smart people and I know that one or some of you will get it working. Source to game and server/client stuff are in a thread link. Have fun!
|
|
|
Logged
|
|
|
|
|
Sanojian
Level 1
|
|
« Reply #70 on: January 22, 2011, 11:05:36 AM » |
|
Yes I am using it for Uncivil and I plan to support 6 players per game with multiple simultaneous games. So far so good. If anyone has any questions about it, ask away.
|
|
|
Logged
|
|
|
|
xhunterko
|
|
« Reply #71 on: January 22, 2011, 12:19:46 PM » |
|
Well, I would ask if you would show how to use it with a flixel game but that wouldn't be fair since I'm not participating. Though it might be useful for other people using flixel (if any) in the compo.
|
|
|
Logged
|
|
|
|
Sanojian
Level 1
|
|
« Reply #72 on: January 22, 2011, 12:48:02 PM » |
|
Well, I would ask if you would show how to use it with a flixel game but that wouldn't be fair since I'm not participating. Though it might be useful for other people using flixel (if any) in the compo.
Hmm, I am not a Flash developer so I can't answer definitively but you should be able to use a Javascript-Flash connection API ( like this) to pass the messages on. Channel API is a javascript API. It is an implementation of Comet (Ajax in reverse).
|
|
|
Logged
|
|
|
|
LuisAnton
|
|
« Reply #73 on: January 22, 2011, 03:12:40 PM » |
|
Yes I am using it for Uncivil and I plan to support 6 players per game with multiple simultaneous games. So far so good. If anyone has any questions about it, ask away. Isn't the connection synchronous? Or does it depend on your local socket implementation? I would like to dig a little bit more in that API. Do you know any good example, something more complex than the Tic-Tac-Toe tutorial? Something more 'real-time' : )
|
|
|
Logged
|
|
|
|
Sanojian
Level 1
|
|
« Reply #74 on: January 22, 2011, 04:55:33 PM » |
|
Isn't the connection synchronous? I would like to dig a little bit more in that API. Do you know any good example, something more complex than the Tic-Tac-Toe tutorial? Something more 'real-time' : )
Synchronous meaning that the script needs to halt to wait for an answer? No. It is event-driven. Or does it depend on your local socket implementation?
It does not require HTML5 websockets or any special browser add-ons either. I believe that under the hood it is a regular HTTP connection that remains open. Google's magic API then uses XMPP to pass the data. It is one-way, so you need to pass data from the client via Ajax POSTs. Do you know any good example, something more complex than the Tic-Tac-Toe tutorial? Something more 'real-time' : )
I am afraid it is a pretty new API. Not many examples out there. I used the Tic-Tac-Toe example to get started.
|
|
|
Logged
|
|
|
|
FinalSin
Level 1
Too bad they lose!
|
|
« Reply #75 on: January 23, 2011, 09:17:12 AM » |
|
Any lovers working on Versus games? I'm going to attempt a first-time use of Love's networking library add-on. Wondered if anyone had gone toe-to-toe with it before.
|
|
|
Logged
|
|
|
|
MedO
Level 1
|
|
« Reply #76 on: January 24, 2011, 03:42:02 PM » |
|
If you are considering to use the Faucet Networking extension for Game Maker, you might be interested to know that I'll keep updates to the current version backward-compatible from now on, so that you won't have to change your code when you get a new version. In other words, you can now actually start using it.
|
|
|
Logged
|
|
|
|
Mega
Level 1
|
|
« Reply #77 on: January 30, 2011, 09:10:39 PM » |
|
Is there any method to have a program find another program who is listning for it and who is on a seperate machine across the internet, without using a permanent server. The system I have in mind is to have the client spam all possible ip addresses. wait, there are too many possible ip addresses.. I guess I need some sort of permanent server. do I? In any event there should be a quintillion kazillion possible IP addresses, so at spamming 100 of those per second It should take about 1.5 light years to connect to a game. If I were only a bit more smarterer, I could figure out a way.
|
|
|
Logged
|
|
|
|
ink.inc
Guest
|
|
« Reply #78 on: January 30, 2011, 09:13:31 PM » |
|
It should take about 1.5 light years to connect to a game.
lol
|
|
|
Logged
|
|
|
|
FK in the Coffee
|
|
« Reply #79 on: January 30, 2011, 09:15:55 PM » |
|
It should take about 1.5 light years to connect to a game.
So it should take roughly 15 trillion kilometers to connect?
|
|
|
Logged
|
|
|
|
|