• What are you working on? v67 - March 2017
    2,544 replies, posted
  • Avatar of Enternode
  • I'm hearing a lot of differing opinions about SDL vs. SFML Now that SFML and SDL have version 2s, which do you think is better for 2d game engine development in C++, and why? Reddit says SDL2 but I've heard a couple of arguments for SFML2. [editline]20th March 2017[/editline] I should state I intend on implimemting Lua and Tiled into what I am making
  • Avatar of Protocol7
  • [QUOTE=Lett1;51978418]Trying my hand at a [URL="https://github.com/TheBerkin/Rant/issues/92"]typo generator[/URL]. Currently two modes are implemented: transposition and mistyping based on the keyboard layout. Example string: [CODE]the quick brown fox jumps over the lazy dog 1234567890 -+ [] \ ; ' , . /[/CODE] Transposing letters: [CODE]teh qucik borwn fxo jupms ovre hte layz dgo 1234568790 +- ][ \ ; ' , . / hte qucik rbown ofx jmups ovre hte layz odg 1235467890 +- ][ \ ; ' , . / hte uqick borwn fxo jmups ovre teh layz dgo 1243567890 +- ][ \ ; ' , . / teh qucik borwn ofx jupms oevr hte alzy dgo 1234657890 +- ][ \ ; ' , . / teh qucik borwn fxo jmups oevr teh alzy odg 1243567890 +- ][ \ ; ' , . / hte qiuck borwn fxo ujmps oevr hte alzy dgo 1234567980 +- ][ \ ; ' , . / hte uqick rbown ofx jumsp voer hte layz odg 1234567809 +- ][ \ ; ' , . / teh quikc brwon ofx jumsp oevr hte lzay odg 1234567809 +- ][ \ ; ' , . / teh quikc rbown ofx ujmps ovre teh alzy odg 1234568790 +- ][ \ ; ' , . / hte qucik borwn fxo ujmps oevr hte alzy odg 1234576890 +- ][ \ ; ' , . / [/CODE] Mistyping Keys: [CODE]the quick b3own fox jumps ove4 5he lasy d9g 1234567890 -+ [] \ ; ' , . / the quick brown rox jumps pver the lqzy dog 12345u7890 -+ [] \ ; ' , . / the quick brown fox jumps over the laay dog 1234567890 -+ [] \ ; ' , . / the quick brown fox jumpc obe5 fhe lazy dov 1134567890 -+ [] \ ; ' , . / ty4 qyick br;wn fox kumps ofer the .wzy dog 123e567890 -+ [] \ ; ' , . / the 2uick bdiwn fox jujps ov45 the lazy dog 223456u8o- -+ [] \ ; ' , . / the quicm browb fox jumps over thf lazy dog 1234567890 -+ [] \ ; ' , . / th3 quick browj fox jumpa ;ver the lazy doy 12e45y7990 -+ [] \ ; ' , . / the quick vr;wn fpx jumps over the lazy dog 1234567890 -+ [] \ ; ' , . / the 1uick brown f0z jumps over the lazy dog 1234567890 -+ [] \ ; ' , . / [/CODE] This one probably needs some adjustments but it looks pretty good so far.[/QUOTE] I'm a bit late but a long time ago I did something similar in C# that does random capitalizations and stuff. [url]https://github.com/protocol114/Fore/blob/master/Common/TypoGenerator/TypoGenerator.cs[/url] It was actually paired with a shitty Markov chain and prepopulated dictionaries, with final output that looks like any of the following sentences: [quote] having the rainy bEGinner beginner radiate he helpful beginners beginners bird cOMPAny milk just hEAd delay?. delay?. plantation have a am AM beginners sUPPOSe a sticky cannnon s tease a just mysterious bedroom stoMact raiNY WAtch watches helpless dude kick I careful cup plug a ctackers where wehere is an immense Piss wALLET mysTERIOUS lettuce,! flap the AFternoON has clumsy stomach sQUEEze you you large peNCjl prick the awlaways in kill he rapid stomach have you you returN EASy pencil pnencil shxllow.? laNguage wAIK YO u there paprer[/quote]
  • [QUOTE=TeamEnternode;51986736]I'm hearing a lot of differing opinions about SDL vs. SFML Now that SFML and SDL have version 2s, which do you think is better for 2d game engine development in C++, and why? Reddit says SDL2 but I've heard a couple of arguments for SFML2. [editline]20th March 2017[/editline] I should state I intend on implimemting Lua and Tiled into what I am making[/QUOTE] It's mostly a matter of taste. They differ mainly in API style, with SFML being pretty object oriented and SDL being plain C. I'd argue for something that's going to be a fairly low level component of an engine, the latter is better, but it's entirely up to personal taste. It's in any case nothing to spend a lot of time on up front evaluating, just pick one and see if you like it. It's going to vanish pretty quickly inside your engine code anyways. I've always been a bit suspious of the built in sprite stuff they have and would recommend rolling that yourself using OpenGL because it's the more flexible route but that's also up to personal taste I guess. FWIW I used both and liked SDL better because the C-ish API is a better format for libraries in my opinion but if you prefer to USE object oriented APIs, you might find SFML nicer to use.
  • [QUOTE=eirexe;51985857]I have published our game's source code: [url]https://github.com/PepperCarrotGame/peppercarrotgame_source[/url] It still lacks the binary assets folder, I'll upload that later once I sort out licensing.[/QUOTE] In case you used other engines previously, what is most different in Godot in your opinion? [editline]20th March 2017[/editline] [QUOTE=pierre0158;51986116][...] Procedural flares are ugly as fuck [...][/QUOTE] They could use some irregularities, but I'm saying this as someone who wears glasses and as such gets pretty crazy patterns from these :v: They seem overall way too strong/large, too.
  • [QUOTE=pierre0158;51986116] [...] Any idea how i could improve it ? [...] [/QUOTE] Can't say much about the looks. But performance wise, I would do a row-major traversal for better cache utilization. Assuming your texture uses a conventional pixel layout. And you could probably approximate a min-max region for x1 and y1. But I don't know math so idk. You can also easily optimize your pow calls, since you use a fixed exponent. pow is slow af [code] float dx = x1 - x; float dy = y1 - y; dist = sqrt(dx*dx + dy*dy) [/code] I know you didn't ask for performance advice but I couldn't help myself sorry
  • Avatar of jangalomph
  • [QUOTE=Z_guy;51986193]That's a nice looking ImGui theme. Mind sharing it?[/QUOTE] [CODE]void VectorayGenStyle() { auto& style = ImGui::GetStyle(); style.Alpha = 1.0f; // Global alpha applies to everything in ImGui style.WindowPadding = ImVec2(8, 8); // Padding within a window style.WindowMinSize = ImVec2(32, 32); // Minimum window size style.WindowRounding = 0.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows style.WindowTitleAlign = ImGuiAlign_Left; // Alignment for title bar text style.ChildWindowRounding = 0.0f; // Radius of child window corners rounding. Set to 0.0f to have rectangular child windows style.FramePadding = ImVec2(4, 3); // Padding within a framed rectangle (used by most widgets) style.FrameRounding = 0.0f; // Radius of frame corners rounding. Set to 0.0f to have rectangular frames (used by most widgets). style.ItemSpacing = ImVec2(8, 4); // Horizontal and vertical spacing between widgets/lines style.ItemInnerSpacing = ImVec2(4, 4); // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label) style.TouchExtraPadding = ImVec2(0, 0); // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much! style.IndentSpacing = 21.0f; // Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2). style.ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns style.ScrollbarSize = 16.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar style.ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar style.GrabMinSize = 10.0f; // Minimum width/height of a grab box for slider/scrollbar style.GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs. style.DisplayWindowPadding = ImVec2(22, 22); // Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows. style.DisplaySafeAreaPadding = ImVec2(4, 4); // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows. style.AntiAliasedLines = true; // Enable anti-aliasing on lines/borders. Disable if you are really short on CPU/GPU. style.AntiAliasedShapes = true; // Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.) style.CurveTessellationTol = 1.25f; // Tessellation tolerance. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality. style.Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f); // Fine style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f); // Fine style.Colors[ImGuiCol_WindowBg] = ImVec4(0.12f, 0.12f, 0.12f, 1.00f); // Fine style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); // Fine style.Colors[ImGuiCol_PopupBg] = ImVec4(0.05f, 0.05f, 0.10f, 1.00f); // Maybe? style.Colors[ImGuiCol_Border] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f); // Fine style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); // Fine style.Colors[ImGuiCol_FrameBg] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f); // Background of checkbox, radio button, plot, slider, text input style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); // Little box hover color style.Colors[ImGuiCol_FrameBgActive] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); style.Colors[ImGuiCol_TitleBg] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f); //Title bar style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.12f, 0.12f, 0.12f, 1.00f); //Title Bar style.Colors[ImGuiCol_TitleBgActive] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); //Title bar active (ORANGE) 1.00f, 0.47f, 0.00f, 1.00f style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f); style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f); //Scroll bar background style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.40f, 0.40f, 0.40f, 1.00f); //Scroll Bar Color style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.40f, 0.40f, 0.40f, 1.00f); //Scroll bar click color style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.40f, 0.40f, 0.40f, 1.00f); //Scroll bar drag color style.Colors[ImGuiCol_ComboBg] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f); // Drop down menus style.Colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f); //Check Box style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.80f, 0.80f, 0.80f, 0.25f); //Slider/Float Slider color style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); //Slider/Float Slider Active Color style.Colors[ImGuiCol_Button] = ImVec4(1.00f, 0.47f, 0.10f, 1.00f); //Button Color *FIX THIS* style.Colors[ImGuiCol_ButtonHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); style.Colors[ImGuiCol_ButtonActive] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); style.Colors[ImGuiCol_Header] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f); style.Colors[ImGuiCol_HeaderHovered] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); style.Colors[ImGuiCol_HeaderActive] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); style.Colors[ImGuiCol_Column] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f); style.Colors[ImGuiCol_ColumnHovered] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); style.Colors[ImGuiCol_ColumnActive] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); style.Colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); style.Colors[ImGuiCol_CloseButton] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); style.Colors[ImGuiCol_CloseButtonHovered] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); style.Colors[ImGuiCol_CloseButtonActive] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f); style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); style.Colors[ImGuiCol_PlotHistogram] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f); style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(1.00f, 0.47f, 0.00f, 1.00f); style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f); }[/CODE] We use an external file to control our colors so that we don't edit any of the files from the ImGui Library. Makes for easier updating. You should be able to get this to work for you :)
  • Avatar of Karmah
  • I've been meaning to implement ImGUI in my engine and drop the shitty ui I made. If I use it then I'm going to have at least 3 separate libraries defining vector classes with: GLM, ImGUI, and ASSIMP all defining vec2 vec3 and vec4 :v:
  • Avatar of Dr Magnusson
  • I've been following [URL="https://www.youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_"]Bartosz Milewski's videos on Category Theory for Programmers[/URL], and I feel like it's blowing my mind on a regular basis. Furthermore, I am starting to see why Haskell is so well liked by people who "get it". The video series is bridging that gap between rough and tumble programming languages like C++, and the mathematical beauty and purity of what lies beneath all the dirty implementation details. I might give Haskell another shot once I'm done with the series. I read the Learn You A Haskell For Great Good book a while ago, and understood the syntax fine, but it never really explained the "why" of Haskell, the almost philosophical arguments for why Haskell, or category theory in general, is a good thing to know about and use when programming. [B]edit: [/B]I still don't really know what a monad is
  • Avatar of jangalomph
  • [QUOTE=Karmah;51987680]I've been meaning to implement ImGUI in my engine and drop the shitty ui I made. If I use it then I'm going to have at least 3 separate libraries defining vector classes with: GLM, ImGUI, and ASSIMP all defining vec2 vec3 and vec4 :v:[/QUOTE] We use a number of libraries for our software, but isn't it possible to only include what you want from each library? (I truly don't know :P)
  • Avatar of Karmah
  • [QUOTE=jangalomph;51987724]We use a number of libraries for our software, but isn't it possible to only include what you want from each library? (I truly don't know :P)[/QUOTE] Idk if there's any other way because the assimp model importing library seems to store its data using its own data structures ie using its own vector math library.
  • [QUOTE=Karmah;51987680]I've been meaning to implement ImGUI in my engine and drop the shitty ui I made. If I use it then I'm going to have at least 3 separate libraries defining vector classes with: GLM, ImGUI, and ASSIMP all defining vec2 vec3 and vec4 :v:[/QUOTE] When you add a physics engine you're going to have 4 probably. Not really something I'd call an issue though, esp. with being able to define conversion operators for them.
  • Avatar of DoctorSalt
  • [QUOTE=Berkin;51985550]My speech synthesizer can now convert simple words to a phonemic representation, but all it can pronounce right now is vowels (not even diphthongs). It's something special. ~MOUTH SOUNDS~ [/QUOTE] If you add a drum machine and some synth you could create a sequel to that rat man song from portal [media]https://www.youtube.com/watch?v=tzwIzwe9Iq0[/media]
  • Avatar of Karmah
  • [QUOTE=JWki;51987903]When you add a physics engine you're going to have 4 probably. Not really something I'd call an issue though, esp. with being able to define conversion operators for them.[/QUOTE] Whoops totally forgot about that, so yeah I do currently have 3, plus ImGui = 4
  • [QUOTE=Dr Magnusson;51987714]I've been following [URL="https://www.youtube.com/playlist?list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_"]Bartosz Milewski's videos on Category Theory for Programmers[/URL], and I feel like it's blowing my mind on a regular basis. Furthermore, I am starting to see why Haskell is so well liked by people who "get it". The video series is bridging that gap between rough and tumble programming languages like C++, and the mathematical beauty and purity of what lies beneath all the dirty implementation details. I might give Haskell another shot once I'm done with the series. I read the Learn You A Haskell For Great Good book a while ago, and understood the syntax fine, but it never really explained the "why" of Haskell, the almost philosophical arguments for why Haskell, or category theory in general, is a good thing to know about and use when programming. [B]edit: [/B]I still don't really know what a monad is[/QUOTE] Here's an explanation that I don't often hear when people ask what a monad is. Say you have a value of type Int in a strict, non-pure language. You don't know where it came from because it doesn't matter. Now say you're in a non-strict (as in, lazy), non-pure language. Your Int might not yet be evaluated, and in order to evaluate it you might need to do some IO, perhaps query a database or something. Suddenly you need to start caring if the Int you have is a simple number or if it's actually a side effecting computation waiting to happen. So the way you decide to do that is by differentiating these values at the type level. Ints that can't do anything special remain just Ints, but those that require some side effect evaluate will be decorated with a special IO type. Now you have two incompatible things, Ints and IO Ints, and there's no way to make a mistake. The only problem is that you can't really do anything with the IO variants so you need to define some operations that make sense for these values. Firstly, we should be able to "promote" a normal Int into an IO Int. Nothing bad can happen by assuming some pure value does side effects. So that's our first function, `Int -> IO Int`. Next we might consider the opposite. A function that takes an IO Int, does the side effect and gives you a normal Int back. The problem is that we're still in a lazy language so this side effect again won't happen until we start doing something with our normal Int. This is the same problem we started with. So `IO Int -> Int` is out of the question. There are many candidates for potential functions to include, but it turns out that pretty much all the sensible ones can be implemented with the following function: IO Int -> (Int -> IO Int) -> IO Int. So a function that takes an `IO Int`, and takes another function `Int -> IO Int`. When the side effect finally gets executed we get our normal Int out of it. Then we feed it into the provided function which can also potentially require additional side effects to produce a new number. The final result, an IO Int, represents an Int we'll get when both of those side effects get executed. Notice that we don't have a problem we had with the `IO Int -> Int` function because we never claim to produce normal Ints. We just keep stringing on functions that will eventually get run when the side effecting starts to happen. Now we have a pure, lazy language. It's pure because the side effects never really happen. Our code just constructs this huge plan what to do. Then the runtime takes that plan and actually executes it. If you get this, you get what a monad is in a practical sense. Further insight comes from the realization that many more things, other than just our magical IO, also allow for the same interface. So you call everything that implements this interface a monad. The other generalization is, of course, that talking about Ints here is completely arbitrary since the whole story works for any kind of value. Now as far as theory goes, there is a bit of a disconnect. Monads in Haskell are more "inspired" by category theory than they are derived from it. Actually seeing the parallels between mathematics and code does yield significant insight about what this interface does and doesn't let us do, but understanding that is in no way required to be able to say you "know what a monad is". Common question is "so what's so special about this?". Well, there is a certain minimality to the interface we defined. Because it's so minimal, a HUGE number of ideas and constructs can implement it. On the other hand these two functions are enough to be able to write whole libraries worth of functions, without ever talking about anything more concrete. The whole laziness story above is the actual motivation for introducing this concept into Haskell. I feel that it provides a useful perspective for understanding monads. That being said, the interface itself has nothing to do with laziness. It's just a solution to some of the issues.
  • Avatar of paindoc
  • One of the long-standing problems I've had with my slicing engine is the simplification of polygons. When imported from an STL mesh especially, the output polygons generated can have an excessive amount of vertices that aren't needed at all. This is a problem both from the standpoint of computational complexity (generating toolpaths and such), and because lots of small details are really rough on 3D printers - you want the smoothest, simplest toolpath required to sufficiently describe a polygon so that you can keep the movements smooth. Right now, the simplification is hopelessly broken and has become a blocker since its so bad at safely simplifying things (either I get way too many points to use for a toolpath, or I lose vital detail). Both of the big slicing engines out there use the [URL="https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm"]Douglas–Peucker algorithm[/URL] to simplify Polygons, which is fairly primitive. Its also pretty hard on RAM in most implementations, and requires a lot of recursion. Enter the [URL="https://bost.ocks.org/mike/simplify/"]Visivalignam algorithm[/URL]! I just kinda stumbled into this and a really nice implementation on [URL="https://github.com/shortsleeves/visvalingam_simplify"]github[/URL]. It iterates through all points defining a polyline, considering the area generated by the triangle created by a point and its immediate neighbors. In this way, it's able to weigh the simplification better to avoid over-simplifying and really easily takes care of regions with unnecessarily high detail. It uses less RAM, is generally faster, and adjusting the tolerance to clip/simplify by feels much more intuitive. There's also no need for a new heap class: just define a "<" operator for the Visivalignam node struct you create and then use the standard library's lovely "make_heap", "pop_heap", and "push_heap" to take care of all of the sorting/ordering work for you. In simple tests I've run, its already come out far ahead. I take a square and just add random points all along the lines defined by the initial four vertices, and then simplify this down as far as both algorithms are willing to go. Visivalingam simplifies down to the base square, but Douglas-Puecker can't even handle this fairly simple test and ends up keeping a lot of the extra points around (and they really aren't needed). The Douglas-Puecker version also ends up breaking things, making the output into a really distorted rhombus. Oops :v: [t]http://i.imgur.com/J0zDZn4.png[/t] I've also integrated automated unit testing using the Boost Unit Test Framework, which has helped me loads in verifying functionality as I rewrite a large chunk of my codebase (it was terribly broken and used Cura's wretched code too much). With that complete and this simplification integrated, I should be able to get back to work on tying up the last of the work needed to get this application running on the command line. Also, we just got news of an awarded Phase II contract at work. I'm not going to say what, exactly, as my name is on the paper and I don't want to throw that around too casually, but the tech is something NASA really wants for the Mars missions, and it should be immensely helpful for any long-term stays on the Red planet :science101:
  • [QUOTE=Tamschi;51987353]In case you used other engines previously, what is most different in Godot in your opinion? [editline]20th March 2017[/editline] They could use some irregularities, but I'm saying this as someone who wears glasses and as such gets pretty crazy patterns from these :v: They seem overall way too strong/large, too.[/QUOTE] Godot's extensiblity, speed, lack of dependencies and low weight makes it my go to choice for 2d, I would use UE4 before, but I switched to Godot in an attempt to get away from UE4's licensing system, plus it uses gdscript which is like python, which is something I like. I feel like Godot is the 2D king, and will become a very competitive 3D engine once 3.0 drops.
  • [QUOTE=TeamEnternode;51986736]I'm hearing a lot of differing opinions about SDL vs. SFML Now that SFML and SDL have version 2s, which do you think is better for 2d game engine development in C++, and why? Reddit says SDL2 but I've heard a couple of arguments for SFML2. [editline]20th March 2017[/editline] I should state I intend on implimemting Lua and Tiled into what I am making[/QUOTE] For an engine, SDL2 has features that SFML2 simply doesn't have. Raw mouse input, multi monitor stuff, no window maximising without context switch, i'm sure there's a few others. I hit a few snags with SFML2 not supporting features in my 3d game engine SFML is easy as shite to use though. Its super useful because of the whole RAII thing, so you can easily manage object lifetimes and gl stuff with it
  • [QUOTE=Icedshot;51988702]For an engine, SDL2 has features that SFML2 simply doesn't have. Raw mouse input, multi monitor stuff, no window maximising without context switch, i'm sure there's a few others. I hit a few snags with SFML2 not supporting features in my 3d game engine SFML is easy as shite to use though. Its super useful because of the whole RAII thing, so you can easily manage object lifetimes and gl stuff with it[/QUOTE] Ah really I didn't know SFML was lacking on that front.
  • Avatar of Phygon
  • I feel honored. [url]https://leakforums.net/thread-861651?pid=24409220#pid24409220[/url]
  • [QUOTE=phygon;51989056]I feel honored. [url]https://leakforums.net/thread-861651?pid=24409220#pid24409220[/url][/QUOTE] [quote=]Also, in addition to the moral thing, there's a deadlock switch built in to an obfuscated DLL. If you accidentally trigger it, it rm - rf / 's your computer so your mileage may vary if you decide to pirate it.[/quote] seems like a really dodgy and malicious thing to do imo.
  • Avatar of Ott
  • [QUOTE=Skipcast;51989106]seems like a really dodgy and malicious thing to do imo.[/QUOTE] Pretty sure he's bluffing [editline]20th March 2017[/editline] Why would a DLL execute bash?
  • Avatar of Karmah
  • [QUOTE=Ott;51989113]Pretty sure he's bluffing [editline]20th March 2017[/editline] Why would a DLL execute bash?[/QUOTE] I don't think it matters if it actually does or not; as long as those who want to pirate it think it does.
  • Avatar of Phygon
  • [QUOTE=Skipcast;51989106]seems like a really dodgy and malicious thing to do imo.[/QUOTE] I'm not being serious All the DLL actually does is turn your computer into a grenade and blow your family to smithereens.
  • [QUOTE=phygon;51989207]I'm not being serious All the DLL actually does is turn your computer into a grenade and blow your family to smithereens.[/QUOTE] Phew, I was actually worried there for a second.
  • [QUOTE=phygon;51989207]I'm not being serious All the DLL actually does is turn your computer into a grenade and blow your family to smithereens.[/QUOTE] I think the issue with stuff like that is that a legitimate customer could be turned away by it by doubt alone. Then again, most people should recognise this as a joke or at least ask you about it. I don't really get why anyone would pirate programming assets though. You can't publish anything with that stuff without risking to get sued.
  • [QUOTE=Tamschi;51989957]I think the issue with stuff like that is that a legitimate customer could be turned away by it by doubt alone. Then again, most people should recognise this as a joke or at least ask you about it. I don't really get why anyone would pirate programming assets though. You can't publish anything with that stuff without risking to get sued.[/QUOTE] I mean, people steal whole games and upload them onto the steam store, some games have audio and art assets stolen from other games etc. It is illegal, but that doesn't seem to stop them given valve's fairly lax moderation policy [editline]poo poo bum willy[/editline] [QUOTE=phygon;51989207]I'm not being serious All the DLL actually does is turn your computer into a grenade and blow your family to smithereens.[/QUOTE] You are a truly talented programmer, grenade.exe is top tier business
  • Avatar of Ac!dL3ak
  • [QUOTE=Darwin226;51988350]Here's an explanation that I don't often hear when people ask what a monad is. Say you have a value of type Int in a strict, non-pure language. You don't know where it came from because it doesn't matter. Now say you're in a non-strict (as in, lazy), non-pure language. Your Int might not yet be evaluated, and in order to evaluate it you might need to do some IO, perhaps query a database or something. Suddenly you need to start caring if the Int you have is a simple number or if it's actually a side effecting computation waiting to happen. So the way you decide to do that is by differentiating these values at the type level. Ints that can't do anything special remain just Ints, but those that require some side effect evaluate will be decorated with a special IO type. Now you have two incompatible things, Ints and IO Ints, and there's no way to make a mistake. The only problem is that you can't really do anything with the IO variants so you need to define some operations that make sense for these values. Firstly, we should be able to "promote" a normal Int into an IO Int. Nothing bad can happen by assuming some pure value does side effects. So that's our first function, `Int -> IO Int`. Next we might consider the opposite. A function that takes an IO Int, does the side effect and gives you a normal Int back. The problem is that we're still in a lazy language so this side effect again won't happen until we start doing something with our normal Int. This is the same problem we started with. So `IO Int -> Int` is out of the question. There are many candidates for potential functions to include, but it turns out that pretty much all the sensible ones can be implemented with the following function: IO Int -> (Int -> IO Int) -> IO Int. So a function that takes an `IO Int`, and takes another function `Int -> IO Int`. When the side effect finally gets executed we get our normal Int out of it. Then we feed it into the provided function which can also potentially require additional side effects to produce a new number. The final result, an IO Int, represents an Int we'll get when both of those side effects get executed. Notice that we don't have a problem we had with the `IO Int -> Int` function because we never claim to produce normal Ints. We just keep stringing on functions that will eventually get run when the side effecting starts to happen. Now we have a pure, lazy language. It's pure because the side effects never really happen. Our code just constructs this huge plan what to do. Then the runtime takes that plan and actually executes it. If you get this, you get what a monad is in a practical sense. Further insight comes from the realization that many more things, other than just our magical IO, also allow for the same interface. So you call everything that implements this interface a monad. The other generalization is, of course, that talking about Ints here is completely arbitrary since the whole story works for any kind of value. Now as far as theory goes, there is a bit of a disconnect. Monads in Haskell are more "inspired" by category theory than they are derived from it. Actually seeing the parallels between mathematics and code does yield significant insight about what this interface does and doesn't let us do, but understanding that is in no way required to be able to say you "know what a monad is". Common question is "so what's so special about this?". Well, there is a certain minimality to the interface we defined. Because it's so minimal, a HUGE number of ideas and constructs can implement it. On the other hand these two functions are enough to be able to write whole libraries worth of functions, without ever talking about anything more concrete. The whole laziness story above is the actual motivation for introducing this concept into Haskell. I feel that it provides a useful perspective for understanding monads. That being said, the interface itself has nothing to do with laziness. It's just a solution to some of the issues.[/QUOTE] holy fuck, does that make a promise a type of monad?
  • [QUOTE=Icedshot;51989992]I mean, people steal whole games and upload them onto the steam store, some games have audio and art assets stolen from other games etc. It is illegal, but that doesn't seem to stop them given valve's fairly lax moderation policy[/QUOTE] They don't moderate actively enough, but as far as I know they crack down pretty hard on any kind of copyright infringement [URL="https://steamcommunity.com/dmca/create/"]once they're notified[/URL]. I'm pretty sure they permanently ban companies and individuals who are caught selling copyrighted material on their platform. [editline]edit[/editline] There's at least one game that didn't get banned permanently, [URL="http://www.shacknews.com/article/95645/activision-invoked-dmca-law-to-remove-steam-game-that-stole-assets-from-call-of-duty"]though that had a freelancer steal assets[/URL]. [QUOTE][editline]poo poo bum willy[/editline] [...][/QUOTE] [editline]:wideeye::ass:[/editline]
  • Avatar of Dr Magnusson
  • [QUOTE=Darwin226;51988350]Here's an explanation that I don't often hear when people ask what a monad is. Say you have a value of type Int in a strict, non-pure language. You don't know where it came from because it doesn't matter. Now say you're in a non-strict (as in, lazy), non-pure language. Your Int might not yet be evaluated, and in order to evaluate it you might need to do some IO, perhaps query a database or something. Suddenly you need to start caring if the Int you have is a simple number or if it's actually a side effecting computation waiting to happen. So the way you decide to do that is by differentiating these values at the type level. Ints that can't do anything special remain just Ints, but those that require some side effect evaluate will be decorated with a special IO type. Now you have two incompatible things, Ints and IO Ints, and there's no way to make a mistake. The only problem is that you can't really do anything with the IO variants so you need to define some operations that make sense for these values. Firstly, we should be able to "promote" a normal Int into an IO Int. Nothing bad can happen by assuming some pure value does side effects. So that's our first function, `Int -> IO Int`. Next we might consider the opposite. A function that takes an IO Int, does the side effect and gives you a normal Int back. The problem is that we're still in a lazy language so this side effect again won't happen until we start doing something with our normal Int. This is the same problem we started with. So `IO Int -> Int` is out of the question. There are many candidates for potential functions to include, but it turns out that pretty much all the sensible ones can be implemented with the following function: IO Int -> (Int -> IO Int) -> IO Int. So a function that takes an `IO Int`, and takes another function `Int -> IO Int`. When the side effect finally gets executed we get our normal Int out of it. Then we feed it into the provided function which can also potentially require additional side effects to produce a new number. The final result, an IO Int, represents an Int we'll get when both of those side effects get executed. Notice that we don't have a problem we had with the `IO Int -> Int` function because we never claim to produce normal Ints. We just keep stringing on functions that will eventually get run when the side effecting starts to happen. Now we have a pure, lazy language. It's pure because the side effects never really happen. Our code just constructs this huge plan what to do. Then the runtime takes that plan and actually executes it. If you get this, you get what a monad is in a practical sense. Further insight comes from the realization that many more things, other than just our magical IO, also allow for the same interface. So you call everything that implements this interface a monad. The other generalization is, of course, that talking about Ints here is completely arbitrary since the whole story works for any kind of value. Now as far as theory goes, there is a bit of a disconnect. Monads in Haskell are more "inspired" by category theory than they are derived from it. Actually seeing the parallels between mathematics and code does yield significant insight about what this interface does and doesn't let us do, but understanding that is in no way required to be able to say you "know what a monad is". Common question is "so what's so special about this?". Well, there is a certain minimality to the interface we defined. Because it's so minimal, a HUGE number of ideas and constructs can implement it. On the other hand these two functions are enough to be able to write whole libraries worth of functions, without ever talking about anything more concrete. The whole laziness story above is the actual motivation for introducing this concept into Haskell. I feel that it provides a useful perspective for understanding monads. That being said, the interface itself has nothing to do with laziness. It's just a solution to some of the issues.[/QUOTE] Thank you for the detailed reply, I can definitely see the use for it, especially now with the insight into why these foundational constructs are useful and necessary, in a programming context. I haven't gotten to the video on monads yet, so my edit was mostly made in jest, but your contextualization will no doubt make it easier for me to understand completely when I get to it. Thank you!