• What are you working on? v67 - March 2017
    3,527 replies, posted
[QUOTE=Radical_ed;51916481] This lil guy turned out real cute[/QUOTE] Some instant feedback, e.g. a red line on the blocks where you've cut them, would be good. It's a bit confusing at the moment if they've been cut or not.
[QUOTE=Icedshot;51916400]I found columns were nigh completely broken for anything other than super basic usage in imgui. Eg nested columns just don't work[/QUOTE] Yep the built-in column support is quite lacking. I built my own though, so the brokenness in the gif is my own as well. My first try at implementing the functionality in the gif was using the built-in columns but also was way too convolved, the approach I use now is fairly simple.
Redoing the UI to make it a little more compact. Still very much a temporary solution until I get a better one together Old: [IMG]https://dl.dropboxusercontent.com/u/9317774/old_ui.PNG[/IMG] New: [IMG]https://dl.dropboxusercontent.com/u/9317774/newui3.PNG[/IMG] Next plan is to probably go with a pip boy style interface using the same bar mechanics. I need to chop down how many parts are damageable as well (probably ditching everything below and including the waist), to reduce visual clutter (and reduce cluttered game mechanics)
Got modules playing nicely, after some initial difficulties. Destructors with virtual classes can be messy as is when you're inexperienced, but I felt I was kinda playing with fire as each module has a list of pointers to source modules and that was causing issues too. Add in the "big" change I made and things got worse when dealing with asynchronous operations between the CPU and GPU. Regardless, I'm starting to prepare various demos and work on improving my imaging abilities (this is the first step in setting up continents for what i use to make planets): [t]http://i.imgur.com/DEDKlCk.png[/t] The above took about 8 minutes to run with libnoise, but completed in less than a second on the GPU. Its not the best image though, libnoise at least does bmp output so they're not compressing 32-bit data into an 8-bit range. My code for normalization to scale data before turning it into pixels was fairly slow on the CPU, so I whipped up a quick SIMD implementation. The dataset should always be power-of-two, so this should hopefully be safe (I say, before it all breaks inevitably), and its pretty much made this part of image writing a non-issue in terms of execution time. I stuck with the baseline of just using SSE instructions (since the steam hardware survey says everyone has those, or nearly everyone), but AVX's wider registers would make this even faster: [cpp] // Convert floating point data that is "raw" output from GPU noise modules to // use the full range of datatype "T", making it easier to write pixel data of // arbitrary bit depths template<typename T> inline std::vector<T> convertRawData(const std::vector<float>& raw_data) { // Get min of return datatype __m128 t_min = _mm_set1_ps(static_cast<float>(std::numeric_limits<T>::min())); // Like with the min/max of our set, we don't use max of T alone and instead can evaluate // the expression its used with here (finding range of data type), instead of during every iteration __m128 t_ratio = _mm_sub_ps(_mm_set1_ps(static_cast<float>(std::numeric_limits<T>::max()), t_min); // Declare result vector and use resize so we can use memory offsets/addresses to store data in it. std::vector<T> result; result.resize(raw_data.size()); // Get min/max values from raw data auto min_max = std::minmax_element(raw_data.begin(), raw_data.end()); // Mininum value is subtracted from each element. __m128 min_register = _mm_set1_ps(*min_max.first); // Max value is only used in divisor, with min, so precalculate divisor instead of doing this step each time. __m128 ratio_register = _mm_sub_ps(min_register, _mm_set1_ps(*min_max.second)); // Iterate through result in steps of 4 for (size_t i = 0; i < result.size(); ++i) { // Load 4 elements from raw_data - ps1 means unaligned load. __m128 step_register = _mm_load_ps1(&raw_data[i]); // get elements in "reg" into 0.0 - 1.0 scale. step_register = _mm_sub_ps(reg, min); step_register = _mm_div_ps(reg, ratio); // Multiply step_register by t_ratio, to scale value by range of new datatype. step_register = _mm_mul_ps(step_register, t_ratio); // Add t_min to step_register, getting data fully into range of T step_register = _mm_add_ps(step_register, t_min); // Store data in result. _mm_store1_ps(&result[i], reg); } // Return result, which can be (fairly) safely cast to the desired output type T. // At the least, the range of the data should better fit in the range offered by T. return result; } [/cpp] I found a [URL="https://deplinenoise.files.wordpress.com/2015/03/gdc2015_afredriksson_simd.pdf"]really interesting presentation on someone using SIMD stuff in games[/URL], and never would've guessed it could've been used like that to accelerate tracking entities and handling game logic. Its a really long presentation, but most of the actual content per slide is fairly small and there's a lot of duplicated slides. The biggest change I made in the CUDA project was ditching surface objects in favor of a C-style float array allocated using cudaMallocManaged. Managed memory in CUDA is memory that can be accessed from both the CPU and GPU (synchronously using runtime API, async using driver API). Surface objects were great for general usage and pretty easy to access, but I was pretty quickly using obnoxious amounts of GPU memory and couldn't think of a good way to bring this back to the CPU without destroying the GPU handle/objects. Managed memory is cool because despite the dangers of C-style arrays, the CUDA runtime has been pretty smart about moving the module data to/from the GPU as needed. It's easy to run into asynchronous operation issues though, which is bad enough on the CPU, but an absolute pain in the dick on the GPU. I had a module that was broken without me knowing it, and I had made the array representing the "input" in this module's kernel non-const. So when the array had values that got too large and it indexed outside of the array, it just expanded the array. The CPU didn't know this though, and it wasn't easy for me to detect this (it only occurred when a certain parameter was above 1.569f), but I'd get errors that'd throw in memcpy assembly code. That was a tremendous fucking headache to figure out. Regardless, the change has been positive as a whole. It also makes certain crazy plans I have for terrain generation a lot easier and a lot faster.
How the fuck does [i]anyone[/i] remain sane working with MSVC? I noticed I'm just starting to put off working as much as physically possible and I'm starting to feel like I need to hit a blunt every time I press "compile". It's like the whole package and the OS it's running on was written by complete fucking subhumans, just end me. [editline]5th March 2017[/editline] Except STL I guess, but if you ask him why something doesn't work the response will probably be "compiler bug, still awaiting response from compiler team". [editline]5th March 2017[/editline] Even with all my template abuse it doesn't even take that long to compile, it's just that cl.exe tends to lock up at 0% CPU doing fuckall for no appearent reason more often than it doesn't. And it's starting to feel like they pay their programmers by number of lines that block the UI thread, GB of memory leaked and bugs that should be so impossible they deserve an award.
the text editor in visual studio is also utter garbage, i'm honestly amazed how people don't seem to notice [editline]5th March 2017[/editline] not to mention that intellisense just randomly breaks half of the time and you have to restart visual studio to get it back
The auto-completion and automatic formatting is such a mental struggle between their usefulness and how amazingly bad they are I should just have turned it all off a long time ago and forgotten about it. Try changing [cpp]#include "skeleton.h"[/cpp] To [cpp]#include <renderer/skeleton.h>[/cpp] And watch it just start deleting random parts of the line as the auto-complete kicks in. You have to edit that in a [i]very[/i] specific order for it to work properly. I'm just gonna start using MSBuild from the command line and edit with sublime. The only redeeming feature is intellisense, which is honestly quite nice except when it doesn't fucking work or forces you to delete the entire VS AppData directory to stop it from slowing the entire IDE to a crawl. [editline]5th March 2017[/editline] Trying to add another argument to a function when namespaces are involved is also a good way to break the autocompletion into removing random shit. Did they test it at all?
I'm working on a discord bot that simulates a hockey league. I've got leagues and teams set up, next to allow player trading and simulate seasons [img]http://i.imgur.com/2WF63cT.png[/img]
Where is Finland.
[QUOTE=robinkooli;51918566]Where is Finland.[/QUOTE] I'm still putting together that list of names. It and the US are the other main countries not added yet, but the US is just going to use the same list as the English speaking Canadian provinces.
[QUOTE=robinkooli;51918566]Where is Finland.[/QUOTE] Between Sweden and Russia.
I've re-created the HL2 Antlion Guard in my engine to test out my AI-system. I'm rather proud how it turned out so I wanted to post it here as well :v:: [HD]https://youtu.be/G1JvibPFnyE[/HD] The system is written in C++ and uses behavior trees, the actual NPC is written in Lua. [T]http://sciolyte.com/sharex/sciolyte_2017-03-06_06-50-46.png[/T]
MSVC didn't ruin my life but it wasn't much to begin with either.
[t]http://i.imgur.com/6hssMIp.gif[/t] Moar solid view splitting on top of dear imgui.
Cleanup up the code a little for my game, which is never that exciting So far there are 5 different objects claiming to be game state/gamemode state (and named accordingly!). The first is actually a world collision handler that had greater aspirations that were scrapped (gamemodes and other state is usefully a separate concept to collision). This class got renamed, and its unused accessory aspirational functions deleted The second was actually *server* 'game' state, that deals with routing packets between clients (at a very high level), but also team balancing, respawning and gamemode info. This just got simply renamed The third is a class that I had actually intended to deal with the menu/gameplay separation that tend currently is handled as a series of not helpful if(!in_menu && window.focus), which leads to a bit of a clusterfuck because its unclear what's going. However, I never implemented this as I decided that the main menu and the game are going to have a very *very* thin separation between the two, so a massively regimented restructure of everything vs a few if statements that won't spiral out of control because I have no plans to expand the menu system. This all got deleted The fourth is the clientside gamemode handler, which receives packets from the server and has methods like game_over() and get_game_over string. Not really game state as such, just a gamemode handler The fifth is the *serverside* gamemode handler, which (as mentioned in the second game state method) deals with what the current number of kills are, how much time has elapsed etc. It is in fact very similar to number 4, and both will get merged once I figure out what an acceptable merging strategy is because maintaining all this separate gamestate code is one giant clusterfuck I tend to leave a lot of code around unused or unimplemented. This is particularly if I don't really know what the end goal is anyway, so I have a lot of semi failed starts, or unclear ideas. I've recently taken up spending more time planning my code (which is why implementing disconnecting went so damn smooth), as well as making more efforts to actually clean my shit up because its actively harmful to me doing anything useful
I'm writing a binding library for ChakraCore (Microsoft's Javascript runtime for Edge) . The idea is that you never have to declare anything twice, it parses your source tree when you run it, and get bindings generation for CPP <-> Javascript (or Typescript) :~) It sort of abuses the new C++ attributes (they're intended for the compiler only, but I'm parsing the source tree and ripping them out). Anyway, here's a simple example: Declarations (the CC_DECLAREONLY is because i inherit from glm::vec2 and I don't want to touch the library code :S) [IMG]http://i.imgur.com/C3GTdqG.png[/IMG] Actually using it: [IMG]http://i.imgur.com/JWErAXk.png[/IMG] Result: [IMG]http://i.imgur.com/F3Kv8XJ.png[/IMG] And just for kicks the declarations for the "OS" library: [IMG]http://i.imgur.com/lBXO34S.png[/IMG] And yeah, you're right, this might be semantically noncompliant and a little weird but I mean, UE4 does it as well. Plus, it makes it really easy to write bindings, and I hate declaring things in more than one place :~)
Man I've had a massive influx of chinese folks buying my asset, not reading the manual, and then sending me angry emails This only started over the last three days, strange.
Got vertex lighting working for static props (mostly): [media]https://www.youtube.com/watch?v=S0RiP7UiCJk[/media] Some stills: [t]http://files.facepunch.com/ziks/2017/March/06/chrome_2017-03-06_23-30-51.jpg[/t][t]http://files.facepunch.com/ziks/2017/March/06/chrome_2017-03-06_23-33-21.jpg[/t] [t]http://files.facepunch.com/ziks/2017/March/06/chrome_2017-03-06_23-34-55.jpg[/t][t]http://files.facepunch.com/ziks/2017/March/06/chrome_2017-03-06_23-39-58.jpg[/t]
Ran into an ICE! And an interesting one at that, only happens on Release + x64 and the output is useless. Kids, don't type erase variadic template function calls it seems. It's a shame too, I was hoping to use that technique to make type erased entities. It might be an issue with catch though, in which case I think I'll try it anyway.
[QUOTE=Tobba;51918277]The auto-completion and automatic formatting is such a mental struggle between their usefulness and how amazingly bad they are I should just have turned it all off a long time ago and forgotten about it. Try changing [cpp]#include "skeleton.h"[/cpp] To [cpp]#include <renderer/skeleton.h>[/cpp] And watch it just start deleting random parts of the line as the auto-complete kicks in. You have to edit that in a [i]very[/i] specific order for it to work properly. I'm just gonna start using MSBuild from the command line and edit with sublime. The only redeeming feature is intellisense, which is honestly quite nice except when it doesn't fucking work or forces you to delete the entire VS AppData directory to stop it from slowing the entire IDE to a crawl. [editline]5th March 2017[/editline] Trying to add another argument to a function when namespaces are involved is also a good way to break the autocompletion into removing random shit. Did they test it at all?[/QUOTE] What version?
Oculus Rift + Oculus Touch (on my feet, don't ask) + Leap Motion + Inverse Kinematics + lightsaber = [QUOTE][vid]http://www.webm.land/media/tmp/d4155091-c354-48b2-bcb6-2db0eb5e4953.webm[/vid][/QUOTE] shitty webm hosts. well it's on facebook too [url]https://www.facebook.com/futurice/videos/10158201024865005/[/url]
Another interesting scripting language called Gravity! This might even replace Lua for me. I don't like the fact that it has === operator and the fact that 1=="1" equals to true, but eh. [url]https://github.com/marcobambini/gravity[/url] [url]http://gravity-lang.org[/url]
[QUOTE=tschumann;51925705]What version?[/QUOTE] At least 2015. It doesn't seem like the include-related problems kick in every time, but type-related ones do. [vid]https://zippy.gfycat.com/ScaredPotableButterfly.webm[/vid]
[QUOTE=cartman300;51926088]Another interesting scripting language called Gravity! This might even replace Lua for me. I don't like the fact that it has === operator and the fact that 1=="1" equals to true, but eh. [url]https://github.com/marcobambini/gravity[/url] [url]http://gravity-lang.org[/url][/QUOTE] How can it replace lua for you if nothing uses it?
[QUOTE=phygon;51927288]How can it replace lua for you if nothing uses it?[/QUOTE] I Think he means where ever he implements it. Such as a modding API for a game.
If only I had some kind of method of producing really natural hand animations. I could really my game look a lot better. The hands in my game so far have just been a blocky mess, its pretty sad [IMG]https://dl.dropboxusercontent.com/u/9317774/topng.PNG[/IMG] *headscratch* [media]https://www.youtube.com/watch?v=XnF7_tMLJdo[/media] No solutions here [media]https://www.youtube.com/watch?v=pTFb4Cho32E[/media] [IMG]https://dl.dropboxusercontent.com/u/9317774/nosurprises2.PNG[/IMG] Hopefully I should be able to use this to create some much higher quality hand animations (going for idle anims first, I may use it as a animation editor as well, as you can see its easy to produce swings with this method) This was actually me just hacking in the fighter for fun (the whole animation system was already based around IKing hands to specific positions so it was very straightforward), I'm not actually going to use it like this. I've set up some basic motion capture/animation interpolation so you can save a hand movements as an animation. Ideally I'll save some finger tapping, hand readjustments etc, then apply these to the hand model wrapped nicely around the sword. The new hand model should hopefully give a little more definition to the characters. The new hand might be a little too real atm (and its a little close to the wrist link), but it looks much better IMO [IMG]https://dl.dropboxusercontent.com/u/9317774/newhand.PNG[/IMG] I'm also considering going full rayman. Oh and, ignore the legs they're broken
Would anyone be interested in a weekly stream of [URL="https://youtu.be/ZOwzXdxzheg"]Hockey?[/URL] being played by teams of bots people have written. (or interested in making some bots for it)
[QUOTE=laserpanda;51928740]Would anyone be interested in a weekly stream of [URL="https://youtu.be/ZOwzXdxzheg"]Hockey?[/URL] being played by teams of bots people have written. (or interested in making some bots for it)[/QUOTE] Yes please, AI programming challenges are always fun. Also it's hard to search for a game which has a question mark in it's name and a very generic title like "Hockey?", mind giving a link? [editline]8th March 2017[/editline] Rrrrrrrrrright, [URL="http://www.hockeyquestionmark.com/"]i think i found it.[/URL]
[QUOTE=cartman300;51929002]Yes please, AI programming challenges are always fun. Also it's hard to search for a game which has a question mark in it's name and a very generic title like "Hockey?", mind giving a link? [editline]8th March 2017[/editline] Rrrrrrrrrright, [URL="http://www.hockeyquestionmark.com/"]i think i found it.[/URL][/QUOTE] Yeah it's awful because Google filters out the punctuation. You have to spell out question mark. The website is pretty outdated and I'm not sure it even has the latest version. I would go to [url]www.reddit.com/r/hockeyquestionmark[/url] instead. There's a modding API for c#, and a python API designed specifically for bots in the works.
Hooray! I spent today actually implementing the motion capture and replay etc in the fashion that I want. It works quite well. I'll need to strictly enforce some anti clipping later down the line, but on first pass this is pretty sweet [media]https://www.youtube.com/watch?v=rnOXvVe2-bs[/media]
Sorry, you need to Log In to post a reply to this thread.