[QUOTE=sarge997;47679038]I've been using C# for ages now, and I only JUST stumbled upon SendMessage, sweet baby christ how have I not seen or heard of this before, it's like I found gold.
I must be a terrible programmer if I didn't know of this until now. :v:[/QUOTE]
Do you mean SendMessage in Unity3D? Because that's not really part of C#, and to be honest it's not really the best way to implement a messaging system in C#.
[QUOTE=thomasfn;47679087]Do you mean SendMessage in Unity3D? Because that's not really part of C#, and to be honest it's not really the best way to implement a messaging system in C#.[/QUOTE]
He could mean the method for sending messages to other windows via the Windows API.
[QUOTE=Protocol7;47679104]He could mean the method for sending messages to other windows via the Windows API.[/QUOTE]
Maybe, but even then that's a PInvoke call and not really part of C#.
[QUOTE=thomasfn;47679087]Do you mean SendMessage in Unity3D? Because that's not really part of C#, and to be honest it's not really the best way to implement a messaging system in C#.[/QUOTE]
Unity's SendMessage is such a paradox; I try to avoid it but then I see them using it all the time in the official tutorials and I wonder why I disregard it. C# events are great and maintain the same modularity as SendMessage, but they must have had some reason behind writing it.
I want to make a game where you can move between multiple size scales seamlessly, and have an infinite map at the same time. So I'm creating my own spatial partitioning system that should dynamically handle objects of any size at any position, without ever running into overflow (which you would very quickly run into trying to store coordinates at small scales, because you could easily be 2^some ridiculous power units out at a small scale while like 100 units out at a larger scale). It also avoids problems with precision at the same time (if you used normal-scale coordinates for very small things, you would run out of precision before you even started)
The format for coordinates in 1D is: (Max Scale, Bifurcation List, [0, 1])
Where Max Scale is the largest scale that the point falls within 1 unit of. This is the reference point for the general scale of the coordinate. A Max Scale of 3 would include [0, 8] of scale 0 units. (For x units at scale s, the equivalent Max Scale is [s + ceil(log2(x))] )
Then the Bifurcation List is just a list of 0s and 1s that navigates down that Max Scale's tree of children to pinpoint the location at progressively smaller scales.
The last [0, 1] gives the relative location within whatever branch of the tree it gets to.
Objects of any size can be supported, because they are normalized to fit in [0, 1] and then are simply located in whatever scale they need to fit in.
Coordinates located far out an at small scales will take marginally more data to store than anything else, but the number of required bifurcations should grow logarithmically for however far out you go. (You would need to go twice as far each time to need another bifurcation due to increasing Max Scale, although the bifurcations still increase linearly as you go down in scale for however far out you're looking)
I still need to work out how collisions can be determined between different scales, although I have some ideas like larger scales overriding smaller scales (ants can have intense fights with ants, but you can thoughtlessly squish them with your finger, after all)
No flashy pictures yet because I just have notebook diagrams but eventually I will implement this, I might even try to use it for a final project for my gamedev class but I'd have to start on that pretty soon
This should be fairly straightforward to translate to 2D and even 3D, and it should be fun/interesting to render things correctly
Turns out my untested code I quickly wrote at work was shit. I got it kinda fixed tho
[t]http://i.imgur.com/uN9p1M0.png[/t]
It doesn't seem to like the mac&cheese tho.
Detection with sensitivity turned up
[t]http://i.imgur.com/sEWjDGQ.png[/t]
[url=http://i.imgur.com/3RXuPJe.png]Without the hard triangles it looks weird[/url]
[QUOTE=foszor;47679187]Unity's SendMessage is such a paradox; I try to avoid it but then I see them using it all the time in the official tutorials and I wonder why I disregard it. C# events are great and maintain the same modularity as SendMessage, but they must have had some reason behind writing it.[/QUOTE]
The only good use I can see for SendMessage is the ability to send a generic event to all components on a single GameObject, without any coupling. For instance, a weapon might fire a raycast and, on whatever object it hits, call SendMessage with "TakeDamage" and a damage info struct parameter. The other components on that GameObject are free to handle that message or not without having to purposefully subscribe to them through some kind of Damageable component or other centralized location.
But even then, there are other and faster ways to do this (such as making an interface called ITakeDamage with the method on it, and instead of using SendMessage just iterate through a GetComponents<ITakeDamage> - no reflection needed).
No, the image comes from Wikipedia :). I don't know what it was made with
What a shame wasting CPU cycles calculating each cell individually. Imagine the performance such a software would benefit if it was running on the GPU.
[QUOTE=Mega1mpact;47679349]It doesn't seem to like the mac&cheese tho.
Detection with sensitivity turned up
[t]http://i.imgur.com/sEWjDGQ.png[/t]
[url=http://i.imgur.com/3RXuPJe.png]Without the hard triangles it looks weird[/url][/QUOTE]
boy howdy mom, i love me some illuminati and cheese!
[QUOTE=Mega1mpact;47679349]Turns out my untested code I quickly wrote at work was shit. I got it kinda fixed the
[url]http://i.imgur.com/uN9p1M0.png[/url]
It doesn't seem to like the mac&cheese tho.
Detection with sensitivity turned up
[url]http://i.imgur.com/sEWjDGQ.png[/url]
[url=http://i.imgur.com/3RXuPJe.png]Without the hard triangles it looks weird[/url][/QUOTE]
[img]http://i.imgur.com/kkzppUH.png[/img]
Triple illuminati?
Spent the last two days optimizing code and moving everything over from the test environment to proper entity managers. The masking and lighting processes are now over ten times faster and my PC can easily handle thousands of sprites with over a thousand lights all rendering rim lighting and shadows. Adding new lights and drawing all world lights are now just single function calls away. I'm also experimenting with a depth buffer and automatic draw ordering.
That was all very satisfying in the end but it was also boring as shit so to give myself a break I coded a little dynamic console as well:
[vid]http://puu.sh/hFeq3.webm[/vid]
Doesn't support inputting commands yet but I might add that later if I feel like it'd help the project. I saw a very cool solution some guy made where you just pass variable pointers to the console class so you can modify any variables you want without much extra code, might try that.
[QUOTE=aurum481;47680251][img]http://i.imgur.com/kkzppUH.png[/img]
Triple illuminati?[/QUOTE]
I run multiple passes with a slightly higher filter over the grascale image every time, 8 to be exact.
I'm uncovering some really [url=http://i.imgur.com/7178YfS.jpg]spooky[/url] [url=http://i.imgur.com/efuf8IH.png]iluminati[/url] shit now tho.
only on facepunch can a discussion about webm turn into one about the illuminati
Should it only detect close-to-equilateral triangles? Or is the meme any kind of triangle?
[QUOTE=Mega1mpact;47680907]I run multiple passes with a slightly higher filter over the grascale image every time, 8 to be exact.
I'm uncovering some really [url=http://i.imgur.com/7178YfS.jpg]spooky[/url] [url=http://i.imgur.com/efuf8IH.png]iluminati[/url] shit now tho.[/QUOTE]
You may already know this, but you could try having an angle limit of some sort to avoid all of the weird shaped triangles, depending on how your algorithm works.
[QUOTE=Cow Muffins;47681102]Should it only detect close-to-equilateral triangles? Or is the meme any kind of triangle?[/QUOTE]
It's not hard to calculate the angles, trivial actually. The problem is that it's really rare for one of those triangles to be in any image. Especially when it comes to "natural" images.
Support for properties of type int, string, Color, Size and Point.
[vid]https://dl.dropboxusercontent.com/u/35032740/ShareX/2015/05/2015-05-08_02-42-22.webm[/vid]
[editline]8th May 2015[/editline]
[vid]https://dl.dropboxusercontent.com/u/35032740/ShareX/2015/05/2015-05-08_02-48-29.webm[/vid]
Man, Unity is pretty cool. A little non-intuitive at times, but damn, that productivity.
[IMG]http://i.imgur.com/evByZT1.gif[/IMG]
I've been working on fixing my goddamned motherfucking phone all night and haven't been able to write up how I finished my arithemetic EMDAS parser.
input:
[code]collin@collin-notebook:~/Documents/Code/C/lex$ ./algebra 2+2*3-5+9/3^2*6+4^2*5+17^2*9+17*8
[/code]
output:
[code]
2+2*3-5+9/9*6+4^2*5+17^2*9+17*8
2+2*3-5+9/9*6+16*5+17^2*9+17*8
2+2*3-5+9/9*6+16*5+289*9+17*8
2+6-5+9/9*6+16*5+289*9+17*8
2+6-5+1*6+16*5+289*9+17*8
2+6-5+6+16*5+289*9+17*8
2+6-5+6+80+289*9+17*8
2+6-5+6+80+2601+17*8
2+6-5+6+80+2601+136
8-5+6+80+2601+136
3+6+80+2601+136
9+80+2601+136
89+2601+136
2690+136
2826
Answer: 2826
[/code]
wolfram Alpha agrees with me. Success!
[vid]http://a.loveisover.me/nloxbk.webm[/vid]
Still have to fix a bunch of shit, but I am kinda happy with how this turned out.
This is a preview of the menu and the character creator for a homestuck game I am working on called Sburb.
I removed all the regular expressions from Rant's compiler and reduced the compile time of a ~300 line pattern from over a minute to about 0.1 seconds.
Just... wow.
Maybe not 100% programming related, but I was working with some ARMA 3 addons and got this peculiar error:
[code]7:32:04 Error in expression <rms\IS_woodland_2_t_woodland_1_b.paa"
] select _randomSeed1];
};
if ((_class == >
7:32:04 Error position: <select _randomSeed1];
};
if ((_class == >
7:32:04 Error Zero divisor
7:32:04 File IraqiSyrianConflict\IS\script\randomize_gear.sqf, line 364[/code]
Oh a divide by zero error I see? Hm, well, I'm not dividing anything in that file, I don't see how that could be.
Then I look up the error on the Bohemia Community wiki and found this appalling thing out:
[img]http://puu.sh/hFCb5/2a19d166f2.png[/img]
Why would you throw a divide by zero error for an out-of-range array subscript error?!
[QUOTE=ZestyLemons;47683019]Maybe not 100% programming related, but I was working with some ARMA 3 addons and got this peculiar error:
[code]7:32:04 Error in expression <rms\IS_woodland_2_t_woodland_1_b.paa"
] select _randomSeed1];
};
if ((_class == >
7:32:04 Error position: <select _randomSeed1];
};
if ((_class == >
7:32:04 Error Zero divisor
7:32:04 File IraqiSyrianConflict\IS\script\randomize_gear.sqf, line 364[/code]
Oh a divide by zero error I see? Hm, well, I'm not dividing anything in that file, I don't see how that could be.
Then I look up the error on the Bohemia Community wiki and found this appalling thing out:
Why would you throw a divide by zero error for an out-of-range array subscript error?![/QUOTE]
abandon ship
[QUOTE=Berkin;47682970]I removed all the regular expressions from Rant's compiler and reduced the compile time of a ~300 line pattern from over a minute to about 0.1 seconds.
Just... wow.[/QUOTE]
Can you show a diff? I'm interested in why that is.
[QUOTE=Darwin226;47683636]Can you show a diff? I'm interested in why that is.[/QUOTE]
[url]https://github.com/TheBerkin/Rant/commit/158f3a1088f7db5fab7c46e448bfa248a614fd49[/url]
Applied some language analysis stuff I was working on and hooked it up to a web app to show the UK general election opinion. It uses tweets, gets the sentiment and calculates averages. It's more programming than web development, I swear.
[img]https://dl.dropboxusercontent.com/u/16266581/kworm1.png[/img]
[URL="http://worm.karambyte.com"]http://worm.karambyte.com[/URL]
Anyone else seeing waywo being super popular in popular threads? :v:
Image if it goes away: [url]http://i.imgur.com/QM0Wbw5.png[/url]
[editline]8th May 2015[/editline]
Programming (2729 Viewing)
holy shit
Unfortunately the refferrers page doesn't work anymore.
[editline]8th May 2015[/editline]
[QUOTE=KillerLUA;47683834]Applied some language analysis stuff I was working on and hooked it up to a web app to show the UK general election opinion. It uses tweets, gets the sentiment and calculates averages. It's more programming than web development, I swear.
[img]https://dl.dropboxusercontent.com/u/16266581/kworm1.png[/img]
[URL="http://worm.karambyte.com"]http://worm.karambyte.com[/URL][/QUOTE]
Could you do bigger update periods? Every 2 seconds is quite spectacular but also somewhat useless.
[QUOTE=Skipcast;47683860]Anyone else seeing waywo being super popular in popular threads? :v:
Image if it goes away: [url]http://i.imgur.com/QM0Wbw5.png[/url]
[editline]8th May 2015[/editline]
Programming (2729 Viewing)
holy shit[/QUOTE]
Quick everyone, post your portfolios! This is it boys!
Sorry, you need to Log In to post a reply to this thread.