Create UDP And TCP Connections In A Browser-based Game?
Nov 13, 2010
I'm working on a game and want the freedom to choose between UDP and TCP connections in the future when I decide to add multiplayer. I'm not sure how something like this would work in the browser with security.
There are two scenarios I can think of for multiplayer. The first is that a player becomes the host of the game (in the browser) and thus would need to communicate with other players directly via TCP or UDP. This would save me on bandwidth costs.
The second scenario would be to have the web server host the game and pass messages back and forth to the clients again via TCP or UDP.
Do Flash or Java applets let me do something like this? If not is there an alternative I can use for the browser or am I stuck with moving to providing a game download and installation?
View 3 Replies
Similar Posts:
Jun 30, 2010
If I wanted to code a desktop-based game, I could pull some XNA code and UDP sockets and make a decent multiplayer game. I would have an extremely clear of how to code the game I wanted.But if I wanted to code a browser-based online multiplayer game, how would I do it?ou can't use XNA....I've been looking at some questions and I'm seeing PHP and ASP.NET and Silverlight and Flash and Java as the alternative languages...I really don't understand how it works. I mean, for a desktop-based game, you're opening a UDP socket and accepting clients and transferring data, updating player states, drawing the results using XNA. But in a browser, how do you open a socket and stuff? How does that concept work, communicating to people in realtime through a web-browser.
View 6 Replies
Oct 25, 2010
There's clearly a bunch of new stuff in Flash 10, I'm seeing a bunch in the Graphics class so far. Struggling a bit to reconcile it with what I know already but it looks useful - render lists and 3D transforms, etc - however I wondered if there are good arguments for targeting Flash 9 since I can definitely manage without all the new stuff I don't know. Like support on non-Windows devices, wide adoption of Flash 9 Vs 10, etc.
View 1 Replies
Sep 26, 2011
I'm trying to include a database un flex4 (flashbuilder) project, I don't see data and SQL packages in the import? What might be the reason? Should I add external library?
import flash.data.SQLConnection;
import flash.data.SQLStatement;
import flash.events.SQLErrorEvent;
import flash.events.SQLEvent;
Description Resource Path Location Type
1172: Definition flash.data:SQLConnection could not be found.
EyeVision1.mxml /EyeVision1/src line 28 Flex Problem
View 2 Replies
Feb 23, 2012
I have been running FMIS 3.5 for about 18 months, and recently it started acting up even though I have not made any changes. After a while (sometimes days, sometimes hours), it starts rejecting new connections, but it allows existing connections to keep working. If I refresh my app, then I can't reconnect. The license I have is unlimited. Can anyone shed some light into why this is doing this and what I can do to fix it? Sometimes it happens when only a couple dozen people are online, and today it did it about 4 times with over 1500 people online.
View 1 Replies
Nov 17, 2009
I'm relatively new to AS3. There's one thing that I don't quite understand about Sprites. I'm making a tile based game, and all the tile graphics for a level are inside one movie clip in each frame. Would I be able to go about creating multiple sprites based on the frames in said movieclip's timeline I would I have to go through and make a separate library graphic for each.
View 2 Replies
Mar 28, 2012
im trying to create a tamagotchi game type game. For some reason i can not add any items to the stage.Currently i have imported 2 png images to the stage and coverted them to movie clips. One is called TamagotchiCharacter and the other is called Beer. I have also created a new 2 AS3.0 script class called TamagotchiGame and DraggableItem. The following is TamagotchiGame:
Code:
package {
import flash.display.MovieClip;
public class TamagotchiGame extends MovieClip {
[code]....
I have assigned the above code as the BaseClass of the Beer symbol, this has allowed the beer to become draggable and droppable etc.when i run the program nothing happens, i just get a blank white screen.
View 2 Replies
Jun 1, 2010
Pretty much what I am looking to do is have an NPC find the shortest path from their location to the player's. Everything is turn-based, so the NPC would have the capability to move from one room to another adjacent room in one turn. Keep in mind that there would be no physical manifestation of the code, other than some text that would be displayed when the NPC enters the same room as the player.And as an added aspect if possible I would like the ability to stop NPCs from entering the same room as the player once they've reached it if the room/door/entrance is locked.So the end result would be something like this...
-------[E]
[P][ ][ ][ ][ ]
--------[ ]
[P][ ][ ][E][ ][code]..........
Only difference is that there would be no graphical representation.
View 1 Replies
Feb 28, 2010
I am trying to make a pacman game and was advised that collision detection for a game like this is much easier if you create it using a tile based methodology. I have the map created and the character moves fine around the grid. But once I added collision detection it seems to be a bit off and inconsistent. Im not entirely sure what the problem is with the collisions.
View 9 Replies
Nov 3, 2011
I'm currently working on an action adventure game and have run into some issues. I am using flash CS4 and AS3. On the stage I have created a user input text field with the instance name of textbox and a button with the instance name of btn. I'm trying to set it up so that when the user types in a word that word is cross referenced with an array and a function is run. I have noticed that some times the functions are not run in the order there typed. For example if I type "enterdoor. lookaround." Than the following is traced.
" you have entered the door.
.
you are looking around, but don't see anything.
. "
Which is good but if I reverse the order and type "lookaround. enterdoor." then I receive the following.
"you are looking around, but don't see anything.
.
.
you have entered the door. "
Also if I were to type "gobacklookaroundenterdoor" then the following is displayed.
"go back you have entered the door. you are looking around, but don't see anything."
Notice that the function "enterdoor" is run before "lookaround" even thou "lookaround" was typed first. Also if I were to type "enterdoorlookaround enterdoorlookaround" then the following is displayed.
"you have entered the door.
you are looking around, but don't see anything.
you are looking around, but don't see anything.
you have entered the door. "
I cant seem to figure out why the functions are not run in the order they are typed by the user. Not sure if this helps but I have determined that if a function is typed 3 times or more then it only returns the function twice. For instance if I were to input "enterdoorenterdoorenterdoor" then the following is displayed.
"you have entered the door.
you have entered the door. "
I would also like for the user to have the option of typing a function as many times in a row as needed. It seems to me that I'm missing some thing simple. I was thinking if I change the commands "array" to an "associative array" it might process the functions in the correct order. It seems to me that the commands array is being compared to the inputholder array.
this.stop();
import flash.events.*;
btn.addEventListener(MouseEvent.CLICK,textChanged)
[code]....
View 1 Replies
Jul 18, 2009
Is there an actionscript for a point system? I want my points to be time based from this script
stop();
count = 60;
countdown = function(){count--;
if (count ==0){clearInterval(doCountdown);
gotoAndStop(11);
clearInterval(doCountdown);
}}doCountdown = setInterval(countdown, 1000);
View 5 Replies
Feb 12, 2010
I want to make a turn base strategy game. I was just curious if anyone had any sources or books that explains the concept and architect of designing a turn based strategy game or any turn based game.
View 2 Replies
Sep 28, 2010
I'm developing a web-based fantasy football game. Most of the game is a straight-forward web application built on top of Linux/Apache/Php/MySQL.
I'm trying to figure out how to implement the draft application. The draft date and time will be scheduled in advance by each league's owner. Up to 32 users may be logged on for a given league's draft, and there is no limit to how many drafts may be happening concurrently. The users will take turns selecting players, and each user's turn will have a time limit. I'd like for all the users to be able to see whose turn it is, how much time that user has left to select a player, who they select, and which players are still available. If there are users in the league who are not logged in during the draft I'd like to be able to detect that and automatically assign players to them rather than waiting for the time to run out on their turn. Ideally I'd also like to have a chat window so the users could chat with one another during the draft.
My background is in desktop application development, so if necessary I could write server code in C#/.NET or Java. As far as I can see these are the options: PHP/AJAX - It seems like it would be possible to have all the state for the draft in the database and have the operations for the draft run in PHP triggered by requests from the clients? I guess in this case the draft doesn't start until at least one user logs in, and it seems like it would be a lot of polling requests to the server if I want everyone notified quickly when a user makes a selection.
[Code]...
View 2 Replies
Oct 29, 2010
If I have a designer make the necessary graphics, what do I need to learn to make a flash based game?
I already understand the backend server work that would need to talk to the 'front end' part of the game i.e. how the flash game will make requests to the backend servers for storing/retrieving data in xml/json etc.
View 3 Replies
Mar 25, 2011
how to make a interesting flash based game?
View 1 Replies
Oct 1, 2011
I have been thinking of trying out component based architecture for game development. I have read some blog posts and articles about it but I have a few things I have not sorted out yet. When I say component based I mean that you can add components to a ComponentManager that updates all components in its list. I want to try this to avoid getting classes that inherits variables and functions that they don´t need. I really like the idea of having an really simple entity class with a lot of components working side by side without getting bloated. Also, it is easy to remove and add functionality at runtime wich makes it really cool.
This is what I am aiming for.
// this is what the setup could be like
entity.componentManager.add(new RigidBody(3.0, 12.0));
entity.componentManager.add(new CrazyMagneticForce(3.0));
entity.componentManager.add(new DrunkAffection(42.0, 3.0));
// the game loop updates the component manager which updates all components
entity.componentManager.update(deltaTime);
Communication: Some of the components need to communicate with other components I can´t rely on the components to be self-sustaining. Sometime they will need to communicate with the other components.In Unity 3D, you can access the components using GetComponent().I was thinking of doing it like this, but what happens if you have two components of the same type? Maybe you get a Vector back.
var someComponent : RigidBody = _componentManager.getComponent(RigidBody);
Priority: Some components need to update before others
Some components need to update before others to get the correct data for the current game loop. I am thinking of adding a PRIORITY to each component, but I am not sure that this is enough. Unity uses LateUpdate and Update but maybe there is a way to get an even better control of the order of execution.
[URL]
View 1 Replies
Oct 1, 2007
I've been playing around with ActionScript 3. They have a new way of placing clips onto the stage, "addChild(clip)," which automatically places the clip onto the stage with it's own depth. So here's my problem, when making a tile based game, I have to constantly depth sort to make sure the object lower on the screen has the higher depth than an object higher on the screen. Pretty much, their depth depended on their y-coord. Does ActionScript 3 still let us play with depths?
View 2 Replies
Apr 12, 2011
I'm planning to make a multiplayer hero-based RTS game, similar to the gameplay of DotA/HoN/LoL. With about 10~ players max at once in a game. The latency and responsetime is key, trying to get as low ping as possible.And last but not least - I don't want to use any 3rd party solutions, such as smartfox server or any of the likes of it.So, with that said, what is the way to go if I'm going to build this properly? Java socket server? Python? Let me know what you think and please share resources since i haven't done anything similar before.
View 6 Replies
Sep 3, 2011
I've developed a game that records how long it took to complete the game. At the end of the game it shows the user how long it too to complete. I want to be able display message to the user depending on how quickly they took to complete the game. I have set up a dynamic text box called "message" that will display the message, but I am struggling to figure out the syntax for :
If gametime is less than 60 secs then message = "well done thats very quick"
If gametime is between 60 and 80 secs then message = "Not bad at all"
If gametime is between 81 and 100 secs then message = "Its good but not good enough"
If gametime is between 101 and 120 secs then message = "You can do better than that!"
If gametime is between 121 and 140 secs then message = "Too slow, you need to practice"
If gametime is greater than 140 then message = "Did you fall asleep?"
View 3 Replies
Mar 4, 2008
So your playing a flash game that's fast paced and mouse-based (hey that rhymes somewhat)... And then you accidentally move your mouse outside of the area of the swf... And then it pauses automatically with a "Continue" button, instead of you just dying or whatever. I've thought you could have a huge button the size of the stage and make it do something when the frame isn't 'mouseover' or whatever, but there's gotta be a better way. Also setting limits on the _xmouse and _ymouse wouldn't work cos sometimes the mouse moves too fast for them to accurately get the last mouseposition...
View 8 Replies
Nov 28, 2011
Basically there will be a club and a ball. You can control the power and angle to hit the ball. How do I go about implementing this? Is flash the easiest way to go? I want to implement this as a facebook game. Any game libraries specific to this I can use to quickly implement a basic version? I am comfortable with Java and PHP.
View 1 Replies
Mar 25, 2010
I have a swf file imbedded in a HTML. Acceess to the file are controlled by passwords, stored in a XML-file I want to limit the number of accesses for each visitor to let us say 10 visits. How do I count (and store) the number of logons for each visitor? SharedObject works only at clienside, but iI want i serverside. The "easy" way would be to save the number of accesses for each visitor in a text-file but Flash and save... I hvave tried ExternalInterface calls, PHP etc and etc, but cant find a way that works. This is the last obstacle in a huge project.
View 1 Replies
Oct 19, 2009
Does anyone know how to resize a website's content proportionally based on the browser window's width and height? Also, the navigation can be repositioned accordingly based on the browser's size as well.[url]...Resize website content based on browser?
View 0 Replies
Mar 11, 2006
im trying to resize/scale a movieclip based on the browser window.i sort of got it working. but my prob is that i dont want it to scale beyond the browser size when u just stretch the width or height.check it outif u stretch just the width of the browser the image enlarges which i dont wont it to. heres the code/formula used in a onResize
var mywidth:Number = 955;
var myheight:Number = 575;
Enlarge = (Math.round(Stage.height/myheight*100)+Math.round(Stage.width/mywidth*100))/2;
[code].....
View 2 Replies
May 26, 2009
Is it possible to do what this tutorial shows but instead of having your mc�s be positioned related to the stage, have them be positioned related to the browser window?
[URL]
View 2 Replies
Sep 4, 2011
I started off game development on Android about a year ago and want to expand to developing browser games as well. Is flash worth learning? Or should I go for using an engine like Unity and learn game development in c#. Mostly I'm just worried that I would be wasting my time learning flash if I'm not going to get much use from it.
View 1 Replies
Feb 24, 2010
I have a Flash file embedded into HTML - the objects inside are place based on the browser's screen size.Most of the time I don't want a scroll bar, as things are correctly placed, but once the browser window gets too small it'd be nice to have it.So, the main question: can I have a Javascript code listening for the browser window, then adding a scroll bar if it's smaller than a certain number?
View 1 Replies
Jun 11, 2010
Imagine I want a user to be able to copy-paste a selection of pixels from MSPaint into a browser-based app. Is this possible using JavaScript in any current browsers? Will it become possible in HTML5?If not, is it feasible using something like Flex/Silverlight, or is it simply not possible at this time, and you'd have to save a file and manually upload it?
update: sounds like HTML5 should allow it, but that's a way in the future to be genuinely useful. Some suggestions of Java applets and Flash are mentioned, probably Flash would be preferable since parts of the web-client would probably use Flex anyway... I'd rather not have requirement for Java and Flash in my site.
View 1 Replies
Aug 30, 2010
To display a P2P video chat / screen-share session in the browser are we limited only to Flash?
I think there are HTML5 solutions 'in the pipeline' but I've no idea of timescales. Do you know of any flash alternatives?
View 4 Replies
Jul 18, 2011
What I want to do is have control over the streams so I can send them wherever I want, have it interface w/a mic and cam, and the ability to capture and record them. At this point I don't have any specific specs or limitations. It will be used in a commercial project so the license must allow for that. Free and OSS is preferably, but commercial and proprietary is not out of the question if it's worth it.
I don't see html5 as a viable solution at this point so I'm assuming it's going to rely on flash which is fine, but I do not know actionscript. I'm not opposed to learning it, and assume I could pick it up fine within a week, but keep that in mind. If I have to build something myself from the actionscript libraries (I assume they provide enough functionality) I can do so, but I'm hoping for a quicker solution than that.
View 2 Replies