Online Game using HTML Object - Theory

New releases and general discussions.

Post » Mon Nov 23, 2009 2:14 pm

I had this theory that I could make a complex multiplayer game suing the HTML object, and I was wondering what everyone's opinions were on the feasibility of it working properly.

My plan is to make an overhead view game like the old GTA games. The player will run around shooting at things, picking things up etc. There will also be other players that can join the game and run around with the other players.

My overall idea is this:
Knowing that the HTML object is way too slow for accurate and real-time movement I was planning on "faking" it. The player will move around as normal on his/her screen, while the other players will use a pseudo AI to control the more complex actions. The HTML objects comes in to play by sending the players X and Y coordinates every few seconds, and data such as "is shooting" and "is searching" etc.

In between the pings of data, the AI takes over and moves the player towards the coordinates the last ping data was set to. There will also be some correction data so if the players coordinates don't update correctly for any reason, the character may appear to "teleport" nearer the actual location of the real player. This may look and feel like the old-school lag from dial-up days, but I was thinking it may just work.

Any thoughts or ideas to add to this?

I will also be using Rich's early alpha online plugin he has made for a chat system since it seems to work just fine for that as it is.

The only problem I can foresee at this point is how the client and server will communicate? Should it be made to work as a straight peer to peer data transfer? Is a server required at all? Will it even work?

Any input or considerations is much appreciated. Thanks in advance.

~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 » Mon Nov 23, 2009 2:40 pm

You could do something based on nodes, or way points, like if another player gets to building A it sends an update. Then the individual clients could use some sort of interpolation using last know coords updated to the new one.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Mon Nov 23, 2009 3:56 pm

So, if I shoot at a player, I'm not even sure I'm really hitting that player? And I also wouldn't be sure that a player is shooting at me? I think the HTML object can be used just for online card games, etc. Interpolation between the last known coords is way too inaccurate.
B
2
S
1
G
3
Posts: 193
Reputation: 1,486

Post » Mon Nov 23, 2009 4:49 pm

Obviously you couldn't do anything even remotely resembling real time. That is a given.... duh.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Mon Nov 23, 2009 6:20 pm

[quote="SoldjahBoy":8ss1m8jj]I will also be using Rich's early alpha online plugin he has made for a chat system since it seems to work just fine for that as it is.[/quote:8ss1m8jj]
Whoah, wait, did he release an early version in chat or something? I don't remember anything being released. :?
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Mon Nov 23, 2009 8:07 pm

You need a proper online object, it won't work via the HTML object. It's the wrong technology, it's based on clients making requests to servers, which then respond with a document. There's no way for the server to notify the client out of the blue. You might get a turn based game or something working but still - it's like using a SQL database for a todo list. Way too much technology involved, which is going to make it clumsy and slow.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Tue Nov 24, 2009 5:24 am

[quote="newt":37qlolbd]You could do something based on nodes, or way points, like if another player gets to building A it sends an update. Then the individual clients could use some sort of interpolation using last know coords updated to the new one.[/quote:37qlolbd]

Yeah that's pretty much what I was thinking. Using nodes or target waypoints, and the players "AI" will move them to the next updated position. Sort of like a real-time game using turn based node updates.

[quote="Genesys":37qlolbd]So, if I shoot at a player, I'm not even sure I'm really hitting that player? And I also wouldn't be sure that a player is shooting at me? I think the HTML object can be used just for online card games, etc. Interpolation between the last known coords is way too inaccurate.[/quote:37qlolbd]

It's going to be a cooperative game, so shooting at other players will not be an issue.

@ Linkman: There was an alpha test of the online object that was being worked on in the chat room one night. It was never officially released but seems to work ok for a chat program.

[quote="Ashley":37qlolbd]You need a proper online object, it won't work via the HTML object. It's the wrong technology, it's based on clients making requests to servers, which then respond with a document. There's no way for the server to notify the client out of the blue. You might get a turn based game or something working but still - it's like using a SQL database for a todo list. Way too much technology involved, which is going to make it clumsy and slow.[/quote:37qlolbd]

So... you are saying it won't work at all? Or just not work very well?

Slow won't really matter... that's what the AI will be for. As long as the other players are kept relatively close to their intended position, and shoot when they are pressing the shoot key (specific number of rounds fired etc won't matter... it will be shooting until the clip is empty for all I care.) then it would be fine.

How slow are we talking here? Would updating the player location every 2-3 seconds be too much?

Cheers all!

~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 » Tue Nov 24, 2009 10:01 am

Updating the player position every 2-3 seconds is way too slow. Your game will probably be unplayable. At a big stretch you can only interpolate (guess) the player's movements for about 250ms before weirdness starts happening, like teleporting because the system guessed wrong. Network programming is hard, and I'm sure it'll be harder if you force it through the wrong technology.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Tue Nov 24, 2009 12:23 pm

A cross between GTA, and checkers might be a better way to think of it. I know that makes it sound real dull, but there are a lot of cool things you can do in a turn based system. Look at some of the older turn based rpg's out there. I know of several that take a few minutes just to show a magic spell.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Nov 24, 2009 6:25 pm

You could use weapon/spell effects to hide latency perhaps? but yeah, HTTP means definitely turn based.

Consider that big games like UT3 do the same "AI in between" (called interpolation there) but between UDP packets.... and still you get some lag. With HTTP your lag would go out of control and clients would desynchronize... unless you make them wait for a synch on each turn :)
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests