[QUOTE=Verideth;49537005]Yeah I'm trying to fix it. I really have no idea lol.[/QUOTE]
You have committed a cardinal sin.
So a product here at work started going slow after a bunch of edits. Decided to run a profiler on the product and see exactly where at in the code were things getting clogged. After finding the issue and fixing it speed increased by like 100x and its faster then it ever has been. I love profiling stuff so much.
[img]http://puu.sh/mwNPS/256c1ff6c1.png[/img]
Turns out some stuff was running way to much and wasn't needed. as well as on top of that ToList() apparently isn't the fastest thing ever.
A year or so ago, I had tried to make a PEMDAS parser based on a specification from BYTE Magazine. It described the means by which you implement the order of operations, but gave no code. I did this myself in C, and created something which parses simple EMDAS (no parentheses), but that was it. I hit a roadblock because I hadn't studied data structures much (I used Linked lists to store the parse tree), and I didn't use a buffer for shift-reducing. So, when the input was parsed, the original input was lost when reduced, and all that was left was the reduction. This is obviously unacceptable when parsing programming languages since loops require the original input remain intact. I just read an example of a shift-reduce tree on the Wikipedia article for Shift-Reduce Parsing, and I noticed striking similarities to what I had done lazily from a BYTE magazine article and what is accepted practice in the field of Parsing.
Thankfully, I did implement some level of abstraction and created a separate library for my parser, allowing me to easily go back and revise the mistakes I had made then. SR-Parsing uses a Parse Stack as a buffer to preserve input for later usage, but returns the reduction to the calling subroutine (assignment, bare reduction, etc.) I will have to go back to use this for my CSC205 project
[QUOTE=TH3_L33T;49538235]So a product here at work started going slow after a bunch of edits. Decided to run a profiler on the product and see exactly where at in the code were things getting clogged. After finding the issue and fixing it speed increased by like 100x and its faster then it ever has been. I love profiling stuff so much.
[img]http://puu.sh/mwNPS/256c1ff6c1.png[/img]
Turns out some stuff was running way to much and wasn't needed. as well as on top of that ToList() apparently isn't the fastest thing ever.[/QUOTE]
If you're using something like Entity Framework, ToList() executes the query.
Some days ago, JetBrains revealed they are working on a C# IDE which is, ofc, powered by the JetBrains IDE Family. Maybe it will be a good alternative, so we can stop using VS + Resharper :v:!
It will be cross platform and looks promising!
[url]http://blog.jetbrains.com/dotnet/2016/01/13/project-rider-a-csharp-ide/[/url]
(Posted since a lot of you guys use C# and maybe find it interesting)
[QUOTE=johnnyaka;49538445]Some days ago, JetBrains revealed they are working on a C# IDE which is, ofc, powered by the JetBrains IDE Family. Maybe it will be a good alternative, so we can stop using VS + Resharper :v:!
It will be cross platform and looks promising!
[url]http://blog.jetbrains.com/dotnet/2016/01/13/project-rider-a-csharp-ide/[/url]
(Posted since a lot of you guys use C# and maybe find it interesting)[/QUOTE]
I saw this, looked prett cool
[editline]15th January 2016[/editline]
If anyone wants to work on this game with me toss me a PM. I'd be glad to work on this game with someone :)
[QUOTE=Berkin;49538230]You have committed a cardinal sin.[/QUOTE]
Make it work -> make it preform.
[editline]15th January 2016[/editline]
[QUOTE=Downsider;49534218]Decided to work on some shit again..
Custom physics in UE4, trying to replicate what Smash Bros does for collision. A convex diamond that resizes to match the animation that the character's playing, and can push itself out of colliders.
It's actually really crucial to do that in order to support certain movement tech in Smash Melee, like wavelanding.
[/QUOTE]
Can you elaborate or link to something that does? I would love to know why that design is necessary.
[QUOTE=chimitos;49538923]Make it work > make it preform.[/QUOTE]
While I agree that's generally true, my only point is that's a pretty [I]horrifying[/I] way to do it, even starting out. But I only know this because I did it myself in another engine with a much larger terrain, and had the privilege of watching my RAM pop like a balloon.
It's all about the learning experience in the end.
[QUOTE=Ziks;49536884][vid]http://files.facepunch.com/ziks/2016/January/15/2016-01-15-1700-27.mp4[/vid]
Started work on a clipboard tool, which later on you will be able to use to share things you build on the workshop.
Sound warning near the end.[/QUOTE]
there's something awesome about those floating menus. reminds me of minority report
Homework. Professor gave us some program in C which computes some polynomials and told us to try to optimize it for extra credit.
The program she gave us computes some polynomials (1000, 100000, and 10000000 of them in each trial) and calculates how long it took to do them. Then, it calculates them a second time, but also writes the output of each computation to a file. She is demonstrating the difference in overhead in execution time.
My first optimization is to throw the `register` keyword into a few variables, namely, the ones used for the computation. This shaved a few milliseconds off the first two trials and 300 milliseconds off of the last trial (10000000 polynomials).
Next, I realized that her code was writing `double` variables as strings to an output file, taking up to 16 bytes instead of 8, not to mention the compiler's overhead in parsing out the strings. Instead, I elected to write the variables as binary to a file, separated by newline characters. As a result, I cut her code's execution time down to 1/6th of the original execution time. The issue, of course, is human readability, but there is no loss in data at all. Ultimately, while her third trial took ~18000 milliseconds to execute, mine took ~3000, shaving off 15000 milliseconds.
[QUOTE=johnnyaka;49538445]Some days ago, JetBrains revealed they are working on a C# IDE which is, ofc, powered by the JetBrains IDE Family. Maybe it will be a good alternative, so we can stop using VS + Resharper :v:!
It will be cross platform and looks promising!
[url]http://blog.jetbrains.com/dotnet/2016/01/13/project-rider-a-csharp-ide/[/url]
(Posted since a lot of you guys use C# and maybe find it interesting)[/QUOTE]
JetBrains is awesome, it's a shame they switched to subscription pricing because I heard they received quite a lot of flak for that. Anything other than mono or VS is great because now we have a semi-decent(?) C# ide that is cross-platform!
oh yeah it's modeled after resharper which is awesome
[video=youtube;ZJijoKibFY8]https://www.youtube.com/watch?time_continue=25&v=ZJijoKibFY8[/video]
Games going pretty well.
Sorry for shit quality :(
So I had this
[code]internal void GameUpdateAndRender(/* rendering args */GameMemory * Memory)
{
Assert(sizeof(GameState) <= Memory->PermanentStorageSize);
GameState * gameState = (GameState *)Memory;
if (!Memory->IsInitialised)
{
gameState->ToneHz = 256;
gameState->XOffset = 0;
gameState->YOffset = -66;
Memory->IsInitialised = true;
}
// input code to change X and Y offset, and render game.
}[/code]
This worked fine with analogue input on a gamepad but when using either keyboard or digital gamepad input it would not go higher than 0 on X or Y and going past 0 on X reset it to the default values of 0, -66.
[code]GameState * gameState = (GameState *)Memory;[/code]
should have been
[code]GameState * gameState = (GameState *)Memory->PermanentStorage;[/code]
Pointers are fun. XOffset was overwriting IsInitialised and YOffset and ToneHz were overwriting the lower and higher half of a uint64 (allocated memory size) in Memory instead of the memory that was allocated for them. I was having another bug where I could not get XOffset to be 0, because it was set to 1 by the boolean value the next line. So whenever XOffset was positive IsInitialised was still true but as soon as it goes negative (1xxx...) it's suddenly false and it resets the values to default next frame.
The DirectInput keyboard format is a bit odd, giant holes in the indexing [I]fucking everywhere[/I]. There's only ~140 keys but the indices go up to 237 for the last named key and it's returned to you as a char[256].
[URL="https://dl.dropboxusercontent.com/u/15606445/dump.png"]Bonus accidental semi-artistic content[/URL].
My teacher said my solution was "splendid"
Man, no more playing around. I'm getting down and dirty into procedural generation. I'm rewriting this code and fixing it up so its a lot bigger, and a lot less memory consuming
[QUOTE=proboardslol;49539823]Homework. Professor gave us some program in C which computes some polynomials and told us to try to optimize it for extra credit.
The program she gave us computes some polynomials (1000, 100000, and 10000000 of them in each trial) and calculates how long it took to do them. Then, it calculates them a second time, but also writes the output of each computation to a file. She is demonstrating the difference in overhead in execution time.
My first optimization is to throw the `register` keyword into a few variables, namely, the ones used for the computation. This shaved a few milliseconds off the first two trials and 300 milliseconds off of the last trial (10000000 polynomials).
Next, I realized that her code was writing `double` variables as strings to an output file, taking up to 16 bytes instead of 8, not to mention the compiler's overhead in parsing out the strings. Instead, I elected to write the variables as binary to a file, separated by newline characters. As a result, I cut her code's execution time down to 1/6th of the original execution time. The issue, of course, is human readability, but there is no loss in data at all. Ultimately, while her third trial took ~18000 milliseconds to execute, mine took ~3000, shaving off 15000 milliseconds.[/QUOTE]
optimization is fun- a fair few people don't think about it very often. Any coding I do for engineering work is commonly with microcontrollers so the whole checking for misuse of 'double' types and complete abuse of memory allocation is reflexive since the wee things have like 8k memory total. I've always loved optimization though, its satisfying as hell. That's a hell of an improvement too!
i'm finally taking the programming class I was excited to take, which is essentially just MATLAB for engineers. Its a lot of fun so far, I had always found the idea of data manipulation fascinating and I'm taking my first linear/matrix algebra class at the same time and so far they've complemented each other quite well. We don't get points for optimization yet, but its coming down the road :D
For now, since the next HW hasn't been released and I really want to program, I've been working on writing my first independent program in MATLAB- just a really simple musical scale tool that takes in a root note and then finds the mode of various scales from that (Major, Minor, Harmonic Minor, Melodic Minor). I'm attempt to write a dynamic melody generator based on simple wee genetic algorithms, which should be the topic we cover this week, and needed this as the first component so I don't get melodies completely out of key. Its actually surprisingly easy to write pleasing melodies using math, since so many of the harmonic relationships are really mathematical. Writing the chords to go with it is a touch harder, and adding flair from jazz structures is really hard. It can provide a good base point though. Its super cool math and is so useful to know for when I get stuck producing and the like, but it's boring as fuck to most :v:
I'm completely stuck on how to write to midi, though.
Fucking 75th attempt at getting "ffmpeg -f x11grab" to work. Why do they think that changing the names and order of the arguments every few years is a good idea?
So we talking homework?
Our lecturer told us to implement some garbage collection pseudo-implementation, very limited, and wrote the example usage case in a way it was impossible and told us to "come up with something that works by yourselves, discuss it with someone else" as a way to force us to think and come with different ideas, and to develop group skills.
[url=https://gist.github.com/JohnnyonFlame/c0bd3af0f38ce8e37e3c]It was a fun assignment tbh, I could've done this in a thousand better ways. Also didn't have time to finish a few sanity checks.[/url]
And no, I can't use anything non-standard such as using asm to read stack pointers and bullshit like that. However I still wonder how far I can get by parsing stackframes and parsing gdb info.
My lecturer put a comma in 10 values of a 10,000 entry long CSV file (we had to write a parser).
Cheers mate.
So in Unity I'm trying to make a sort of space ship with an interior that the player can move around in regardless of the rotation and movement of the ship. I'm using triggers to mark the interior area of the ship. Every frame everything inside the triggers is moved and rotated based on the movement and rotation of the ship itself compared to the last frame.
Right now I'm having an issue where the ship and objects inside it are still reacting to each others velocity. In the video bellow the small cube is having gravity applied to it and falling correctly even though the ship itself is moving upwards. However, when the cube finally lands on the ship floor it sees that the ship has an upward velocity and "bounces" off of it. Is there any way to get rid of interactions like this without getting rid of collisions entirely?
[vid]https://λ.pw/3qe.webm[/vid]
I added shoving
[vid]https://giant.gfycat.com/CoordinatedMemorableFantail.webm[/vid]
I'm not good at animations so I just didn't do one
[QUOTE=Stents*;49542076]So in Unity I'm trying to make a sort of space ship with an interior that the player can move around in regardless of the rotation and movement of the ship. I'm using triggers to mark the interior area of the ship. Every frame everything inside the triggers is moved and rotated based on the movement and rotation of the ship itself compared to the last frame.
Right now I'm having an issue where the ship and objects inside it are still reacting to each others velocity. In the video bellow the small cube is having gravity applied to it and falling correctly even though the ship itself is moving upwards. However, when the cube finally lands on the ship floor it sees that the ship has an upward velocity and "bounces" off of it. Is there any way to get rid of interactions like this without getting rid of collisions entirely?
[vid]https://λ.pw/3qe.webm[/vid][/QUOTE]
This is really a WDYNHW post but I'm super interested in the answer if anyone has it.
[QUOTE=Stents*;49542076]So in Unity I'm trying to make a sort of space ship with an interior that the player can move around in regardless of the rotation and movement of the ship. I'm using triggers to mark the interior area of the ship. Every frame everything inside the triggers is moved and rotated based on the movement and rotation of the ship itself compared to the last frame.
Right now I'm having an issue where the ship and objects inside it are still reacting to each others velocity. In the video bellow the small cube is having gravity applied to it and falling correctly even though the ship itself is moving upwards. However, when the cube finally lands on the ship floor it sees that the ship has an upward velocity and "bounces" off of it. Is there any way to get rid of interactions like this without getting rid of collisions entirely?[/QUOTE]
[QUOTE=Nigey Nige;49542253]
This is really a WDYNHW post but I'm super interested in the answer if anyone has it.[/QUOTE]
This is a common problem in platformers (usually elevators/moving platforms). The common solution is to parent yourself to the object you're colliding with, and unparent when you want to unattach yourself. This usually means that you unparent when you jump.
[QUOTE=Stents*;49542076]So in Unity I'm trying to make a sort of space ship with an interior that the player can move around in regardless of the rotation and movement of the ship. I'm using triggers to mark the interior area of the ship. Every frame everything inside the triggers is moved and rotated based on the movement and rotation of the ship itself compared to the last frame.
Right now I'm having an issue where the ship and objects inside it are still reacting to each others velocity. In the video bellow the small cube is having gravity applied to it and falling correctly even though the ship itself is moving upwards. However, when the cube finally lands on the ship floor it sees that the ship has an upward velocity and "bounces" off of it. Is there any way to get rid of interactions like this without getting rid of collisions entirely?
[vid]https://λ.pw/3qe.webm[/vid][/QUOTE]
What does the motion of the cube look like if it isn't artificially moved within the trigger?
How fast do you plan to be moving the ship? Do you want actual general physics (rather than say, just character physics) occurring on the ship? Are objects going to be transitioning on and off the ship? Do you want the ship's acceleration to effect the objects inside of it?
If the ship is going to be moving and you don't want to have to deal with either the ship's acceleration or physics bugs due to continual high speed collisions, can you get away with outright faking the ship's movement (move everything else)? Failing that, you could perform the physics simulation of objects inside of the ship in a completely separate physics world instance (in a stationary frame of reference), and mirror the state back inside of the real ship.
[QUOTE=Em See;49542377]What does the motion of the cube look like if it isn't artificially moved within the trigger?
How fast do you plan to be moving the ship? Do you want actual general physics (rather than say, just character physics) occurring on the ship? Are objects going to be transitioning on and off the ship? Do you want the ship's acceleration to effect the objects inside of it?
If the ship is going to be moving and you don't want to have to deal with either the ship's acceleration or physics bugs due to continual high speed collisions, can you get away with outright faking the ship's movement (move everything else)? Failing that, you could perform the physics simulation of objects inside of the ship in a completely separate physics world instance (in a stationary frame of reference), and mirror the state back inside of the real ship.[/QUOTE]
I made a small program to automatically scan functions, copy them into other processes, and edit them to fit to the other process.
I e.g. have
[code]
int penis()
{
MessageBox(0,0, "cucks", "CUCKS", MB_OK);
return 0;
}
[/code]
and my code loads a prepared version into some allocated memory of the other process & executes it by hijacking the main current thread context & fixes it up & frees the memory.
It also supports e.g. strings.
[IMG]http://i.imgur.com/Kgq77P9.png[/IMG]
[QUOTE=DoctorSalt;49518556]What linux distro do you use for graphics/programming?[/QUOTE]i love me some debian unstable.
Spend 4 hours trying to get SFTP access to my Google Cloud Virtual Machine
it works now so I can continue working.. man I wanted to kill someone
[t]http://i.imgur.com/wn5jG2h.png[/t]
it lives.. after 3 days of trying.
[QUOTE=Asgard;49542366]This is a common problem in platformers (usually elevators/moving platforms). The common solution is to parent yourself to the object you're colliding with, and unparent when you want to unattach yourself. This usually means that you unparent when you jump.[/QUOTE]
You remind of the time I almost got a cancer from this bug.
I made a cat in unity :v:
[vid]https://dl.dropboxusercontent.com/u/357850863/ShareX/2016/01/2016-01-16_12-58-40.mp4[/vid]
It pushes cubes and can wear hats. What more could you ask for?
Also something else that is shown in the video is my console, which only supports variables at the moment. It's inspired by source's cvar system, so to create one you do this:
[CODE]
new ConVar("test", "0", ConVarFlags.INT, "This is a useless convar!");
[/CODE]
And to grab them, you have set up a list. So in my cat script I can do this to grab the speed:
[CODE]
_agent.speed = GameManager.Instance.GetConVarValueFloat("catspeed");
[/CODE]
The gamemanager singleton handles the list of convars, so I can grab them practically anywhere.
Sorry, you need to Log In to post a reply to this thread.