wow I feel dumb, I needed to edit a spreadsheet of patients to remove patients with duplicate phone numbers so I can send a mass SMS. my first instinct was to write a program to do this but I didn't have any tools at work to do so so I used java (first time in 3 years, that was fun). the program worked but it had a problem processing all the numbers because there was too many.
then used ms excel to sort and remove duplicate rows...
[editline]23rd May 2015[/editline]
to make matters worse the sms software also removes duplicates, i'm so not working today
[QUOTE=andrewmcwatters;47780547]I've seen some swarm demos which offloaded movement behavior to the GPU for very large sets. They were in graphic tech demos, though, and not commercial games. I don't know if they utilized GPGPU access for that or if it was all craftily done in shaders.[/QUOTE]
Doing swarm simulations is pretty easy even with just a vertex or pixel shader in the earliest programmable pipeline implementations that can render back into a matching buffer.
The bottleneck is the amount of texture reads you need to sample the whole swarm as far as I know.
[editline]23rd May 2015[/editline]
[QUOTE=sarge997;47782713]Made trees sway and stir from the wind.
[vid]http://a.pomf.se/eiqdxr.mp4[/vid][/QUOTE]
Which encoding profile did you use for this?
The video doesn't play for me in Firefox Nightly with the "built-in" OpenH264 plug-in.
(It works if I download it and use MPC-HC, but I don't know if I can make FF use my installed codecs instead.)
[QUOTE=Tamschi;47784052]Doing swarm simulations is pretty easy even with just a vertex or pixel shader in the earliest programmable pipeline implementations that can render back into a matching buffer.
The bottleneck is the amount of texture reads you need to sample the whole swarm as far as I know.
[editline]23rd May 2015[/editline]
Which encoding profile did you use for this?
The video doesn't play for me in Firefox Nightly with the "built-in" OpenH264 plug-in.
(It works if I download it and use MPC-HC, but I don't know if I can make FF use my installed codecs instead.)[/QUOTE]
Works fine in Waterfox 38 with OpenH264.
[QUOTE=helifreak;47784218]Works fine in Waterfox 38 with OpenH264.[/QUOTE]
[del]The error message changed. It's probably a.pomf.se dropping connections again.
(My internet is relatively slow and it seems to sometimes abort the download if it takes too long.)[/del]
That doesn't seem to be the reason. I'm on Nightly 41.0a1 (2015-05-22) (x64 iirc) with OpenH264 Video Codec provided by Cisco Systems, Inc. 1.4.
Burst mode was not fun to program.
[img]http://puu.sh/hXfC9/f1c1252e83.gif[/img]
But it works properly!
[QUOTE=JohanGS;47783409]I haven't played gmod winter survival (is it similar to stranded?) but it actually gave me the thought of something similar.[/QUOTE]
You're basically thrown in to an arena with a bunch of people and have to survive the basic elements (staying warm, fed, and hydrated). Usually it breaks down in to a bunch of duels to the death before anyone can start building the cool stuff.
Also, building a scarecrow is the best way to get food.
[QUOTE=polkm;47783813]I was working on making things attach to other things so that silly things can happen, and then an old bug popped up again the same way it did last time.
[video=youtube;LkTVSaJGXyo]https://www.youtube.com/watch?v=LkTVSaJGXyo&feature=youtu.be[/video][/QUOTE]
play some [url=https://www.youtube.com/watch?v=afzmwAKUppU]fun music[/url] and leave that in.
free feature
I've been working on my ADSB radar client, I fixed my god awful map projection—I was treating longitude and latitude as x and y respectively, now I convert to an azimuth and distance to plot.
It now ends up with this projection:
[img]http://i.imgur.com/10vDfQe.png[/img]
But does this kind of projection have a name?
Constantly spamming this thread:
I made a level
[img]https://dl.dropboxusercontent.com/u/99717/OpenGL/MadeALevel.jpg[/img]
Now to save it...
[QUOTE=sarge997;47782713]Made trees sway and stir from the wind.
[vid]http://a.pomf.se/eiqdxr.mp4[/vid][/QUOTE]
They just look like they're rocking back and fourth, add a few more frequencies in:
[url]https://www.google.com/search?q=(sin(x)+%2B+1)+%2B+sin(x*2)+*+0.5+%2B++sin(x%2F2)+%2B++sin(x+%2F+10)+*+0.25+from+1+to+10[/url]
Relational DBs, Document stores, pfft. You're all wrong. Just read and write directly to shared memory with [url=http://whitedb.org/]WhiteDB[/url]!
In all seriousness though, I've begun using Ajax functionality to interact with my application prototypes. Does anyone know of a good C library to ease the development of this? Is it possible to just push JSON as application/json with something like microhttpd or another tiny tiny http framework?
[QUOTE=mastersrp;47785465]Relational DBs, Document stores, pfft. You're all wrong. Just read and write directly to shared memory with [url=http://whitedb.org/]WhiteDB[/url]!
In all seriousness though, I've begun using Ajax functionality to interact with my application prototypes. Does anyone know of a good C library to ease the development of this? Is it possible to just push JSON as application/json with something like microhttpd or another tiny tiny http framework?[/QUOTE]
If you are making websites than you shouldnt use C. And if you are making web apps with high load functionality then you shouldnt use http and use WebSockets API instead (works like a charm btw) and send json back and forth.
[QUOTE=MuffinZerg;47785523]If you are making websites than you shouldnt use C. And if you are making web apps with high load functionality then you shouldnt use http and use WebSockets API instead (works like a charm btw) and send json back and forth.[/QUOTE]
I should use C, because the only other good alternative to a high load web serving application is assembly, and that aint worth it man.
I'll check out WebSockets and see if it's worth it as opposed to just slamming an HTTP/1.1 API on top.
Many people know the computing term algorithm, but little know of its true origin. A young intern at the time, Al Gore ( Widely known for inventing the Internet. ) was writing the kernel for the ZX Spectrum. While writing a function, he noticed it had a sort of rhythm, so he called the function Al Gore's Rhythm. While he was explaining the concept of it to a colleague, the man misheard him. He went to write his own function similar to Gore's, but called it an algorithm instead, thinking it was a programming term he'd never heard before. Al Gore was later looking through the code, and noticed the term used. He thought the misspelling was funny, and renamed his original function to be the same. The word later spread through Sinclair Labs and eventually to the rest of the programming world.
[QUOTE=mastersrp;47785582]I should use C, because the only other good alternative to a high load web serving application is assembly, and that aint worth it man.
I'll check out WebSockets and see if it's worth it as opposed to just slamming an HTTP/1.1 API on top.[/QUOTE]
You could use any web language and do the high load functionality in a C module. Python takes it further with Cython where you can just compile a python module to C/C++.
Here's info on web sockets api
[url]https://msdn.microsoft.com/en-us/library/hh673567%28v=vs.85%29.aspx[/url]
Only tcp, but still blazing fast and very easy to use.
[QUOTE=COBRAa;47785435]They just look like they're rocking back and fourth, add a few more frequencies in:
[url]https://www.google.com/search?q=(sin(x)+%2B+1)+%2B+sin(x*2)+*+0.5+%2B++sin(x%2F2)+%2B++sin(x+%2F+10)+*+0.25+from+1+to+10[/url][/QUOTE]
Still periodic, you want to use prime numbers instead of even coefficients.
Nevermind, this doesn't works the way I expected.
Well irrational numbers might be an answer :D
[url]https://www.google.si/search?q=sin(x*%CF%80)+%2B++sin(x*e)+%2B++sin(x*5)+from+1+to+10[/url]
Time for me to show something.
I am making a web socket based HTML5 mmo game with python backend. Currently making the skeleton of it.
I am aiming for 50 concurrent connections.
I just finished a super-rough movenment system:
[t]http://i.gyazo.com/e0df06f212023e89a29d7474f497aaef.png[/t]
The logic is:
1. Client connects to socket
2. Client sends {"type":"handshake"}
3. Server receives handshake and assigns the player an id. Creates a player info object,
[code]
{
player = {
"x": 0,
"y" : 0,
"spawned": false,
movement_data : ... #more on that later
}
[/code]
Stores it in a collection of player objects.
Stores the connection object (not game related data) in a separate collection.
4. Player sends {"type":"spawn"}
5. Server receives "spawn" and changes player's x and y cords to (10, 10).
Sends the player the updated player info
[code]
{
player = {
"x": 10,
"y" : 10,
"spawned": true
}
[/code]
6. Player presses an arrow key. Say it's the "UP" key
Client sends an object movenment_data:
[code]
{
movement_data = {
"up": true,
"down" : false,
"left": false,
"right": false,
}
[/code]
7. Server receives the movement_data, updates player.movement data with these values.
Now the server [b]doesn't[/b] do any more logic or respond to the player in any way.
8. On arrow key up same as in step 6 happens, except if key "UP" was up (duh) then movement_data.up gets set to false instead of true. Server logic is same.
9. Every server Tick (30 ms currently) the server loops throught all players and does this:
[code]
for player_id, player in self.player_collection.iteritems():
movement_data = player["movement_data"]
if movement_data["up"]:
player["y"] -= 1
elif movement_data["down"]:
player["y"] += 1
if movement_data["right"]:
player["x"] += 1
elif movement_data["left"]:
player["x"] -= 1
[/code]
Then the server sends updated player info to all players. So each player also receives info about all other players so he can update their pos too.
10. Player receives player objects and updates the position of stuff on canvas, including himself.
Sorry for the lengthy description, but I really wanted to share because its the first time I am handling networking at such basic level. And maybe it will help someone because I didn't find anything of sort when I was looking for info.
Is this the proper way to handle serverside logic and networking? I plan to use the same template to handle collisions and basically everything.
[QUOTE=COBRAa;47785435]They just look like they're rocking back and fourth, add a few more frequencies in:
[URL]https://www.google.com/search?q=(sin(x)+%2B+1)+%2B+sin(x*2)+*+0.5+%2B++sin(x%2F2)+%2B++sin(x+%2F+10)+*+0.25+from+1+to+10[/URL][/QUOTE]
[QUOTE=Fourier;47785644]Still periodic, you want to use prime numbers instead of even coefficients.
Nevermind, this doesn't works the way I expected.
Well irrational numbers might be an answer :D
[URL]https://www.google.si/search?q=sin(x*π)+%2B++sin(x*e)+%2B++sin(x*5)+from+1+to+10[/URL][/QUOTE]
I didn't even know that Google supported Sine waves.
I'm still learning this stuff, as before I was using Mathf.Lerp() for my movement, but since I recently found Mathf.Sin in Unity, my script looks like this
[code] public float speed = 0.02f;
public float xAmount, yAmount;
Quaternion startRotation;
void Start ()
{
startRotation = transform.localRotation;
}
void Update ()
{
startRotation.x = Mathf.Sin (Time.time * xAmount) * speed;
startRotation.y = yAmount;
transform.localRotation = startRotation;
}[/code]
Basically, how on earth do I implement this magic Google sin stuff you guys posted?
I mean I can sort of understand it, but it's different from C#.
[I]
Teach me ze ways.
[/I][B]Edit*[/B]
[vid]http://a.pomf.se/vyndcu.mp4[/vid]
God dammit Unity that's not how trees work what are you doing[I]..
[/I]
Woo! I now have a functioning resource system. Objects are stored as stacks with a fixed maximum size, and individual objects can be taken from a stack
[IMG]https://dl.dropboxusercontent.com/u/9317774/functioning%20resources.PNG[/IMG]
At the top it shows how many of each resource you have. You can currently transport things into and out of storage (with the peons), and the peons will attempt to stack the resources if there's a stack available with enough space to store it. I had to change the way that objects were stored, rendered, and had their power processed to not make it a complete troll to add and remove objects from arbitrary points within the code
On the plus side, objects no longer own their own memory but are instead owned by an object manager - the power distributor processes this list rather than having to have objects carted into it manually, and the rendering auto renders everything on the object list rather than having to stuff objects into it manually.
All together this means objects can also easily be destroyed/added now without leaking memory everywhere and having to update a bajillion different systems to ensure there are no null pointer accesses, as the only system that takes pointers to objects rather than using the global object list is the ship class, which can simply check if any objects are dead and then remove them
Tragically the oil symbol isn't all that great, so I'm going to spend some time reworking that
On the plus side, I've got a fun [url=https://trello.com/b/VohHA3Hj/spess]trello[/url] and [url=https://bitbucket.org/20k11/spess]bitbucket[/url] thing going if anyone wants to see those for some reason
[QUOTE=sarge997;47786310]I didn't even know that Google supported Sine waves.
I'm still learning this stuff, as before I was using Mathf.Lerp() for my movement, but since I recently found Mathf.Sin in Unity, my script looks like this
[code] public float speed = 0.02f;
public float xAmount, yAmount;
Quaternion startRotation;
void Start ()
{
startRotation = transform.localRotation;
}
void Update ()
{
startRotation.x = Mathf.Sin (Time.time * xAmount) * speed;
startRotation.y = yAmount;
transform.localRotation = startRotation;
}[/code]
Basically, how on earth do I implement this magic Google sin stuff you guys posted?
I mean I can sort of understand it, but it's different from C#.
[I]
Teach me ze ways.
[/I][B]Edit*[/B]
[/I][/QUOTE]
Shouldn't that be
[code]
startRotation.x = Mathf.Sin (Time.time * speed) * xAmount;
[/code]
?
I added pointlights to my fragment shader, but now I'm only getting ~50 fps with 2600 tiles. It doesn't seem to be related to shader though, since when I simply set the colour to something, and doing nothing else, I get the same fps. Time to debug my code!
[vid]http://www.broxzier.com/files/ShareX/2015-05-23_17-30-39.mp4[/vid]
[QUOTE=sarge997;47786310]
[vid]http://a.pomf.se/vyndcu.mp4[/vid]
God dammit Unity that's not how trees work what are you doing[I]..
[/I][/QUOTE]
Now they just need to grunt, hum, and say "how u doin" and you have a Christmas edition of [I][URL="https://www.youtube.com/watch?v=4aiIF1fUgeM"]Abnormals[/URL][/I].
[QUOTE=sarge997;47786310]God dammit Unity that's not how trees work what are you doing[I]..
[/I][/QUOTE]
Game development bugs = best bugs
[QUOTE=sarge997;47786310]I didn't even know that Google supported Sine waves.
I'm still learning this stuff, as before I was using Mathf.Lerp() for my movement, but since I recently found Mathf.Sin in Unity, my script looks like this
[code] public float speed = 0.02f;
public float xAmount, yAmount;
Quaternion startRotation;
void Start ()
{
startRotation = transform.localRotation;
}
void Update ()
{
startRotation.x = Mathf.Sin (Time.time * xAmount) * speed;
startRotation.y = yAmount;
transform.localRotation = startRotation;
}[/code]
Basically, how on earth do I implement this magic Google sin stuff you guys posted?
I mean I can sort of understand it, but it's different from C#.
[I]
Teach me ze ways.
[/I][B]Edit*[/B]
[vid]http://a.pomf.se/vyndcu.mp4[/vid]
God dammit Unity that's not how trees work what are you doing[I]..
[/I][/QUOTE]
Something like this, completely untested.
[code]
float x_freqhz = 1f / 4f; // 1 big sway per 4 seconds
float x_freqhz = .5f; // 1 big sway per 1.333 seconds
start_rotation.x = ( 0.0
+ Mathf.Sin (Time.time * x_freqhz) * 1.0 // low "sway" frequency at 100% magnitude
+ Mathf.Sin (Time.time * x_freqhz * 3.14) * 0.25 // oscillates 3.14x quicker, 25% less magnitude
) * x_ammount; // amplify it to the size you want
start_rotation.y = Math.Sin(Time * y_freqhz) * y_amount; // do the same here with some more SINs
[/code]
This doesn't have wind direction, but that would be a pretty simple 2d rotation with cos/sin.
Oh, you should add the positions of the trees as a time offset, that way it will look like the wind is moving through the world (things will ripple).
That's better. *Plus that helped me understand Sines more so thank you for that*
But Mathf.Sin() seems to *go back and forth* and the effect I'm trying to achieve is a tree blowing in heavy wind right? The tree wouldn't start going into the direction the wind is blowing, would it? [B]*Hint: It wouldn't :v:*
[/B]
This is what I'm talking about.
When the tree goes to the left, it looks nice, and when it returns it should stop when it's basically straight up, and return to blowing to the left. Instead it blows to the left, goes to the center, then start's leaning to the right. Bleh.
[I]The tree leaning is exaggerated to show what I mean.[/I]
[vid]http://a.pomf.se/orhzix.mp4[/vid]
[QUOTE=sarge997;47786990]That's better. *Plus that helped me understand Sines more so thank you for that*
But Mathf.Sin() seems to *go back and forth* and the effect I'm trying to achieve is a tree blowing in heavy wind right? The tree wouldn't start going into the direction the wind is blowing, would it? [B]*Hint: It wouldn't :v:*
[/B]
This is what I'm talking about.
When the tree goes to the left, it looks nice, and when it returns it should stop when it's basically straight up, and return to blowing to the left. Instead it blows to the left, goes to the center, then start's leaning to the right. Bleh.
[I]The tree leaning is exaggerated to show what I mean.[/I]
[vid]http://a.pomf.se/orhzix.mp4[/vid][/QUOTE]
Just offset the equation to the left (add/subtract a constant) and maybe multiply it by half.
[QUOTE=Ott;47787000]Just offset the equation to the left (add/subtract a constant) and maybe multiply it by half.[/QUOTE]
You mean like a const offset to the Sine?
[code] public float xAmount;
public const float offset = 1.0f;
Quaternion startRotation;
void Start ()
{
startRotation = transform.localRotation;
}
void Update ()
{
float x_freqhz = 4.0f / 3.0f;
startRotation.x = ( 0.0f + Mathf.Sin (Time.time * x_freqhz) * 3.0f + Mathf.Sin (Time.time * x_freqhz * 5.14f) * 0.85f) * xAmount;
transform.localRotation = startRotation;
}[/code]
[B]Edit*[/B]
I think I got it!
[vid]http://a.pomf.se/fgxdsz.mp4[/vid]
Here's my code incase I'm doing something wrong.
[code]float x_freqhz = 2.75f / 3.0f;
startRotation.x = ( offset + Mathf.Sin (Time.time * x_freqhz) * 2.0f + Mathf.Sin (Time.time * x_freqhz * 3.5f) * 0.85f) * xAmount;
transform.localRotation = startRotation;
[/code]
Am I doing it right? :v:
If so then all I have left is to randomize this a little bit, so that every tree isn't doing the same motion.
Yeah, sin oscillates between -1 and 1 so you just have to offset it with a constant if you only want it to go in one direction.
[QUOTE=KmartSqrl;47787061]Yeah, sin oscillates between -1 and 1 so you just have to offset it with a constant if you only want it to go in one direction.[/QUOTE]
Don't forget to subtract Zayn.
I implemented Kahan summation with SSE while doing some data processing. It's almost as fast as naive summation using the FPU (Kahan summation in general being about 4x slower, and SSE in turn giving a 4x speedup) -- but it's a lot more resistant to error when you have a lot of floats.
[cpp]float fls_kahan(size_t count, const float *arr)
{
float fsum = 0.0f;
float ferr = 0.0f;
#define KAHAN_ITER { \
const float u = *arr - ferr; \
const float v = fsum + u; \
\
ferr = (v - fsum) - u; \
fsum = v; \
\
++arr; \
--count; \
}
// Align the 'arr' pointer. Accumulate the unaligned parts to 'fsum'.
switch((uintptr_t)arr & 12) {
case 0: break;
case 4: KAHAN_ITER;
case 8: KAHAN_ITER;
case 12: KAHAN_ITER;
break;
}
// Accumulate four individual sums (in 'vsum') simultaneously using SSE.
__m128 vsum = _mm_setzero_ps();
__m128 verr = _mm_setzero_ps();
while(count >= 4) {
const __m128 x = _mm_load_ps(arr);
const __m128 u = _mm_sub_ps(x, verr);
const __m128 v = _mm_add_ps(vsum, u);
verr = _mm_sub_ps(_mm_sub_ps(v, vsum), u);
vsum = v;
count -= 4;
arr += 4;
}
// Add the sums from 'vsum' to the 'fsum'.
__declspec(align(16)) float fsums[4];
__declspec(align(16)) float ferrs[4];
_mm_store_ps(fsums, vsum);
_mm_store_ps(ferrs, verr);
ferr += ferrs[0] + ferrs[1] + ferrs[2] + ferrs[3];
for(int i = 0; i < 4; ++i) {
const float u = fsums[i] - ferr;
const float v = fsum + u;
ferr = (v - fsum) - u;
fsum = v;
}
// Process the leftovers.
while(count != 0) {
KAHAN_ITER;
}
#undef KAHAN_ITER
return fsum;
}[/cpp]
Sorry, you need to Log In to post a reply to this thread.