00:00
00:00
Newgrounds Background Image Theme
Upgrade Your Account!

HO HO HOPE you become a Newgrounds Supporter this year!

We're working hard to give you the best site possible, but we have bills to pay and community support is vital to keep things going and growing. Thank you for considering!

Become a Supporter so NG can see another Christmas!

The Flash 'Reg' Lounge

3,083,957 Views | 60,186 Replies
New Topic Respond to this Topic

Response to The Flash 'Reg' Lounge 2015-03-10 08:27:36


I just stumbled on this:

http://www.as3gamegears.com/about/

Looks pretty sweet.

Response to The Flash 'Reg' Lounge 2015-03-10 10:17:08


I just realized there should be a copyPixels but for 90 and -90 degrees.

Response to The Flash 'Reg' Lounge 2015-03-13 20:30:16 (edited 2015-03-13 20:31:33)


Heads up, 10gb worth of premium sfx free until April 2nd (I think):

http://bedroomproducersblog.com/2015/03/12/sonniss-free-game-sounds/

Response to The Flash 'Reg' Lounge 2015-03-13 21:19:59


At 3/13/15 08:30 PM, slugrail wrote: Heads up, 10gb worth of premium sfx free until April 2nd (I think):

http://bedroomproducersblog.com/2015/03/12/sonniss-free-game-sounds/

I thought the half gig of audio I got for $10 was good... nice call.

Response to The Flash 'Reg' Lounge 2015-03-13 21:46:05


At 3/13/15 09:19 PM, MSGhero wrote:
At 3/13/15 08:30 PM, slugrail wrote: Heads up, 10gb worth of premium sfx free until April 2nd (I think):

http://bedroomproducersblog.com/2015/03/12/sonniss-free-game-sounds/
I thought the half gig of audio I got for $10 was good... nice call.

I'm so glad you posted this today and not tomorrow when I go back home for break. 24 mins to download.

Response to The Flash 'Reg' Lounge 2015-03-15 20:42:05


Got another small update for y'all regarding the C++ WebSocket server I posted about earlier.

MSGHero asked how the thing I talked about in that post would help in making games, and, basically, by itself it doesn't do a whole lot (it just implements the WebSocket protocol), which is why I've been hard at work implementing features to make developing networked games very easy.

As of writing this post, I have authenticating with the Newgrounds API working, as explained on the wiki, which allows you to guarantee that a person connecting is logged in and actually is who they are claiming to be. That can be disabled if you don't need users to be authenticated, although any users who play the game will still send their NG info to the server (players not logged in will just be recorded as "Guest" or something to that effect).

In short: the authentication means that when a user connects you will be given their username and userid in a Player object, and possibly some other information pulled from their profile (e.g. if they are a supporter).

I am also working on an event messaging system to simplify communication between the client and server. Given that the server is written in C++, it has all the drawbacks that C++ has (duh). Most notable being that C++ is statically typed whereas JavaScript is not, which can make parsing JSON sent from a JavaScript-based client a little bit tricky. The solution I came up for this is to allow you to define event handlers by a given name, which are tied to a function, and their expected parameters; meaning that you can, for example, define an event called "chat" which expects two parameters: target and message, both of which are strings.

So, basically, a client can send JSON data such as {"type":"chat", "to":"Diki", "message":"You suck"} and the server will receive it, parse out the data, see that it's a "chat" event and that the given parameters match what are expected, and will call the defined function and pass the parsed data. If, for some reason, the client were to send {"type":"chat", "to":42, "message":"butts"} the server would reject the event because the "to" field is expected to be a string, not an integer.

Here is a very basic example:

int print(newgrounds::Player player, newgrounds::Payload data) { std::cout << data.gets("message") << std::endl; return 0; } int sum_numbers(newgrounds::Player player, newgrounds::Payload data) { int result = 0; for (auto i : data.getvi("numbers")) { result += i; } std::cout << "Sum: " << result << std::endl; return 0; } int main() { newgrounds::events::add("print", print, {"message:string"}); newgrounds::events::add("sum", sum_numbers, {"numbers:vector<int>"}); newgrounds::set_port(5000); newgrounds::set_secret_key("YOUR_SECRET_KEY"); newgrounds::start_server(); }

Most of that should be self-explanatory, but here's briefly what's happening:

- The secret key is your unique publisher key (I'm not really sure where you go to get this, but I got mine by PMing PsychoGoldish). It's required to authenticate users.

- The stuff in the brackets in the events::add function is the expected parameter names and types. There isn't any limit to how many expected parameters you can define.

- The data.gets() and data.getvi() functions are converting the stored data into what you require. There is no way to get around having to do this because of the nature of C++. Basically, the function names are short for get_string and get_vector_of_ints.

- The return value of the two event functions is used to denote the result, or, in other words, whether there was an error. A value of 0 represents that there was no error, as is the standard in C/C++. The returned value will be sent to the client that sent the payload data, so if there was some problem, the client can be informed.

All of that code I currently have working, but it's very messy and not finished, nor have I done any unit testing, so I won't be posting any source code just yet. I do have the WebSocket server source code on GitHub, as it's pretty much finished (other than some very minor things I plan on changing which won't affect any functionality).

Anyway, that's all for now.

I hope to have this finished, or at least in a usable state, by the end of the month. I'll be designing it such that anyone with a beginner to intermediate understanding of C++ will be able to use it; I'll be hiding all the tricky and mucky asynchronous networking function calls beneath the API, so all you'll see is pure sex.

I'll also be writing some basic code for the client-side so that you won't need to write any boilerplate code to use the server, but I haven't started that yet because it's not pertinent.

Hopefully someone will actually read all that text and/or be interested in using this.

Response to The Flash 'Reg' Lounge 2015-03-15 21:26:56


At 3/15/15 08:42 PM, Diki wrote: Got another small update for y'all regarding the C++ WebSocket server I posted about earlier.

So in haxe, I guess I did all the stuff you didn't in that I made the actual ng api but avoided publisher stuff, though I stopped altogether because of a haxe bug where incoming byte data gets dropped if there's a 0x00 somewhere in it (todo for Haxe 3.4, 3.2 released today, sigh).

I am confused about what the server stuff has to do with ng though. With my lack of cpp syntax knowledge, it looks like you're asking ng to add numbers for you, and PG is like "ok I guess, here's a secret key." I guess, why do you need publisher access or what are you going to do with it?

Response to The Flash 'Reg' Lounge 2015-03-15 21:58:34


At 3/15/15 09:26 PM, MSGhero wrote: So in haxe, I guess I did all the stuff you didn't in that I made the actual ng api but avoided publisher stuff, though I stopped altogether because of a haxe bug where incoming byte data gets dropped if there's a 0x00 somewhere in it (todo for Haxe 3.4, 3.2 released today, sigh).

I'm not really using the Newgrounds API other than to authenticate users (which is done by sending a POST request here).

At 3/15/15 09:26 PM, MSGhero wrote: I am confused about what the server stuff has to do with ng though. With my lack of cpp syntax knowledge, it looks like you're asking ng to add numbers for you, and PG is like "ok I guess, here's a secret key." I guess, why do you need publisher access or what are you going to do with it?

I'm not asking Newgrounds to do anything in those two events. I think the confusion is coming from me having chosen the namespace "newgrounds", which I chose because this API won't work unless tied to Newgrounds, not because the functions in that namespace are involved with the Newgrounds servers.

The secret key is a required argument in the POST request to the user_auth.php file I linked above. When you publish an HTML5 game on the portal, it's loaded inside of an iframe which is passed data about the user currently viewing the game: their username, userid and sessionid.

Given that HTML5 is JavaScript-based, it would be trivial to spoof that data and claim to be a user you're not (i.e. just change the values passed to the iframe). In other words: the data you're given there cannot be trusted and has to be verified, which is what the authentication with the secret key does.

So, lets say you had a very, very simple and lame HTML5 game that just sends a message to the server and nothing else. You could use this basic code for the client:

var socket = new WebSocket("ws://myserver.com:5000"); socket.onmessage = function(event) { var payload = JSON.parse(event.data); if (payload.type === "authenticated") { socket.send( JSON.stringify({ "type": "chat", "to": "MSGHero", "message": "I like hotdogs." }) ); } }; socket.onopen = function() { socket.send(JSON.stringify( "username": ng.username, "userid": ng.userid, "sessionid": ng.sessionid )); };

The socket will connect to the server, send the information passed to the iframe (which can easily be parsed out of the query string, pretend I included the code to do that), and await confirmation that the information is valid. Presuming it is valid, that whole operation shouldn't take much, if at all, longer than the latency to the server

It the client receives information that it was verified, it sends an event payload in JSON format. Because the event payload has a type of "chat", and valid parameters (i.e. the 'to' and 'message' fields), it will call the chat() function in the C++ code I posted above, which will be passed the fields as part of the newgrounds::Payload object.

The server will also respond with the result of the event payload. So, in this example, if the "I like hotdogs." were successfully sent to you, MSGHero, the client would receive a response with the result code 0. If there were some error, such as the message being undeliverable because you're not connected, the server could respond with the code -1, or some other predefined value that represents that particular error in that particular situation.

Basically, the client sends data, which the server interprets and calls a function based on it and responds with a code representing the result of the function call.

I just want to stress that this is API not in any way similar to the HTML5 Newgrounds API. My API is simply code that can be used to create a server so you can create online multiplayer applications (e.g. a chat room or online poker or online worms/tanks or whatever). It is a TCP-based server, so real-time games are mostly out of the question as they would require UDP, but anything turn-based can be made with TCP just fine.

I haven't tested any of this with the HTML5 Newgrounds API, nor have I tried using that at all, but I don't see any reason that you wouldn't be able to use it with my API, as the client-side and server-side code don't really communicate with Newgrounds.

Response to The Flash 'Reg' Lounge 2015-03-15 22:17:21 (edited 2015-03-15 22:18:56)


At 3/15/15 09:58 PM, Diki wrote: I just want to stress that this is API not in any way similar to the HTML5 Newgrounds API. My API is simply code that can be used to create a server so you can create online multiplayer applications (e.g. a chat room or online poker or online worms/tanks or whatever). It is a TCP-based server, so real-time games are mostly out of the question as they would require UDP, but anything turn-based can be made with TCP just fine.

Gotcha, then are you making a turn-based multiplayer game for ng? I don't remember if you mentioned it in the first post.

Or the next time someone posts in the collab forum about wanting to make a MMO also I'm 14 and this is my first game (i.e. tomorrow), will you post this like "here, this will help you out with the backend"?

Edit: NG says I'm offline which raises some questions about my state of being.

Response to The Flash 'Reg' Lounge 2015-03-15 22:38:57


At 3/15/15 10:17 PM, MSGhero wrote: Gotcha, then are you making a turn-based multiplayer game for ng? I don't remember if you mentioned it in the first post.

I don't think that I mentioned it, but I am.

At present I'm working on a kind of side-project game, just to stress test the server code. It's going to just be a Pictionary-esque game where players group together in "rooms", where one person draws something, the other players see it being drawn and have to guess what they're drawing. I think the game "Drawin with Friends" does the same thing. It isn't a particularly original game, but it's more than anything a test to make sure the server can do what it should, and it's not very difficult to make (the game itself is a little over half finished).

Tecnically a drawing game isn't really turn-based, as the drawing does update as the person draws, but it's non-real-time enough that TCP can handle it no problem; the drawing just updates a little bit more slowly.

At 3/15/15 10:17 PM, MSGhero wrote: Or the next time someone posts in the collab forum about wanting to make a MMO also I'm 14 and this is my first game (i.e. tomorrow), will you post this like "here, this will help you out with the backend"?

Pretty much. I like multiplayer games, and writing server-side code for them can be a real bitch, so I opted to develop an API to let people create their own game servers without having to write a few thousand lines of boilerplate code (all the code I've written for this is getting close to two-thousand lines and it's not even half-done).

I also plan on making a UDP-based server that essentially does the same stuff so people can make real-time games, and possibly implement compatibility with Flash sockets, but I'm sticking to TCP WebSocket sockets for now.

Response to The Flash 'Reg' Lounge 2015-03-16 23:11:55 (edited 2015-03-16 23:12:27)


The next time I can compile my game, remind me to never update libraries, editors, and compilers until after I'm done.

to be fair, it's dev flixel and FD, and haxe 3.2 hasn't been officially announced because of these issues

It even feels like updating flash player made things worse.

Response to The Flash 'Reg' Lounge 2015-03-17 05:33:54


Lolwhut?
On a 980? You're joking, right?


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2015-03-17 12:08:52


At 3/17/15 05:33 AM, egg82 wrote: Lolwhut?
On a 980? You're joking, right?

Is it detecting your default card? It always detects my active card, which when not playing a game is the Intel 3000 rather than AMD.

Response to The Flash 'Reg' Lounge 2015-03-17 15:46:18 (edited 2015-03-17 15:47:39)


At 3/17/15 12:08 PM, MSGhero wrote: Is it detecting your default card? It always detects my active card, which when not playing a game is the Intel 3000 rather than AMD.

My other card is an AMD which doesn't play nicely with the 980. I removed it; the only card in my system is the 980.
I heard reports about HotS being porrly-optimized for NVIDIA cards, but I mean come on. lol
I played it fine on max settings at 60 FPS, minus a few dips. Before everything shut down, anyway.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2015-03-18 23:53:45 (edited 2015-03-18 23:53:53)


Soo, I got fired today.
..
..
..

):

Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2015-03-19 14:53:38


At 3/18/15 11:53 PM, egg82 wrote: Soo, I got fired today.
..
..
..
):

What happened?


- Matt, Rustyarcade.com

Response to The Flash 'Reg' Lounge 2015-03-19 18:52:53


At 3/19/15 02:53 PM, Rustygames wrote: What happened?

Ah, my fault.

My job was partially commission (5%) but we didn't get anything until we hit $400 in net sales.
So, if we got $390, we only got hourly. If we hit $400, we got our hourly plus 5% of $400 which was $20. If we made $650 then we got 5% of $650, etc etc etc.

I was at $385 for the day, so I made a fake cash sale for $20. I texted my co-worker to tell him to ignore the missing $20 in the till and I would return the next day to make that sale and give someone the receipt I printed out that day.
(This practice isn't uncommon where I work)

Problem is, my phone was out of service so the text was never sent. He reported $20 missing from the till and my boss pieced everything together. Hence, fired.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2015-03-20 23:50:16


Oh, man, I completely lost sight of what I came down here for.
I left Loveland and moved to Denver so I could get a job and pay for the things I wanted. I slowly wound up paying bills and other expenses and debts instead and completely stopped doing things I liked.
What the hell is life worth if you're not living?

I'm gonna chill from working for a few days and focus more on stuff I actually like doing. I have next month's rent paid and enough food (and a temporary Saturday job to cover food) - I'm gonna go enjoy life for a bit.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2015-03-21 05:54:03


At 3/20/15 11:50 PM, egg82 wrote: Oh, man, I completely lost sight of what I came down here for.
I left Loveland and moved to Denver so I could get a job and pay for the things I wanted. I slowly wound up paying bills and other expenses and debts instead and completely stopped doing things I liked.
What the hell is life worth if you're not living?

I'm gonna chill from working for a few days and focus more on stuff I actually like doing. I have next month's rent paid and enough food (and a temporary Saturday job to cover food) - I'm gonna go enjoy life for a bit.

Cooking the books eh? :P

Sorry to here it mate, at least you've got a months rent in hand and hopefully a bit of scratch on top to go drinking with ;)


- Matt, Rustyarcade.com

Response to The Flash 'Reg' Lounge 2015-03-22 18:15:58


At 3/21/15 05:54 AM, Rustygames wrote: Cooking the books eh? :P

Yeah, that was a mistake, slightly. lol

Sorry to here it mate, at least you've got a months rent in hand and hopefully a bit of scratch on top to go drinking with ;)

$200 should be enough, yeah.

Man, I told myself I'd take it easy and I've still been working at temp jobs and finding a permanent job every day now. The hell is wrong with me?


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2015-03-23 16:06:55



Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2015-03-23 21:00:03 (edited 2015-03-23 21:01:29)


Damn, I'm late on my first parking ticket. Hopefully it didn't go up much.
Still got that other $25 ticket.

Oh, christ, I'm gonna hit the DMV tomorrow and find out I owe a couple grand in fines, I can feel it.
On an unrelated note, my mother sent me this.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2015-03-27 19:36:09


At 3/23/15 09:00 PM, egg82 wrote: Damn, I'm late on my first parking ticket. Hopefully it didn't go up much.
Still got that other $25 ticket.

Oh, christ, I'm gonna hit the DMV tomorrow and find out I owe a couple grand in fines, I can feel it.
On an unrelated note, my mother sent me this.

I don't pay parking tickets out of principle (unless I really deserved them). But then I live in a free country where I won't be shot by the police or something.


- Matt, Rustyarcade.com

Response to The Flash 'Reg' Lounge 2015-03-27 19:50:52


At 3/27/15 07:36 PM, Rustygames wrote: I don't pay parking tickets out of principle (unless I really deserved them). But then I live in a free country where I won't be shot by the police or something.

That's reserved for black people.

Response to The Flash 'Reg' Lounge 2015-03-30 21:40:58


At 3/30/15 09:28 PM, CodeCrunch wrote: Also recently met a guy who doesn't know how to code but makes about £3000 a month doing "web development" that consists of no more than setting up wordpress accounts and installing plugins/ stock images to said accounts, how common is this?

In the US, it's not uncommon. You probably have the people who don't realize how easy(ish) wordpress makes it, but then you also have the people who don't have any time to set it up and hire someone. I say easyish because some people don't understand things even remotely code-oriented, though it's straightforward from my perspective.

Response to The Flash 'Reg' Lounge 2015-03-31 05:12:05


After browsing the internet for a while, I have discovered this:
An intelligent post/comment brings intelligent discussion. The opposite is also true. If you're sick of stupid people, stop provoking/invoking stupid people.

On a completely unrelated note, if you want to grow hairy balls then drink straight whiskey. Hollywood makes it seem so easy!

Hold me, I'm drunk

Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2015-03-31 13:19:30


At 3/31/15 05:12 AM, egg82 wrote: If you're sick of stupid people, stop provoking/invoking stupid people.

But what do you do if you are the stupid person?

The Flash 'Reg' Lounge

Response to The Flash 'Reg' Lounge 2015-03-31 16:59:20


At 3/30/15 09:28 PM, CodeCrunch wrote: Words on jokes, apropos of nothing
I really hope the self referential nature of memes isn't asymptotic and that eventually meme culture will implode and I don't have to be subjected to this shit in every corner of the internet. Generally I feel like society is a little comedically oversaturated, every twitter I've seen (famous or not) just seems to be the nature of people vying for approval distilled down to an uncomfortable level. Do people feel like they have to be living in a sitcom to be fulfilled? One of the reasons I really like hanging with old people is that they just talk about shit and aren't concerned with being boring. Humour is great and all but I find it exhausting sometimes.

+1. What a nicely written comment :)


Also recently met a guy who doesn't know how to code but makes about £3000 a month doing "web development" that consists of no more than setting up wordpress accounts and installing plugins/ stock images to said accounts, how common is this?

£3k a month isn't that much if you're talking before tax (which people will always do if they're bragging about how much they earn). And I'm sure his job is a little more involved than you think (or what Metal Gear Solid bamboo said)


- Matt, Rustyarcade.com

Response to The Flash 'Reg' Lounge 2015-04-01 02:55:13 (edited 2015-04-01 02:56:14)


I love the 4/1 joke, but ow my eyes D:

At 3/31/15 01:19 PM, Diki wrote: But what do you do if you are the stupid person?

Well played, sir.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature

Response to The Flash 'Reg' Lounge 2015-04-09 16:21:31


Posted a contest thingy on freelancer.co.uk to do my company logo. Pretty exciting to see what people come up with (although so far nothing has blown me away, so hopefully this isn't a waste of money).

Will let you guys know the result

https://www.freelancer.co.uk/contest/Design-a-Logo-for-Epic-Industries-193312.html


- Matt, Rustyarcade.com