haxe Multiplayer game

classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|

haxe Multiplayer game

Tony Polinelli
Hi,

we are currently designing a multiplayer flash game, and i'm wondering has anyone used haxe for multiplayer games much?

There will be a meeting area, where users can chat & lineup games - similar to the www.ff0000.com website. the game will then be a turnbased box2d setup - kinda similar to worms.

I am looking at the chat example http://haxe.org/doc/flash/chat and things look pretty simple there - has anyone used this as a basis for a game? if so, are there any obvious restrictions / performance issues i should look out for? I havent hosted a neko app before, the current fb app uses amazon storage & s3 - can this host neko? there isnt a way to use php as the socket server is there? - as it doesnt have the ThreadRemotingServer

I am thinking that i will send information about an event, then let box2d rollout the simulation, then when things settle down, do a refresh of the changes to the world - as the simulations will be slightly different on each client. I am assuming that it would be too much to send much more informations (per frame for example), as there will be 50-100 objects - but only 1 moving most of the time. hmmm. I'll have to look into how to make network games a little more ;P

So, does anyone have anything more than this example? and/or know of other solutions - as3 isnt totally ruled out as the rest of the existing projects work is in as3 - but am wondering if there are any major benefits to something like smartfox server?

sorry for the spillage of questions ;P

thanks in advance


--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: haxe Multiplayer game

Tony Polinelli
ps - we just had a play with the chat example - worked first time, reeeally amazing. great work! ;P



On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli <[hidden email]> wrote:
Hi,

we are currently designing a multiplayer flash game, and i'm wondering has anyone used haxe for multiplayer games much?

There will be a meeting area, where users can chat & lineup games - similar to the www.ff0000.com website. the game will then be a turnbased box2d setup - kinda similar to worms.

I am looking at the chat example http://haxe.org/doc/flash/chat and things look pretty simple there - has anyone used this as a basis for a game? if so, are there any obvious restrictions / performance issues i should look out for? I havent hosted a neko app before, the current fb app uses amazon storage & s3 - can this host neko? there isnt a way to use php as the socket server is there? - as it doesnt have the ThreadRemotingServer

I am thinking that i will send information about an event, then let box2d rollout the simulation, then when things settle down, do a refresh of the changes to the world - as the simulations will be slightly different on each client. I am assuming that it would be too much to send much more informations (per frame for example), as there will be 50-100 objects - but only 1 moving most of the time. hmmm. I'll have to look into how to make network games a little more ;P

So, does anyone have anything more than this example? and/or know of other solutions - as3 isnt totally ruled out as the rest of the existing projects work is in as3 - but am wondering if there are any major benefits to something like smartfox server?

sorry for the spillage of questions ;P

thanks in advance


--
Tony Polinelli
http://touchmypixel.com



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Chris Hecker

When I was looking into doing a flash multiplayer game, I was going to
write the server in C and the client in haxe with a custom sockets
protocol (too bad flash doesn't support udp).  This is partly because
I'm old and conservative, and partly because I was worried about
performance scaling and control over the server/protocol.  That said,
the jvm is pretty fast now with hotspot, and smartfox says it scales
well.  I also don't trust things like built-in remoting because they
tend to have tons of overhead compared to custom protocols.  That said,
you can obviously switch it out later if it's a bottleneck, premature
optimization and all that.

Chris



Tony Polinelli wrote:

> ps - we just had a play with the chat example - worked first time,
> reeeally amazing. great work! ;P
>
>
>
> On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi,
>
>     we are currently designing a multiplayer flash game, and i'm
>     wondering has anyone used haxe for multiplayer games much?
>
>     There will be a meeting area, where users can chat & lineup games -
>     similar to the www.ff0000.com <http://www.ff0000.com> website. the
>     game will then be a turnbased box2d setup - kinda similar to worms.
>
>     I am looking at the chat example http://haxe.org/doc/flash/chat and
>     things look pretty simple there - has anyone used this as a basis
>     for a game? if so, are there any obvious restrictions / performance
>     issues i should look out for? I havent hosted a neko app before, the
>     current fb app uses amazon storage & s3 - can this host neko? there
>     isnt a way to use php as the socket server is there? - as it doesnt
>     have the ThreadRemotingServer
>
>     I am thinking that i will send information about an event, then let
>     box2d rollout the simulation, then when things settle down, do a
>     refresh of the changes to the world - as the simulations will be
>     slightly different on each client. I am assuming that it would be
>     too much to send much more informations (per frame for example), as
>     there will be 50-100 objects - but only 1 moving most of the time.
>     hmmm. I'll have to look into how to make network games a little more ;P
>
>     So, does anyone have anything more than this example? and/or know of
>     other solutions - as3 isnt totally ruled out as the rest of the
>     existing projects work is in as3 - but am wondering if there are any
>     major benefits to something like smartfox server?
>
>     sorry for the spillage of questions ;P
>
>     thanks in advance
>
>
>     --
>     Tony Polinelli
>     http://touchmypixel.com
>
>
>
>
> --
> Tony Polinelli
> http://touchmypixel.com
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Tony Polinelli

That was another thing - flash 10 now supports udp for peer-to-peer connections, any thoughts on this? its a pretty new & not widely used feature as far as i can find. A friend of ours who made the game bunni is using it for his multiplayer setup - quite interesting. He looked at haxe for a while, but just decided to use php.

 


On Thu, Nov 5, 2009 at 6:54 PM, Chris Hecker <[hidden email]> wrote:

When I was looking into doing a flash multiplayer game, I was going to write the server in C and the client in haxe with a custom sockets protocol (too bad flash doesn't support udp).  This is partly because I'm old and conservative, and partly because I was worried about performance scaling and control over the server/protocol.  That said, the jvm is pretty fast now with hotspot, and smartfox says it scales well.  I also don't trust things like built-in remoting because they tend to have tons of overhead compared to custom protocols.  That said, you can obviously switch it out later if it's a bottleneck, premature optimization and all that.

Chris



Tony Polinelli wrote:
ps - we just had a play with the chat example - worked first time, reeeally amazing. great work! ;P



On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli <[hidden email] <mailto:[hidden email]>> wrote:

   Hi,

   we are currently designing a multiplayer flash game, and i'm
   wondering has anyone used haxe for multiplayer games much?

   There will be a meeting area, where users can chat & lineup games -
   similar to the www.ff0000.com <http://www.ff0000.com> website. the

   game will then be a turnbased box2d setup - kinda similar to worms.

   I am looking at the chat example http://haxe.org/doc/flash/chat and
   things look pretty simple there - has anyone used this as a basis
   for a game? if so, are there any obvious restrictions / performance
   issues i should look out for? I havent hosted a neko app before, the
   current fb app uses amazon storage & s3 - can this host neko? there
   isnt a way to use php as the socket server is there? - as it doesnt
   have the ThreadRemotingServer

   I am thinking that i will send information about an event, then let
   box2d rollout the simulation, then when things settle down, do a
   refresh of the changes to the world - as the simulations will be
   slightly different on each client. I am assuming that it would be
   too much to send much more informations (per frame for example), as
   there will be 50-100 objects - but only 1 moving most of the time.
   hmmm. I'll have to look into how to make network games a little more ;P

   So, does anyone have anything more than this example? and/or know of
   other solutions - as3 isnt totally ruled out as the rest of the
   existing projects work is in as3 - but am wondering if there are any
   major benefits to something like smartfox server?

   sorry for the spillage of questions ;P

   thanks in advance


   --    Tony Polinelli
   http://touchmypixel.com




--
Tony Polinelli
http://touchmypixel.com


--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Tarwin Stroh-Spijer
In reply to this post by Chris Hecker
Flash does do some UDP stuff with FP10. Video / audio go by non-safe routing (can be dropped) and "messages" are handled to be somehow "safe". Only problem is it's only peer-to-peer as far as I know ...


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Thu, Nov 5, 2009 at 6:54 PM, Chris Hecker <[hidden email]> wrote:

When I was looking into doing a flash multiplayer game, I was going to write the server in C and the client in haxe with a custom sockets protocol (too bad flash doesn't support udp).  This is partly because I'm old and conservative, and partly because I was worried about performance scaling and control over the server/protocol.  That said, the jvm is pretty fast now with hotspot, and smartfox says it scales well.  I also don't trust things like built-in remoting because they tend to have tons of overhead compared to custom protocols.  That said, you can obviously switch it out later if it's a bottleneck, premature optimization and all that.

Chris



Tony Polinelli wrote:
ps - we just had a play with the chat example - worked first time, reeeally amazing. great work! ;P



On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli <[hidden email] <mailto:[hidden email]>> wrote:

   Hi,

   we are currently designing a multiplayer flash game, and i'm
   wondering has anyone used haxe for multiplayer games much?

   There will be a meeting area, where users can chat & lineup games -
   similar to the www.ff0000.com <http://www.ff0000.com> website. the

   game will then be a turnbased box2d setup - kinda similar to worms.

   I am looking at the chat example http://haxe.org/doc/flash/chat and
   things look pretty simple there - has anyone used this as a basis
   for a game? if so, are there any obvious restrictions / performance
   issues i should look out for? I havent hosted a neko app before, the
   current fb app uses amazon storage & s3 - can this host neko? there
   isnt a way to use php as the socket server is there? - as it doesnt
   have the ThreadRemotingServer

   I am thinking that i will send information about an event, then let
   box2d rollout the simulation, then when things settle down, do a
   refresh of the changes to the world - as the simulations will be
   slightly different on each client. I am assuming that it would be
   too much to send much more informations (per frame for example), as
   there will be 50-100 objects - but only 1 moving most of the time.
   hmmm. I'll have to look into how to make network games a little more ;P

   So, does anyone have anything more than this example? and/or know of
   other solutions - as3 isnt totally ruled out as the rest of the
   existing projects work is in as3 - but am wondering if there are any
   major benefits to something like smartfox server?

   sorry for the spillage of questions ;P

   thanks in advance


   --    Tony Polinelli
   http://touchmypixel.com




--
Tony Polinelli
http://touchmypixel.com


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Nicolas Cannasse
Tarwin Stroh-Spijer a écrit :
> Flash does do some UDP stuff with FP10. Video / audio go by non-safe
> routing (can be dropped) and "messages" are handled to be somehow
> "safe". Only problem is it's only peer-to-peer as far as I know ...

And it's only supported in proprietary FlashMediaServer as far as I know ;)

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Chris Hecker

Yeah, it didn't sound like it was actual UDP sockets, it sounded like
some dumb Adobe crap.  :)

Chris


Nicolas Cannasse wrote:
> Tarwin Stroh-Spijer a écrit :
>> Flash does do some UDP stuff with FP10. Video / audio go by non-safe
>> routing (can be dropped) and "messages" are handled to be somehow
>> "safe". Only problem is it's only peer-to-peer as far as I know ...
>
> And it's only supported in proprietary FlashMediaServer as far as I know ;)
>
> Nicolas
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Trevor Burton
UDP Sockets will be available in AIR 2.0

http://www.insideria.com/2009/10/air-2-enhancements-complete-ov.html

but for now and in the flash player itself you're restricted to the RTMFP protocol and (i believe) you need to use their (Adobe's) Stratus service to get the near and far ids for 2 flash players to talk p2p. So, yeah, it's not as straightforward (ie useful) as it sounds.

The RTMFP protocol is almost reverse engineered at the moment but i doubt you'll see any implementation of it - at least not for long - as i think it's a bit of a favoured son of Adobe's and they're not going to like people cracking it and going off and building something useful with it ;)

You're basic approach seems sound but i think it's going to involve more work than you imagine (if you've never tried it before) - if you're using an authoritative server approach then send your user input to the server. Have the server update its version of the simulation and send out updates to each of the players about where things 'should' be. You can use client side prediction to allow the results of the player input to be seen by that player immediately on their system, then correct when you receive the server updates. If the client and server are out by a huge amount then you can just 'snap' them into the correct place, otherwise use some smoothing to gradually bring them back into line.

There's a huge amount of information about this sort of thing online. Glenn Fiedler's networked physics article is a really good starting point http://gafferongames.com/game-physics/networked-physics/ there's an entry on his blog that has links to loads of other sources of great information about multiplayer stuff - The Quake source, OpenTNL etc. etc.

I've written a fair amount of AS3 code that does some of this but it's all still pretty alpha. I've never used smartfox so can't really pass judgement but i've heard good things - i write everything in java and use Red5 as it provides a load of other flash-related usefulness as well as being able to script in javascript, python etc (in the interest of full disclosure i should say i work for Infrared5 who are sort of the people behind Red5, so i'm completely biased in this regard - but it is good once you know a little bit about it). Feel free to contact me offlist if you'd like to discuss the multiplayer side of things as it's a little OT for this list.

good luck and have fun

T


On Thu, Nov 5, 2009 at 9:29 AM, Chris Hecker <[hidden email]> wrote:

Yeah, it didn't sound like it was actual UDP sockets, it sounded like some dumb Adobe crap.  :)

Chris



Nicolas Cannasse wrote:
Tarwin Stroh-Spijer a écrit :
Flash does do some UDP stuff with FP10. Video / audio go by non-safe routing (can be dropped) and "messages" are handled to be somehow "safe". Only problem is it's only peer-to-peer as far as I know ...

And it's only supported in proprietary FlashMediaServer as far as I know ;)

Nicolas


--
haXe - an open source web programming language
http://haxe.org



--
Trevor Burton
http://www.flashmonkey.org
http://www.infrared5.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Robin Palotai
In reply to this post by Tony Polinelli
1,
Last time I played with Stratus (the p2p mediator from Adobe) it had
an Eula telling me it is in beta, can change anytime, etc. While using
p2p to distribute load from the server sounds fun, right now I would
not be happy if Adobe suddenly pulled stratus from under my apps.

(or can you have an own flash media server running the mediator
service? I don't know that).

If interestedhowever, I have some Stratus code around to get started
with in Haxe

2,
A question: did you run custom neko server on Amazon? Which service?

Robin

On Thu, Nov 5, 2009 at 9:10 AM, Tony Polinelli <[hidden email]> wrote:

>
> That was another thing - flash 10 now supports udp for peer-to-peer
> connections, any thoughts on this? its a pretty new & not widely used
> feature as far as i can find. A friend of ours who made the game bunni is
> using it for his multiplayer setup - quite interesting. He looked at haxe
> for a while, but just decided to use php.
>
>
>
>
> On Thu, Nov 5, 2009 at 6:54 PM, Chris Hecker <[hidden email]> wrote:
>>
>> When I was looking into doing a flash multiplayer game, I was going to
>> write the server in C and the client in haxe with a custom sockets protocol
>> (too bad flash doesn't support udp).  This is partly because I'm old and
>> conservative, and partly because I was worried about performance scaling and
>> control over the server/protocol.  That said, the jvm is pretty fast now
>> with hotspot, and smartfox says it scales well.  I also don't trust things
>> like built-in remoting because they tend to have tons of overhead compared
>> to custom protocols.  That said, you can obviously switch it out later if
>> it's a bottleneck, premature optimization and all that.
>>
>> Chris
>>
>>
>>
>> Tony Polinelli wrote:
>>>
>>> ps - we just had a play with the chat example - worked first time,
>>> reeeally amazing. great work! ;P
>>>
>>>
>>>
>>> On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli <[hidden email]
>>> <mailto:[hidden email]>> wrote:
>>>
>>>    Hi,
>>>
>>>    we are currently designing a multiplayer flash game, and i'm
>>>    wondering has anyone used haxe for multiplayer games much?
>>>
>>>    There will be a meeting area, where users can chat & lineup games -
>>>    similar to the www.ff0000.com <http://www.ff0000.com> website. the
>>>    game will then be a turnbased box2d setup - kinda similar to worms.
>>>
>>>    I am looking at the chat example http://haxe.org/doc/flash/chat and
>>>    things look pretty simple there - has anyone used this as a basis
>>>    for a game? if so, are there any obvious restrictions / performance
>>>    issues i should look out for? I havent hosted a neko app before, the
>>>    current fb app uses amazon storage & s3 - can this host neko? there
>>>    isnt a way to use php as the socket server is there? - as it doesnt
>>>    have the ThreadRemotingServer
>>>
>>>    I am thinking that i will send information about an event, then let
>>>    box2d rollout the simulation, then when things settle down, do a
>>>    refresh of the changes to the world - as the simulations will be
>>>    slightly different on each client. I am assuming that it would be
>>>    too much to send much more informations (per frame for example), as
>>>    there will be 50-100 objects - but only 1 moving most of the time.
>>>    hmmm. I'll have to look into how to make network games a little more
>>> ;P
>>>
>>>    So, does anyone have anything more than this example? and/or know of
>>>    other solutions - as3 isnt totally ruled out as the rest of the
>>>    existing projects work is in as3 - but am wondering if there are any
>>>    major benefits to something like smartfox server?
>>>
>>>    sorry for the spillage of questions ;P
>>>
>>>    thanks in advance
>>>
>>>
>>>    --    Tony Polinelli
>>>    http://touchmypixel.com
>>>
>>>
>>>
>>>
>>> --
>>> Tony Polinelli
>>> http://touchmypixel.com
>>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
>
> --
> Tony Polinelli
> http://touchmypixel.com
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Tony Polinelli
>Trevor
Thanks for your comments - i'll read up on Glenn Fieldings site - i've seen it before, but now it seems a bit more relevant ;P.  I'm playing with a small test right now - i guess that i should send the events through to the server and then it relays messages back to me - even to move my own player. I didnt think of running a physics simulation on the server - that might be a little bit of overkill for it - i'll just pass events through - have a dominant simulation on the client, maybe flicking which is dominant (as its a turn based game)

>Robin
the game currently uses http://aws.amazon.com/ec2/ to host their php - its the coincan facebook app - we just do the flash work, so i might have to work with their existing server setup, thats why it would be interesting to setup neko here

hope to get a veery basic little game test working in a few hours- pumped! ;P




On Thu, Nov 5, 2009 at 9:09 PM, Robin Palotai <[hidden email]> wrote:
1,
Last time I played with Stratus (the p2p mediator from Adobe) it had
an Eula telling me it is in beta, can change anytime, etc. While using
p2p to distribute load from the server sounds fun, right now I would
not be happy if Adobe suddenly pulled stratus from under my apps.

(or can you have an own flash media server running the mediator
service? I don't know that).

If interestedhowever, I have some Stratus code around to get started
with in Haxe

2,
A question: did you run custom neko server on Amazon? Which service?

Robin

On Thu, Nov 5, 2009 at 9:10 AM, Tony Polinelli <[hidden email]> wrote:
>
> That was another thing - flash 10 now supports udp for peer-to-peer
> connections, any thoughts on this? its a pretty new & not widely used
> feature as far as i can find. A friend of ours who made the game bunni is
> using it for his multiplayer setup - quite interesting. He looked at haxe
> for a while, but just decided to use php.
>
>
>
>
> On Thu, Nov 5, 2009 at 6:54 PM, Chris Hecker <[hidden email]> wrote:
>>
>> When I was looking into doing a flash multiplayer game, I was going to
>> write the server in C and the client in haxe with a custom sockets protocol
>> (too bad flash doesn't support udp).  This is partly because I'm old and
>> conservative, and partly because I was worried about performance scaling and
>> control over the server/protocol.  That said, the jvm is pretty fast now
>> with hotspot, and smartfox says it scales well.  I also don't trust things
>> like built-in remoting because they tend to have tons of overhead compared
>> to custom protocols.  That said, you can obviously switch it out later if
>> it's a bottleneck, premature optimization and all that.
>>
>> Chris
>>
>>
>>
>> Tony Polinelli wrote:
>>>
>>> ps - we just had a play with the chat example - worked first time,
>>> reeeally amazing. great work! ;P
>>>
>>>
>>>
>>> On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli <[hidden email]
>>> <mailto:[hidden email]>> wrote:
>>>
>>>    Hi,
>>>
>>>    we are currently designing a multiplayer flash game, and i'm
>>>    wondering has anyone used haxe for multiplayer games much?
>>>
>>>    There will be a meeting area, where users can chat & lineup games -
>>>    similar to the www.ff0000.com <http://www.ff0000.com> website. the
>>>    game will then be a turnbased box2d setup - kinda similar to worms.
>>>
>>>    I am looking at the chat example http://haxe.org/doc/flash/chat and
>>>    things look pretty simple there - has anyone used this as a basis
>>>    for a game? if so, are there any obvious restrictions / performance
>>>    issues i should look out for? I havent hosted a neko app before, the
>>>    current fb app uses amazon storage & s3 - can this host neko? there
>>>    isnt a way to use php as the socket server is there? - as it doesnt
>>>    have the ThreadRemotingServer
>>>
>>>    I am thinking that i will send information about an event, then let
>>>    box2d rollout the simulation, then when things settle down, do a
>>>    refresh of the changes to the world - as the simulations will be
>>>    slightly different on each client. I am assuming that it would be
>>>    too much to send much more informations (per frame for example), as
>>>    there will be 50-100 objects - but only 1 moving most of the time.
>>>    hmmm. I'll have to look into how to make network games a little more
>>> ;P
>>>
>>>    So, does anyone have anything more than this example? and/or know of
>>>    other solutions - as3 isnt totally ruled out as the rest of the
>>>    existing projects work is in as3 - but am wondering if there are any
>>>    major benefits to something like smartfox server?
>>>
>>>    sorry for the spillage of questions ;P
>>>
>>>    thanks in advance
>>>
>>>
>>>    --    Tony Polinelli
>>>    http://touchmypixel.com
>>>
>>>
>>>
>>>
>>> --
>>> Tony Polinelli
>>> http://touchmypixel.com
>>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
>
> --
> Tony Polinelli
> http://touchmypixel.com
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Tony Polinelli
I am sending the positions of some objects - x,y,velocity x, velocity y, id,   and the socket message size peaks out at about 60 objects (4 kb) 

So, i dont think that this is a restriction of the flash XMLSocket - but the SocketProtocol - This seems quite a restriction- maybe i am going about things incorrectly, but for updating the positions of a lot of objects (over 60) it seems really hacky to have to split the call over multiple messages.

what should i do?



On Thu, Nov 5, 2009 at 9:24 PM, Tony Polinelli <[hidden email]> wrote:
>Trevor
Thanks for your comments - i'll read up on Glenn Fieldings site - i've seen it before, but now it seems a bit more relevant ;P.  I'm playing with a small test right now - i guess that i should send the events through to the server and then it relays messages back to me - even to move my own player. I didnt think of running a physics simulation on the server - that might be a little bit of overkill for it - i'll just pass events through - have a dominant simulation on the client, maybe flicking which is dominant (as its a turn based game)

>Robin
the game currently uses http://aws.amazon.com/ec2/ to host their php - its the coincan facebook app - we just do the flash work, so i might have to work with their existing server setup, thats why it would be interesting to setup neko here

hope to get a veery basic little game test working in a few hours- pumped! ;P





On Thu, Nov 5, 2009 at 9:09 PM, Robin Palotai <[hidden email]> wrote:
1,
Last time I played with Stratus (the p2p mediator from Adobe) it had
an Eula telling me it is in beta, can change anytime, etc. While using
p2p to distribute load from the server sounds fun, right now I would
not be happy if Adobe suddenly pulled stratus from under my apps.

(or can you have an own flash media server running the mediator
service? I don't know that).

If interestedhowever, I have some Stratus code around to get started
with in Haxe

2,
A question: did you run custom neko server on Amazon? Which service?

Robin

On Thu, Nov 5, 2009 at 9:10 AM, Tony Polinelli <[hidden email]> wrote:
>
> That was another thing - flash 10 now supports udp for peer-to-peer
> connections, any thoughts on this? its a pretty new & not widely used
> feature as far as i can find. A friend of ours who made the game bunni is
> using it for his multiplayer setup - quite interesting. He looked at haxe
> for a while, but just decided to use php.
>
>
>
>
> On Thu, Nov 5, 2009 at 6:54 PM, Chris Hecker <[hidden email]> wrote:
>>
>> When I was looking into doing a flash multiplayer game, I was going to
>> write the server in C and the client in haxe with a custom sockets protocol
>> (too bad flash doesn't support udp).  This is partly because I'm old and
>> conservative, and partly because I was worried about performance scaling and
>> control over the server/protocol.  That said, the jvm is pretty fast now
>> with hotspot, and smartfox says it scales well.  I also don't trust things
>> like built-in remoting because they tend to have tons of overhead compared
>> to custom protocols.  That said, you can obviously switch it out later if
>> it's a bottleneck, premature optimization and all that.
>>
>> Chris
>>
>>
>>
>> Tony Polinelli wrote:
>>>
>>> ps - we just had a play with the chat example - worked first time,
>>> reeeally amazing. great work! ;P
>>>
>>>
>>>
>>> On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli <[hidden email]
>>> <mailto:[hidden email]>> wrote:
>>>
>>>    Hi,
>>>
>>>    we are currently designing a multiplayer flash game, and i'm
>>>    wondering has anyone used haxe for multiplayer games much?
>>>
>>>    There will be a meeting area, where users can chat & lineup games -
>>>    similar to the www.ff0000.com <http://www.ff0000.com> website. the
>>>    game will then be a turnbased box2d setup - kinda similar to worms.
>>>
>>>    I am looking at the chat example http://haxe.org/doc/flash/chat and
>>>    things look pretty simple there - has anyone used this as a basis
>>>    for a game? if so, are there any obvious restrictions / performance
>>>    issues i should look out for? I havent hosted a neko app before, the
>>>    current fb app uses amazon storage & s3 - can this host neko? there
>>>    isnt a way to use php as the socket server is there? - as it doesnt
>>>    have the ThreadRemotingServer
>>>
>>>    I am thinking that i will send information about an event, then let
>>>    box2d rollout the simulation, then when things settle down, do a
>>>    refresh of the changes to the world - as the simulations will be
>>>    slightly different on each client. I am assuming that it would be
>>>    too much to send much more informations (per frame for example), as
>>>    there will be 50-100 objects - but only 1 moving most of the time.
>>>    hmmm. I'll have to look into how to make network games a little more
>>> ;P
>>>
>>>    So, does anyone have anything more than this example? and/or know of
>>>    other solutions - as3 isnt totally ruled out as the rest of the
>>>    existing projects work is in as3 - but am wondering if there are any
>>>    major benefits to something like smartfox server?
>>>
>>>    sorry for the spillage of questions ;P
>>>
>>>    thanks in advance
>>>
>>>
>>>    --    Tony Polinelli
>>>    http://touchmypixel.com
>>>
>>>
>>>
>>>
>>> --
>>> Tony Polinelli
>>> http://touchmypixel.com
>>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
>
> --
> Tony Polinelli
> http://touchmypixel.com
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Michael Baczynski-2
On 05.11.2009 14:38, Tony Polinelli wrote:

> I am sending the positions of some objects - x,y,velocity x, velocity
> y, id,   and the socket message size peaks out at about 60 objects (4 kb)
>
> So, i dont think that this is a restriction of the flash XMLSocket -
> but the SocketProtocol - This seems quite a restriction- maybe i am
> going about things incorrectly, but for updating the positions of a
> lot of objects (over 60) it seems really hacky to have to split the
> call over multiple messages.
>
> what should i do?
>

you could implement some kind of delta compression - send only data that
has changed. but I think the only feasible way is to run the same
simulation on the server and on the client and only send the user input
to the server.

>
>
> On Thu, Nov 5, 2009 at 9:24 PM, Tony Polinelli <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     >Trevor
>     Thanks for your comments - i'll read up on Glenn Fieldings site -
>     i've seen it before, but now it seems a bit more relevant ;P.  I'm
>     playing with a small test right now - i guess that i should send
>     the events through to the server and then it relays messages back
>     to me - even to move my own player. I didnt think of running a
>     physics simulation on the server - that might be a little bit of
>     overkill for it - i'll just pass events through - have a dominant
>     simulation on the client, maybe flicking which is dominant (as its
>     a turn based game)
>
>     >Robin
>     the game currently uses http://aws.amazon.com/ec2/ to host their
>     php - its the coincan facebook app - we just do the flash work, so
>     i might have to work with their existing server setup, thats why
>     it would be interesting to setup neko here
>
>     hope to get a veery basic little game test working in a few hours-
>     pumped! ;P
>
>
>
>
>
>     On Thu, Nov 5, 2009 at 9:09 PM, Robin Palotai
>     <[hidden email] <mailto:[hidden email]>> wrote:
>
>         1,
>         Last time I played with Stratus (the p2p mediator from Adobe)
>         it had
>         an Eula telling me it is in beta, can change anytime, etc.
>         While using
>         p2p to distribute load from the server sounds fun, right now I
>         would
>         not be happy if Adobe suddenly pulled stratus from under my apps.
>
>         (or can you have an own flash media server running the mediator
>         service? I don't know that).
>
>         If interestedhowever, I have some Stratus code around to get
>         started
>         with in Haxe
>
>         2,
>         A question: did you run custom neko server on Amazon? Which
>         service?
>
>         Robin
>
>         On Thu, Nov 5, 2009 at 9:10 AM, Tony Polinelli
>         <[hidden email] <mailto:[hidden email]>> wrote:
>         >
>         > That was another thing - flash 10 now supports udp for
>         peer-to-peer
>         > connections, any thoughts on this? its a pretty new & not
>         widely used
>         > feature as far as i can find. A friend of ours who made the
>         game bunni is
>         > using it for his multiplayer setup - quite interesting. He
>         looked at haxe
>         > for a while, but just decided to use php.
>         >
>         >
>         >
>         >
>         > On Thu, Nov 5, 2009 at 6:54 PM, Chris Hecker <[hidden email]
>         <mailto:[hidden email]>> wrote:
>         >>
>         >> When I was looking into doing a flash multiplayer game, I
>         was going to
>         >> write the server in C and the client in haxe with a custom
>         sockets protocol
>         >> (too bad flash doesn't support udp).  This is partly
>         because I'm old and
>         >> conservative, and partly because I was worried about
>         performance scaling and
>         >> control over the server/protocol.  That said, the jvm is
>         pretty fast now
>         >> with hotspot, and smartfox says it scales well.  I also
>         don't trust things
>         >> like built-in remoting because they tend to have tons of
>         overhead compared
>         >> to custom protocols.  That said, you can obviously switch
>         it out later if
>         >> it's a bottleneck, premature optimization and all that.
>         >>
>         >> Chris
>         >>
>         >>
>         >>
>         >> Tony Polinelli wrote:
>         >>>
>         >>> ps - we just had a play with the chat example - worked
>         first time,
>         >>> reeeally amazing. great work! ;P
>         >>>
>         >>>
>         >>>
>         >>> On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli
>         <[hidden email] <mailto:[hidden email]>
>         >>> <mailto:[hidden email]
>         <mailto:[hidden email]>>> wrote:
>         >>>
>         >>>    Hi,
>         >>>
>         >>>    we are currently designing a multiplayer flash game,
>         and i'm
>         >>>    wondering has anyone used haxe for multiplayer games much?
>         >>>
>         >>>    There will be a meeting area, where users can chat &
>         lineup games -
>         >>>    similar to the www.ff0000.com <http://www.ff0000.com>
>         <http://www.ff0000.com> website. the
>         >>>    game will then be a turnbased box2d setup - kinda
>         similar to worms.
>         >>>
>         >>>    I am looking at the chat example
>         http://haxe.org/doc/flash/chat and
>         >>>    things look pretty simple there - has anyone used this
>         as a basis
>         >>>    for a game? if so, are there any obvious restrictions /
>         performance
>         >>>    issues i should look out for? I havent hosted a neko
>         app before, the
>         >>>    current fb app uses amazon storage & s3 - can this host
>         neko? there
>         >>>    isnt a way to use php as the socket server is there? -
>         as it doesnt
>         >>>    have the ThreadRemotingServer
>         >>>
>         >>>    I am thinking that i will send information about an
>         event, then let
>         >>>    box2d rollout the simulation, then when things settle
>         down, do a
>         >>>    refresh of the changes to the world - as the
>         simulations will be
>         >>>    slightly different on each client. I am assuming that
>         it would be
>         >>>    too much to send much more informations (per frame for
>         example), as
>         >>>    there will be 50-100 objects - but only 1 moving most
>         of the time.
>         >>>    hmmm. I'll have to look into how to make network games
>         a little more
>         >>> ;P
>         >>>
>         >>>    So, does anyone have anything more than this example?
>         and/or know of
>         >>>    other solutions - as3 isnt totally ruled out as the
>         rest of the
>         >>>    existing projects work is in as3 - but am wondering if
>         there are any
>         >>>    major benefits to something like smartfox server?
>         >>>
>         >>>    sorry for the spillage of questions ;P
>         >>>
>         >>>    thanks in advance
>         >>>
>         >>>
>         >>>    --    Tony Polinelli
>         >>> http://touchmypixel.com
>         >>>
>         >>>
>         >>>
>         >>>
>         >>> --
>         >>> Tony Polinelli
>         >>> http://touchmypixel.com
>         >>>
>         >>
>         >> --
>         >> haXe - an open source web programming language
>         >> http://haxe.org
>         >
>         >
>         >
>         > --
>         > Tony Polinelli
>         > http://touchmypixel.com
>         >
>         > --
>         > haXe - an open source web programming language
>         > http://haxe.org
>         >
>
>         --
>         haXe - an open source web programming language
>         http://haxe.org
>
>
>
>
>     --
>     Tony Polinelli
>     http://touchmypixel.com
>
>
>
>
> --
> Tony Polinelli
> http://touchmypixel.com


--
http://www.polygonal.de


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Tony Polinelli
surely running the simulation on the server will mean that i still have to send the position/velocity information back to the client to keep things accurate- maybe moreso, as at the moment i have certain object which are 'owned' by the local swf, which are broadcast out to the other client - and vice versa - which cuts down the lag for the local user ( the user who shot the cannonball, in this case)

I'll post up my test tomor morning - time to sleep now ;P




On Fri, Nov 6, 2009 at 1:39 AM, Michael Baczynski <[hidden email]> wrote:
On 05.11.2009 14:38, Tony Polinelli wrote:
I am sending the positions of some objects - x,y,velocity x, velocity y, id,   and the socket message size peaks out at about 60 objects (4 kb)

So, i dont think that this is a restriction of the flash XMLSocket - but the SocketProtocol - This seems quite a restriction- maybe i am going about things incorrectly, but for updating the positions of a lot of objects (over 60) it seems really hacky to have to split the call over multiple messages.

what should i do?


you could implement some kind of delta compression - send only data that has changed. but I think the only feasible way is to run the same simulation on the server and on the client and only send the user input to the server.


On Thu, Nov 5, 2009 at 9:24 PM, Tony Polinelli <[hidden email] <mailto:[hidden email]>> wrote:

   >Trevor
   Thanks for your comments - i'll read up on Glenn Fieldings site -
   i've seen it before, but now it seems a bit more relevant ;P.  I'm
   playing with a small test right now - i guess that i should send
   the events through to the server and then it relays messages back
   to me - even to move my own player. I didnt think of running a
   physics simulation on the server - that might be a little bit of
   overkill for it - i'll just pass events through - have a dominant
   simulation on the client, maybe flicking which is dominant (as its
   a turn based game)

   >Robin
   the game currently uses http://aws.amazon.com/ec2/ to host their
   php - its the coincan facebook app - we just do the flash work, so
   i might have to work with their existing server setup, thats why
   it would be interesting to setup neko here

   hope to get a veery basic little game test working in a few hours-
   pumped! ;P





   On Thu, Nov 5, 2009 at 9:09 PM, Robin Palotai
   <[hidden email] <mailto:[hidden email]>> wrote:

       1,
       Last time I played with Stratus (the p2p mediator from Adobe)
       it had
       an Eula telling me it is in beta, can change anytime, etc.
       While using
       p2p to distribute load from the server sounds fun, right now I
       would
       not be happy if Adobe suddenly pulled stratus from under my apps.

       (or can you have an own flash media server running the mediator
       service? I don't know that).

       If interestedhowever, I have some Stratus code around to get
       started
       with in Haxe

       2,
       A question: did you run custom neko server on Amazon? Which
       service?

       Robin

       On Thu, Nov 5, 2009 at 9:10 AM, Tony Polinelli
       <[hidden email] <mailto:[hidden email]>> wrote:
       >
       > That was another thing - flash 10 now supports udp for
       peer-to-peer
       > connections, any thoughts on this? its a pretty new & not
       widely used
       > feature as far as i can find. A friend of ours who made the
       game bunni is
       > using it for his multiplayer setup - quite interesting. He
       looked at haxe
       > for a while, but just decided to use php.
       >
       >
       >
       >
       > On Thu, Nov 5, 2009 at 6:54 PM, Chris Hecker <[hidden email]
       <mailto:[hidden email]>> wrote:
       >>
       >> When I was looking into doing a flash multiplayer game, I
       was going to
       >> write the server in C and the client in haxe with a custom
       sockets protocol
       >> (too bad flash doesn't support udp).  This is partly
       because I'm old and
       >> conservative, and partly because I was worried about
       performance scaling and
       >> control over the server/protocol.  That said, the jvm is
       pretty fast now
       >> with hotspot, and smartfox says it scales well.  I also
       don't trust things
       >> like built-in remoting because they tend to have tons of
       overhead compared
       >> to custom protocols.  That said, you can obviously switch
       it out later if
       >> it's a bottleneck, premature optimization and all that.
       >>
       >> Chris
       >>
       >>
       >>
       >> Tony Polinelli wrote:
       >>>
       >>> ps - we just had a play with the chat example - worked
       first time,
       >>> reeeally amazing. great work! ;P
       >>>
       >>>
       >>>
       >>> On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli
       <[hidden email] <mailto:[hidden email]>
       >>> <mailto:[hidden email]

       <mailto:[hidden email]>>> wrote:
       >>>
       >>>    Hi,
       >>>
       >>>    we are currently designing a multiplayer flash game,
       and i'm
       >>>    wondering has anyone used haxe for multiplayer games much?
       >>>
       >>>    There will be a meeting area, where users can chat &
       lineup games -
       >>>    similar to the www.ff0000.com <http://www.ff0000.com>
       <http://www.ff0000.com> website. the
       >>>    game will then be a turnbased box2d setup - kinda
       similar to worms.
       >>>
       >>>    I am looking at the chat example
       http://haxe.org/doc/flash/chat and
       >>>    things look pretty simple there - has anyone used this
       as a basis
       >>>    for a game? if so, are there any obvious restrictions /
       performance
       >>>    issues i should look out for? I havent hosted a neko
       app before, the
       >>>    current fb app uses amazon storage & s3 - can this host
       neko? there
       >>>    isnt a way to use php as the socket server is there? -
       as it doesnt
       >>>    have the ThreadRemotingServer
       >>>
       >>>    I am thinking that i will send information about an
       event, then let
       >>>    box2d rollout the simulation, then when things settle
       down, do a
       >>>    refresh of the changes to the world - as the
       simulations will be
       >>>    slightly different on each client. I am assuming that
       it would be
       >>>    too much to send much more informations (per frame for
       example), as
       >>>    there will be 50-100 objects - but only 1 moving most
       of the time.
       >>>    hmmm. I'll have to look into how to make network games
       a little more
       >>> ;P
       >>>
       >>>    So, does anyone have anything more than this example?
       and/or know of
       >>>    other solutions - as3 isnt totally ruled out as the
       rest of the
       >>>    existing projects work is in as3 - but am wondering if
       there are any
       >>>    major benefits to something like smartfox server?
       >>>
       >>>    sorry for the spillage of questions ;P
       >>>
       >>>    thanks in advance
       >>>
       >>>
       >>>    --    Tony Polinelli
       >>> http://touchmypixel.com
       >>>
       >>>
       >>>
       >>>
       >>> --
       >>> Tony Polinelli
       >>> http://touchmypixel.com
       >>>
       >>
       >> --
       >> haXe - an open source web programming language
       >> http://haxe.org
       >
       >
       >
       > --
       > Tony Polinelli
       > http://touchmypixel.com
       >
       > --
       > haXe - an open source web programming language
       > http://haxe.org
       >

       --
       haXe - an open source web programming language
       http://haxe.org




   --    Tony Polinelli
   http://touchmypixel.com




--
Tony Polinelli
http://touchmypixel.com


--
http://www.polygonal.de


--
haXe - an open source web programming language
http://haxe.org



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Max S-3
In reply to this post by Tony Polinelli
you could also split it into a few messages, for example sending each
object change in different message

2009/11/5 Tony Polinelli <[hidden email]>:

> I am sending the positions of some objects - x,y,velocity x, velocity y,
> id,   and the socket message size peaks out at about 60 objects (4 kb)
>
> So, i dont think that this is a restriction of the flash XMLSocket - but the
> SocketProtocol - This seems quite a restriction- maybe i am going about
> things incorrectly, but for updating the positions of a lot of objects (over
> 60) it seems really hacky to have to split the call over multiple messages.
>
> what should i do?
>
>
>
> On Thu, Nov 5, 2009 at 9:24 PM, Tony Polinelli <[hidden email]>
> wrote:
>>
>> >Trevor
>> Thanks for your comments - i'll read up on Glenn Fieldings site - i've
>> seen it before, but now it seems a bit more relevant ;P.  I'm playing with a
>> small test right now - i guess that i should send the events through to the
>> server and then it relays messages back to me - even to move my own player.
>> I didnt think of running a physics simulation on the server - that might be
>> a little bit of overkill for it - i'll just pass events through - have a
>> dominant simulation on the client, maybe flicking which is dominant (as its
>> a turn based game)
>>
>> >Robin
>> the game currently uses http://aws.amazon.com/ec2/ to host their php - its
>> the coincan facebook app - we just do the flash work, so i might have to
>> work with their existing server setup, thats why it would be interesting to
>> setup neko here
>>
>> hope to get a veery basic little game test working in a few hours- pumped!
>> ;P
>>
>>
>>
>>
>> On Thu, Nov 5, 2009 at 9:09 PM, Robin Palotai <[hidden email]>
>> wrote:
>>>
>>> 1,
>>> Last time I played with Stratus (the p2p mediator from Adobe) it had
>>> an Eula telling me it is in beta, can change anytime, etc. While using
>>> p2p to distribute load from the server sounds fun, right now I would
>>> not be happy if Adobe suddenly pulled stratus from under my apps.
>>>
>>> (or can you have an own flash media server running the mediator
>>> service? I don't know that).
>>>
>>> If interestedhowever, I have some Stratus code around to get started
>>> with in Haxe
>>>
>>> 2,
>>> A question: did you run custom neko server on Amazon? Which service?
>>>
>>> Robin
>>>
>>> On Thu, Nov 5, 2009 at 9:10 AM, Tony Polinelli <[hidden email]>
>>> wrote:
>>> >
>>> > That was another thing - flash 10 now supports udp for peer-to-peer
>>> > connections, any thoughts on this? its a pretty new & not widely used
>>> > feature as far as i can find. A friend of ours who made the game bunni
>>> > is
>>> > using it for his multiplayer setup - quite interesting. He looked at
>>> > haxe
>>> > for a while, but just decided to use php.
>>> >
>>> >
>>> >
>>> >
>>> > On Thu, Nov 5, 2009 at 6:54 PM, Chris Hecker <[hidden email]> wrote:
>>> >>
>>> >> When I was looking into doing a flash multiplayer game, I was going to
>>> >> write the server in C and the client in haxe with a custom sockets
>>> >> protocol
>>> >> (too bad flash doesn't support udp).  This is partly because I'm old
>>> >> and
>>> >> conservative, and partly because I was worried about performance
>>> >> scaling and
>>> >> control over the server/protocol.  That said, the jvm is pretty fast
>>> >> now
>>> >> with hotspot, and smartfox says it scales well.  I also don't trust
>>> >> things
>>> >> like built-in remoting because they tend to have tons of overhead
>>> >> compared
>>> >> to custom protocols.  That said, you can obviously switch it out later
>>> >> if
>>> >> it's a bottleneck, premature optimization and all that.
>>> >>
>>> >> Chris
>>> >>
>>> >>
>>> >>
>>> >> Tony Polinelli wrote:
>>> >>>
>>> >>> ps - we just had a play with the chat example - worked first time,
>>> >>> reeeally amazing. great work! ;P
>>> >>>
>>> >>>
>>> >>>
>>> >>> On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli
>>> >>> <[hidden email]
>>> >>> <mailto:[hidden email]>> wrote:
>>> >>>
>>> >>>    Hi,
>>> >>>
>>> >>>    we are currently designing a multiplayer flash game, and i'm
>>> >>>    wondering has anyone used haxe for multiplayer games much?
>>> >>>
>>> >>>    There will be a meeting area, where users can chat & lineup games
>>> >>> -
>>> >>>    similar to the www.ff0000.com <http://www.ff0000.com> website. the
>>> >>>    game will then be a turnbased box2d setup - kinda similar to
>>> >>> worms.
>>> >>>
>>> >>>    I am looking at the chat example http://haxe.org/doc/flash/chat
>>> >>> and
>>> >>>    things look pretty simple there - has anyone used this as a basis
>>> >>>    for a game? if so, are there any obvious restrictions /
>>> >>> performance
>>> >>>    issues i should look out for? I havent hosted a neko app before,
>>> >>> the
>>> >>>    current fb app uses amazon storage & s3 - can this host neko?
>>> >>> there
>>> >>>    isnt a way to use php as the socket server is there? - as it
>>> >>> doesnt
>>> >>>    have the ThreadRemotingServer
>>> >>>
>>> >>>    I am thinking that i will send information about an event, then
>>> >>> let
>>> >>>    box2d rollout the simulation, then when things settle down, do a
>>> >>>    refresh of the changes to the world - as the simulations will be
>>> >>>    slightly different on each client. I am assuming that it would be
>>> >>>    too much to send much more informations (per frame for example),
>>> >>> as
>>> >>>    there will be 50-100 objects - but only 1 moving most of the time.
>>> >>>    hmmm. I'll have to look into how to make network games a little
>>> >>> more
>>> >>> ;P
>>> >>>
>>> >>>    So, does anyone have anything more than this example? and/or know
>>> >>> of
>>> >>>    other solutions - as3 isnt totally ruled out as the rest of the
>>> >>>    existing projects work is in as3 - but am wondering if there are
>>> >>> any
>>> >>>    major benefits to something like smartfox server?
>>> >>>
>>> >>>    sorry for the spillage of questions ;P
>>> >>>
>>> >>>    thanks in advance
>>> >>>
>>> >>>
>>> >>>    --    Tony Polinelli
>>> >>>    http://touchmypixel.com
>>> >>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> Tony Polinelli
>>> >>> http://touchmypixel.com
>>> >>>
>>> >>
>>> >> --
>>> >> haXe - an open source web programming language
>>> >> http://haxe.org
>>> >
>>> >
>>> >
>>> > --
>>> > Tony Polinelli
>>> > http://touchmypixel.com
>>> >
>>> > --
>>> > haXe - an open source web programming language
>>> > http://haxe.org
>>> >
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>
>>
>>
>> --
>> Tony Polinelli
>> http://touchmypixel.com
>
>
>
> --
> Tony Polinelli
> http://touchmypixel.com
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Trevor Burton
Yes, whatever setup you use you still have to distribute state information about each object that needs to be tracked to each client that needs to track it.

4kb for 60 objects is a bit bloated - you can get some bandwidth back here by using a different approach for your messaging protocol.

If you're sending 4 32-bit floats (x, y, vx, vy) and an id (which i'll assume is another 32-float) you're sending 5 x 4 bytes = 20 bytes

so for 60 objects that'd be 1200 bytes or 1.17kb (or thereabouts) so you can definately save some space here.

You could also cut down on the number of objects that need updating and how often they need updating. I'm not sure what the game looks like but you can cut out objects out of FOV of the player in a first person game. Cut down on the frequency of updates of objects further away from the player etc.etc.

This is where having a server simulation that clients try to sync to has an advantage. The server can do the heavy lifting of deciding who needs updates and how often with some sort of 'relevant set' heuristics for each client (line-of-sight, distance to objects etc).

If you send updates less often you can 'smooth' the movement of the objects in between updates giving the impression they're still moving.

Also, as far as sending input goes, you only need to send CHANGES in input. when a user presses a key, send that, when they release the key, send that... if you send the input back to the client then the client can carry on calculating each object's position from their input and then just snap or smooth when they receive an update from the server.

I cut my teeth on gambling games, where i had it drilled into me about having the server be authoritative, but there are situations and reason why having clients be in charge can be useful, but it can make things more complicated so you do have to be careful and weigh the pros and cons.

There's lots to try - which is all part of the fun :)

T

On Thu, Nov 5, 2009 at 2:51 PM, Max S <[hidden email]> wrote:
you could also split it into a few messages, for example sending each
object change in different message

2009/11/5 Tony Polinelli <[hidden email]>:
> I am sending the positions of some objects - x,y,velocity x, velocity y,
> id,   and the socket message size peaks out at about 60 objects (4 kb)
>
> So, i dont think that this is a restriction of the flash XMLSocket - but the
> SocketProtocol - This seems quite a restriction- maybe i am going about
> things incorrectly, but for updating the positions of a lot of objects (over
> 60) it seems really hacky to have to split the call over multiple messages.
>
> what should i do?
>
>
>
> On Thu, Nov 5, 2009 at 9:24 PM, Tony Polinelli <[hidden email]>
> wrote:
>>
>> >Trevor
>> Thanks for your comments - i'll read up on Glenn Fieldings site - i've
>> seen it before, but now it seems a bit more relevant ;P.  I'm playing with a
>> small test right now - i guess that i should send the events through to the
>> server and then it relays messages back to me - even to move my own player.
>> I didnt think of running a physics simulation on the server - that might be
>> a little bit of overkill for it - i'll just pass events through - have a
>> dominant simulation on the client, maybe flicking which is dominant (as its
>> a turn based game)
>>
>> >Robin
>> the game currently uses http://aws.amazon.com/ec2/ to host their php - its
>> the coincan facebook app - we just do the flash work, so i might have to
>> work with their existing server setup, thats why it would be interesting to
>> setup neko here
>>
>> hope to get a veery basic little game test working in a few hours- pumped!
>> ;P
>>
>>
>>
>>
>> On Thu, Nov 5, 2009 at 9:09 PM, Robin Palotai <[hidden email]>
>> wrote:
>>>
>>> 1,
>>> Last time I played with Stratus (the p2p mediator from Adobe) it had
>>> an Eula telling me it is in beta, can change anytime, etc. While using
>>> p2p to distribute load from the server sounds fun, right now I would
>>> not be happy if Adobe suddenly pulled stratus from under my apps.
>>>
>>> (or can you have an own flash media server running the mediator
>>> service? I don't know that).
>>>
>>> If interestedhowever, I have some Stratus code around to get started
>>> with in Haxe
>>>
>>> 2,
>>> A question: did you run custom neko server on Amazon? Which service?
>>>
>>> Robin
>>>
>>> On Thu, Nov 5, 2009 at 9:10 AM, Tony Polinelli <[hidden email]>
>>> wrote:
>>> >
>>> > That was another thing - flash 10 now supports udp for peer-to-peer
>>> > connections, any thoughts on this? its a pretty new & not widely used
>>> > feature as far as i can find. A friend of ours who made the game bunni
>>> > is
>>> > using it for his multiplayer setup - quite interesting. He looked at
>>> > haxe
>>> > for a while, but just decided to use php.
>>> >
>>> >
>>> >
>>> >
>>> > On Thu, Nov 5, 2009 at 6:54 PM, Chris Hecker <[hidden email]> wrote:
>>> >>
>>> >> When I was looking into doing a flash multiplayer game, I was going to
>>> >> write the server in C and the client in haxe with a custom sockets
>>> >> protocol
>>> >> (too bad flash doesn't support udp).  This is partly because I'm old
>>> >> and
>>> >> conservative, and partly because I was worried about performance
>>> >> scaling and
>>> >> control over the server/protocol.  That said, the jvm is pretty fast
>>> >> now
>>> >> with hotspot, and smartfox says it scales well.  I also don't trust
>>> >> things
>>> >> like built-in remoting because they tend to have tons of overhead
>>> >> compared
>>> >> to custom protocols.  That said, you can obviously switch it out later
>>> >> if
>>> >> it's a bottleneck, premature optimization and all that.
>>> >>
>>> >> Chris
>>> >>
>>> >>
>>> >>
>>> >> Tony Polinelli wrote:
>>> >>>
>>> >>> ps - we just had a play with the chat example - worked first time,
>>> >>> reeeally amazing. great work! ;P
>>> >>>
>>> >>>
>>> >>>
>>> >>> On Thu, Nov 5, 2009 at 6:15 PM, Tony Polinelli
>>> >>> <[hidden email]
>>> >>> <mailto:[hidden email]>> wrote:
>>> >>>
>>> >>>    Hi,
>>> >>>
>>> >>>    we are currently designing a multiplayer flash game, and i'm
>>> >>>    wondering has anyone used haxe for multiplayer games much?
>>> >>>
>>> >>>    There will be a meeting area, where users can chat & lineup games
>>> >>> -
>>> >>>    similar to the www.ff0000.com <http://www.ff0000.com> website. the
>>> >>>    game will then be a turnbased box2d setup - kinda similar to
>>> >>> worms.
>>> >>>
>>> >>>    I am looking at the chat example http://haxe.org/doc/flash/chat
>>> >>> and
>>> >>>    things look pretty simple there - has anyone used this as a basis
>>> >>>    for a game? if so, are there any obvious restrictions /
>>> >>> performance
>>> >>>    issues i should look out for? I havent hosted a neko app before,
>>> >>> the
>>> >>>    current fb app uses amazon storage & s3 - can this host neko?
>>> >>> there
>>> >>>    isnt a way to use php as the socket server is there? - as it
>>> >>> doesnt
>>> >>>    have the ThreadRemotingServer
>>> >>>
>>> >>>    I am thinking that i will send information about an event, then
>>> >>> let
>>> >>>    box2d rollout the simulation, then when things settle down, do a
>>> >>>    refresh of the changes to the world - as the simulations will be
>>> >>>    slightly different on each client. I am assuming that it would be
>>> >>>    too much to send much more informations (per frame for example),
>>> >>> as
>>> >>>    there will be 50-100 objects - but only 1 moving most of the time.
>>> >>>    hmmm. I'll have to look into how to make network games a little
>>> >>> more
>>> >>> ;P
>>> >>>
>>> >>>    So, does anyone have anything more than this example? and/or know
>>> >>> of
>>> >>>    other solutions - as3 isnt totally ruled out as the rest of the
>>> >>>    existing projects work is in as3 - but am wondering if there are
>>> >>> any
>>> >>>    major benefits to something like smartfox server?
>>> >>>
>>> >>>    sorry for the spillage of questions ;P
>>> >>>
>>> >>>    thanks in advance
>>> >>>
>>> >>>
>>> >>>    --    Tony Polinelli
>>> >>>    http://touchmypixel.com
>>> >>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> Tony Polinelli
>>> >>> http://touchmypixel.com
>>> >>>
>>> >>
>>> >> --
>>> >> haXe - an open source web programming language
>>> >> http://haxe.org
>>> >
>>> >
>>> >
>>> > --
>>> > Tony Polinelli
>>> > http://touchmypixel.com
>>> >
>>> > --
>>> > haXe - an open source web programming language
>>> > http://haxe.org
>>> >
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>
>>
>>
>> --
>> Tony Polinelli
>> http://touchmypixel.com
>
>
>
> --
> Tony Polinelli
> http://touchmypixel.com
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org



--
Trevor Burton
http://www.flashmonkey.org
http://www.infrared5.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Jason Plum
I am sending the positions of some objects - x,y,velocity x, velocity y, id,   and the socket message size peaks out at about 60 objects (4 kb)

So, i dont think that this is a restriction of the flash XMLSocket - but the SocketProtocol - This seems quite a restriction- maybe i am going about things incorrectly, but for updating the positions of a lot of objects (over 60) it seems really hacky to have to split the call over multiple messages.

what should i do?


you could implement some kind of delta compression - send only data that has changed. but I think the only feasible way is to run the same simulation on the server and on the client and only send the user input to the server.
 For the game I own, WarheadsSE (hence the email addy ;) ), albeit it non-flash, we do the full simulations on each client and only send the effectors at the instantiation of the action. Then, we compare end results from each client to ensure sync has remained. Conserves greatly on bandwidth, and has served us well for a *very* long time.
--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Robin Palotai
Beware that because of the TCP Socket connection, you may not be able
to achieve near-real time updates in fast action games. There are
mechanisms in TCP that jam the line from time to time.

Robin

On Fri, Nov 6, 2009 at 7:37 PM, Jason Plum <[hidden email]> wrote:

>>> I am sending the positions of some objects - x,y,velocity x, velocity y,
>>> id,   and the socket message size peaks out at about 60 objects (4 kb)
>>>
>>> So, i dont think that this is a restriction of the flash XMLSocket - but
>>> the SocketProtocol - This seems quite a restriction- maybe i am going about
>>> things incorrectly, but for updating the positions of a lot of objects (over
>>> 60) it seems really hacky to have to split the call over multiple messages.
>>>
>>> what should i do?
>>>
>>
>> you could implement some kind of delta compression - send only data that
>> has changed. but I think the only feasible way is to run the same simulation
>> on the server and on the client and only send the user input to the server.
>
>  For the game I own, WarheadsSE (hence the email addy ;) ), albeit it
> non-flash, we do the full simulations on each client and only send the
> effectors at the instantiation of the action. Then, we compare end results
> from each client to ensure sync has remained. Conserves greatly on
> bandwidth, and has served us well for a *very* long time.
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: haxe Multiplayer game

Jason Plum
I should add "at the end of the turn" for the sync checks..

On Sat, Nov 7, 2009 at 3:40 AM, Robin Palotai <[hidden email]> wrote:
Beware that because of the TCP Socket connection, you may not be able
to achieve near-real time updates in fast action games. There are
mechanisms in TCP that jam the line from time to time.

Robin

On Fri, Nov 6, 2009 at 7:37 PM, Jason Plum <[hidden email]> wrote:
>>> I am sending the positions of some objects - x,y,velocity x, velocity y,
>>> id,   and the socket message size peaks out at about 60 objects (4 kb)
>>>
>>> So, i dont think that this is a restriction of the flash XMLSocket - but
>>> the SocketProtocol - This seems quite a restriction- maybe i am going about
>>> things incorrectly, but for updating the positions of a lot of objects (over
>>> 60) it seems really hacky to have to split the call over multiple messages.
>>>
>>> what should i do?
>>>
>>
>> you could implement some kind of delta compression - send only data that
>> has changed. but I think the only feasible way is to run the same simulation
>> on the server and on the client and only send the user input to the server.
>
>  For the game I own, WarheadsSE (hence the email addy ;) ), albeit it
> non-flash, we do the full simulations on each client and only send the
> effectors at the instantiation of the action. Then, we compare end results
> from each client to ensure sync has remained. Conserves greatly on
> bandwidth, and has served us well for a *very* long time.
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org



--
Maximus*
WarheadsSE
MaxSource

--
haXe - an open source web programming language
http://haxe.org