• What Are You Working On? July 2015
    1,392 replies, posted
[I]"Get that spider offa me!"[/I] [img]http://puu.sh/iV8na.gif[/img] Going to try this out and see how it looks in the full combo but most likely I'll remake it :v:
[QUOTE=Winner;48176905]i am not a low level programmer or a hardware guy so please set me straight; i'm assuming that if my gpu is running at only half capacity the application is not working at max efficiency[/QUOTE] Even if you're way up there in abstraction land, I still think you need to know how a computer works!
[QUOTE=Winner;48176931]regardless of the memory usage, a glance at the caffe repo shows that the thread count has always been 1024 (since well before the gtx 900 series came out, which i'm using, and which specifically has much better cuda compute compatibity), so it would probably run noticeably faster with a higher thread count[/QUOTE] The 960 only has 1024 cores, it can't even run more threads than 1024. [editline]11th July 2015[/editline] Also in that source you posted, it says it used 1024 threads per blocks. [editline]11th July 2015[/editline] That means no matter how many multiprocessor units you have on your graphics card, each one will run 1024 threads. You simply can't squeeze out more performance out of that.
[QUOTE=elevate;48176945]Even if you're way up there in abstraction land, I still think you need to know how a computer works![/QUOTE] He can just download more RAM to make it faster. Everybody knows that
[QUOTE=Berkin;48176694]So, you guys probably figured out I'm working on a game. I'm currently designing one of the core features for it, and I need your help! My game is going to use Rant and its core technologies to create an entire world where all missions, story elements, and interactions are nonsensical. Right now I'm designing the system that will drive dialogue between NPC's, and I'm going to need [I]a lot[/I] of testing material. This means I have to write Rant patterns to generate those conversations. The more variety I have, the better tests I can run and the more interesting the conversations will be. While I'm good at Rant, I'm slow at thinking of ideas for dialogue. I would like to set up a public repository where you all can write the most insane, ridiculous, fucked up conversations you can think of and submit it to me. You don't have to write me a Rant pattern (you can if you really want to), I just need an example of what it would put out. Then I'll take them all, write patterns from them, and use them to drive the dialogue system. Would anyone be interested in helping with this? Could be fun to see what people come up with.[/QUOTE] i'll gladly write you some dialogue, i work in an ER so some of the crazy shit that gets said here is awesome for this sort of thing!
[QUOTE=Bomber9900;48177126]i'll gladly write you some dialogue, i work in an ER so some of the crazy shit that gets said here is awesome for this sort of thing![/QUOTE] Oh, that's perfect. [URL="https://github.com/TheBerkin/sanity-plea-dialogue"]Here's the repo[/URL]. Have fun!
[QUOTE=srobins;48151866]Kinda, but I'm more framing this as a solution to desktop or server security. Does something like this already exist for desktops? I know about signed driver enforcement in Windows but I'm talking about ensuring every process running on the machine is signed and verified before execution.[/QUOTE] Doesn't windows sort of do this? It'll throw up a warning if it's not signed, but it won't disallow you from running anything unless you don't have administrator privileges. The answer is because then software would have to be "approved" by MS or Apple or Canonical, etc. before being allowed to be installed on the machine, which is not what you want. You want your users to have the freedom to install what they want, even at the risk of installing malware. I know it's cliche, but Common Sense 2015 (c) has always worked for me.
[QUOTE=Cyberuben;48177010]He can just download more RAM to make it faster. Everybody knows that[/QUOTE] That must be possible since I download my prostitutes for free
[QUOTE=Fourier;48177512]That must be possible since I download my prostitutes for free[/QUOTE] That's inefficient, I have a script set to only acquire specific bytes of prostitute files, it's so much faster that way.
UI programming is tough, especially on mobile.
[QUOTE=icantread49;48177695]UI programming is tough, especially on mobile.[/QUOTE] But only because it's boring.
I've been working with the player animations, and crouching. [vid]http://webm.host/d6056/vid.webm[/vid] I also found out how I can have snow appear on almost any mesh, using the power of shaders. [vid]http://webm.host/d71a3/vid.webm[/vid] I also toyed around with the chatbox this morning. [B]When the chatbox is active and you're typing a message.[/B] [IMG]http://i.imgur.com/mZYPz3v.png[/IMG] [B]When you're not typing, such as when other people send messages.[/B] [IMG]http://i.imgur.com/5fXc4za.png[/IMG]
[QUOTE=Winner;48176762][URL="https://github.com/BVLC/caffe/blob/50ab52cbbf738cc92b0eda042661b8c0172774c1/include/caffe/util/device_alternate.hpp#L88"]except you would because the number of threads spawned by caffe is hardcoded[/URL] ptthtbtht[/QUOTE] GPU threads aren't real threads, they just represent a register set. The maximum number of useful threads is constrained by your register pressure - the more registers you need, the less threads you can spawn. GPUs manage this fairly transparently I believe - on nvidia, there's generally no real difference between having a local work size of 1024 or 256 because you're constrained by registers Its worth noting that the local work size (that they've specified) is NOT the number of threads, even at an abstraction level. Multiple different work groups (ie chunks of 1024 threads) can be running at once I believe that nvidia cards actually don't let you use more than 1024 threads in a local work group, otherwise it crashes (at least under opencl) [editline]11th July 2015[/editline] [QUOTE=cartman300;48176975]The 960 only has 1024 cores, it can't even run more threads than 1024. [editline]11th July 2015[/editline] Also in that source you posted, it says it used 1024 threads per blocks. [editline]11th July 2015[/editline] That means no matter how many multiprocessor units you have on your graphics card, each one will run 1024 threads. You simply can't squeeze out more performance out of that.[/QUOTE] This isn't really strictly true, because gpu threads aren't really threads (threads are just a useful abstraction to get the most performance out of the hardware), when threads are idle (waiting for memory to arrive), other tasks can be run during this (normally other warps i think). On the newest generation of AMD cards (no idea about the state of nvidia) I believe you can asynchronously run two kernels at once, and the dynamic scheduler will autofill the wait holes with the execution for the other kernel, which may improve performance somewhat. I have no idea how well this would operate if you ran two of the same kernel (because presumably the hardware is already doing its best with the current kernel), but its not a completely horribly idea in principle
[QUOTE=Berkin;48177402]Oh, that's perfect. [URL="https://github.com/TheBerkin/sanity-plea-dialogue"]Here's the repo[/URL]. Have fun![/QUOTE] i might be doing it wrong so i submitted one issue and you can tell me how it actually needs to be cause i kind of misunderstood in the readme
[QUOTE=sarge997;48178110]I've been working with the player animations, and crouching. [vid]http://webm.host/d6056/vid.webm[/vid] [/QUOTE] The winter survival feel is strong with this one because the animations are exactly like source
[QUOTE=sarge997;48178110][vid]http://webm.host/d71a3/vid.webm[/vid][/QUOTE] Stuff like this makes me wish i had any idea how shaders work or time to learn it.
[QUOTE=icantread49;48177695]UI programming is tough, especially on mobile.[/QUOTE] [cpp] Title = &UiImpl->MainControl->Add<Ui::Button>() .SetRenderBase(false) .SetText("SELECT A WORLD") .SetTextColor(Vector4(1.0f, 1.0f, 1.0f, 1.0f)) .SizeToText(60.0f); Title->Position.y = 30.0f; Title->AddBehavior<Ui::Behavior::CenterHorizontally>(); WorldButtonsContainer = &UiImpl->MainControl->Add<Ui::Control>(); WorldButtonsContainer->AddBehavior<Ui::Behavior::RowLayout>() .SetNumRows(1) .SetSpacing(30.0f); WorldButtonsContainer->AddBehavior<Ui::Behavior::CenterHorizontally>(); WorldButtonsContainer->AddBehavior<Ui::Behavior::CenterVertically>(); [/cpp] Decided to use the concept of "behaviors" for layouts, etc. It's not beautiful, but it works way better than what I was doing before (manually calculating positions and sizes within the calling code).
Latest 40+ hours I put into Terraria since the new update inspired me to work on a Terraria-style game framework in Unity. Main features I'm targeting: tile engine, terrain (generation, saving / loading), lighting and collision. If that somehow works out, multiplayer and gameplay (movement, weapons, world manipulation). Most tutorials and samples I found in Unity do tiles by creating a mesh, creating the tile texture and pasting it on there. [url=https://github.com/mizipzor/UnityTileMap/blob/master/Assets/Plugins/TileMap/TileMeshQuadGridBehaviour.cs]This[/url] seemed the most suitable for my goals. It applies the tile atlas as a material to the mesh, and sets the UV coordinates of each quad in the mesh to the appropriate tile coords in the atlas. Downside: all tile assets need to be in a single tilesheet. Possibly automate this in the future by auto-generate tilesheets from separate tile assets in a folder structure or something. Another problem with the above approach is that a [url=http://terraria.gamepedia.com/Map_size]large world in Terraria[/url] contains around 20.000.000 tiles. I don't expect creating a mesh for that whole thing is... efficient. So instead I made a much smaller mesh that automatically resizes with the camera and updates as you move around. [vid]http://fat.gfycat.com/SmartOblongAcornwoodpecker.webm[/vid] Every time the mesh is moved it would have to re-apply all the UVs to those of the tiles that it's currently looking at, but I don't expect that to impact performance much. Another thing I have to look at is tiles that have graphics that span multiple tiles. Thinking of making an infinite world format instead of a rigid one like Terraria but not sure about the best approach to this yet. Mainly what sort of chunk sizes to use and how the tile coordinate system will work.
Need muh waywo ego boost so here, a telegram dungeon crawling bot was born [img]https://pp.vk.me/c625524/v625524713/3c5be/Bb1BahmmNgo.jpg[/img]
I needed a structure in C++ that would map strings to 64 bit integers. It was going to hold ~150,000 items. My first thought was std::map<std::string, ulonglong> but having each string in it's own container and then all in a generic container was causing problems - it was using like 100mb+ ram and lookups/inserts were slooow. So I made my own map, without looking up algorithms. I settled for a big array of "tables". Each table had n slots (eventually I settled on 8). A slot referred to either a value or another table. To lookup, I iterated each character of the string, hashed it into a slot number and looked up the next table - or if it was a value, returned there. Of course there were a bunch of edge cases and other things like dealing with duplicates and shit. Insert function isn't pretty either. Anyway, after a bit of unit testing and pointer woes, I finally got it working and ran it with all 150k entries. Worked flawlessly, only used ~40mb of ram, and lookups were taking 0.35ms on average. Which was cool. So I started to fiddle with the hash function and the number of slots per table. Unsurprisingly, doubling the slots per table nearly doubled the memory usage and halving the slots nearly halved the memory usage. However the changes were not affecting lookup time - it was sticking at a constant 0.35ms. Also, the hash function had no effect on anything (unless you literally returned 0 forcing it to linear time). Even just returning the character & 0x07 (for 8 slot tables) was working just fine. I suppose since all the strings only contained letters and the occasional symbol (: , . etc), only the LSBs changed much so a complex hash function wasn't needed. I tried to make the table size 2 to abuse the weird magic constant lookup time but random strings started vanishing from the map so I settled on 8. Oh and I made sure to keep a big "block" of memory with all my strings in, rather than allocate each string separately. I'm sure that helped a bunch. tldr - I made a map in C++ and it's cool
[QUOTE=thomasfn;48180297][...] but random strings started vanishing from the map so I settled on 8. [...][/QUOTE] It's highly likely your current implementation is still prone to silent collisions. Consider allowing multiple plaintexts for each hash chain to guarantee exact matching. In any case, normally (which may not be the best solution here) this is implemented by hashing the whole string and then checking any that fall into a particular bucket. It's also possible that a tree structure (without a separate string allocation block) would lead to less memory use while preserving lookup times. Reconstructing strings from there on the fly wouldn't be difficult either.
[QUOTE=NixNax123;48166541]So I stopped working on my renderer for my game because I couldn't get text rendering to work (for the third time in my life). Do you guys think I should [img]http://www.facepunch.com/fp/ratings/tick.png[/img] - Keep trying on getting text to render [/QUOTE] I can't do this. It's making me so goddamn mad and I have no idea what's wrong and I also have no idea how to make give my text shader an orthographic projection that takes into account the text's position, let alone have it even render on screen. Been working on this for 4 days now
[QUOTE=MatheusMCardoso;48179133]Stuff like this makes me wish i had any idea how shaders work or time to learn it.[/QUOTE] This is basically just [code]if (dot(normal, up) > threshold) // This is unrealistic for thresholds above ~.8, but players won't look that closely. If you need more precision you have to take wind shadowing into account, which requires a completely different system. { // snow } else { // rock }[/code] If you want to work with shaders just get a really solid grasp of trigonometry, and "quickly" read up on the API. The former is useful for a really wide variety of problems, so even if you don't apply it specifically to this you can implement solutions to a lot of different problems with it. The latter is unfortunately not quite as easy because (low-level) graphics APIs are practically all far less straightforward than they could be. ETA on me solving that issue: Still a while off due to sheer volume of the specification.
So I'm doing evolutionary programming again. The units are strings of assembly like code. The method of input and output is reading and writing from their virtual memories. I've given them a task to put a number as close as possible to 123 into memory location 0, and I've also penalized longer code slightly. After 100 000 generations the best candidate produced the following code [code][Push 9,Push 4,Push 4,Mult,Xor,Push 5,Mult,Push 0,Set][/code] Which is equivalent to the expression (9 XOR (4 * 4)) * 5 which is 125. Pretty neat. And this was basically just a "hardcode dumb defaults, just make is do something" run.
[QUOTE=Tamschi;48180485]It's highly likely your current implementation is still prone to silent collisions. Consider allowing multiple plaintexts for each hash chain to guarantee exact matching. In any case, normally (which may not be the best solution here) this is implemented by hashing the whole string and then checking any that fall into a particular bucket. It's also possible that a tree structure (without a separate string allocation block) would lead to less memory use while preserving lookup times. Reconstructing strings from there on the fly wouldn't be difficult either.[/QUOTE] I made each "value" into a linked list by allowing it to hold a reference to another value. If you try and insert a string and it hashes down into an existing value and strcmp fails on existing values in the linked list, it will just append it to the end. The worst hash collisions can do is create very long linked lists which move lookup time closer to a linear search. I add metrics at the end to evaluate the performance of the map and the largest "chain" of strings in a value linked list was 2 on a table size of 8 which is acceptable. I also unit tested all 150k strings afterwards to make sure they were pulled back correctly, and they were. In hindsight I would probably have gone more down the direction of a binary tree but whatever, it works, I've already wasted enough time on it when really I should have taken an off-the-shelf solution. One other thing I didn't mention is that the whole structure can be written to and read from file, making it a nice way to cache a database of string -> int mappings which are generated once every now and again. I'm using it to map function symbol names to RVAs which only needs to be regenerated when the pdb changes (dbghelp and dia sdk are slow).
Made some kind of random dungeon generator to use in a future project. Still a little sketchy but it's easy to tweak. [IMG]http://i.imgur.com/hCoarRA.png[/IMG]
I've been working to port coreclr to ARM, and recently came up against the weirdest C issue I have yet to face. [CODE]void func(va_list arg);[/CODE] That arg argument? It might be a va_list, turns out it might also decay to some other type depending upon the definition of va_list on the target. It's totally dependent upon the ABI. Turns out on ARM, I had implemented a "fix" that relied on va_list being va_list... This totally broke AMD64 through this strange behaviour, I did eventually find it on StackOverflow ( [url]http://stackoverflow.com/questions/9792834/pointer-to-a-va-list-in-amd64-abi[/url] ). I can't say doing this has made me any more of a fan of C/C++.
[QUOTE=MatheusMCardoso;48179133]Stuff like this makes me wish i had any idea how shaders work or time to learn it.[/QUOTE] Basically you need to learn a bit of linear algebra [url]https://en.wikipedia.org/wiki/Linear_algebra[/url] Vertex shader (per 3D vertex/vector operations) and Pixel/Fragment shader (basically you make operations on pixels) But it's not easy, I admit
This UI behavior idea is working out pretty nicely. Went from this: [cpp] float right = 960.0f; float bottom = right / IwGLGetInt(IW_GL_WIDTH) * IwGLGetInt(IW_GL_HEIGHT); MenuHolder = new Ui::Control(Runnable); MenuHolder->Position = Vector2(right * 0.5f, 0.0f); MenuHolder->Size = Vector2(right * 0.5f, bottom); UiImpl->MainControl->Add(MenuHolder); PlayButton = new Ui::Button(Runnable); PlayButton->SetText("Play"); PlayButton->Position = Vector2(0.0f, bottom * 0.5f - 64.0f * 0.5f); PlayButton->Size = Vector2(256.0f, 64.0f); MenuHolder->Add(PlayButton); TestButton = new Ui::Button(Runnable); TestButton->SetText("Test"); TestButton->Position = Vector2(0.0f, bottom * 0.75f - 64.0f * 0.5f); TestButton->Size = Vector2(256.0f, 64.0f); MenuHolder->Add(TestButton); [/cpp] To this: [cpp] MenuHolder = &UiImpl->MainControl->Add<Ui::Control>(); MenuHolder->AddBehavior<Ui::Behavior::GridLayout>() .SetNumCols(1) .SetSpacing(64.0f); MenuHolder->AddBehavior<Ui::Behavior::CenterHorizontally>(); MenuHolder->AddBehavior<Ui::Behavior::CenterVertically>(); PlayButton = &MenuHolder->Add<Ui::Button>() .SetText("Play") .SizeToText(64.0f); TestButton = &MenuHolder->Add<Ui::Button>() .SetText("Test") .SizeToText(64.0f); UiImpl->MainControl->RunBehaviors(); [/cpp]
[QUOTE=NixNax123;48180507]I can't do this. It's making me so goddamn mad and I have no idea what's wrong and I also have no idea how to make give my text shader an orthographic projection that takes into account the text's position, let alone have it even render on screen. Been working on this for 4 days now[/QUOTE] You can generate a bitmap using the system's drawing functionality and then convert it into a texture, instead of using OpenGL. Performance isn't an issue. [URL="https://osu.ppy.sh/"]osu![/URL] uses that technique just fine and it looks great.
Sorry, you need to Log In to post a reply to this thread.