• What are you working on? February 2012
    3,497 replies, posted
  • [QUOTE=ben1066;34776627]So I was working on adding squirrel to my sourcemod and I hit a snag, for some reason the compile errors get horribly mangled and I have no idea why, circled in yellow. [IMG]http://dl.dropbox.com/u/11197643/snapshot0000.jpg[/IMG][/QUOTE] uh, alien swarm already has vscript
  • I'm trying to interact with javascript on a website through a windows form, and it occured to me that VB.NET (shut up) might not be the best option to use. What other things could I use for javascript interactions?
  • [media]http://www.youtube.com/watch?v=2mYaADG2-h4[/media] Abit of an update on my video, made the torch work correctly, I added collision (Not in the video, needs fixing.)
  • My GUI system has hit a hault. Slick2D doesn't have support for "stacked" clips. Can you do this in OpenGL?
  • [IMG]http://i.imgur.com/EMJ35.png[/IMG] Right, that's the graphics and input sorted. Now I just need to port my terrible 2d collision system from C++ to Lua, find out why the hell it doesn't work, sort it out, then port it back to C++. Woo. Incidentally, does anyone know what screenshot prog turb uses?
  • [QUOTE=Map in a box;34778169]My GUI system has hit a hault. Slick2D doesn't have support for "stacked" clips. Can you do this in OpenGL?[/QUOTE] Stencil testing? If you just want to calculate the intersection of a bunch of axis-aligned rectangles in 2D space, you can take the minimum of their maximum x- and y- coordinates and the maximum of their minimum x- and y- coordinates. This would enable you to use only one 'clip region' without having to do anything fancy. If you need to do the same thing for arbitrary geometry, you're better off using a stencil buffer. You can draw each polygon to the stencil buffer with GL_INCR, then you can test against it with GL_EQUAL with the value N, where N is the number of polygons. i.e. if you draw 5 polygons, with each incrementing the stencil buffer, then only pixels which are contained within every polygon will have a value of 5.
  • [QUOTE=PortalGod;34777927]I'm trying to interact with javascript on a website through a windows form, and it occured to me that VB.NET (shut up) might not be the best option to use. What other things could I use for javascript interactions?[/QUOTE] PhantomJS
  • Do you think it would be worth it to have my own forums for my mod? Even if it's a small group of devs that I talk to that post there, I'd kinda like my own place to dump shit that isn't Facepunch.
  • I love your mod but it's not really that popular yet. It's really cringe when people make forums that hardly anyone would use.
  • [QUOTE=layla;34779503]I love your mod but it's not really that popular yet. It's really cringe when people make forums that hardly anyone would use.[/QUOTE] This is exactly why I'm thinking I shouldn't. Anyway, that was quick enough feedback for me. Thank you, guys.
  • [QUOTE=amcfaggot;34779568]This is exactly why I'm thinking I shouldn't. Anyway, that was quick enough feedback for me. Thank you, guys.[/QUOTE] You could make a forum thread here in programming, I'd be sure to follow it.
  • [QUOTE=amcfaggot;34779568]This is exactly why I'm thinking I shouldn't. Anyway, that was quick enough feedback for me. Thank you, guys.[/QUOTE] A blog wouldn't hurt; even if it's not popular a blog doesn't rely on other users for content, and can easily gain popularity.
  • [QUOTE=calzoneman;34772448]Not sure if I'm late, but any plans for releasing this?[/QUOTE] Yup, but not before I'm happy with how it works. But being completely honest here, its a slow program when importing and exporting so using it for huge pictures isn't going to work well.
  • I'm fucked up really badly on my Breakout game. I'm going to have to re-do the entire game. [B]The[/B] [I]entire[/I] [SUB]fucking[/SUB] [SUP]game.[/SUP]
  • so i ran across a very odd crash in box2d every once in a while but i didn't really think much of it today, i decided to crack down on it, thinking that i've been misusing box2d turns out i ran across some obscure bug that only a handful of other people encountered, and i found exactly one thread about it, and erin posted an unexplained code snippet there that fixes it glad to know it wasn't my fault :v:
  • [QUOTE=ZenX2;34781525]Source control can fix that At least that's what I've heard[/QUOTE] That would've been no use for me, the tutorial that I used for the base of the program wouldn't quite fit with breakout. I used [URL="http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition.aspx"]this[/URL] for starting my game but it all just spiraled down in the end. Why did I use it? Well, for me it was kinda like this: Lets say you have an idea for something to draw. You get out a piece of paper and get a pen but, you just can't put your pen down and actually start it. Same here, I didn't know which part of the program to start with. My last game (Pong) was a complete monstrosity [sp] at least it was a full pong game even with changing ball speeds [/sp]. I had EVERYTHING in main.cpp. That's right, no classes. Not only that, but the movement didn't depend on time or framerate. So when I got off the slow laptop I was developing on and got on my desktop I couldn't even see the ball :v:. So Facepunch, when you start a new game, what's the first thing you start with? That's pretty much all I need to start again right now.
  • Sweet freetype is amazing. (Click for full view) [img_thumb]http://j.mp/wSAAo4[/img_thumb] Font rendering with full anti-aliasing, hinting, kerning, (I think it's unicode too?)etc. Freetype made it a piece of cake to do too, without it I'd be stuck with my little hand-made tilesets. [editline]asdf[/editline] [QUOTE=Bumrang;34781783]So Facepunch, when you start a new game, what's the first thing you start with? That's pretty much all I need to start again right now.[/QUOTE] I like to work on little 'modules' where I can code it once and use it in all of my projects. For example this freetype wrapper I made lets me render text on screen. I can use this in any future project I want, improving it when I see it's unfit. I think it's a really rewarding and fun way to tackle making a program.
  • Apparently my body decides to get a flu-like disease. Stop the presses! [editline]19th February 2012[/editline] [QUOTE=ROBO_DONUT;34778570]Stencil testing? If you just want to calculate the intersection of a bunch of axis-aligned rectangles in 2D space, you can take the minimum of their maximum x- and y- coordinates and the maximum of their minimum x- and y- coordinates. This would enable you to use only one 'clip region' without having to do anything fancy. If you need to do the same thing for arbitrary geometry, you're better off using a stencil buffer. You can draw each polygon to the stencil buffer with GL_INCR, then you can test against it with GL_EQUAL with the value N, where N is the number of polygons. i.e. if you draw 5 polygons, with each incrementing the stencil buffer, then only pixels which are contained within every polygon will have a value of 5.[/QUOTE] I'll only clip rectangles.
  • [QUOTE=Naelstrom;34781786]Sweet freetype is amazing. (Click for full view) [img_thumb]http://j.mp/wSAAo4[/img_thumb] Font rendering with full anti-aliasing, hinting, kerning, (I think it's unicode too?)etc. Freetype made it a piece of cake to do too, without it I'd be stuck with my little hand-made tilesets. [editline]asdf[/editline] I like to work on little 'modules' where I can code it once and use it in all of my projects. For example this freetype wrapper I made lets me render text on screen. I can use this in any future project I want, improving it when I see it's unfit. I think it's a really rewarding and fun way to tackle making a program.[/QUOTE] For the C# people here, I've been working on cross-platform FreeType bindings for .NET, which enables you to do write a similar system in C# without having to use any unmanaged/unsafe code in your project. [url]https://github.com/Robmaister/SharpFont[/url] [editline]a[/editline] I'm going to eventually write some OpenGL examples with OpenTK, I'm still writing the bindings, but the high-level API is working pretty well.
  • [QUOTE=Map in a box;34778169]My GUI system has hit a hault. Slick2D doesn't have support for "stacked" clips. Can you do this in OpenGL?[/QUOTE] If I understand you correctly, you want to be able to do something like this: Push Clipping Region (100,100,200,100) (x,y,w,h) Push Clipping Region (25,25,50,10) (new real clipping region is 125,125,50,10) Pop Clipping Region (new real clipping region is 100,100,200,100) If so, all you need to do is create a class with push/pop methods to apply the new clipping region every time you use them.
  • The mix and reset buttons work now. Also I figured out how ads work. [img]http://img856.imageshack.us/img856/2946/capture12ek.png[/img] [img]http://img46.imageshack.us/img46/8214/capture13v.png[/img] Now for a menu, tutorial thing, and icon. :dance:
  • holy shit coding at 2am half asleep is hard! but sometimes you just need something to be done in the morning
  • [QUOTE=icantread49;34782711]holy shit coding at 2am half asleep is hard! but sometimes you just need something to be done in the morning[/QUOTE] Thats the spirit! Programming King for you!
  • [QUOTE=Dr Magnusson;34773802]Almost all code generation is like that, even with optimization on. It'd be extremely difficult to write a compiler that could take all the possible combinations of methods into account and generate "perfect code". This is why lower level code is almost always faster.[/QUOTE] are you serious [editline]20th February 2012[/editline] so this is essentially what the assembly posted by tobba does: [cpp] struct foo { int a; int b; }; int get_b(struct foo* ptr) { int b = ptr->b; return b; } [/cpp] with [b]no[/b] optimization, this is what gcc does: [code] _get_b: push ebp mov ebp, esp sub esp, 0x18 mov eax, [ebp+0x08] mov eax, [eax+0x04] mov [ebp+0xf4], eax mov eax, [ebp+0xf4] leave ret [/code] at -fomit-frame-pointer -O3, this is what gcc does: [code] _get_b: mov eax, [esp+4] mov eax, [eax+4] ret [/code] that's as compact as you can get without inlining (which gcc does anyway)