• What are you working on? January 2012
    3,401 replies, posted
Parser working, spitting out syntax trees - now with 100% less memory leaks! I haven't put procedure and function calls into the parser yet, I want to get the interpreter up and running first to make sure that everything's behaving as it should before I start bolting more stuff onto it. Nothing to show a picture of, really :S
PNG support for the Source Engine was easier to implement than I expected. [img]http://img853.imageshack.us/img853/7962/pngvv.png[/img] [code] int iPNG = gImageLoader->LoadPNG( "facepunch.png" ); vgui::surface()->DrawSetTexture( iPNG ); vgui::surface()->DrawSetColor( 255, 255, 255, 255 ); vgui::surface()->DrawTexturedRect(0,0,305,62);[/code] Annoying that textures have to be by the power of 2.
Yeah it's really easy huh. There's code all over the SDK doing exactly the same thing.
New thread, awesome.
[QUOTE=garry;34013146]Yeah it's really easy huh. There's code all over the SDK doing exactly the same thing.[/QUOTE] Well compiling zlib with the source engine was a doozy, but just adding PNG support afterwards was pretty straightforward. I just followed these three links: [url]http://zarb.org/~gc/html/libpng.html[/url] [url]https://developer.valvesoftware.com/wiki/DrawSetTextureRGBA[/url] [url]http://www.piko3d.com/tutorials/libpng-tutorial-loading-png-files-from-streams[/url] And it was pretty much a breeze. The code for how TGA's and steam avatars were loaded was helpful as well. Screenshot with FP logo resized so that the width and height were by the power of 2. [img]http://img13.imageshack.us/img13/9834/png2z.png[/img]
Not sure if this is the right place to ask, but this is for something I'm working on. Does anyone have a good image of a colour palette similar to the following, but without the alpha: [img]http://upload.wikimedia.org/wikipedia/commons/a/a7/Hue_alpha.png[/img] Wow, nevermind. After looking around for the last 15 minutes on Google for one I come across one right after I post this.
[QUOTE=Cyril;34009686]I have a question, how do you handle the case when an entity move from a cell to another ? I ask this, because I remember reading somewhere that quadtrees were well suited for a lot of static objects and few slow moving object ( objects that doesn't move to another cell often). But when you wanted a lot of fast-moving object, sweep-and-prune algorithm were better.[/QUOTE] Why not use both?
[QUOTE=PieClock;34013790]Not sure if this is the right place to ask, but this is for something I'm working on. Does anyone have a good image of a colour palette similar to the following, but without the alpha: [img]http://upload.wikimedia.org/wikipedia/commons/a/a7/Hue_alpha.png[/img][/QUOTE] Without the alpha it's just a rainbow gradient.
[QUOTE=Hentie;34013304]Well compiling zlib with the source engine was a doozy, but just adding PNG support afterwards was pretty straightforward. I just followed these three links: [url]http://zarb.org/~gc/html/libpng.html[/url] [url]https://developer.valvesoftware.com/wiki/DrawSetTextureRGBA[/url] [url]http://www.piko3d.com/tutorials/libpng-tutorial-loading-png-files-from-streams[/url] And it was pretty much a breeze. The code for how TGA's and steam avatars were loaded was helpful as well. Screenshot with FP logo resized so that the width and height were by the power of 2. [img]http://img13.imageshack.us/img13/9834/png2z.png[/img][/QUOTE] I used Freeimage. It has utility functions to resize images and stuff. So I just stretch the image to the next largest power of 2.
[QUOTE=Darwin226;34013832]Without the alpha it's just a rainbow gradient.[/QUOTE] I wanted it to fade into a grey at the bottom too, like in paint.
Slowly porting steam3 from SteamKit2 to java....So far got the encryption request but need to actually do the encryption stuff.
[QUOTE=Darwin226;34009652]Does it check for collisions only inside it's node or does it check neighboring nodes too?[/QUOTE] blobs only checks for collisions inside it's own node, you can see some errors with collisions inside the image when two blobs are colliding over a line. I've actually fixed this already by adding blobs to several nodes if they are crossing lines. [QUOTE=Cyril;34009686]I have a question, how do you handle the case when an entity move from a cell to another ?[/QUOTE] Every update I clear all of the quadtree's memory then re-add every particle. This effectively moves the entity from one cell to another.
[QUOTE=PieClock;34013936]I wanted it to fade into a grey at the bottom too, like in paint.[/QUOTE] I think you misunderstood him. The easiest way i can think of doing this is by the following: Put this, (0% -> 100% opacity black filled square) [img]http://i.imgur.com/E5OD9.png[/img] on top of: (horizontal rainbow gradient) [img]http://i.imgur.com/dethB.png[/img] and you get: [img]http://i.imgur.com/AYHid.png[/img]
[QUOTE=Naelstrom;34014216]blobs only checks for collisions inside it's own node, you can see some errors with collisions inside the image when two blobs are colliding over a line. I've actually fixed this already by adding blobs to several nodes if they are crossing lines. Every update I clear all of the quadtree's memory then re-add every particle. This effectively moves the entity from one cell to another.[/QUOTE] That seems terribly inefficient. Why not just check if the object has left the node?
[QUOTE=Darwin226;34014280]That seems terribly inefficient. Why not just check if the object has left the node?[/QUOTE] I couldn't think of a more optimal way at the time :( Thanks, that seems like a great idea let me try it.
[QUOTE=HeroicPillow;34014274]I think you misunderstood him. The easiest way i can think of doing this is by the following: -images- [/QUOTE] I see. That seems so obvious now. I'll keep it in mind, thanks.
Just feel like ranting a bit... dunno if you call it a rant even, more like a plea for help. The next session at my university is about to begin. I am going to have 3 programming courses, all of which will likely require a large programming assignment each week. Everyone thinks I'm crazy, but I think I can handle it. All the while I still want to work on the hamsters game... I don't want to lose interest (I doubt that'll happen this time around, but I really shouldn't get distant from the code). So I hope to work on that at least once a week. So that's four programming projects a week. But oh god... my professor just sent me a message to remind him that he wants to talk to me about "a project i want to do for this years Austin and San Fran GDCs conferences." He says he's going to propose the concept and work requirements to me tomorrow. :suicide:
[QUOTE=Darwin226;34014280]That seems terribly inefficient. Why not just check if the object has left the node?[/QUOTE] I usually do this in combination with a garbage collector cleaning up empty nodes and resizing the object lists if there's time left until the next tick (forcing it every so often if it hasn't had time to clean up in a while) Also kinda related; does anyone else name their nodes branches when implementing a tree structure?
[QUOTE=ralle105;34014618]I usually do this in combination with a garbage collector cleaning up empty nodes and resizing the object lists if there's time left until the next tick (forcing it every so often if it hasn't had time to clean up in a while) Also kinda related; does anyone else name their nodes branches when implementing a tree structure?[/QUOTE] But nodes aren't branches. Branches are links.
[QUOTE=jalb;34014608]But oh god... my professor just sent me a message to remind him that he wants to talk to me about "a project i want to do for this years Austin and San Fran GDCs conferences." He says he's going to propose the concept and work requirements to me tomorrow. :suicide:[/QUOTE] Research experience ahoy! If you get your name in as co-author you can tick that off your list of life goals.
[QUOTE=Darwin226;34014898]But nodes aren't branches. Branches are links.[/QUOTE] I guess. It just feels right to have a tree structure extend from the root splitting up into branches finally ending in leaves.
So I turned 19 today, anyone fancy making me a cake or am I gonna have to do it myself? :P [editline]2nd January 2012[/editline] Virtual cake, of course.
I love getting to the point in a game where your fps may drop if to many things are happening at once.
[QUOTE=NotoriousSpy;34015134]I love getting to the point in a game where your fps may drop if to many things are happening at once.[/QUOTE] Throw a sleep(500) into your update loop and enjoy your infinite satisfaction!
[QUOTE=HeroicPillow;34014274]I think you misunderstood him. The easiest way i can think of doing this is by the following: Put this, (0% -> 100% opacity black filled square) [img]http://i.imgur.com/E5OD9.png[/img] on top of: (horizontal rainbow gradient) [img]http://i.imgur.com/dethB.png[/img] and you get: [img]http://i.imgur.com/AYHid.png[/img][/QUOTE] You're missing white
[QUOTE=DrLuke;34015232]You're missing white[/QUOTE] The result is a 2D plane with x = hue and y = value. You'd need a third dimension for saturation.
[QUOTE=Deco Da Man;34015284]The result is a 2D plane with x = hue and y = value. You'd need a third dimension for saturation.[/QUOTE] I guess that's why there's always a slider next to it
[QUOTE=Deco Da Man;34015284]The result is a 2D plane with x = hue and y = value. You'd need a third dimension for saturation.[/QUOTE] y = luminosity
[QUOTE=DrLuke;34015232]You're missing white[/QUOTE] If you were to actually use this, you would normally fade to grey and have the slider control luminosity. This was just the quickest example I could make in photoshop while still getting the point across.
[img]http://i.imgur.com/1GoBa.png[/img] Okay, I've got the sfml test project working, doesn't eat full cpu and no problem for now. Fun fact: Arch Linux's official repo contains the 2.0beta version of sfml instead of 1.6. It was pretty straightforward to setup everything, and I learned about makefiles too! Now I start designing out some ideas before coding...
Sorry, you need to Log In to post a reply to this thread.