• What Are You Working On? - August 2014
    1,181 replies, posted
[QUOTE=Dr. Evilcop;45713331]Not quite sure if I'm understanding your example correctly. If I understand what you're saying, then that has to do with your timestep more than velocity. [editline]16th August 2014[/editline] Actually I think I get what you're saying now. In programming slopes aren't generally represented by the old y = mx+b way you learn in math class. Typically, velocity is stored in two separate variables - horizontal velocity and vertical velocity. Thus, you could update your object like so: xPos += xVeloc; yPos += yVeloc; If xVeloc is set to 5, your object will be moving at five units per frame on the horizontal axis in the east direction. Negative numbers will move west. If yVeloc is set to 2, it will move north at two units per second, and so on. Finally, if yVeloc were 2 and xVeloc were 5, you'd have a slope of 2 over 5, or 0.4. The "speed" question you asked is why using separate horizontal and vertical velocity variables rather than a single slope variable is important - If xVeloc were 4 and yVeloc were 10, you'd still get the same slope of 0.4. However, the object is moving faster (4 units east per frame and 10 units north per frame).[/QUOTE] So this is just some stream of consciousness: if I take a slope like 7.81 and round that up to 8, representing 8 pixels to the right for every pixel to the left, but I only want the object to move 2 pixels (up/down or left/right) at a time. So I could convert that 8/1 to 2/.25 by doing something like (m)/((m)/2) so that if m was 10 then 10/(10/2)) would be 2/.20 or 30 would be 30/(30/2) would be 2/0.66..., etc. and I could add each part to the pixel, rounding up to the nearest pixel... [editline]16th August 2014[/editline] [QUOTE=Dr. Evilcop;45713437]I [i]think[/i] he was asking how to move along the same slope at different speeds, which I answered above. Timestep theory isn't generally taught in beginner programming lessons :v:[/QUOTE] The opposite; how do I move at the same speed at different slopes
[QUOTE=proboardslol;45713502]So this is just some stream of consciousness: if I take a slope like 7.81 and round that up to 8, representing 8 pixels to the right for every pixel to the left, but I only want the object to move 2 pixels (up/down or left/right) at a time. So I could convert that 8/1 to 2/.25 by doing something like (m)/((m)/2) so that if m was 10 then 10/(10/2)) would be 2/.20 or 30 would be 30/(30/2) would be 2/0.66..., etc. and I could add each part to the pixel, rounding up to the nearest pixel...[/QUOTE] what's all this fucking math shit No no, stop thinking of things in terms of slope. It's literally just like what I posted earlier. The only time the location is cast to an integer is when it's passed to whatever render function you're calling. Only the render function gets the location without the decimal, the decimal stays everywhere else. [QUOTE=proboardslol;45713502]The opposite; how do I move at the same speed at different slopes[/QUOTE] Ah I see. You'd use the cosine of a radian multiplied by the speed (e.g. five or whatever) to use as your xVeloc and the sin of a radian multiplied by the speed as your yVeloc. [editline]16th August 2014[/editline] Radians or degrees. It depends on what the sin and cosine methods of your language use. In Java, radians are used. So for example if I wanted to move at a 30 degree angle with a speed of 10 units per frame, I'd set xVeloc and yVeloc like so: (this is in Java) [code]float radians = Math.toRadians(30); xVeloc = (float) (Math.cos(radians) * 10); yVeloc = (float) (Math.sin(radians) * 10);[/code] The cast to float is because Math.cos and Math.sin return double values while I'm storing xVeloc and yVeloc in floats. And, if your language or method used degrees instead of radians, you wouldn't want to call Math.toRadians.
[QUOTE=Dr. Evilcop;45713557]what's all this fucking math shit No no, stop thinking of things in terms of slope. It's literally just like what I posted earlier. The only time the location is cast to an integer is when it's passed to whatever render function you're calling. Only the render function gets the location without the decimal, the decimal stays everywhere else. Ah I see. You'd use the cosine of a radian multiplied by the speed (e.g. five or whatever) to use as your xVeloc and the sin of a radian multiplied by the speed as your yVeloc. [editline]16th August 2014[/editline] Radians or degrees. It depends on what the sin and cosine methods of your language use. In Java, radians are used. So for example if I wanted to move at a 30 degree angle with a speed of 10 units per frame, I'd set xVeloc and yVeloc like so: (this is in Java) [code]float radians = Math.toRadians(30); xVeloc = (float) (Math.cos(radians) * 10); yVeloc = (float) (Math.sin(radians) * 10);[/code] The cast to float is because Math.cos and Math.sin return double values while I'm storing xVeloc and yVeloc in floats. And, if your language or method used degrees instead of radians, you wouldn't want to call Math.toRadians.[/QUOTE] Ah fuck I dont know shit about trigonometry
[QUOTE=proboardslol;45713686]Ah fuck I dont know shit about trigonometry[/QUOTE] to be honest you don't really need to know trig for something simple like this, when I was making my first game I didn't know trig. as long as you know "cos for x, sin for y" you should be fine starting out (until you get into more complicated topics)
[QUOTE=proboardslol;45713686]Ah fuck I dont know shit about trigonometry[/QUOTE] Trigonometry is rather simple and fills in a lot of the gaps of angles, atan2 to get the angle of a line, sin/cos to convert an angle to x/y normals, etc. If you have any questions just ask and I'm sure a lot of others(particularly lurkers) would benefit from it too.
[QUOTE=proboardslol;45713686]Ah fuck I dont know shit about trigonometry[/QUOTE] I fucking love trig, there's some shit on khan academy for it if you're interested
Atan2, cosine, and sin are about all the trig I've ever used in typical game programming. If you get into lower level stuff it might help, though. Particularly physics and 3D rendering, though there are plenty of libraries that can take care of that for you.
from [URL]http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/6008370-bring-back-classic-visual-basic-an-improved-versi[/URL] [quote]Past decade, i develop several good prodeucts use many languages/technologies from microsoft: vb/vc/vf, asp/asp.net winform/asp.net mvc, silverlight,wpf, But now almost every technology is dying, So microsoft will waste me many years time. And for me time is much much more valuable than money. Many years ago, i like languages and develop tools from microsoft, but i now I hate microsoft very very much! Microsoft is the cancer scourge of software industry, it must be cut off in order to make the software industry healthy development.[/quote]
[QUOTE=Darwin226;45714043]from [URL]http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/6008370-bring-back-classic-visual-basic-an-improved-versi[/URL][/QUOTE] What? MS still supports all those languages, even if they aren't continuing to develop them. Technologies dying and being replaced are just a natural part of the software industry. [editline]16th August 2014[/editline] Speaking of, what do you guys think of Monogame? I want to move away from Java and towards C#, but I need to maintain the cross platform capabilities of Java and LibGDX. Is it worth it? Or should I just bide my time until I know C++ well enough?
[QUOTE=Darwin226;45714043]from [URL]http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/6008370-bring-back-classic-visual-basic-an-improved-versi[/URL][/QUOTE] For some reason, I read that in a heavy Indian accent.
[QUOTE=Berkin;45714153]For some reason, I read that in a heavy Indian accent.[/QUOTE] I'd say that's statistically justifiable.
Tried to install Bittorrent Sync, it caused folders to ghost on my external harddrive, windows to freeze up when trying to delete, so I reconnected the external. I tried to install it again, and then the installer wouldnt terminate. I suddenly lost all access to the folder I installed it to and couldn't change ownership of the folder it was in, so I reconnected the external. I tried to install it again, and then all the folders on the external except the Unreal Engine folder I had went missing, but the folders were in it were missing. So I reconnected the external. I tried to install it again, and it was successful. It started downloading the files. Then it crashed, so I tried deleting everything and starting from scratch, but the 6 deleting dialogs wouldnt cancel after they failed, the old XP "this is not responding" dialog popped up(they have that in windows 7? what?), the This process is not responding. Terminate it? or something dialog popped up, I clicked yes but explorer wouldnt terminate. So I reconnected the external and rebooted. I tried to install it again but this time on the main harddrive and everything went fine actually. I was so happy. But then I lost the secret I had on the clipboard. So I have to end up waiting anyway to get the secret again from my friend. All in all a productive day!
[QUOTE=Dr. Evilcop;45714132]What? MS still supports all those languages, even if they aren't continuing to develop them. Technologies dying and being replaced are just a natural part of the software industry. [editline]16th August 2014[/editline] Speaking of, what do you guys think of Monogame? I want to move away from Java and towards C#, but I need to maintain the cross platform capabilities of Java and LibGDX. Is it worth it? Or should I just bide my time until I know C++ well enough?[/QUOTE] It's still somewhat dependant on XNA for content conversion because they haven't finished their own content pipeline. It'll definitely be a lot easier though.
For all your non-computer-science math needs: [url]https://www.khanacademy.org/[/url]
Teleportation! [img]http://puu.sh/aW3CT/f3b8881297.png[/img]
[QUOTE=Zyx;45707446]Some of you might remember some time ago, when I made a post here about auto liking everyone on a dating site? I decided to try again, but this time with the ever so popular Tinder mobile app. [B]Step one:[/B] Look at the web requests. Luckily for me, I still had Charles, and it was just set my pc as my phones proxy and go like some people on Tinder. After further studying the requests, there was next to no security. Only an authentication token was added in the headers - And it was the same every single time. Perfect! [B]Step two:[/B] Understanding the web requests. There are two requests. A "Give me my next batch of users" and a "Like this user". Both requests responds with JSON text, so that's really easy. [B]Step three:[/B] Automating the shit out of it! Fast forward 1½ hour later, a program was born. You just feed in your authentication token at the top, and keep clicking the button until the cows come home. [B]Step four:[/B] Tell the world! *Big ass image*[/QUOTE] [B]And it's done.[/B] Every single person within my age group and area is now liked. Today I made it run a batch of 100 cycles 3 times. Every batch has 10 people in them, so 3000 people today. Yesterday I had it run in batches of 50 a few times, so that's 1000 more. Add 200 more for good measure that I did before I implemented the batches. A grand total of ~4200 people liked in <24 hours. Not bad.
[QUOTE=geel9;45715284]Teleportation! [img]http://puu.sh/aW3CT/f3b8881297.png[/img][/QUOTE] Is this open source?
[QUOTE=Handsome Matt;45715450]I.. I can't.. Have you tried going to bars?[/QUOTE] The thought has crossed my mind.
[QUOTE=Zyx;45715406][B]And it's done.[/B] Every single person within my age group and area is now liked. Today I made it run a batch of 100 cycles 3 times. Every batch has 10 people in them, so 3000 people today. Yesterday I had it run in batches of 50 a few times, so that's 1000 more. Add 200 more for good measure that I did before I implemented the batches. A grand total of ~4200 people liked in <24 hours. Not bad.[/QUOTE] Did it got you any laid?
[QUOTE=hexpunK;45710180]VB6 is fucking weird. I miss my OO.[/QUOTE] VB6 does have classes. They work pretty well, you do have to do a bit of boilerplate for constructors etc but you can still come up with some very sane OO code, just with slightly more effort than some other languages.
[QUOTE=r0b0tsquid;45716423]VB6 does have classes. They work pretty well, you do have to do a bit of boilerplate for constructors etc but you can still come up with some very sane OO code, just with slightly more effort than some other languages.[/QUOTE] It's probably more down to how the thing I'm working on is written than VB6 to be honest. But I still find VB6 very weird, I can use it and get on with it, but it's kinda like going back to using Lego after playing with Meccano for a long period of time. You can make some neat stuff, but it feels like a childs toy. I don't outright hate it, but I'd much rather be using something a bit newer :v:
Was working on a custom virtual machine in Unity. Has a custom instruction set similar to X86, but not quite the same. At which point I realized "Shit, I can't use any existing compilers for this and coding in assembly is horrible". So now I'm writing one. It's a custom language called Kaleedee. Syntactically it's a little similar to Javascript, but it's a lot more low-level (there's only one datatype, it's a 32-bit integer!) [url]http://facepunch.com/showthread.php?t=1418291[/url] It's also not object oriented at all, because I'm lazy and didn't feel like adding classes or structs to it. Still, beats the hell out of coding in assembly. Except that I'm still kinda coding in assembly to implement the compiler >.> But still, it's all fun. Also, pratt parsers are fucking magic.
Is there still anyone doing the projecteuler.net problems? I'm currently at number 10
[QUOTE=jack5500;45717403]Is there still anyone doing the projecteuler.net problems? I'm currently at number 10[/QUOTE] [URL="https://github.com/LukaHorvat/Project-Euler"]I did the first 29 in Haskell[/URL]
[QUOTE=miceiken;45715512]Is this open source?[/QUOTE] Depends. Firstly, I don't think the current state of the server is very impressive, because all I've done is lay a foundation for content creation. I've also stolen some code from some popular (but bloody awfully written) Java 317 servers that has to do with logging in and unpacking text, just so I could get it to actually run. Once I rewrite all that, and make it super fly~, I might release the source, because it's the only C# server of its kind I think. Then again, if I actually take it somewhere, and try to use it in an interview/portfolio with Jagex ("Hey look I made your game again! Hire me!"), I don't know if "Oh and I released the source which directly violates your copyrights" would be the greatest idea.
[QUOTE=jack5500;45717403]Is there still anyone doing the projecteuler.net problems? I'm currently at number 10[/QUOTE] We had to do Project Euler for school.
[QUOTE=geel9;45715284]Teleportation! [img]http://puu.sh/aW3CT/f3b8881297.png[/img][/QUOTE] I like how your basic server already has instanced NPCs when probably 99% of "proper" private servers lack those. they seriously use an integer overflow bug with coordinates or something similar to do instances. RSPS is so much fun, such a shame the community is 1 guy who can program per 1000 "how is server coddes formed?? pls help me fix 100 compiler errors I got from copypasting tutorials" kiddos
Probably still have to, next year fuckin merge
Facepunch I need your help. Why the fuck is my WPF progressbar slightly off-set in the actual application when it's not in the editor? In editor: [t]http://i.imgur.com/m5npwpE.png[/t] When running: [t]http://i.imgur.com/lZ0sxrY.png[/t] Moving it down by one pixel actually makes it worse, because you get those retarded fuzzy edges still but coming out of the bottom now (And with a gap at the top). There is no border or anything on it as well. Any ideas how to fix this?
[QUOTE=sabreman;45718091]Facepunch I need your help. Why the fuck is my WPF progressbar slightly off-set in the actual application when it's not in the editor? In editor: [t]http://i.imgur.com/m5npwpE.png[/t] When running: [t]http://i.imgur.com/lZ0sxrY.png[/t] Moving it down by one pixel actually makes it worse, because you get those retarded fuzzy edges still but coming out of the bottom now (And with a gap at the top). There is no border or anything on it as well. Any ideas how to fix this?[/QUOTE] It's probably a rounding error. Go into the XML file and try to find the position definition for it and round it up/down.
Sorry, you need to Log In to post a reply to this thread.