Online Game using HTML Object - Theory

New releases and general discussions.

Post » Tue Nov 24, 2009 6:36 pm

I think the correct term would be dead reckoning, which is essentially making educated guesses as to where an object might be at any point in time between data packets. I don't really think a system like this would work for such high latencies, though.
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Wed Nov 25, 2009 2:17 pm

Hmmm...

I might still have to test it at least... The position of the players aren't super crucial anyway since the AI will take over for the other players and make them "help" your player.

The location of each player only has to be very approximate (say a 300 pixel margin of error).

The proposed AI idea would involve the other players characters sticking close to you... only if they leave the immediate screen area, go into a building, or leave the screen and go to another screen all together would it really need to "adjust" the players location.

"Teleporting" the player in the event of them doing one of the above things wouldn't be such a bad thing... I'm just really keen to get something at least functional until such time that we get a full online object that can track things better.

Am I still barking up the wrong tree or is it worth testing out? I don't want to waste a bunch of time if it's just not going to work, but I also don't want to wait forever for an online plugin. :(

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Wed Nov 25, 2009 3:46 pm

I still don't think it's going to work. What do you mean, having AI control other players and make them help you? Won't you end up with horribly conflicting events if one player sees their friend shoot an enemy because the AI tried to help, but that person never did that and the enemy is still alive for them?

Wrong tool for the job, sorry - best put off till there's a real networking plugin. (don't know when that will be though)
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,228

Post » Sun Dec 06, 2009 9:46 am

[quote="Ashley":1abfj52y]I still don't think it's going to work. What do you mean, having AI control other players and make them help you? Won't you end up with horribly conflicting events if one player sees their friend shoot an enemy because the AI tried to help, but that person never did that and the enemy is still alive for them?

Wrong tool for the job, sorry - best put off till there's a real networking plugin. (don't know when that will be though)[/quote:1abfj52y]

The plan is to not have sync between the games.

It is designed to be more like a single player experience, but with your "friends" being able to join in, simply by logging in to the game. Basically people you meet in the game and become friends with, when they log in, their character will basically help you in the game much like a completely computer controlled AI would. The placement of enemies will be irrelevant to anyone else apart from the each indivdual player in relation to thier character. Obviously I wanted to do it like this so you still get a multiplayer "feel" to the game since players would be able to chat and cooperate to a degree, while getting around the issue of having no online plugin.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Sun Dec 06, 2009 10:12 am

What if you tied it to parts of IRC? Was an idea I had way long ago, before modern methods had been invented, and everything was a lot more complicated and annoying. Basically special rooms could be used as the backend of an online area, but rather than people chatting in there, their messages contained coordinates and other useful info. That's all sent to logs as you know, and those are also timestamped. Each message sent by someone could include a brief message also, which could allow for basic chatting inside the game.

So couldn't it simply use what amounts to nothing more than text files, to control the positions of various sprites?

As for sending it to IRC. A simple script could be used to just send the contents of a text file, or something along those lines. Construct can read and write to external files. It's granted, a very basic way of doing it. But it would work for the more simple games, and the more basic RPG kind, or even just visual chatroom applications.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Sun Dec 06, 2009 12:40 pm

Interesting theory.

I may have to resort to something like that if I can't find the CSX file for the experimental online plugin. I have the CAP but no CSX. :(

I'm wondering how fast this method could be? Also... it may run in to issues if there are a lot of users online... trying to figure out what messages are supposed to be used for whose character on what IP address etc...

I'm tearing my hair out just thinking about it D:

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Sun Dec 06, 2009 4:36 pm

I has an idea. How about making a simple local http->public socket relay thingy in c++/perl+perl2exe/whatever, and use the HTTP plugin to send the appropriate data to [url:21zykm9b]http://127.0.0.1/[/url:21zykm9b], and having the program send that data to a server through socket? Or you could use files or the command line plugin so you wouldn't need the HTTP plugin at all... (I am tempted to try this myself, a pong game or something wouldn't be too hard as a test...)

EDIT: with the localhost http version, I assume speed isn't a problem if the server is on the same machine?

EDIT2: That covers sending the data; not sure about receiving, perhaps files? Would temp files between the relay program and Construct be fast enough?
B
2
S
2
G
3
Posts: 193
Reputation: 1,636

Post » Sun Dec 06, 2009 4:56 pm

The simplest solution is probably for someone to write an online plugin :P
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,228

Post » Sun Dec 06, 2009 6:10 pm

[quote="SoldjahBoy":3cm1zitz]Interesting theory.

I may have to resort to something like that if I can't find the CSX file for the experimental online plugin. I have the CAP but no CSX. :(

I'm wondering how fast this method could be? Also... it may run in to issues if there are a lot of users online... trying to figure out what messages are supposed to be used for whose character on what IP address etc...

I'm tearing my hair out just thinking about it D:

~Sol[/quote:3cm1zitz]

It wouldn't work for anything that needed to be quick (shoot-em-ups requiring perfect timing probably wouldn't handle well with it), but adventure types could be ok, little mini-mmo's and the like. Though I suppose it depends how fast construct could parse the IRC log file for updating character movement.

You'd not have to worry about IP's. Parsing the output from IRC would get you the time, their name and then whatever info was in their message. Something like (super simple example). Since you can't have duplicate names on any one IRC server, it would cover the job of IP addresses, and of course something like nickserv could be used to protect your characters name.

05:49:32:Frank:024:189:897324:hey guys whats up:

Using : as a separator, you'd get
hour,
minute,
second,
username,
X coords,
Y coords,
set of numbers which would set how the player looks (if there's a choice of appearance) and could show extra's like item carried or something too,
message written, if any.

As for the problem of slowdown with lots of users. I thought at the time of using different IRC channels for different locations. It was easy enough I recall to change channels via scripts (this was all tested in mIRC at the time). So as you move around different locations in your game, your disembodied internet soul does the same in IRC. You could even limit channels to a max number of users, this would give a message if the channel was full, which construct could look for and inform the user in the game that the place is full too.

Private messages in IRC could work fine for private chatting among players in the game, and perhaps also trading of items too, and some kind of 1 on 1 dueling.

Unfortunately it was all worked out as a graphical chat thing done on the cheap. So there was nothing worked out to handle NPC's or proper fighting. But thinking about that now, the simplest way would be IRC bots, as they would update everyone at the same time, just like the players would. Keeping themselves in synch with everyone in the area.

Storing player data - inventory, progress etc. Could be handled by another bot, just like many of them do for those generally annoying IRC gamebots that keep players scores. The only problem is something like this would generally not be very secure, and likely very easy to cheat on, unless the player output used in IRC was encrypted somehow. But that would be cracked eventually too.

-

Another method, which would be much slower and really only of use for turn based games, would be using the Get and Post tools, and uploading movement and changes to a website. That would work as-is for a two player turn based game. Or using PHP and a cron job, it could be made to handle more players as well as fancier extra's.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Tue Dec 08, 2009 1:03 pm

[quote="Ashley":1iv7tdxu]The simplest solution is probably for someone to write an online plugin :P[/quote:1iv7tdxu]

Been waiting on that for months :/

Also, Dataflash... If you test anything out, I'd be keen to see how it works out. If it's plausible for something simple, it may work for something more complicated.

@Keys
Hmmm well that sort of confirms the IRC idea... though I would have no idea where to start with something like that. It's been so many YEARS since I've used IRC I would have to relearn all of that stuff just to get a room going with reliable bots... which would then need programming scripts etc etc.

I am still determined to find a way... I work with the tools I have... and since I don't have a proper tool, I will dodgy something together and make it work as good as it can.

Thanks for your input everyone... I think I have enough information thusly to realise this won't be easy, but should at least be possible to some extent. If anyone gets all excited and starts playing with this idea themselves, please share any results you find so we can all learn from it.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

PreviousNext

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests