Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by drailing

hi,

im pretty new to impact and the main reason i bought the engine was making nice multiplayer games.

im really not that pro in making screencasts like dominic, but i gave my best to show you my work in a short video, so you can decide if its worth to read more :-)

http://www.youtube.com/watch?v=4-ib0qJsyrE

the main difference from the implementations i saw is that other players are independent from gravity, i only broadcast position and animations, but all players are still colliding and can check against other entities.

spawning new entities like projectiles is really simple, they only need a starting position and optional settings.

if you take a look at the spawning and moving code, you see a few eval() calls. im not that happy with it, but socket.io strips all prototype function from classes and objects and without them impact cannot use them anymore of course. so i decided to send strings and eval them. one other possibility is to write big switch-cases... im very grateful for other smart solutions!

a lot of debugging and searching in the serverside socket objects was the joining of all availible players to the new one, but it works really nice.

removing players on disconnect works too, and im sad i have no reconnect strategy for unwanted disconnects yet.

i also made a github repo with a short readme + a bit more of code comments than usual but i think its easy to understand ;-)

https://github.com/cdreier/impactConnect

improvements, contributions and any other feedback are highly welcome!

1 decade ago by drailing

heyho,

heres a small update:

http://www.youtube.com/watch?v=zEppdr0EX7s

i added collisions between players and projectiles, so you can kill your opponents!

that everyone can see your shame, i added the notification-manager plugin from Abraham Walters and the "announce" method to announce your death to everyone :-)

on feedback I'd be very happy

1 decade ago by TylerAppmobi

This is a great plugin/code implementation!

1 decade ago by Graphikos

Good work... it does seem to be taking the much-needed multiplayer ability a bit further than has been publicly released before. Be sure to post your plugin at http://www.pointofimpactjs.com!

1 decade ago by TylerAppmobi

I got some time to work with this today, and I have to say it's brilliant! Documentation was perfect and it took me a very short time to get it up and running on my machine. Mass kudos @drailing! I have begun to tinker and with not too much effort, have gotten an iPhone, iPad and chrome browser to play simultaneously.

An interesting bug, two players can't jump at the same time. if they do, the server only recognizes one, then when that player lands, the server updates the other player in a rapid motion.

1 decade ago by drailing

Hi Tyler,

Tanks a lot for your great feedback :)

Ill try to reproduce the jumping issue, today we played with 3 players on different PCs and i didnt notice that.

Perhaps a mobile only bug?

1 decade ago by gxxaxx

@drailing

Your project is amazing.

I too am discomforted by the idea of using eval

In my code recently I implemented an array as an attempt to get around the huge switch case statement.

ig.MyEnts['player'] = EntityPlayer;
ig.MyEnts['bat'] = EntityBat;

This allowed me to pass a string then get access to the prototype functions.

Might be the same difference in terms of performance. I just didn't like the idea of a huge case statement and in this case I could write a method to add the entities. Made it a little more plug and play.

1 decade ago by EvilJohnny

This is really an exciting plugin!! Keep going!! :D

I did some tests with my amazon EC2 instance (MicroInstance: 613 RAM, 2 EC2 Computing Units, I/O Performance: Low) and it works great. I had latency problems that caused that I could kill myself :P and it wasn't very smooth. But maybe that's because of my Instance. I'll do some more test and tell here.

Lots of thanks for this plugin! :)

1 decade ago by drailing

Hi,

im very happy about your feedback :-)

my freetime is very low at the moment and i just have too many projects at the same time... but i hope i can test and improve a bit more in the next weeks.

a simple ajax interface is in developement as well!

1 decade ago by EvilJohnny

Hi again!

Well, I've done a couple more tests (all done with the impact connect example).
The last of all was done with a this amazon instance: High-CPU Extra Large Instance

7 GB of memory
20 EC2 Compute Units (8 virtual cores with 2.5 EC2 Compute Units each)
64-bit platform
I/O Performance: High

And I launched it on Ireland zone ( I live in Spain, so this is the closer Amazon's server zone I have).
The results: well, maybe I achieve a little reduction of latency with this monster-instance but... is still very noticeable, and again I've been able do kill myself :P

So... now the question is... is this a limit of Socket.IO? There is an engine around there (http://www.isogenicengine.com, I haven't tried it) that claims "has a built-in advanced networking system supporting compression and client-side entity interpolation to mitigate round-trip latency." Maybe this is the only way? Client-side interpolation?

By the way, I am happy to hear you still work in the project :)

I have a game in mind, I have done some tests and I am trying to convince some designers from the company where I work, but without a good real time multiplayer the project will not certainly be the same... That's why I am so interested ;)

Again, lot of thanks for the plugin and the time you spend on it :D

1 decade ago by Philip

Websockets aren't as fast as a normal TCP Connection, but come pretty close. But I don#t have any prove of this, sorry.

Nevertheless, all network games interpolate. Cause lags happen, even if your server is super fast. The clients can be slow and to get everything in sync isn't easy.

I run into the same problems while developing the network part of Steamclash. Unfortunately I'm no network guy so i dropped the interpolation and tried to send as little data as possible.

The game was meant to be 1 on 1 anyway, without a server. so the lags could only occur on one device and were pretty rare to see. So I let things be and concentrated on other stuff.

Before that I did a browser only game, but i was much dumber. So it only worked in local wifi.

Would be great if somebody could write some cool interpolation code :)

1 decade ago by drailing

@EvilJohnny:
thanks a lot for your tests!
and if you really dont want the awesome feature to kill yourself, just add one more pixel to the spawncoordinates from the projectile (not a latency issue :-) ):
//line 142 in player.js
var spawnPointAdjustmentX = (settings.flipped)?-7:7;

@Philip:
youre right, you cant avoid lags.
i did nothing with interpolation till now, but perhaps its the only solution to get a smooth running multiplayergame.

1 decade ago by SpaceHorse

hi, i tried to install everything but i couldn't.
i have mac osx 10.5.8 and downloaded node.js installation package. everything went ok during installation but when i had an error. it seems that i need higher version of my osx system to use noje.js. maybe someone faced with this problem?

1 decade ago by SpaceHorse

yea... it seems i need new osx :<
or something like a Linux in a VirtualBox. Mother of god, i just need to run 1 file on node.js. Why is it so complicated.

1 decade ago by Arantor

Because Node.js isn't just a processing engine like PHP is, but essentially IS the webserver?

1 decade ago by SpaceHorse

yes it is.
i'm trying to find free node.js hosting with socket.io / can't find it. it seems like maybe http://nodester.com/ is one of the best solutions but i still didn't receive their reply from a registration request. does anyone know any free working node.js/socket.io hostings?

1 decade ago by Arantor

yes it is.


(I know, it was a rhetorical question, primarily to answer your "why is it so complicated" comment. The whole point is that you can't just drop in a simple module like you can PHP into Apache, because it's not a drop in module.)

1 decade ago by PatrickBell

What exactly do I need to change about the 2 lines in Index.html and impactconnect.js to make it accessible outside of localhost?

this is my impactconnect.js line:

this.socket = io.connect();

and my index.html line:

<script type="text/javascript" src="/socket.io/socket.io.js"></script>


I would have thought this would work but all I get is undefined for both require and socket.io

Any help?

1 decade ago by motoko

First, you have to understand that you need two servers, the 'html' one and the nodejs one.

Once you have your nodejs server up and running the script (server script), you have to include the socket.io.js ini your index.html file, like:
<script
type="text/javascript" src="http://machine_name_or_ip:nodejs_listening_port/socket.io/socket.io.js"
>
</script>

1 decade ago by Arantor

You do not need two servers. Node.JS is quite capable of serving files generally (I have written apps that do just that)

1 decade ago by stahlmanDesign

I finally got this demo working in localhost. Excellent work.

Now I have to figure out how to install it on a real server.

Thanks for this excellent demo.

1 decade ago by lazer

Thank you so much, this is awesome. I finally got the demo working yesterday locally. However I have a newbish question - how do I keep the attributes of each existing player when a new player joins? For example, I have two kinds of players: "A" and "B". In player.js I randomly assign a kind to them - either A or B. A has totally different attributes from B, one of them being a different animation sheet. Things like size etc will also vary slightly down the line.

The problem is that because these player entities are spawned from scratch for every new user that joins, the other player "kinds" are calculated separately each time, so a player could spawn as player A on one machine and player B on another. How would I make the "kind" assigned to the player persist for every user?
Page 1 of 1
« first « previous next › last »