• Programming - WAYWO - V.37
    1,000 replies, posted
[QUOTE=TheEyes;40173454][IMG]http://puu.sh/2utef[/IMG] Fuck. [IMG]http://puu.sh/2uth1[/IMG] Fuck. Why is it so hard to center a sprite...[/QUOTE] Because you need to center the center of the sprite. [editline]5th April 2013[/editline] [QUOTE=danharibo;40172776]Considering that the fixed function pipeline is removed in OpenGL 3.2 core, and doesn't exist in OpenGL ES 2.0, I would keep it in mind.[/QUOTE] I definitely have that in mind. For now I am sidestepping the problem by using GLEW. I am looking into moving it over soon. [editline]5th April 2013[/editline] [QUOTE=Chris220;40172836]How are you doing your collisions, by the way? I'm interested.[/QUOTE] Welp... I have bounding box and bounding sphere collisions for object->object, and for object->terrain, I have a heightmap.getHeight() function that interpolates between two points on a heightmap to get the exact value for a coordinate. I am looking into getting help from one of my teachers for full-on convex hull collisions. [editline]5th April 2013[/editline] [QUOTE=NightmareX91;40173412]Also, is there a maximum world size and height? And are custom skyboxes possible? And what about animated models? As for improving the camera in your plane game, maybe you could make it lag behind the plane's movements and smooth the camera out a bit?[/QUOTE] There is no limit on world size. Skybox colors are possible, but not images for now. I was planning on adding in those later. There are some really ugly hacks that someone could use to do animated models, but I am planning on adding in official support soon. As far as the camera in the plane game, that sounds like a good idea and I will try it out soon.
[QUOTE=TheEyes;40173454][IMG]http://puu.sh/2utef[/IMG] Fuck. [IMG]http://puu.sh/2uth1[/IMG] Fuck. Why is it so hard to center a sprite...[/QUOTE] X = (window_width / 2) - (sprite_width / 2) Y = (window_height / 2) - (sprite_height / 2)
[QUOTE=supersnail11;40173844]Width = (window_width / 2) - (sprite_width / 2) Height = (window_height / 2) - (sprite_height / 2)[/QUOTE] you mean X and Y not width and height :v:
[QUOTE=Perl;40173907]you mean X and Y not width and height :v:[/QUOTE] Width and height of the area between 0,0 and x,y :v:
[QUOTE=Spoco;40172859]Me too, for almost a year now. We've used RoR almost exclusively for back-ends. I agree in this instance, that Ruby & Rails is the easiest way, but it's far from the best. We've been "forced to" develop on Windows, and there has been quite a few problems, but we have overcome [u]every single one[/u] of them, sometimes after days of trying though. Some gems just won't work on Windows (some of the gems with native extensions or dependencies), but usually there's a separate Windows version or at least an alternative in that case. After all it is free software and if some gem doesn't work, it's usually just because no-one has gone through the trouble of getting it to compile on Windows. Agreed, you need some knowledge about native programming if you want to understand the problems you will eventually face if you choose to develop on Windows. You're also going to face some very undescriptive error messages that don't relate to the real problem at all. This isn't exclusively a Windows or gem problem though. The biggest problem is that MRI (the original Matz's Ruby Interpreter) is just very slow (to start) and has a quite large memory footprint. It was originally developed for Unix-based systems, so it works a little faster there (still very slow). On Windows, you have to wait between 10-30 seconds just to run tests (even one), start your server or run any script. Once the interpreter is running though, everything is fine. Ruby has the concept of threads/concurrency, but [url=https://blog.engineyard.com/2011/ruby-concurrency-and-you]MRI cannot actually run Ruby code in parallel[/url], so you're stuck on one core unless you start more than one process (but it is going to hog that many times memory then). Application servers generally start multiple processes. You could try other interpreters like JRuby (real multi-threading!), but I imagine you're gonna face compatibility problems with gems as these 3rd party interpreters can't always keep up with the MRI. I'm not really surprised it's slow when it was designed with mainly developer joy in mind. It is very good at that job. Unless you like TDD, because it's going to be a waste of time to try to fix a problem and re-run tests as you spend 10-30 seconds waiting for the interpreter on every iteration. Also debuggers don't work perfectly (at least on Windows). Good news is that you can keep your development server running while you develop, as it can reload code (except of course initializers) when you refresh. Other than that, the language is incredibly flexible and allows for some great elegance, though sometimes [url=http://stackoverflow.com/questions/372652/what-are-the-ruby-gotchas-a-newbie-should-be-warned-about]it can be a problem[/url]. Rails is fantastic, but in my opinion it is getting old. Nowadays it's easy to leave the processing up to the client (JS) and just make minimal back-ends. If you want to make a single-page web application with a minimal (and FAST) back-end, Rails seems a bit overkill, although it makes it incredibly easy. [b]tl;dr[/b] Ruby is awesome as a language and RoR makes things easy, but those are the good news and there's a load of bad news to top it off. Now if we only had a good (C++ & modern/OO/minimal/fast/modular/extendable) framework for JSON API web services.[/QUOTE] "Best" is subjective though, to decide what langauge or framework is the best, you absolutely need to define what you need from a solution, and in my case rails does often end up being the "best" as well as the easiest. Using [url=https://github.com/burke/zeus]zeus[/url] will alleviate all your startup time issues. I TDD everything and have no issues with speed when doing that, especially since I've started using zeus. To be fair though, if you were trying to TDD with C++ you're going to have to wait for things to compile every time, and compile times can grow a lot more easily than Rails startup time. Using Ruby/Rails on windows is a different story, but I don't think that's a fault of the framework or language. JRuby is pretty good as far as gem compatibility goes. And yes, ruby is absolutely more resource intensive, but that's part of the trade off. I'm of the opinion that my time is more costly than server resources, and so far ruby helps me develop more quickly than anything else I've worked with. Things like [url=https://www.heroku.com/]heroku[/url] make that less of an issue for small projects as well. [url]www.daily750.com[/url] is running on heroku and I haven't spent a dime on it yet because one dyno is enough for the traffic it gets. I also generally work for small start-ups, so the ability to iterate as quickly as possible is [I]incredibly[/I] important, and I would argue that means that rails is the best fit. There's absolutely trade offs though, as is the case with any language. Ruby's benefits just happen to far outweigh the negatives for me.
My first grapher ever, woop. [img]http://i.imgur.com/akxcvwi.png[/img] It graphes (x-1)[sup]3[/sup]+1. I would've antialiased the lines but SFML doesn't support that when drawing to render textures :<
[QUOTE=Jawalt;40167545]Working on a wrapper sort-of-thing for Steamkit in C# for making steam bots: [code] public class ExampleBot : CommandBot { public ExampleBot() { cmds.Add(new CommandQuit()); } public override void AccountInfo (SteamUser.AccountInfoCallback msg) { friends.SetPersonaName("Mattybot"); } public override void ChatInvite(Chat chat) { chat.Join(); } public override void Message (ChatMessage msg) { base.Message(msg); msg.chat.Send("Fuck off."); } } [/code] Eventually I want it so writing a bot requires no interfacing with Steamkit at all, but this is where I'm at right now. I don't know shit all about C#'s naming system so I needa run this shit through ReSharper asap.[/QUOTE] I don't think Resharper follows Microsoft's naming conventions by default. I would say the most important thing is UpperCamelCase for everything that is public and consistency for internals(private/protected/internal). [url=http://msdn.microsoft.com/en-us/library/vstudio/ms229043(v=vs.100).aspx]Capitalization Conventions[/url] More info: [url=http://msdn.microsoft.com/en-us/library/vstudio/ms229045(v=vs.100).aspx]General Naming Conventions[/url] [url=http://msdn.microsoft.com/en-us/library/vstudio/ms229002(v=vs.100).aspx]Guidelines for Names[/url]
[QUOTE=Dlaor-guy;40175611]My first grapher ever, woop. [img]http://i.imgur.com/akxcvwi.png[/img] It graphes (x-1)^3+1. I would've antialiased the lines but SFML doesn't support that when drawing to render textures :<[/QUOTE] You can always downscale from a texture that's twice as large as the window.
I don't know if any of you ever used JRebel or even heard of it, but I'm regularly using it at work because our application is already so bloated and huge that just redeploying on the application server (Glassfish) takes nearly 10 minutes. With JRebel it takes seconds from saving in Eclipse to having up to date code (and configuration XMLs!!) in a running Glassfish server. The problem with this was that we have tons of modules and you enable JRebel by putting a rebel.xml which has a path to where Eclipse puts the compiled class files. Not only would creating these rebel.xml files by hand take a lot of time because of the sheer amount of modules we have, it also makes deploying much, much, much slower. And to add to all that, compiling the whole application so you have the rebel.xmls correctly packaged in the jars in the ears etc can easily take half an hour or more. Luckily we have a Jenkins job running that compiles and packages every change as soon as it's checked into SVN. So the solution was to just put the rebel.xml into the projects you needed and compile only those which was still a huge hassle and took a lot of time. Tuesday I didn't have much to do and decided to fix that once and for all. So I wrote a Groovy script that parses a super simple config file that lists the archives you want deployed and the modules you are modifiying (ie, where you need JRebel) and then it automatically stops Glassfish (if it's running), cleans all the temporary folders, generates a new clean setup, starts Glassfish, downloads the newest artifacts from our company Maven repo, generates JRebel XMLs for the configured modules by scanning the local workspace for the correct folders and even taking into account if it's a backend or frontend module because they are packaged differently. It then takes the generated XMLs puts them in the correct jars in the ears and some subfolders in some wars and deploys the modified archives. The whole process takes about 10 minutes with a few modules with JRebel activated (about 9.5 minutes of that is waiting for Glassfish to complete various operations and the rest is waiting for downloads). This script alone saves me about 1-2 hours per day and now I only have to get my colleagues to start using it (which isn't so easy because it has to be crossplatform because a third of the team decided to switch to Ubuntu). Writing this script was so much more fun that working on the actual project because I actually get to use it and see other people use it while the software we develop is usually only used by one or two huge faceless corporations. Sometimes I wonder what it would be like to work on customer software.
[QUOTE=danharibo;40175903]You can always downscale from a texture that's twice as large as the window.[/QUOTE] You'd still have to filter it manually, wouldn't you?
[QUOTE=esalaka;40177086]You'd still have to filter it manually, wouldn't you?[/QUOTE] I assumed he was rendering the line into a render texture, so by downsamlping you could make use of the filtering options OpenGL gives you.downsamlping
You guys ready for the most descriptive line of code ever? [code] //Graph graph = [Graph graph];[/code]
what does it do???
[QUOTE=ief014;40177555]what does it do???[/QUOTE] initializes a graph
slow down, I'm not following
Messing around in Java when suddenly... Potato. [IMG]http://puu.sh/2uKfV[/IMG] [IMG]http://puu.sh/2uKfZ[/IMG] Looks cool though.
[QUOTE=duno;40177583]initializes a graph[/QUOTE] Bad commenting 0/10 would not fork
Hey we can post Unity projects here right yeah? [t]http://i.imgur.com/R5fyynG.jpg[/t] [t]http://i.imgur.com/TxlQWwB.jpg[/t] So this is a little space shooter I'm working on with my friend. It's for our Freshman Design project. uhhh. Think Jets n Guns/Raptor Call of Shadows + FTL's Map (More stuff to visit though, less rebel fleet pushing you on).
Update on my autonomous drone project: I've been working away on a network protocol and I'm pretty much done. It only took a few hours, but I didn't have much time to program the last two weeks. It's all nice and event based and implementing new packets is as easy as implementing a Packet marker interface and putting a few attributes in the class. Now the next step is deciding how I actually want to control the whole thing. The easiest way would probably be a Java Swing application that runs on the server (which is my PC currently), but I probably want to control it from something mobile like my tablet too so I can actually see what my drone is doing. But my tablet doesn't have 3G and I might want to follow my drone around so I want to control it from a second Android too. I've been thinking about running a super simple integrated HTTP server in the actual server and creating a HTML5 control panel, but I have barely any experience with that. Any suggestions for other solutions that run on Windows, Android and Playbook?
[QUOTE=supersnail11;40173844]X = (window_width / 2) - (sprite_width / 2) Y = (window_height / 2) - (sprite_height / 2)[/QUOTE] I guess silly problems always have simple answers.
[QUOTE=Robber;40180557]Update on my autonomous drone project: I've been working away on a network protocol and I'm pretty much done. It only took a few hours, but I didn't have much time to program the last two weeks. It's all nice and event based and implementing new packets is as easy as implementing a Packet marker interface and putting a few attributes in the class. Now the next step is deciding how I actually want to control the whole thing. The easiest way would probably be a Java Swing application that runs on the server (which is my PC currently), but I probably want to control it from something mobile like my tablet too so I can actually see what my drone is doing. But my tablet doesn't have 3G and I might want to follow my drone around so I want to control it from a second Android too. I've been thinking about running a super simple integrated HTTP server in the actual server and creating a HTML5 control panel, but I have barely any experience with that. Any suggestions for other solutions that run on Windows, Android and Playbook?[/QUOTE] I got a simple demo running using the Google Maps API that works on my PC, my phone and my tablet and lets me select a target and updates the drone's position using AJAX. Now I just have to connect the separate components (browser -> HTTP server -> drone control server -> drone) which shouldn't take more than an hour and I have a first prototype working. The next step is to find a good way to put my phone on the drone :v:
I'm going through the code to a small game I made for a game jam two years ago. I found this gem: [cpp] totalTime += deltaTime; if (totalTime >= 628.3185307179586476925286766559f) { totalTime = 0.f; } [/cpp] Oh, the things you do when you're overly tired. I have no idea where that number came from.
[QUOTE=Z_guy;40182063]I'm going through the code to a small game I made for a game jam two years ago. I found this gem: [cpp] totalTime += deltaTime; if (totalTime >= 628.3185307179586476925286766559f) { totalTime = 0.f; } [/cpp] Oh, the things you do when you're overly tired. I have no idea where that number came from.[/QUOTE] It's pi * 200.
[QUOTE=Z_guy;40182063]I'm going through the code to a small game I made for a game jam two years ago. I found this gem: [cpp] totalTime += deltaTime; if (totalTime >= 628.3185307179586476925286766559f) { totalTime = 0.f; } [/cpp] Oh, the things you do when you're overly tired. I have no idea where that number came from.[/QUOTE] It's pi * 200 [editline]6th April 2013[/editline] woa
It's Pi * 200 [editline]6th April 2013[/editline] god damed
guys it's pi * 200
no its pi/e[sup]-5.29831736655[/sup]
it's pi * 200
It's tau * 100 duh
[media]http://www.youtube.com/watch?v=F97UZ0af8sI[/media]
Sorry, you need to Log In to post a reply to this thread.