• What are you working on? December 2011 Edition
    3,353 replies, posted
i have yet to grasp the full depth of his distaste for rtmp and feel that further posting on the matter is required by him as well
[QUOTE=Ehmmett;33613812]So I got the player to collide with all boxes now. As long as collisions are fixed by forcing the player backwards, causing wall bouncing. :/ it's not a bug it's a feature.[/QUOTE] It sounds like how 'skiing' started in Starseige: Tribes. It became a staple and major selling point for the game series. All the best mechanics start out as physics bugs. Look at strafe-jumping (and other movement tricks) in Quake. It's the result of some [url=http://www.funender.com/quake/articles/strafing_theory.html]bad physics[/url], but it adds a whole extra layer of depth for those [url=http://www.youtube.com/watch?v=xuHrwn6u2BY]stubborn enough to master it[/url].
[video=youtube;QD_D-NRSYcs]http://www.youtube.com/watch?v=QD_D-NRSYcs[/video] Dumb small shooter. Heavily unoptimized and will never be finished. Just... move on with this thread of cool stuff :v:
[QUOTE=Ehmmett;33613999]Except it just makes it a pain in the ass to play anywhere near walls and just barely solved my problem of having the player go through walls. Interior corners still push the player through if they edge their way into it. Working on a better way.[/QUOTE] You can't just move the player to the wall's surface instead of applying impulse?
[QUOTE=Dienes;33614046][video=youtube;QD_D-NRSYcs]http://www.youtube.com/watch?v=QD_D-NRSYcs[/video] Dumb small shooter. Heavily unoptimized and will never be finished. Just... move on with this thread of cool stuff :v:[/QUOTE] You should release it That actually looks amusing
[QUOTE=Ehmmett;33614084]That's what I'm working on figuring out.[/QUOTE] The most naive method would be backtracking (I'm making up this name here, I don't know if there's a proper term for it). In its simplest form, you just move the player back to his initial position at the start of the game frame if he collided with something. You can get a little extra precision by doing a binary search. If the player collides, you re-check at t/2. If he's still colliding, you check t/4, otherwise you check 3t/4, and you repeat this process iteratively/recursively with finer precision a few times (4-8 should be more than enough for just about anything) There are much better ways to handle this depending on what sort of structures you use and what kind of information you can get about collisions. The simplest are spheres and planes. If you have sphere-sphere, you just move the spheres so that their distance is the sum of their radii. If you have sphere-plane, you do something like [i]p = p + scale(n, d - dot(p, n) + r)[/i], where [i]p[/i] and [i]r[/i] are the position and radius of the sphere, and [i]n[/i] and [i]d[/i] are the normal and 'distance' of the plane (distance is found by the dot product of the normal and any given point on the plane). AABBs are simpler geometrically, but it involves a lot of if-then statements that would be a pain for me to type out. With any sort of collision response, you need to cancel any velocity in the direction of collision normal, otherwise the object will just collide over and over and (if you have a constant force like gravity), the object will accumulate velocity until something breaks.
School project, AI for Starcraft. [IMG]http://imgur.com/re8C7.png[/IMG] We've already been given a base to work from that can do the basic things and an API to use. I'm currently working on implementing all special attacks units have. In January we will have a tournament and pit everyones AI's against each other to see who wins.
[QUOTE=Dienes;33614046][video=youtube;QD_D-NRSYcs]http://www.youtube.com/watch?v=QD_D-NRSYcs[/video] Dumb small shooter. Heavily unoptimized and will never be finished. Just... move on with this thread of cool stuff :v:[/QUOTE] That art is incredible.
[QUOTE=Fear_Fox;33614737]School project, AI for Starcraft. [IMG]http://imgur.com/re8C7.png[/IMG] We've already been given a base to work from that can do the basic things and an API to use. I'm currently working on implementing all special attacks units have. In January we will have a tournament and pit everyones AI's against each other to see who wins.[/QUOTE] Did they give you a copy of Starcraft, too?
[QUOTE=ROBO_DONUT;33614820]Did they give you a copy of Starcraft, too?[/QUOTE] Yes. Those who didn't have the game was offered to install it from a retail disc.
[QUOTE=Fear_Fox;33614737]School project, AI for Starcraft. [IMG]http://imgur.com/re8C7.png[/IMG] We've already been given a base to work from that can do the basic things and an API to use. I'm currently working on implementing all special attacks units have. In January we will have a tournament and pit everyones AI's against each other to see who wins.[/QUOTE] that sounds badass
Great. Now I have 7 weeks to turn this: [img_thumb]http://i.imgur.com/ZjWNV.png[/img_thumb] into a tower defense game for a school project. Yay.... :gonk: I guess my first step is mouse input. Any ideas how I would do that? I want to mouse-over a grid rectangle and make it change color or something, but that's not the point. I'm just not 100% sure how I would let the mouse influence the position in the grid. I am using this: [url]http://www.sgtconker.com/2010/01/article-grid-based-isometric-renderer-tutorial/[/url]
There was a pretty big problem with the base AI we were given to work with. It is programmed to automatically resign if it has no workers collecting resources and mineral count is less then 50. We noticed that when me and another classmate did a test run against each other. He was in the middle of wiping my base out with a pretty big army, but mere seconds before my last nexus was destroyed his AI resigned because there were no minerals left to harvest. After that, we both changed it so that instead of resigning it will force an attack even if all squads aren't full. This made us wonder though, if the other people haven't found this out it would be very easy to make them loose. Just harass their workers enough and/or prevent them from expanding their base and it'll make their AI automatically resign once their initial resources are depleted.
[QUOTE=Asgard;33614982]Great. Now I have 7 weeks to turn this: [img_thumb]http://i.imgur.com/ZjWNV.png[/img_thumb] into a tower defense game for a school project. Yay.... :gonk: I guess my first step is mouse input. Any ideas how I would do that? I want to mouse-over a grid rectangle and make it change color or something, but that's not the point. I'm just not 100% sure how I would let the mouse influence the position in the grid. I am using this: [url]http://www.sgtconker.com/2010/01/article-grid-based-isometric-renderer-tutorial/[/url][/QUOTE] Possibly overcomplicated but you could do this: [img]http://dl.dropbox.com/u/35032740/diagram.png[/img] Cast the blue line from the mouse position and find where it intersects with the red line (line-line intersection), then get the distance between the mouse and the intersection. Repeat for the other line. Now you have 2 coordinates you can work with like you normally would in a regular grid.
[QUOTE=Dienes;33614046][video=youtube;QD_D-NRSYcs]http://www.youtube.com/watch?v=QD_D-NRSYcs[/video] Dumb small shooter. Heavily unoptimized and will never be finished. Just... move on with this thread of cool stuff :v:[/QUOTE] Is this upscaled? I love the sharp aliased oldschool game kinda look. it looks solid somehow
[QUOTE=SwoonPoon;33615262]Is this upscaled? I love the sharp aliased oldschool game kinda look. it looks solid somehow[/QUOTE] It is. [IMG]http://dl.dropbox.com/u/1453576/prisonescape_01.png[/IMG] [IMG]http://dl.dropbox.com/u/1453576/prisonescape_02.png[/IMG]
[QUOTE=garry;33610522]Wow. 3 people on these forums are working on the same app. [url]http://itunes.apple.com/us/app/photo2calc/id484973997?ls=1&mt=8[/url][/QUOTE] hurr durr garry i think you missed the part where overv and i are working on apps that recognize [i]formulas[/i] and use a CAS to symbolically evaluate the expressions the app you linked to contains a bunch of false advertising and amounts to nothing more than a typical OCR reading lists of numbers and doing basic options like "add" or "subtract" in the best possible case (i.e. none of the advertising was false) then all it does is calculate numerical values, nothing to do with symbolic computation
There's a lot of people working on school projects right now. It must be fun to have 50 advanced coder on FP helping you against your classmates.
[QUOTE=I am God.;33615433]There's a lot of people working on school projects right now. It must be fun to have 50 advanced coder on FP helping you against your [B]classmates[/B].[/QUOTE] Who all have access to exactly the same resources?
[QUOTE=I am God.;33615433]There's a lot of people working on school projects right now. It must be fun to have 50 advanced coder on FP helping you against your classmates.[/QUOTE] So you can't be an advanced coder and be doing your school project? Not that coding ability is something can be quantified into ranks.
[QUOTE=iPope;33615688]So you can't be an advanced coder and be doing your school project? Not that coding ability is something can be quantified into ranks.[/QUOTE] <-- Grandmaster Coding Wizard
But if it were, it would apparently be classed similarly to the KKK
Is there a way to get the number of lines in a whole Visual Studio 2008 project ?
[QUOTE=AntonioR;33616215]Is there a way to get the number of lines in a whole Visual Studio 2008 project ?[/QUOTE] Sloccount or similar. Just googled "code metrics for Visual Studio": [url]http://msdn.microsoft.com/en-us/library/bb385908.aspx[/url]
[QUOTE=AntonioR;33616215]Is there a way to get the number of lines in a whole Visual Studio 2008 project ?[/QUOTE] yeah here's my little utility for that [cpp] using System; using System.Collections.Generic; using System.IO; using System.Windows.Forms; namespace LineCounter { class Program { [STAThread] static void Main(string[] args) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Multiselect = true; dialog.Filter = "Code Files (*.h, *.hpp, *.cpp, *.cs, *.java)|*.h;*.hpp;*.cpp;*.cs;*.java"; if (dialog.ShowDialog() != DialogResult.OK) { return; } int blankLines = 0; int commentLines = 0; int codeLines = 0; DateTime oldestTime = DateTime.Now; string oldestFile = null; int minLines = int.MaxValue; int maxLines = int.MinValue; string minLinesFile = ""; string maxLinesFile = ""; foreach (string str in dialog.FileNames) { StreamReader stream = new StreamReader(str); int bl = 0; int cl = 0; int cdl = 0; while (!stream.EndOfStream) { string line = stream.ReadLine(); line = line.Trim(); if (line.Length == 0) { bl++; } else if (line.IndexOf("//") == 0) { cl++; } else { cdl++; } } blankLines += bl; commentLines += cl; codeLines += cdl; int tot = bl + cl + cdl; if (tot < minLines) { minLines = tot; minLinesFile = Path.GetFileName(str); } if (tot > maxLines) { maxLines = tot; maxLinesFile = Path.GetFileName(str); } DateTime createdTime = File.GetCreationTime(str); if (createdTime.CompareTo(oldestTime) < 0) { oldestTime = createdTime; oldestFile = Path.GetFileName(str); } } int totalLines = blankLines + commentLines + codeLines; DateTime codingTime = DateTime.Now; TimeSpan codingSpan = codingTime.Subtract(oldestTime); int numFiles = dialog.FileNames.Length; Console.WriteLine("Number of files: {0}", numFiles); Console.WriteLine("Blank lines: {0}", blankLines); Console.WriteLine("Comment lines: {0}", commentLines); Console.WriteLine("Code lines: {0}", codeLines); Console.WriteLine("Total lines: {0}", totalLines); Console.WriteLine("Avg lines per file: {0}", (float)totalLines / numFiles); Console.WriteLine("Least lines: {0} in {1}", minLines, minLinesFile); Console.WriteLine("Most lines: {0} in {1}", maxLines, maxLinesFile); Console.WriteLine("Started coding on: {0}", oldestTime); Console.WriteLine("Oldest code file: {0}", oldestFile); Console.WriteLine("Been coding for {0} days, {1} hours and {2} minutes", codingSpan.Days, codingSpan.Hours, codingSpan.Minutes); Console.WriteLine("Avg lines per day: {0}", totalLines / codingSpan.TotalDays); Console.WriteLine("Avg lines per month: {0}", totalLines / (codingSpan.TotalDays / 30)); Console.Read(); } } } [/cpp]
[QUOTE=RyanDv3;33616187]But if it were, it would apparently be classed similarly to the KKK[/QUOTE] Just like how military is classed similarly to the nazis Who cares, Grand Wizard sounds cool but you need a proper hat
[QUOTE=Darwin226;33615258]Possibly overcomplicated but you could do this: [img]http://dl.dropbox.com/u/35032740/diagram.png[/img] Cast the blue line from the mouse position and find where it intersects with the red line (line-line intersection), then get the distance between the mouse and the intersection. Repeat for the other line. Now you have 2 coordinates you can work with like you normally would in a regular grid.[/QUOTE] This seems complicated.... wouldn't it be easier to instead transform the mouse coordinates using simple trig from isometric to 'flat' so that it corresponds to a specific tile? This dosn't work with some stuff though. [editline]7th December 2011[/editline] Like 1 tile being 2 tall.
[QUOTE=Jawalt;33617032]This seems complicated.... wouldn't it be easier to instead transform the mouse coordinates using simple trig from isometric to 'flat' so that it corresponds to a specific tile? This dosn't work with some stuff though. [editline]7th December 2011[/editline] Like 1 tile being 2 tall.[/QUOTE] Well it depends what's complicated. Since I already have a line intersection function it's like 5 lines of code total... Transforming the grid would also work, don't know if it would be easier to do.
[QUOTE=mechanarchy;33610563]Overv, null, and who's the third? The website for your link doesn't give any information under the contact page.[/QUOTE] Thats mine
[QUOTE=Jawalt;33617032]This seems complicated.... wouldn't it be easier to instead transform the mouse coordinates using simple trig from isometric to 'flat' so that it corresponds to a specific tile? This dosn't work with some stuff though. [editline]7th December 2011[/editline] Like 1 tile being 2 tall.[/QUOTE] You can do this with some simple linear algebra. [IMG_thumb]http://img685.imageshack.us/img685/333/uvcoords.png[/IMG_thumb] First, look at your isometric coordinate system. We'll call a point in this coordinate system [i]<u, v>[/i]. What are the isometric unit vectors [img]http://www.forkosh.com/mathtex.cgi?\hat{u}[/img] and [img]http://www.forkosh.com/mathtex.cgi?\hat{v}[/img] in screen-space coordinates? Something like [img]http://www.forkosh.com/mathtex.cgi?\hat{u}=\left\langle w/2, h/2 \right\rangle[/img] and [img]http://www.forkosh.com/mathtex.cgi?\hat{v}=\left\langle -w/2, h/2 \right\rangle[/img], where [i]w[/i] and [i]h[/i] are cell width and cell height, respectively. Plug these values into a matrix: [img]http://www.forkosh.com/mathtex.cgi?\dpi{160}\left[\begin{array}{cc}\frac{w}{2} & -\frac{w}{2} \\ \frac{h}{2} & \frac{h}{2}\end{array}\right][/img] Multiplying a value by this matrix will give you screen coordinates for an input isometric coordinate. You, however, want to go the other way, screen->isometric. So we have to invert this matrix. I'm a lazy jackass, so I just told Wolfram Alpha to "[url=http://www.wolframalpha.com/input/?i=invert+%7B%7Bw%2F2%2C+-w%2F2%7D%2C+%7Bh%2F2%2C+h%2F2%7D%7D]invert {{w/2, -w/2}, {h/2, h/2}}[/url]", and it tells me that: [img]http://www.forkosh.com/mathtex.cgi?\dpi{160}\left[\begin{array}{cc}\frac{w}{2} & -\frac{w}{2} \\ \frac{h}{2} & \frac{h}{2}\end{array}\right]^{-1}=\left[\begin{array}{cc}\frac{1}{w} & \frac{1}{h} \\ -\frac{1}{w} & \frac{1}{h}\end{array}\right][/img] So, to get isometric coords from screen coords: [code] u = y/cell_h + x/cell_w; v = y/cell_h - x/cell_w; [/code] [editline]f[/editline] Hopefully it's right now.
Sorry, you need to Log In to post a reply to this thread.