1. Post #3441
    Gold Member
    Ortzinator's Avatar
    May 2005
    1,645 Posts
    The Functionality of code, how you approached different problems and how efficient your code it.

    Not differences that don't make any changes in compiled state

    like

    void myfunc() {
           // Do stuff
    }
    
    // vs
    
    void MyFunc()
    {
           // Do stuff
    }
    
    Where do you work that they let you use whatever coding style you want?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2Optimistic Optimistic x 1 (list)

  2. Post #3442
    King Flawless's Avatar
    July 2010
    1,625 Posts
    Code:
    19:03 - |TzC| The Cupid Stunt: i know
    19:03 - |TzC| The Cupid Stunt: but this is a pretty simple gamemode
    19:03 - |TzC| The Cupid Stunt: this is the hardest part of it really
    19:03 - |TzC| The Cupid Stunt: and i have made a full game before
    19:04 - |TzC| The Cupid Stunt: so i though why dont i just go ahead and make a gmod gamemode
    19:04 - King Flawless: What did you make the game in?
    19:04 - |TzC| The Cupid Stunt: gamemaker
    :barf:
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 28 (list)

  3. Post #3443
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,616 Posts
    That doesn't make any sense, GWEN is in C++
    how is this so dumb

    Edited:

    Argh fucking point doesn't wanna unproject

    -snip-

    note to self, "divide by w" applies to unprojection too
    Reply With Quote Edit / Delete Windows XP United States Show Events Dumb Dumb x 2 (list)

  4. Post #3444
    Gold Member
    Darwin226's Avatar
    January 2009
    3,878 Posts
    So I ported my GLSL helper thing to WPF and I'd appreciate it if someone could try it with Mono.
    It has some stuff that I'm not sure if Mono supports.

    http://anyhub.net/file/2V9W-glslhelper.rar
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events

  5. Post #3445
    deloc's Avatar
    January 2008
    1,148 Posts
    Blogged about how other people's coding annoys me
    yeah one thing i really hate is when people use hungarian notation in lua.

    Edited:

    OH WAIT
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Zing Zing x 19Dumb Dumb x 2Winner Winner x 1Funny Funny x 1 (list)

  6. Post #3446
    Capsup's Avatar
    April 2007
    809 Posts
    So I'm working on my first opengl application, and I got this piece of code to choose a pixel format in windows.
    Code:
    	int pixAttribs[] = { WGL_SUPPORT_OPENGL_ARB, 1, // Must support OGL rendering
    						 WGL_DRAW_TO_WINDOW_ARB, 1, // pf that can run a window
    						 WGL_ACCELERATION_ARB,   1, // must be HW accelerated
    						 WGL_COLOR_BITS_ARB,     24, // 8 bits of each R, G and B
    						 WGL_DEPTH_BITS_ARB,     16, // 16 bits of depth precision for window
    						 WGL_DOUBLE_BUFFER_ARB,	 GL_TRUE, // Double buffered context
    						 WGL_SAMPLE_BUFFERS_ARB, GL_TRUE, // MSAA on
    						 WGL_SAMPLES_ARB,        8, // 8x MSAA 
    						 WGL_PIXEL_TYPE_ARB,      WGL_TYPE_RGBA_ARB, // pf should be RGBA type
    						 0}; // NULL termination
    
    	// Ask OpenGL to find the most relevant format matching our attribs
    	// Only get one format back.
    	wglChoosePixelFormatARB(g_hDC, &pixAttribs[0], NULL, 1, &nPixelFormat, (UINT*)&nPixCount);
    However, that leaves me with an error that it cannot find a matching pixel format. However, if I remove the hardware accelerated option it finds a pixel format but nothing gets rendered at all. My graphics card supports Opengl 3.3, and the drivers are up to date. Any ideas? I'm very new to opengl so it might just be something really stupid.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events

  7. Post #3447
    Gold Member
    Fire's Avatar
    October 2005
    1,491 Posts
    I remember something in this thread about a terraria widescreen prog with fixed hug placements, but I can't find it anymore, anyone have a link?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  8. Post #3448
    Gold Member
    bobthe2lol's Avatar
    July 2007
    1,370 Posts
    Missed you FP :love:
    Apparently, it didn't miss you.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 5Agree Agree x 3Zing Zing x 1 (list)

  9. Post #3449
    Gold Member
    ZeekyHBomb's Avatar
    June 2006
    3,577 Posts
    So I ported my GLSL helper thing to WPF and I'd appreciate it if someone could try it with Mono.
    It has some stuff that I'm not sure if Mono supports.

    http://anyhub.net/file/2V9W-glslhelper.rar
    Code:
    $ mono GLSLDebugHelperWPF.exe 
    The entry point method could not be loaded
    It works fine on other programs, I also have the newest version (2.10).
    Reply With Quote Edit / Delete Linux Germany Show Events

  10. Post #3450
    Gold Member
    WeltEnSTurm's Avatar
    December 2007
    1,862 Posts
    I just found out about C++0x.
    #include <string>
    #include <vector>
    #include <iostream>
    
    using namespace std;
    
    
    vector<string> awesomeface = {
    		"HI THERE",
    		"Whuzup",
    		"HAHAHA",
    		"this is stupid",
    };
    
    int main(){
    	for(string& s: awesomeface){
    		cout << s << endl;
    	}
    }
    
    Reply With Quote Edit / Delete Windows 7 Austria Show Events Late Late x 1Dumb Dumb x 1 (list)

  11. Post #3451
    Gold Member
    ZeekyHBomb's Avatar
    June 2006
    3,577 Posts
    Reply With Quote Edit / Delete Linux Germany Show Events

  12. Post #3452
    Gold Member
    Darwin226's Avatar
    January 2009
    3,878 Posts
    :(
    I couldn't get Avalon syntax highlighting on WinForms.
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events

  13. Post #3453
    Lutin's Avatar
    December 2007
    64 Posts
    How do you not know what XNA does?
    Completely misread what he said.
    Also had no idea what GWEN was.

    Total herp derp moment on my part.

    Edited:

    So I'm working on my first opengl application, and I got this piece of code to choose a pixel format in windows.
    -snip-
    However, that leaves me with an error that it cannot find a matching pixel format. However, if I remove the hardware accelerated option it finds a pixel format but nothing gets rendered at all. My graphics card supports Opengl 3.3, and the drivers are up to date. Any ideas? I'm very new to opengl so it might just be something really stupid.
    Replace the 1 after WGL_ACCELERATION_ARB with WGL_FULL_ACCELERATION_ARB
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 2 (list)

  14. Post #3454
    asherkin's Avatar
    October 2009
    40 Posts
    Lack of an internet connection from my desktop PC for the last couple of days sort of brought my regular programming stuff to a halt and I had been admiring high's work on a Terraria map renderer a few pages back right before I lost connection, so today I decided to give one a shot as well.

    Having never messed with anything related to 2D games (sprite sheets, etc.), it was quite fun to do!
    Only things left to work out are tile "styles" (which is probably the biggest thing of the whole lot), better colours for the liquids and proper background transition points (it'll probably only work on a Small map at the moment).
    It renders into 1200px x 1200px tiles currently, rather than a single large image.

    Some earlier renderings: http://dl.dropbox.com/u/6938670/Terr...orld1_test.png http://dl.dropbox.com/u/6938670/Terr...rld1_test2.png http://dl.dropbox.com/u/6938670/Terr...rld1_test3.png
    Rendering using the current code of the column around my house: http://dl.dropbox.com/u/6938670/Terr...rariaHouse.png (Warning, it's big.)
    "Deep Zoom" image of the full map (this is currently using older code, it's rebuilding right now): http://fennec.limetech.org/terraria
    Reply With Quote Edit / Delete Linux Thailand Show Events Programming King Programming King x 3 (list)

  15. Post #3455
    Gold Member
    ThePuska's Avatar
    October 2005
    3,334 Posts
    Does anyone know of a method to weigh nodes with 2-dimensional (or more general) coordinates so that their barycenter is a given point?

    Mathematically



    How does one determine the multipliers a(k)?

    (Quite clearly there are an infinite amount of solutions except for perhaps some special cases - but just one will do for me)

    Edited:

    Or does anyone know anything about this problem? How hard is it? Can it be reduced to some other problem?

    Edited:

    Oh wait, I just realized that's actually a very simple problem. Nevermind then
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  16. Post #3456
    Gold Member

    March 2005
    3,028 Posts
    Does anyone know of a method to weigh nodes with 2-dimensional (or more general) coordinates so that their barycenter is a given point?

    Mathematically



    How does one determine the multipliers a(k)?

    (Quite clearly there are an infinite amount of solutions except for perhaps some special cases - but just one will do for me)

    Edited:

    Or does anyone know anything about this problem? How hard is it? Can it be reduced to some other problem?
    I've never heard of this problem before, but aren't there an infinite number of solutions there?
    As a heuristic, couldn't you give them all a weight of 1 initially, find S', then take the difference of S and S' to determine which way center of mass has to move? You could probably take the dot product of this difference vector and each v_k to determine a weight adjustment factor and repeat the process in an iterative fashion, with smaller adjustments each iteration.
    Reply With Quote Edit / Delete Windows 7 Show Events

  17. Post #3457
    Lutin's Avatar
    December 2007
    64 Posts
    I've never heard of this problem before, but aren't there an infinite number of solutions there?
    As a heuristic, couldn't you give them all a weight of 1 initially, find S', then take the difference of S and S' to determine which way center of mass has to move? You could probably take the dot product of this difference vector and each v_k to determine a weight adjustment factor and repeat the process in an iterative fashion, with smaller adjustments each iteration.
    That's actually the definition of a system of linear equations where v_k are the coefficients, a_k are the variables and S is the desired result. (Though in most formal math you would see k start from 1, but that's just nitpicking)

    Edited:

    And yes there are an infinite number of solutions if n exceeds the dimension of the space you are working in.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Winner Winner x 4Agree Agree x 1 (list)

  18. Post #3458
    Gold Member
    ThePuska's Avatar
    October 2005
    3,334 Posts
    Beaten to it.

    Edited:

    It was much harder in my mind when I was thinking of all kinds of stuff like how you'd do some weird gradient shit with the nodes etc. and just writing the definition out made me realize how easy it was
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  19. Post #3459
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,616 Posts
    Working on serializing my game world into a file so i can make levels
    Reply With Quote Edit / Delete Windows XP United States Show Events

  20. Post #3460
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,081 Posts
    Crossposting from WDYNHW:

    So I'm still trying to convert BBcode to JSON, and still no further. My regex really sucks.

    I'm trying to turn this:

    This is some text.

    [url=http://example.com]This is a URL[/url]

    This is an image:

    [img]http://lol.com/lol.png[/img]

    That was an image. Here's a YouTube video:

    [media]video-id-here[/media]

    [b]This is some bold text.[/b]

    Into this:

    Code:
    {
    	"tags":[
    		{
    			"text":"This is some text.\n\n"
    		},
    		{
    			"url":{
    				"content":"This is a URL",
    				"href":"http://example.com"
    			}
    		},
    		{
    			"text":"\n\nThis is an image:\n\n"
    		},
    		{
    			"img":"http://lol.com/lol.png"
    		},
    		{
    			"text":"\n\nThat was an image. Here's a YouTube video:\n\n"
    		},
    		{
    			"youtube":"video-id-here"
    		},
    		{
    			"text":"\n\n"
    		},
    		{
    			"b":"This is some bold text."
    		}
    	]
    }
    Any suggestions? Doing this in PHP, by the way, as part of vBulletin, so all it's functions are available for use.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  21. Post #3461
    Neigh
    CarlBooth's Avatar
    June 2007
    28,535 Posts
    Um, the whole point of WDYNHW is so that WAYWO isn't littered with questions like this...
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Agree Agree x 11Zing Zing x 2Disagree Disagree x 1 (list)

  22. Post #3462
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,081 Posts
    Um, the whole point of WDYNHW is so that WAYWO isn't littered with questions like this...
    True, but most of the questions in WDYNHW are rather simple, figured this was more of a challenge.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Dumb Dumb x 16Disagree Disagree x 1 (list)

  23. Post #3463
    Gold Member
    thomasfn's Avatar
    July 2008
    2,881 Posts
    Is the post limit per thread capped at 3.5k now? If so, who's making v18?
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Late Late x 1 (list)

  24. Post #3464
    Neigh
    CarlBooth's Avatar
    June 2007
    28,535 Posts
    Is the post limit per thread capped at 3.5k now? If so, who's making v18?
    go for it
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Agree Agree x 5 (list)

  25. Post #3465
    deloc's Avatar
    January 2008
    1,148 Posts
    i have an op ready but anyone else wants to make it go for it.

    Edited:

    oops i didn't save it nevermind then!
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Funny Funny x 5 (list)

  26. Post #3466
    Neigh
    CarlBooth's Avatar
    June 2007
    28,535 Posts
    deloc you've made the last 3, let someone else have a turn!
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Agree Agree x 6 (list)

  27. Post #3467
    Gold Member
    thomasfn's Avatar
    July 2008
    2,881 Posts
    Where's that automatic thing Overv made..
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Disagree Disagree x 1 (list)

  28. Post #3468
    deloc's Avatar
    January 2008
    1,148 Posts
    Where's that automatic thing Overv made..
    i don't know, which is why i just go through posted images and pick out anything that looks interesting.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Agree Agree x 2Optimistic Optimistic x 1 (list)

  29. Post #3469
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    Where's that automatic thing Overv made..
    I'll let it run on this thread.

    Edit: Here you go.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Useful Useful x 1 (list)

  30. Post #3470
    Gold Member
    thomasfn's Avatar
    July 2008
    2,881 Posts
    Thanks, but you posted that link literally a second after I trawled through every page.

    Oh well, it didn't take too long, it's amazing how many pages of content there aren't.

    Unfortunately, I must go to bed now - but here is what I've come up with.
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Friendly Friendly x 1 (list)

  31. Post #3471
    mmavipc's Avatar
    February 2009
    830 Posts

    I love how easy .NET makes this
    Reply With Quote Edit / Delete Windows 7 United States Show Events Programming King Programming King x 1 (list)

  32. Post #3472
    Map in a box's Avatar
    July 2009
    6,577 Posts
    Thomas thats a nice OP! <3
    Reply With Quote Edit / Delete Windows XP Professional x64 United States Show Events

  33. Post #3473
    mmavipc's Avatar
    February 2009
    830 Posts
    Thomas thats a nice OP! <3
    Isn't the max post count 5k, why are we talking about v18 right now?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Disagree Disagree x 5 (list)

  34. Post #3474
    Gold Member

    March 2005
    3,028 Posts
    I'll let it run on this thread.

    Edit: Here you go.
    It goes by artistic ??
    Reply With Quote Edit / Delete Windows 7 Show Events Dumb Dumb x 1Funny Funny x 1Disagree Disagree x 1 (list)

  35. Post #3475
    Gold Member
    BlkDucky's Avatar
    May 2008
    6,425 Posts
    Isn't the max post count 5k, why are we talking about v18 right now?
    Nope. 3.5k now.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  36. Post #3476
    I haz a title.
    Borsty's Avatar
    September 2005
    308 Posts
    Implemented a little neural network thingy during the last 2 hours.. using backpropagation for learning.
    Results look promising already, will have to do some more testing when I find the time :D

    // Generate network with 2 input neurons and 1 output neuron
    final Network network = NetworkFactory.generateSigmoidNet( new int[] { 2, 4, 4, 1 } );
    
    // Teach the network to act like a logic AND gate
    System.out.println( "Pre test 0,1 -> 0 ");
    network.setInputValues( new double[] { 0, 1 } );
    network.dumpOutput();
    
    System.out.println( "Pre test 1,1 -> 1 ");
    network.setInputValues( new double[] { 1, 1 } );
    network.dumpOutput();
    
    final int steps = 1000;
    for ( int i = 0; i < steps; i++ ) {
    
    	final double learningRate = 1.0 - ( i / (double)steps );
    
    	network.setInputValues( new double[] { 0, 1 } );
    	network.learn( new double[] { 0 }, learningRate );
    
    	network.setInputValues( new double[] { 1, 1 } );
    	network.learn( new double[] { 1 }, learningRate );
    
    	network.setInputValues( new double[] { 1, 0 } );
    	network.learn( new double[] { 0 }, learningRate );
    
    	network.setInputValues( new double[] { 0, 0 } );
    	network.learn( new double[] { 0 }, learningRate );
    
    }
    
    System.out.println( "Post test 0,1 -> 0 ");
    network.setInputValues( new double[] { 0, 1 } );
    network.dumpOutput();
    
    System.out.println( "Post test 1,1 -> 1 ");
    network.setInputValues( new double[] { 1, 1 } );
    network.dumpOutput();
    

    Resulting in:

    Code:
    Pre test 0,1 -> 0 
    Layer  3:	[0] = 0,84, 
    Pre test 1,1 -> 1 
    Layer  3:	[0] = 0,84, 
    
    Post test 0,1 -> 0 
    Layer  3:	[0] = 0,04, 
    Post test 1,1 -> 1 
    Layer  3:	[0] = 0,95,
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Winner Winner x 2Artistic Artistic x 1Programming King Programming King x 1 (list)

  37. Post #3477
    Map in a box's Avatar
    July 2009
    6,577 Posts
    Rated artistic because I don't know whats going on.
    Reply With Quote Edit / Delete Windows XP Professional x64 United States Show Events Dumb Dumb x 2Funny Funny x 1 (list)

  38. Post #3478
    Richy19's Avatar
    May 2010
    5,273 Posts
    Rated artistic because I don't know whats going on.
    you dont need to tell us everytime you rate artistic.

    Also managed to fix the problem i was having, boxes for everyone


    It also takes into account mass so some objects can fall faster thna others
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Dumb Dumb x 12Artistic Artistic x 1Funny Funny x 1 (list)

  39. Post #3479
    Samuka97's Avatar
    April 2007
    1,982 Posts
    C++ Primer Plus is awesome. I'm gonna try to make a little game where you explore a dungeon, but I can't decide on how to store the map: 2D arrays or just have several blocks. With several blocks I could enable destruction and generate random dungeons easily, while with 2D arrays I'm not sure. Should I go for 2D arrays or just instances?

    Edit: And my idea is just like the game below. Damn.
    Reply With Quote Edit / Delete Windows 7 Brazil Show Events

  40. Post #3480
    Gold Member
    BlkDucky's Avatar
    May 2008
    6,425 Posts


    My roguelike still isn't dead. :buddy:

    I don't even remember adding the Combustible Lemon enemy. Must have been post-Portal 2's release, though.

    Anyway, added a lot of stuff I can't really show...

    The "Unthreatened" text on the bottom right changes depending on the situation. For instance, if your character has taken a lot of damage it will change to "Wounded", or if he's dead it'll change to "Deceased". Added a ton of items and monsters, as well.

    Another neat feature is that if you stay on a particular level for an extended period of time, the game will spawn a "motivator monster" which is almost impossible to kill, forcing the player to descend and therefore stops excessive grinding. There is forewarning, though, so it's not completely cheap. In this case the "Unthreatened" text changes to "Endangered."

    Also, I'm aware I misspelled "combustible". Heh.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Winner Winner x 7Funny Funny x 1Artistic Artistic x 1 (list)