• What are you working on? v67 - March 2017
    3,527 replies, posted
So the fundamental problem with 2d physics, for me at least, is this If you have an object going along a very curvey course at speed, it will sometimes hit the underside of other collision surfaces [IMG]https://i.imgur.com/R6fxiq1.png[/IMG] Like this. Its very difficult to prevent this from happening. While you can prevent your objects from clipping through surfaces, its more difficult to prevent it from getting stuck (due to the last resort 'stop this from clipping through anything') So, an easy solution is the line rider solution. In line rider, you define a series of connected lines, which have a normal. Objects only cross lines from one direction. This fixes everything as lines can now never collide from underneath (and I suspect that is partly why this mechanic exists), but means that your levels have to pay attention to your line normals, and means you have to double up anything and leave an arbitrary gap if you want pseudo double sided collision [IMG]https://i.imgur.com/E6E1TZY.png[/IMG] So the solution I found is that you just assume that your normals are consistent and don't change rapidly (ie the normals don't flip with each successive line). This is significantly more lax of a condition to impose, and is guaranteed by default (unless you deliberately violate it). Now, whenever your object is near the terrain, you store the current normal direction (ie 1 or 0) of the underlying object with respect to yourself. When colliding with objects in the extremely near future, you simply ignore anything with the wrong normal direction - this is the consistent normal property There may be a non time based solution here that would be more ideal, but given that the time length can be extremely short in a fixed timestep physics engine (like 33ms), this isn't too much of a worry for me. This means I can now have nice double sided completely smooth physics! I literally haven't found a way to break it yet. Hooray! Ps I hate physics and never want to do anymore ever again
I'm attempting to contribute to Dolphin emulator's Qt conversion, to brush up on my Qt skills. [img]https://puu.sh/wJgak/711753ea78.gif[/img] Just figuring out how to fix the platform sorting now and then i'll make a pull request back to dolphin :)
Hello! A short video of our game we just made :) [video=youtube;c7-d6L5f2Lo]https://www.youtube.com/watch?v=c7-d6L5f2Lo&t=7s[/video]
[QUOTE=TM Gmod;52467494]I'm attempting to contribute to Dolphin emulator's Qt conversion, to brush up on my Qt skills. [img]https://puu.sh/wJgak/711753ea78.gif[/img] Just figuring out how to fix the platform sorting now and then i'll make a pull request back to dolphin :)[/QUOTE] Are they using Qt Quick + QML stuff?
[QUOTE=BAZ;52467639]Are they using Qt Quick + QML stuff?[/QUOTE] No it seems like everything is being defined in C++
Having fun with the ui for the jetpack system [video=youtube;PmLzzaI1a_0]https://www.youtube.com/watch?v=PmLzzaI1a_0[/video]
[QUOTE=TM Gmod;52467816]No it seems like everything is being defined in C++[/QUOTE] Bit of a missed opportunity (although to be fair the platform specific Qt Quick 2.0 QML stuff is still in Labs at the moment and the 1.0 stuff is just half assed)
[QUOTE=Karmah;52465132]Whoops, just realized I missed this post. I do alter the number of steps based on the slope, from 8 when looking straight down to 32 on extreme angles, though as the depth scale increases the more steps seem to be required to fix it. Running a depth scale of 0.075 seems to look good enough for now.[/QUOTE] I meant that more as biasing the texture coordinate based on the slope hit in the last step, but that probably would artefact near edges... Have you tried Newton's method yet? In theory that should give you a better solution with fewer steps than just breaking it down further and further. It probably causes issues if there are thin spikes in the depth map, though.
As useful as boost can be, I really wish the header count wasn't so incredibly high. I was using boost::polygon, boost::program_options, and boost::python - in total requiring 5,500+ headers. Intellisense fucking [I]despised[/I] me, and it was part of why I was trying to get PyBind11 working. Its a bummer too, because some of the Boost stuff is really really great - like program_options - but goddamn if the header bloat doesn't kill intellisense and compile times (if you're not using a precompiled header, at least). PyBind11 has been super neat though, and feels much lighter (saved me 2k headers) and cleaner to use than Boost had, and wayyy easier than not using a wrapper library to simplify binding Python and C++ together. The binding code for my line class, for example, is [cpp] py::class_<Line>(geom, "Line") .def(py::init<>()) .def(py::init<Point, Point>()) .def("Translate", &Line::Translate) .def("Rotate", &Line::Rotate) .def("Scale", &Line::Scale) .def("CoincidesWith", &Line::CoincidesWith, "Returns true if given line is on top of this line") .def("Direction", &Line::Direction, "Gives angular orientation/direction of this line") .def("DistanceTo", &Line::DistanceTo) .def("Intersection", &Line::Intersection, "Checks for intersection with given line.") .def("Length", &Line::Length) .def("Midpoint", &Line::Midpoint) .def_readwrite("A", &Line::A) .def_readwrite("B", &Line::B); [/cpp] Overload resolution is still admittedly all kinds of fucked for me, though. Regardless, using this in python becomes as simple as just importing my module (right now, I'm just exporting my Geometry namespace as a module) and using the methods I defined: [code] import SliceEngineGeometry l = SliceEngineGeometry.Line() p = SliceEngineGeometry.Point() p.x = 10 p.y = 20 l.A = p; l.B = SliceEngineGeometry.Point(-50, 0) intersection = l.Midpoint() [/code] Its not fancy by any means, but there's a really strange novelty to using my C++ code in Python and the general ease with which this was all setup. I'm nearing feature-complete for the C++ side of things, which mostly involves running test prints and waiting for them to finish. In the downtime between those, I've been working on writing the bindings and I'm hoping to add overloads to most of my functions for numpy datatypes.
[QUOTE=Fourier;52467517]Hello! A short video of our game we just made :) [video=youtube;c7-d6L5f2Lo]https://www.youtube.com/watch?v=c7-d6L5f2Lo&t=7s[/video][/QUOTE] I waNT IT NOW
[QUOTE=TM Gmod;52467494]I'm attempting to contribute to Dolphin emulator's Qt conversion, to brush up on my Qt skills. [img]https://puu.sh/wJgak/711753ea78.gif[/img] Just figuring out how to fix the platform sorting now and then i'll make a pull request back to dolphin :)[/QUOTE] actually, can you also add the windows way of doing it too? ie: right click on the column header to filter, or have a little arrow next to the header that when clicked shows you checkboxes? like this: [img]https://tr3.cbsistatic.com/hub/i/r/2015/10/02/a89ad469-4496-48d5-b4d6-26581c4998dc/resize/770x/e229d17cb94402e1cdadcfea5e184c63/fig-b-9-28.png[/img]
Been doing some Half-Life modding lately. Last week I did battle with the mess of header files (most of which don't have header guards and need to be included in a specific order) and today I got a menu to only stay open as long as you have a key held down today (at the cost of the MOTD not showing - for some reason the engine seems to be calling one of the client commands I added - need to do some digging to figure out what's going on there).
I'm working on memory management stuff in C++ and it's big fun. I'm not even kidding I love this stuff. I set up policy based memory arenas as seen in Stefan Reinalter's great blog over at blog.molecular-matters.com and am currently testing whether I've managed to introduce some off-by-one errors in some of the pointer arithmetics - looking good so far. Forcing myself to use fully qualified C++ style casts instead of C style casts as well which makes code like this a bit more verbose than it has to be: [CODE] void* Allocate(size_t size, size_t alignment, size_t offset) { //if (size == 0) { return nullptr; } size_t totalSize = size + alignment + sizeof(AllocInfo); char* memory = static_cast<char*>(malloc(totalSize)); char* alignedMemory = static_cast<char*>(lc::pointerUtil::AlignAddress(memory + offset + sizeof(AllocInfo), alignment)) - offset; AllocInfo* info = reinterpret_cast<AllocInfo*>(alignedMemory - sizeof(AllocInfo)); info->size = size; info->adjust = uint32_t(reinterpret_cast<uintptr_t>(info) - reinterpret_cast<uintptr_t>(memory)); return alignedMemory; } [/CODE] Also who can spot the misnamed variable?
[QUOTE=JWki;52470800]I'm working on memory management stuff in C++ and it's big fun. I'm not even kidding I love this stuff. I set up policy based memory arenas as seen in Stefan Reinalter's great blog over at blog.molecular-matters.com and am currently testing whether I've managed to introduce some off-by-one errors in some of the pointer arithmetics - looking good so far. Forcing myself to use fully qualified C++ style casts instead of C style casts as well which makes code like this a bit more verbose than it has to be: [CODE] void* Allocate(size_t size, size_t alignment, size_t offset) { //if (size == 0) { return nullptr; } size_t totalSize = size + alignment + sizeof(AllocInfo); char* memory = static_cast<char*>(malloc(totalSize)); char* alignedMemory = static_cast<char*>(lc::pointerUtil::AlignAddress(memory + offset + sizeof(AllocInfo), alignment)) - offset; AllocInfo* info = reinterpret_cast<AllocInfo*>(alignedMemory - sizeof(AllocInfo)); info->size = size; info->adjust = uint32_t(reinterpret_cast<uintptr_t>(info) - reinterpret_cast<uintptr_t>(memory)); return alignedMemory; } [/CODE] Also who can spot the misnamed variable?[/QUOTE] You might find this useful, it seemed like an extremely sane approach to memory management to me [video=youtube;LIb3L4vKZ7U]https://www.youtube.com/watch?v=LIb3L4vKZ7U[/video]
Anybody know any good programming/tech talks that aren't C++ related
[QUOTE=proboardslol;52472110]Anybody know any good programming/tech talks that aren't C++ related[/QUOTE] 33c3 has some pretty fun talks, GDC technical talks are amazing too.
[QUOTE=Icedshot;52471592]You might find this useful, it seemed like an extremely sane approach to memory management to me [video=youtube;LIb3L4vKZ7U]https://www.youtube.com/watch?v=LIb3L4vKZ7U[/video][/QUOTE] Yeah that's a pretty decent talk.
[QUOTE=proboardslol;52472110]Anybody know any good programming/tech talks that aren't C++ related[/QUOTE] Honestly, SOME of Blackhat/Defcon stuff is kinda interesting
[QUOTE=JohnnyOnFlame;52473563]33c3 has some pretty fun talks, GDC technical talks are amazing too.[/QUOTE] Time for some [t]https://pbs.twimg.com/media/C07sDtFXEAANl-S.jpg[/t] [url]https://media.ccc.de/c/33c3[/url] Who's going to 34c3?
[QUOTE=DrDevil;52474029]Time for some [t]https://pbs.twimg.com/media/C07sDtFXEAANl-S.jpg[/t] [url]https://media.ccc.de/c/33c3[/url] Who's going to 34c3?[/QUOTE] me, but I refuse to plan it this year
[QUOTE=Icedshot;52471592]You might find this useful, it seemed like an extremely sane approach to memory management to me [/QUOTE] Besides, anything by Andrei is gold. I don't know any other speaker that can so forcefully, yet successfully get the audience to participate.
Today is an excellent day: I've spent the past week on the most challenging programming problem I've tackled yet, and just now I produced a 3D print that my boss called "so, [I]so[/I] close!". Feels good - especially because my software produces the GCode required for these prints in no more than a few seconds, and the old MATLAB software took 25-30 [I]minutes[/I] per print. Not to mention all the other improvements I've rolled in. I'm so close to being free!
[QUOTE=paindoc;52478664]Today is an excellent day: I've spent the past week on the most challenging programming problem I've tackled yet, and just now I produced a 3D print that my boss called "so, [I]so[/I] close!". Feels good - especially because my software produces the GCode required for these prints in no more than a few seconds, and the old MATLAB software took 25-30 [I]minutes[/I] per print. Not to mention all the other improvements I've rolled in. I'm so close to being free![/QUOTE] Make sure you get a letter of recommendation that mentions things like that. I can hardly think of a way it could be more glowing regarding technical skills than a throughput optimisation by 14900%+ (conservative estimate) :v:
[QUOTE=Tamschi;52479179]Make sure you get a letter of recommendation that mentions things like that. I can hardly think of a way it could be more glowing regarding technical skills than a throughput optimisation by 14900%+ (conservative estimate) :v:[/QUOTE] Well, to be fair, it is a MATLAB prototype I'm upgrading against. Most of my speed increase probably comes from just using C++, followed by smart usage of std::async for multithreading wherever possible. It would be unfair to myself, though, to not mention that it took a lot of work on my part to make more of the algorithm iterative - instead of recursive - during several key steps to get further performance improvements. I did the same recursive-to-iterative conversion work for a few other algorithms that it seemed appropriate for, too. I am feeling a [I]bit[/I] smug though, because the guy who wrote the MATLAB code was giving me shit a few days ago as he managed to make this entire system in about the same amount of time as I did, and it worked better and had more features. He's pretty much just a MATLAB/Python script-kiddie though, excelling at copy-and-paste programming, so it feels good to have my software starting to catch up to his in features AND [I]obliterating[/I] it in terms of throughput. And of course I'm behind in features: I don't have a lot of the MATLAB "standard library" features to help me out, and have had to implement a tremendous amount of "infrastructure" code. He was also a complete dick to me several times during my first few months (over incredibly urbane shit). My boss is still angry at him about that, so she said she'll be sure to mention my software's performance at our next status meeting in front of the whole company :zing:
I think you're still underselling yourself. As far as I know, not (all that?) many developers can handle complicated maths-heavy projects like this one in the first place, even with a template of sorts.
semi-inspired by zelda, and if you pay extra-attention you'll see the burrow-charge mutation too [media]https://twitter.com/MONOTHETIC/status/887074663834165249[/media]
[QUOTE=paindoc;52479313]Well, to be fair, it is a MATLAB prototype I'm upgrading against. Most of my speed increase probably comes from just using C++, followed by smart usage of std::async for multithreading wherever possible. It would be unfair to myself, though, to not mention that it took a lot of work on my part to make more of the algorithm iterative - instead of recursive - during several key steps to get further performance improvements. I did the same recursive-to-iterative conversion work for a few other algorithms that it seemed appropriate for, too. I am feeling a [I]bit[/I] smug though, because the guy who wrote the MATLAB code was giving me shit a few days ago as he managed to make this entire system in about the same amount of time as I did, and it worked better and had more features. He's pretty much just a MATLAB/Python script-kiddie though, excelling at copy-and-paste programming, so it feels good to have my software starting to catch up to his in features AND [I]obliterating[/I] it in terms of throughput. And of course I'm behind in features: I don't have a lot of the MATLAB "standard library" features to help me out, and have had to implement a tremendous amount of "infrastructure" code. He was also a complete dick to me several times during my first few months (over incredibly urbane shit). My boss is still angry at him about that, so she said she'll be sure to mention my software's performance at our next status meeting in front of the whole company :zing:[/QUOTE] You just disintegrated that guy :P
I'm stupidly proud of this, but I decided to learn socket programming yesterday and came up with this chat application. Conditional compilation allows you to create a client or server, as well as either use the Windows or POSIX API. [url]https://pastebin.com/QAGJFv2H[/url]
[QUOTE=elevate;52481897]I'm stupidly proud of this, but I decided to learn socket programming yesterday and came up with this chat application. Conditional compilation allows you to create a client or server, as well as either use the Windows or POSIX API. [url]https://pastebin.com/QAGJFv2H[/url][/QUOTE] Nothing stupid about being proud of that!
Kind of a weird question - I got a laptop, and I want to be able to collaborate the same project on both my laptop and my desktop since I have to bounce between the two frequently, will it fuck anything up if I'm making changes to the same repo under the same username but from different machines?
Sorry, you need to Log In to post a reply to this thread.