1. Post #81
    Everyone has a $1 title
    Skipcast's Avatar
    November 2008
    6,721 Posts
    I've been lurking in here for years, so I guess it's time to actually make something other than uni related work and contribute.



    This is all rendered using Console.WriteLine's using C# which is pretty wonky.
    You should consider parsing arrow keys for movement. Typing repeatedly will probably get really annoying after 5 minutes.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Agree Agree x 5 (list)

  2. Post #82
    Zee!'s Avatar
    April 2008
    714 Posts
    You should consider parsing arrow keys for movement. Typing repeatedly will probably get really annoying after 5 minutes.
    Will probably add that sooner rather than later, but I wanted to build the foundation for all kinds of different mobs first. : )
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events

  3. Post #83
    Sidneys1's Avatar
    June 2014
    311 Posts
    Converted my monolithic main() to a finite state machine with generics, worked on the first try! successbaby.jpg
    Reply With Quote Edit / Delete United States Show Events Winner Winner x 3Informative Informative x 1Useful Useful x 1 (list)

  4. Post #84
    Fourier's Avatar
    July 2014
    3,847 Posts
    Nice! Why is that good for? Does it works like a "restart" state?

    Edited:

    If Facepunch feels sane then I must be insane according to everyone here
    Reply With Quote Edit / Delete Windows 8 Slovenia Show Events Agree Agree x 5 (list)

  5. Post #85
    SirCrest is my life, so is yours.
    Goz3rr's Avatar
    October 2009
    8,095 Posts
    Since I've been able to rip Final Fantasy XII stuff with intact animations and all, I thought maybe I'll just make a clone of FF12
    Doesn't matter if it's not finished though, at least I'tll be a fun learning.
    Thinking of making it fight like Dark Souls (yeah its a long shot but still)
    For now I'll just make it and endless procedurally generated dungeon, with infinite depth.
    Would be fun if it's multiplayer, just to see how the players will survive the depths



    The Hell Wyrm. I remembered fighting this guy for 4 hrs straight with his 30-layer HP bar

    Damn, DarkBASIC, haven't seen that in a while. I think that's the language I started 3D stuff in
    Reply With Quote Edit / Delete Netherlands Show Events Friendly Friendly x 1 (list)

  6. Post #86
    Gold Member
    Darwin226's Avatar
    January 2009
    5,164 Posts
    This is the first thing that worked properly: https://github.com/JahTheDev/irc-fs
    Pretty great considering that it's also natively meant for F#.
    Reply With Quote Edit / Delete Croatia Show Events

  7. Post #87
    Fourier's Avatar
    July 2014
    3,847 Posts
    Why do you need IRC? Botnet?

    Also that feel when game is 99% done and you just need to puuuuuuush
    Reply With Quote Edit / Delete Windows 8 Slovenia Show Events

  8. Post #88
    Gold Member
    Darwin226's Avatar
    January 2009
    5,164 Posts
    Why do you need IRC? Botnet?

    Also that feel when game is 99% done and you just need to puuuuuuush
    Integration with a chat service.
    Reply With Quote Edit / Delete Croatia Show Events

  9. Post #89
    I'm rocketsnail full of rocketfail! Drop boxes ⇒⇒⇒
    Rocket's Avatar
    January 2011
    3,244 Posts
    Apparently you can press F12 in Visual Studio Code to open up Chrome Dev Tools:

    You'd think they'd disable that when they released it.
    Reply With Quote Edit / Delete United States Show Events Funny Funny x 16Winner Winner x 1Informative Informative x 1 (list)

  10. Post #90
    Gold Member
    Karmah's Avatar
    December 2007
    6,383 Posts
    Thanks to Cartman300 in WDYNHW and people on stackoverflow, I'm finally able to create world geometry with repeating textures!
    (One of these days I'll stop using these ugly dev-textures)


    (it's a single object, I should have switched to wireframe at the end to show that)

    Next up, implementing resizing with the mouse in my 2D viewports.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Winner Winner x 5Programming King Programming King x 1 (list)

  11. Post #91
    Sidneys1's Avatar
    June 2014
    311 Posts
    Nice! Why is that good for? Does it works like a "restart" state?
    Usually when I design games I go for a "component" style structure, however I felt that a FSM more closely resembles the flow of control in a game. For example, say I have three states: MainMenuState, IngameState, and PauseState. MainMenu can transition to Ingame, Ingame can transition to Pause, and Pause can Transition to Ingame or MainMenu. Plus then it's all modular and really easy to extend. Still a lot of work to do, but so far it's working for me :)
    Reply With Quote Edit / Delete United States Show Events

  12. Post #92
    Gold Member

    April 2011
    4,312 Posts
    Also here's some SSAO because why not:


    Could you spare a tip or two how you did it ?
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Agree Agree x 1 (list)

  13. Post #93
    Gold Member
    The Inzuki's Avatar
    August 2008
    3,897 Posts


    now i got two model loaders that don't work correctly (in two different ways!)
    Reply With Quote Edit / Delete Windows 7 United States Show Events Winner Winner x 3 (list)

  14. Post #94
    Meow :3
    Ac!dL3ak's Avatar
    July 2005
    6,141 Posts
    I just wrote this so please excuse any mistakes or anything like that.
    https://gist.github.com/Polkm/6fa5c263efb6cbab9018

    Sorry if it goes too much or too little into detail. I didn't want to bog it down with a ton of GLSL examples.
    Thanks, I got the shaders working in love, but now I need to learn about GLSL because I don't know wtf is going on in those
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  15. Post #95
    Dennab
    December 2008
    6,305 Posts
    I am out of work for a month. I've got my classmates to trade food for debugging their code.

    In other news, why the fuck is there no byref/byval keyword in java like there is in c#? a lot of times when my classmates are having some kind of problem with their code it's because they don't understand the difference between the two and it's because java is like, 99% byref
    Reply With Quote Edit / Delete Linux United States Show Events Friendly Friendly x 4Disagree Disagree x 1 (list)

  16. Post #96
    Gold Member
    No_0ne's Avatar
    October 2005
    3,552 Posts


    just spent like two hours making sure these two identical platforms never fall out of sync, worth it

    edit:
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 28Winner Winner x 5Agree Agree x 1 (list)

  17. Post #97
    Source Engine Optometrist!
    cra0kalo's Avatar
    June 2010
    2,266 Posts
    More cVision stuff
    This time aim lines big thanks to Tamschi for the math angle help. Basically will draw the enemies viewangles when they are using snipers so you can see the exact angle they are holding.    BOTS SEE THROUGH WALLS   
    Reply With Quote Edit / Delete United Kingdom Show Events Programming King Programming King x 7Dumb Dumb x 1Friendly Friendly x 1 (list)

  18. Post #98
    Gold Member
    Dr Magnusson's Avatar
    July 2008
    2,828 Posts
    I think we need to do a census of WAYWOer, so we can find out once and for all exactly how many Matts we have.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Funny Funny x 4 (list)

  19. Post #99
    Gold Member
    war_man333's Avatar
    May 2006
    7,734 Posts
    I think we need to do a census of WAYWOer, so we can find out once and for all exactly how many Matts we have.
    http://facepunch.com/showthread.php?t=1463724
    Reply With Quote Edit / Delete Denmark Show Events Winner Winner x 5Funny Funny x 2 (list)

  20. Post #100
    Gold Member
    BoowmanTech's Avatar
    April 2013
    1,333 Posts
    More cVision stuff
    This time aim lines big thanks to Tamschi for the math angle help. Basically will draw the enemies viewangles when they are using snipers so you can see the exact angle they are holding.    BOTS SEE THROUGH WALLS   
    Is source using C++ ?
    Reply With Quote Edit / Delete United Kingdom Show Events Dumb Dumb x 4 (list)

  21. Post #101
    Gold Member
    Darwin226's Avatar
    January 2009
    5,164 Posts
    I am out of work for a month. I've got my classmates to trade food for debugging their code.

    In other news, why the fuck is there no byref/byval keyword in java like there is in c#? a lot of times when my classmates are having some kind of problem with their code it's because they don't understand the difference between the two and it's because java is like, 99% byref
    Passing by reference is almost exclusively what you want.
    Reply With Quote Edit / Delete Croatia Show Events Agree Agree x 6 (list)

  22. Post #102
    polkm's Avatar
    August 2007
    842 Posts
    Thanks, I got the shaders working in love, but now I need to learn about GLSL because I don't know wtf is going on in those
    This is an old ass thread but I still like it, especially the simplified bloom shader. https://love2d.org/forums/viewtopic.php?f=4&p=38565

    Code:
    vec2 image_size;
    
    vec4 effect(vec4 color, Image tex, vec2 tc, vec2 pc)
    {
        vec2 pixel_offset = vec2(1.0)/image_size;
        color = Texel(tex, tc); // maybe add a weight here?
    
        color += Texel(tex, tc + vec2(-offset.x, offset.y));
        color += Texel(tex, tc + vec2(0, offset.y));
        color += Texel(tex, tc + vec2(offset.x, offset.y));
    
        color += Texel(tex, tc + vec2(-offset.x, 0));
        color += Texel(tex, tc + vec2(0, 0));
        color += Texel(tex, tc + vec2(offset.x, 0));
    
        color += Texel(tex, tc + vec2(-offset.x, -offset.y));
        color += Texel(tex, tc + vec2(0, -offset.y));
        color += Texel(tex, tc + vec2(offset.x, -offset.y));
    
        return color / 9.0; // use 10.0 for regular blurring.
    }
    The way you would set "image_size" is like this.

    Code:
    shader:send("image_size", {canvas:getDimensions()})
    If you want to see some really crazy GLSL then go here http://glslsandbox.com/
    Reply With Quote Edit / Delete Linux United States Show Events

  23. Post #103
    RusselG's Avatar
    February 2011
    580 Posts
    Is source using C++ ?
    It has previously been stated that this has been done in C#.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Zing Zing x 3Dumb Dumb x 1 (list)

  24. Post #104
    Gold Member
    BoowmanTech's Avatar
    April 2013
    1,333 Posts
    It has previously been stated that this has been done in C#.
    Probably, but I didn't read that post so not my fault.
    Reply With Quote Edit / Delete United Kingdom Show Events Dumb Dumb x 23Friendly Friendly x 1Funny Funny x 1 (list)

  25. Post #105
    Gold Member
    fewes's Avatar
    December 2006
    1,716 Posts
    Could you spare a tip or two how you did it ?
    You mean the SSAO in particular?
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Agree Agree x 1 (list)

  26. Post #106
    Dennab
    December 2008
    6,305 Posts
    Passing by reference is almost exclusively what you want.
    Well I think it leads to unsafety. Though java is technically by value, something like:
    Code:
    int americaFuckYeah = 1;
    System.out.println(americaFuckYeah); // prints 1
    foo(americaFuckYea);
    System.out.println(americaFuckYeah); // prints 2
    
    foo(int bar){
        //do a bunch of shit
        bar = 2;
        //do some more shit
    }
    does all this without explicit instructions to do so
    Reply With Quote Edit / Delete Linux United States Show Events Disagree Disagree x 2Dumb Dumb x 2 (list)

  27. Post #107
    Gold Member
    RoflKawpter's Avatar
    December 2007
    2,576 Posts
    Well I think it leads to unsafety. Though java is technically by value, something like:
    Code:
    int americaFuckYeah = 1;
    System.out.println(americaFuckYeah); // prints 1
    foo(americaFuckYea);
    System.out.println(americaFuckYeah); // prints 2
    
    foo(int bar){
        //do a bunch of shit
        bar = 2;
        //do some more shit
    }
    does all this without explicit instructions to do so
    Umm actually you misspelled americafuckyeah in your foo parameters so you wont be able to compile your code or maybe run it I cant remember which because I just dont okay
    Reply With Quote Edit / Delete Canada Show Events Dumb Dumb x 4 (list)

  28. Post #108
    Gold Member
    Darwin226's Avatar
    January 2009
    5,164 Posts
    Well I think it leads to unsafety. Though java is technically by value, something like:
    Code:
    int americaFuckYeah = 1;
    System.out.println(americaFuckYeah); // prints 1
    foo(americaFuckYea);
    System.out.println(americaFuckYeah); // prints 2
    
    foo(int bar){
        //do a bunch of shit
        bar = 2;
        //do some more shit
    }
    does all this without explicit instructions to do so
    http://ideone.com/09Aetv

    No. It doesn't.
    It would be extremely weird if it did.

    A reference in this context is just a pointer to a constant value. You can change the pointer because it itself isn't constant (but this doesn't change the value passed in), and you can modify the object pointed to by using it's methods. The only thing you can't do is modify the object itself like you would be able to in C.

    Let's say you have an object `o` in memory at some address `a`

    Code:
    address: |a       |a+x
    data:    |o header|o data
    Then if you have a function like

    Code:
    void f(object oRef);
    What happens when you call it like
    Code:
    f(o)
    is that `oRef` (basically a pointer) becomes a. It let's you modify stuff in the `o data` memory with o's methods and properties. You can also do `oRef = something else` to rebind the `oRef` pointer to some other memory location. The only thing you can't change is the header part. You can't swap out the WHOLE `o` object in memory.

    You can think of primitive types (like ints, floats, bools) as having no data and consisting only of headers. With them you can just change what the pointer is pointing to, can't modify the object itself.
    Reply With Quote Edit / Delete Croatia Show Events

  29. Post #109
    Gold Member
    Richy19's Avatar
    May 2010
    5,732 Posts
    Well I think it leads to unsafety. Though java is technically by value, something like:
    Code:
    int americaFuckYeah = 1;
    System.out.println(americaFuckYeah); // prints 1
    foo(americaFuckYea);
    System.out.println(americaFuckYeah); // prints 2
    
    foo(int bar){
        //do a bunch of shit
        bar = 2;
        //do some more shit
    }
    does all this without explicit instructions to do so
    Thats not correct, however wrap the int in an object:
    Code:
    /* package whatever; // don't place package name! */
    
    import java.util.*;
    import java.lang.*;
    import java.io.*;
    
    class Bar
    {
    	public int i;
    	public Bar(int a){ i = a; }
    	public void add(){ i++; } 
    }
    
    /* Name of the class has to be "Main" only if the class is public. */
    class Ideone
    {
    	public static void main (String[] args) throws java.lang.Exception
    	{
    		Bar bar = new Bar(1);
    		System.out.println(bar.i); // prints 1
    		foo(bar);
    		System.out.println(bar.i); // prints 2
    
    	}
    	
    	static void foo(Bar bar){
    	    bar.add();
    	}
    }
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  30. Post #110
    Gold Member
    Darwin226's Avatar
    January 2009
    5,164 Posts
    A bit of clarification:

    pass-by-ref and pass-by-val are semantic concepts. People often confuse other things to relate to those concepts when they often have nothing to do with them.

    Code:
    void f(int x) { x = 5; }
    int a = 6;
    f(a)
    This doesn't modify a, but the fact that it doesn't has nothing to do with int being a value type. It definitely has nothing to do with passing by value.

    Code:
    void f(List<int> x) { x = new List<int>() { 1 }; }
    List<int> a = new List<int>() { 2 };
    f(a)
    Here we're using a List<int> which is a reference type, but a still doesn't get modified. Again, nothing to do with value/reference types and passing by reference.

    Assignment doesn't modify anything. Ever. It just rebinds an existing name (this is, for example, not true in C where you can do *p = something that does modify memory).

    Now take a look at this example:
    Code:
    void f(List<int> x) { x.Add(1); }
    List<int> a = new List<int>() { 2 };
    f(a)
    Here passing by reference actually comes into play.
    In a pass-by-ref language like C# and Java we would modify the SAME list we passed in. In a pass-by-val language, the list would get copies and the .Add wouldn't apply to the original.

    If you're comfortable with pointer, a convenient way to think about passing by reference is that EVERYTHING is a pointer. List<int> x, actually means List<int>* x. Combine that with the "caveat" that you can't do modifying assignment (*x = something), just regular assignment, and you have the pass-by-ref model.
    Reply With Quote Edit / Delete Croatia Show Events Agree Agree x 1Useful Useful x 1 (list)

  31. Post #111
    Gold Member

    April 2011
    4,312 Posts
    You mean the SSAO in particular?
    Yes <3
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Friendly Friendly x 1 (list)

  32. Post #112
    Dennab
    November 2009
    1,250 Posts
    due to source and quake influence, i'm used to nearly exclusively passing pointers around
    Reply With Quote Edit / Delete Mac United States Show Events Agree Agree x 4Friendly Friendly x 1 (list)

  33. Post #113
    Sidneys1's Avatar
    June 2014
    311 Posts
    Got attached generic behaviors, my single-inheritance/modular-function solution, working :) Now I can write a few lines of code and attach it to any IBehavioral<> object.
    Reply With Quote Edit / Delete United States Show Events Winner Winner x 1 (list)

  34. Post #114
    Dennab
    November 2009
    1,250 Posts
    polkm is basically the best, and you can't have him he's mine

    Edited:

    he introduced some fixes into Grid, which have been merged into VA and will be code dropped into grid-sdk on GitHub tonight
    Reply With Quote Edit / Delete Mac United States Show Events Friendly Friendly x 3 (list)

  35. Post #115
    Gold Member
    fewes's Avatar
    December 2006
    1,716 Posts
    It's very simple and rather rough if you actually look at the buffer (only 12 samples):



    It works by sampling the input mask with some small offsets, just a standard blur shader really.

    I'm using a predefined gaussian blur array but it could easily be moved to a 2-pass blur with n amount of samples. The only other inputs it takes besides the scene mask are the screen resolution and two values for the radius and offset.

    Here's the GLSL code:
    Code:
    uniform sampler2D rt_sceneMask;
    uniform vec2 r_screenRes;
    uniform float r_ssaoRadius;
    uniform vec2 r_ssaoOffset;
    
    vec2 taps[12] = vec2[12](
    	vec2( -0.326212, -0.405805),
    	vec2( -0.840144, -0.073580),
    	vec2( -0.695914,  0.457137),
    	vec2( -0.203345,  0.620716),
    	vec2( 0.962340, -0.194983),
    	vec2( 0.473434, -0.480026),
    	vec2( 0.519456,  0.767022),
    	vec2( 0.185461, -0.893124),
    	vec2( 0.507431,  0.064425),
    	vec2( 0.896420,  0.412458),
    	vec2( -0.321940, -0.932615),
    	vec2( -0.791559, -0.597705)
    );
    
    void main()
    {
    	vec4 ao = 0;
    	vec2 pixelSize = vec2( 1.0f / r_screenRes.x, 1.0f / r_screenRes.y );
    	// Center tap
    	ao += texture2D(rt_sceneMask, gl_TexCoord[0] + pixelSize * r_ssaoOffset.x );
    	if( r_ssaoRadius > 0 ) {
    		// Sample taps
    		int tapCount = 12;
    		for ( int i=0; tapCount > i; i++ )
    			ao += texture2D(rt_sceneMask, gl_TexCoord[0] + taps[i] * pixelSize * r_ssaoRadius + pixelSize * r_ssaoOffset.x );
    		ao *= ( 1.0 / (tapCount+1) );
    	}
    	
    	vec4 p_sceneMask = texture2D(rt_sceneMask, gl_TexCoord[0]);
    	float f_sceneMask = 1 - p_sceneMask.r * p_sceneMask.g;
    	
        gl_FragColor = ao.r * ao.g + f_sceneMask;
    }
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Winner Winner x 6Friendly Friendly x 1 (list)

  36. Post #116
    Gold Member
    war_man333's Avatar
    May 2006
    7,734 Posts
    Probably, but I didn't read that post so not my fault.
    this is proof we need the 'bad reading' rating back
    also what sort of dumb argument is that.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Agree Agree x 6 (list)

  37. Post #117
    Sidneys1's Avatar
    June 2014
    311 Posts
    Put my Generic Finite State Machine and Behavioral frameworks on GitHub. :)

    Edited:

    I have no idea if they're any good, so feedback is welcome :) So far they work, though they haven't been heavily tested.
    Reply With Quote Edit / Delete United States Show Events Winner Winner x 1Agree Agree x 1 (list)

  38. Post #118
    Dostoyevsky's Avatar
    December 2014
    91 Posts
    Put my Generic Finite State Machine and Behavioral frameworks on GitHub. :)

    Edited:

    I have no idea if they're any good, so feedback is welcome :) So far they work, though they haven't been heavily tested.
    What do these do/mean , for a starter?

    If I may ask ofc.
    Reply With Quote Edit / Delete Windows 7 Ukraine Show Events

  39. Post #119
    Dennab
    July 2009
    12,246 Posts
    this is proof we need the 'bad reading' rating back
    also what sort of dumb argument is that.
    Let's not stretch this into a page long argument
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  40. Post #120
    Sidneys1's Avatar
    June 2014
    311 Posts
    What do these do/mean , for a starter?

    If I may ask ofc.
    tl;dr:
    GFSM allows you to easily implement a finite state machine. In my case I used it to model the states of a game I'm working on (Main Menu, Ingame, Pause Menu, etc)
    Behavioral lets you attach behaviors to classes. In my case I use it to attach various behaviors to UIElements in my menu states.

    Not very descriptive I know, but they're kinda hard to explain. There is example code in the readme's, reading through it might make more sense than my babbling.
    Reply With Quote Edit / Delete United States Show Events