WebGL client

The original, free Ace of Spades game powered by the Voxlap engine. Known as “Classic,” 0.75, 0.76, and all 0.x versions. Created by Ben Aksoy.
57 posts Page 2 of 4 First unread post
longbyte1
Deuced Up
Posts: 336
Joined: Sun Jul 21, 2013 7:27 pm


LeCom wrote:
I didn't say a single word about raycasting with java/js lol
Just had terrible experiences with this, but if you say it's fast enough, fine. We can judge when there's a first version
If/when there is one.

I need to find a way to "lock" time daily for coding, or make a schedule or something. I can't have random stuff popping up and obstructing my development.

I also need to fix my code. A lot of it makes sense but it's not the right way to do it. Examples:
  • My packet handling consisted of a big switch/case statement. I had to turn it into a jump table, which is only a bit less ugly.
  • I seem to be abusing the fact that you can put whatever you want inside any object. As a result, my initialization for session data is literally `peer.session = {}`. I need to create an object for this.
  • Module.exports doesn't use JSON format. That's an easy fix, I think.
Other problems:
  • Race condition caused by receiving data other than map data during loading. It makes an unhandled exception if the player table hasn't been made yet. For now I am putting these stray packets in a queue while the map is loading. Once the map loads, on receiving the next packet, the callback will recursively call each packet in the queue until it is empty.
  • Callback hell during map load. It's node.js what'd you expect.
LeCom


longbyte1 wrote:
[*]My packet handling consisted of a big switch/case statement. I had to turn it into a jump table, which is only a bit less ugly.
A question of taste.
longbyte1 wrote:
[*]Module.exports doesn't use JSON format. That's an easy fix, I think.
Ye, just use the most suitable format it can provide.
longbyte1 wrote:
[*]Race condition caused by receiving data other than map data during loading. It makes an unhandled exception if the player table hasn't been made yet. For now I am putting these stray packets in a queue while the map is loading. Once the map loads, on receiving the next packet, the callback will recursively call each packet in the queue until it is empty.
Parts of the AoS protocol just completely break stuff if you enforce such dynamic allocation, just alloc the table for 32 players on initialization. Related note: Allocate space for 33 players if you want most scripts to work, because they use a 33rd player to create coloured blocks.
bloodfox
Post Demon
Post Demon
Posts: 2206
Joined: Mon Oct 21, 2013 4:32 pm


ooooooooo fancy code talk that I don't know but give a shit about. Anywho a webGL client isn't a bad idea but... I've never been fond of a web based game unless we're talking about flash games and all that jazz. But then again It'd be easier than trying to break down the code for AOS without either getting sued by Jagex or having to work with so little.
longbyte1
Deuced Up
Posts: 336
Joined: Sun Jul 21, 2013 7:27 pm


bloodfox wrote:
ooooooooo fancy code talk that I don't know but give a shit about. Anywho a webGL client isn't a bad idea but... I've never been fond of a web based game unless we're talking about flash games and all that jazz. But then again It'd be easier than trying to break down the code for AOS without either getting sued by Jagex or having to work with so little.
As I emphasize, it is futile to work with the disassembly unless you want to know about specific behaviors (recoil amount, gun cooldown, reload time, HUD positions, etc) because the compiler likes to take its time unrolling for loops (and you already know enough of the strange optimizations Mr. Aksoy does in his code Blue_Wink1).

I am so annoyed how on map load my client stops receiving data packets and instead 13% of my CPU usage (!?). But when I attach a debugger on the Node process, everything works.

I am also seeing the server's chat ID go all the way up to 35 (??). Not sure if it is sending held item packets for airstrikes or my code is just buggy as heck.
bloodfox
Post Demon
Post Demon
Posts: 2206
Joined: Mon Oct 21, 2013 4:32 pm


also, Idk if you could do this with using webGL but please do your best to make the framerate lock to 60 instead of 30...
longbyte1
Deuced Up
Posts: 336
Joined: Sun Jul 21, 2013 7:27 pm


bloodfox wrote:
also, Idk if you could do this with using webGL but please do your best to make the framerate lock to 60 instead of 30...
Can't really control that, but I'll try my best to keep the fps well above 60 (without vsync).

Also I will remove the loading packet queue, since that does not sound like something Aksoy even did in his code. I just have to be sure to move the player array initialization to the "map start" packet.
ByteBit
Build and Shoot's 1st Birthday
Build and Shoot's 1st Birthday
Posts: 141
Joined: Sun Mar 24, 2013 12:08 pm


longbyte1 you could look at my client's code, it already has all the networking stuff implemented and works pretty well. If you got any questions ask me on IRC (default bns channel)

https://github.com/xtreme8000/BattleofS ... kThread.pb
LeCom


longbyte1 wrote:
bloodfox wrote:
ooooooooo fancy code talk that I don't know but give a shit about. Anywho a webGL client isn't a bad idea but... I've never been fond of a web based game unless we're talking about flash games and all that jazz. But then again It'd be easier than trying to break down the code for AOS without either getting sued by Jagex or having to work with so little.
As I emphasize, it is futile to work with the disassembly unless you want to know about specific behaviors (recoil amount, gun cooldown, reload time, HUD positions, etc) because the compiler likes to take its time unrolling for loops (and you already know enough of the strange optimizations Mr. Aksoy does in his code Blue_Wink1).

I am so annoyed how on map load my client stops receiving data packets and instead 13% of my CPU usage (!?). But when I attach a debugger on the Node process, everything works.

I am also seeing the server's chat ID go all the way up to 35 (??). Not sure if it is sending held item packets for airstrikes or my code is just buggy as heck.
That's the point where one starts using console print debugging.

And PySnip uses that high player ID for sending chat without a player ID, e.g. airstrike messages, announcements, IRC chat etc.
longbyte1 wrote:
bloodfox wrote:
also, Idk if you could do this with using webGL but please do your best to make the framerate lock to 60 instead of 30...
Can't really control that, but I'll try my best to keep the fps well above 60 (without vsync).

Also I will remove the loading packet queue, since that does not sound like something Aksoy even did in his code. I just have to be sure to move the player array initialization to the "map start" packet.
Just what I said. Or even move it to the program initialization.
longbyte1
Deuced Up
Posts: 336
Joined: Sun Jul 21, 2013 7:27 pm


I've not been able to work much on the client due to my summer program. Hopefully I can pick it back up soon enough.
Lincent
Veterans
Veterans
Posts: 693
Joined: Wed Mar 27, 2013 9:47 pm


longbyte1 wrote:
I've not been able to work much on the client due to my summer program. Hopefully I can pick it back up soon enough.
Thanks for bringing this back up.
Warp
Green Master Race
Green Master Race
Posts: 704
Joined: Mon May 19, 2014 4:07 pm


Thinking about it, a WebGl client could really revive the game.

AoS was never hardcore (in my opinion), this would fit it very well.

Image
Lincent
Veterans
Veterans
Posts: 693
Joined: Wed Mar 27, 2013 9:47 pm


Warp wrote:
Thinking about it, a WebGl client could really revive the game.

AoS was never hardcore (in my opinion), this would fit it very well.

Image
I think you posted your SMG mod in the wrong section.
Please make your own topic for mods in this section next time.
LeCom


Warp wrote:
Thinking about it, a WebGl client could really revive the game.

AoS was never hardcore (in my opinion), this would fit it very well.

Image
It's already possible now, you can write your own program for that and then optionally start AoS from that prog.
longbyte1
Deuced Up
Posts: 336
Joined: Sun Jul 21, 2013 7:27 pm


My goal right now is to make a 0.75-compliant client. Nothing fancy right now, although I've thought of a few "simple" things that could be added to the protocol in the very distant future (like moving block groups and a use key on blocks, to make elevators and stuff).

But enough already needs to be done. I've given myself until the end of the summer to have at least the full backend done and a proof-of-concept frontend completed.

Here is the backend running (no fatal errors Blue_BigSmile):

Image

I haven't tested if specific behavioral portions of the protocol (grenades, respawn, block line, even positions) are working as intended, but I assume they are since they're not bugging out like they were before.

A weird thing that is also happening is that the backend also wants to load the map data only when I'm running it with the debugger. Otherwise it just gets stuck on one packet and stops loading for some reason (?!).

I've decided to go with Websockets to wrap the network throughput, as it's been used frequently with games like Agar and Lichess. WebRTC is looking iffy to me.
Warp
Green Master Race
Green Master Race
Posts: 704
Joined: Mon May 19, 2014 4:07 pm


Lincent wrote:
Warp wrote:
Thinking about it, a WebGl client could really revive the game.

AoS was never hardcore (in my opinion), this would fit it very well.

Image
I think you posted your SMG mod in the wrong section.
Please make your own topic for mods in this section next time.
Are you being sarcastic or something?

That was a concept image I had from a while back, which I used in what I envisaged a in-browser version could look like.

Good progress, longbyte!
57 posts Page 2 of 4 First unread post
Return to “Ace of Spades 0.x Discussion”

Who is online

Users browsing this forum: No registered users and 22 guests