• What are you working on? December 2011 Edition
    3,353 replies, posted
I feel a little silly posting in here surrounded by awesome things, but I'm going to anyways, because I've finally been able to get the first semblance of useful data out of my Kinect tonight! [img]http://imgkk.com/i/t47p.png[/img] [I'm sitting on a chair holding my arm out toward the kinect and giving a thumbs-up, if that helps make sense of the image.] I know it looks terribad, I'm still trying to make sense of the scale and direction of the depth in the point cloud by sampling at a lower resolution, waving my arms around, and squinting at the screen.
[QUOTE=voodooattack;33820765] *snippity snip* [/QUOTE] The actual parsing is okay I think, just the message parsing is iffy. It assumes that the message will be in this format: [["gotMessage", "message goes here"]] If it contains other bits at the beginning or end such as typing or suggestSpyee, stuff like this happens: brazil"], ["suggestSpyee" I am not familiar with JSON.NET, is the problem solved in the code you posted? Going to try work out how to implement the spying feature. Also, hopefully be able to get random strangers ID's, so you can send messages from their ID, and even disconnect them. :D
[QUOTE=Naarkie;33826037]The actual parsing is okay I think, just the message parsing is iffy. It assumes that the message will be in this format: [["gotMessage", "message goes here"]] If it contains other bits at the beginning or end such as typing or suggestSpyee, stuff like this happens: brazil"], ["suggestSpyee" I am not familiar with JSON.NET, is the problem solved in the code you posted?[/QUOTE] The server sends responses as a JSON encoded array. You really shouldn't be parsing it like that, considering that a single response could dispatch multiple events. That's what causes the problem you mentioned, but my code dispatches all events in order. And yes, it solves that, along with the problem of escape character handling. [QUOTE=Naarkie;33826037]Going to try work out how to implement the spying feature. Also, hopefully be able to get random strangers ID's, so you can send messages from their ID, and even disconnect them. :D[/QUOTE] What do the spying events signify? I really have no idea what those are. Ah, and one more thing, Cleverbot's replies are already URI encoded, so your original implementation was doing it twice and people were figuring it out from the messed up text. I fixed it like this (and added trick "is typing" events while the bot is thinking to fool people even more): In omegle.cs: [csharp] /// <summary> /// Sends a message to the connected stranger. /// </summary> /// <param name="message">The message to send</param> /// <returns>The stranger response</returns> public string SendMessage(string message) { message = HttpUtility.UrlEncode(message); //URL encode it first return SendMessageRaw(message); } public string SendMessageRaw(string message) { //Send Message format: [url]http://bajor.omegle.com/send?id=ID&msg=MSG[/url] PostSubmitter sendPost = new PostSubmitter(); sendPost.Url = "http://bajor.omegle.com/send"; sendPost.PostItems.Add("id", ID); sendPost.PostItems.Add("msg", message); sendPost.Type = PostSubmitter.PostTypeEnum.Post; return sendPost.Post(); } public void StartTyping() { PostSubmitter sendPost = new PostSubmitter(); sendPost.Url = "http://bajor.omegle.com/typing"; sendPost.PostItems.Add("id", ID); sendPost.Type = PostSubmitter.PostTypeEnum.Post; sendPost.Post(); } public void StopTyping() { PostSubmitter sendPost = new PostSubmitter(); sendPost.Url = "http://bajor.omegle.com/stoppedtyping"; sendPost.PostItems.Add("id", ID); sendPost.Type = PostSubmitter.PostTypeEnum.Post; sendPost.Post(); } [/csharp] In omegle_MessageReceived: [csharp] omegle.StartTyping(); string response = bot.Think(e.message).Replace("Cleverbot", "Jasmin"); //MWAHAHAHA omegle.StopTyping(); omegle.SendMessageRaw(response); //Already URI encoded[/csharp] [editline]21st December 2011[/editline] I also advise letting the bot initiate the conversation, it's tenfold as interesting when the bot draws first blood. [csharp] private static void omegle_Connected(object sender, EventArgs e) { Console.WriteLine("Connected."); Log("\r\nConnected"); omegle_MessageReceived(null, new MessageReceivedArgs(string.Empty)); } [/csharp] [quote]13:30:27 Cleverbot: Can you run? 13:30:41 Stranger: run? what? :O yes 13:30:41 Cleverbot: So you have legs? 13:30:55 Stranger: yepp 13:30:55 Cleverbot: Yes. 13:31:13 Stranger: why? 13:31:13 Cleverbot: Because that is my purpose. 13:31:30 Stranger: to run? 13:31:30 Cleverbot: Yes. 13:31:39 Stranger: do you have legs? 13:31:39 Cleverbot: Yes. Do you? 13:32:8 Stranger: okaaay. this is a weird conversation, but yeaah, as i told you, i have.[/quote]
Hollygram is now statically linked (had to patch Holly to work on Linux again), so it's now one library.
[QUOTE=Night-Eagle;33825010]Worked on this UDP packet sequencing code (again), thought some people might find it helpful since it can be a bit of a pain: This is used for reliability schemes when networking over UDP. I didn't really need to change much from my first implementation, but I fixed a really nasty bug in the PostAck method where I didn't check the edge case where delta == 0. I could probably revert to 32-bit fields without a problem, but for some reason, I feel the need to support a latency of 1600 (as compared to 800 milliseconds maximum for a 32-bit seqfield - sending packets at a base rate of 50 milliseconds.) The testing program still looks purdy: Here, three packets have been dropped and are never re-sent. The first column indicates a fail state and turns 1 when overflow is encountered. I feel like I should do tests more complicated than alternating packet order with a small maximum sequence number value, though. Also, it turns out that bitshifts have undefined behavior in C++ if you shift by more than the size of the number.[/QUOTE] Just to let you know, if you have packet loss you need to slow the packets you're sending out right down, if you don't then the packet loss will get significantly worse.
[QUOTE=Simspelaaja;33784625][IMG]http://www.1337upload.net/files/s_2011-12-18_22.20.55.png[/IMG] Working on a game inspired by Game Dev Story.[/QUOTE] Hire Chris Sawyer immediately.
Does anyone know of somewhere I can get free assets? Like, textures, basic models etc? I can sort of make programmer textures in gimp, but I don't know the first thing about how to start with modeling.
I'd decided not to post more in this thread but this is just too much. [quote]Stranger typing... Stranger: can you talk to me for a few minutes until I cum? :-) Are you a girl? Cleverbot: can i? Stranger typing... Stranger typing... Stranger: can you what Cleverbot: have a children with you? Stranger is disconnected. Restarting main loop.[/quote]
I finally figured out why everything was failing horribly "Wait, why is the C code writing to that location, its--- wait, where did I place the bss section again..." Now, the problem is that I dont know how large the bss section is, dangit :v: [editline]21st December 2011[/editline] Wait, upon examining this closer, what the FUCK are you doing, GCC? [code] COMMON 0x0000c000 0x8 sysldr.o 0x0000c000 partitions 0x0000c004 pci_devices 0x0000c008 end = .[/code] When did I ever tell you to place this shit here [editline]21st December 2011[/editline] -fno-common solved that, but still, what the fuck
Updaaate. [URL="http://code.google.com/p/dot-omegle/source/detail?r=9"]rv9[/URL] Should I make a CleverOmegle thread in programming after all? In the other thread it was by another program. Perhaps "Automated omegle trolling v2"?
I finished adding control points to my animations. Now I just need my artist to make me a few hats, add a control point to the player's head, and then HATS! [editline]21st December 2011[/editline] [vid]http://dl.dropbox.com/u/4093439/cpoints.webm[/vid] Fuck yeah.
ASCII shapes, yay: [img]http://puu.sh/bbZt[/img] [img]http://puu.sh/bbZy[/img] Only done the code for a triangle yet, which was pretty easy. Next up is the circle, which will probably be much harder. I might as well do the easy rectangle before that though.
[QUOTE=Naarkie;33828935]Updaaate. [URL="http://code.google.com/p/dot-omegle/source/detail?r=9"]rv9[/URL] Should I make a CleverOmegle thread in programming after all? In the other thread it was by another program. Perhaps "Automated omegle trolling v2"?[/QUOTE] I'm adding recaptcha support right now, I'll post a patch file when I'm done. Omegle is aware of my nefarious intentions.
Hi again, WAYWO. So, here's today's grief. There are a few instances in my little mod where I have to learn how the Source SDK works to replicate runtime generation of objects for creation of them in Lua. It's pretty fun, but more often than being fun, it puts me in a bind, because for long durations of time I get demotivated and this demotivation keeps me from doing that critical research I need. Today I didn't have much to do, so I though I'd look back into how to create VGUI Panel objects at runtime. There's this class called EditablePanel, and it has a virtual function called CreateControlByName which is typically used as a virtual factory for extending your own custom Panel classes. Code for that looks like this: [cpp]Panel *CClassMenu::CreateControlByName(const char *controlName) { if( !Q_stricmp( "MouseOverPanelButton", controlName ) ) { MouseOverPanelButton *newButton = CreateNewMouseOverPanelButton( m_pPanel ); m_mouseoverButtons.AddToTail( newButton ); return newButton; } else { return BaseClass::CreateControlByName( controlName ); } } [/cpp] As you can see, it creates a MouseOverPanelButton if the string matches, otherwise it falls back on default VGUI factory jazz. I figured, this must be a way to circumvent having to add stuff to a factory that we don't have access to or something along those lines. I guess it could be thought of like detouring (if you're stretching the definition) before actually getting around to having the factory take care of creation. I currently use that in a Lua binding to create Panel objects. I figured this must be a typical factory structure, so I [i]need[/i] to rely on that function for runtime generation. Except it isn't. I have some of the code for EditablePanel that's not in the SDK, and I realized I could just see how it works through that. [cpp]//----------------------------------------------------------------------------- // Purpose: Virtual factory for control creation //----------------------------------------------------------------------------- Panel *EditablePanel::CreateControlByName(const char *controlName) { if (!strcmp(controlName, "Label")) { return new Label(NULL, NULL, "Label"); } else if (!strcmp(controlName, "Button")) { return new Button(NULL, NULL, "Button"); } else if (!strcmp(controlName, "CheckButton")) { return new CheckButton(NULL, NULL, "CheckButton"); } else if (!strcmp(controlName, "ComboBox")) { return new ComboBox(NULL, NULL, 5, true); } else if (!strcmp(controlName, "Menu")) { return new Menu(NULL, "Menu"); } else if (!strcmp(controlName, "MenuItem")) { return new MenuItem(NULL, NULL, "MenuItem"); } else if (!strcmp(controlName, "MessageBox")) { return new MessageBox("MessageBox", "MessageBoxText"); } else if (!strcmp(controlName, "ProgressBar")) { return new ProgressBar(NULL, NULL); } else if (!strcmp(controlName, "RadioButton")) { return new RadioButton(NULL, NULL, "RadioButton"); } else if (!strcmp(controlName, "ScrollBar")) { return new ScrollBar(NULL, NULL, false); } else if (!strcmp(controlName, "TextEntry")) { return new TextEntry(NULL, NULL); } else if (!strcmp(controlName, "RichText")) { return new RichText(NULL, NULL); } else if (!strcmp(controlName, "ToggleButton")) { return new ToggleButton(NULL, NULL, "ToggleButton"); } else if (!strcmp(controlName, "ImagePanel")) { return new ImagePanel(NULL, "ResourceImagePanel"); } else if (!strcmp(controlName, "AnimatingImagePanel")) { return new AnimatingImagePanel(NULL, NULL); } else if (!strcmp(controlName, "Panel")) { return new Panel(NULL, NULL); } else if (!strcmp(controlName, "Divider")) { return new Divider(NULL, "Divider"); } else if (!strcmp(controlName, "URLLabel")) { return new URLLabel(NULL, NULL, "URLLabel", NULL); } else if (!strcmp(controlName, "EditablePanel")) { return new EditablePanel(NULL, NULL); } return NULL; } [/cpp] How fucking nice. It's not a factory. I could have written this shit myself and had Panel work done for my mod months ago. The primary reason this is important to me is because Frame, the base structure for most windows in VGUI2 and dialog boxes, isn't a control, so I can't create it CreateControlByName. I needed to see how to add it to the factory without using CreateControlByName directly, which I now know, doesn't actually use a factory. Stuff like this makes me wonder what Garry did or what problems he had when writing core parts of GMod. [editline]21st December 2011[/editline] I also just wanted to add that I know Garry has a bad rep for supposed bad coding and bad design and bad this and bad that, but the work I've done over the last couple of years has put me in a place where I realize some of his work is pretty clever.
It works! You can't stop me Omegle. :eng101: [IMG]http://dl.dropbox.com/u/27714141/captcha.png[/IMG]
[img]http://puu.sh/bc7y[/img] It's beginning to look a lot like Christmas...
Load it full of cheesy chat up lines. Bot: Do you have any raisins? Stranger: No Bot: How about a date then? :v:
[QUOTE=Murkat;33827708]Hire Chris Sawyer immediately.[/QUOTE] You called? ...it's going to suck if I ever really get into the games industry. "No, I'm not THAT Chris Sawyer :/"
Well, I'm going to try to take a vacation from programming now that I've fixed my whole wrists and hands aching and being unable to type. Maybe play a few games, sit at my desk lonely all day and cry, that kind of thing. Ciao!
[img]http://puu.sh/bcaO[/img]
Man, I wish I could print an image to the console... Also, best line ever. [quote]Cleverbot: I used to think I was indecisive but now I am not so sure.[/quote]
[img]http://i.imgur.com/7hwyT.png[/img]
Decided to take a break from other things and try out random terrain. So first I just placed grass and water randomly, with a bigger chance of grass spawning. [img]http://dl.dropbox.com/u/6470891/firsttherewasthisshit.png[/img] And then I made some tile replacement code, bound it to a button, and produced this; [img]http://dl.dropbox.com/u/6470891/thentherewasthis.png[/img] And finally I accidentally on purpose pressed the button again. [img]http://dl.dropbox.com/u/6470891/thenfinallythis.png[/img] ... mission accomplished?
Patch sent: [url]http://code.google.com/p/dot-omegle/issues/detail?id=1[/url]
[IMG]http://content.screencast.com/users/codydv/folders/Jing/media/889afe72-ce88-487a-a23e-3fcf3acaa1dd/2011-12-21_1439.png[/IMG] Holocaust Tycoon. Ignore the fact that I don't have any Jew sprites so I used Ash.
I rated you funny at first, but then I reconsidered. You're serious, aren't you?
[QUOTE=cody8295;33831814][IMG]http://content.screencast.com/users/codydv/folders/Jing/media/889afe72-ce88-487a-a23e-3fcf3acaa1dd/2011-12-21_1439.png[/IMG] Holocaust Tycoon. Ignore the fact that I don't have any Jew sprites so I used Ash.[/QUOTE] Next up, 9/11 Simulator 2012.
[QUOTE=voodooattack;33831900]I rated you funny at first, but then I reconsidered. You're serious, aren't you?[/QUOTE] Yes, why would I post if I weren't serious? [QUOTE=Darwin226;33831903]Next up, 9/11 Simulator 2012.[/QUOTE] Hmmmm
I'm having one of these days: Me: Hey, could you look at this code? My brain: AAAAAAHHHHHHHHH!!!!!!! Me: I'm sure it's really not that complicated. My brain: AAAAAAHHHHHHHHH!!!!!!! Me: Maybe I should do something else right now. [sp]My brain: How about some Skyrim. Me like Skyrim.[/sp]
[QUOTE=cody8295;33831915]Yes, why would I post if I weren't serious?[/QUOTE] Bacon Hitler approves. [IMG]http://i.imgur.com/ABzjH.jpg[/IMG] [editline]21st December 2011[/editline] [QUOTE=Ortzinator;33832042]I'm having one of these days: Me: Hey, could you look at this code? My brain: AAAAAAHHHHHHHHH!!!!!!! Me: I'm sure it's really not that complicated. My brain: AAAAAAHHHHHHHHH!!!!!!! Me: Maybe I should do something else right now. [sp]My brain: How about some Skyrim. Me like Skyrim.[/sp][/QUOTE] That's basically what I'm facing right now. Although in my case, I'm build-sick.. after building mountains of libraries to get gstreamer and its dependencies working, I still have buttloads more to do to build its plugins.
Sorry, you need to Log In to post a reply to this thread.