• What are you working on? v19
    6,590 replies, posted
[QUOTE=Nigey Nige;31352284]BLOOD FOR THE BLOOD GOD [img]http://i.imgur.com/msgh3.png[/img] Got actual fighting implemented now, people have HP and don't just disappear. Fucking revolutionary. Also was pleasantly surprised when I left it running while I got dinner and it didn't crash. [editline]26th July 2011[/editline] Also I just remembered it still isn't a game.[/QUOTE] I can't wait to play this eventually. Make sure once it gets advanced enough to add races, spells and all that jazz. It could be really great.
[QUOTE=s0ul0r;31350782]Right now this is just a raw prototype I whipped together in 2 days. And attaching the output to the input does nothing, since the output value is null. So it doesn't even start to calculate the value. And I'm just calling the DoCalculations() for every gate in the update loop. [IMG]http://img837.imageshack.us/img837/8802/flowrelink.png[/IMG] Edit: Ok, assigning a standard value for the gates as outputs brings the wanted results: When you link the output of the add gate to itself, it counts upwards.[/QUOTE] What is this editor going to edit? A shading language?
Hm, having quite an issue here: [csharp] switch (gateNumber) { case 1: Gate addGate = new Add(new Vector2(ms.X, ms.Y)); gates.Add(addGate); break; case 2: Gate subtractGate = new Subtract(new Vector2(ms.X, ms.Y)); gates.Add(subtractGate); break; case 3: Gate constantGate = new Constant(new Vector2(ms.X, ms.Y)); gates.Add(constantGate); break; } [/csharp] Gate is the base class and Add, Subtract etc. derive from that, as you can probably tell. Now how would I go about implementing easy to expand constructors? So that I can add the name of a new Gate in an enumerator somewhere and call the constructor of that, so that in the end I don't have 50000 switch : case statements... ?
[QUOTE=s0ul0r;31355132]Hm, having quite an issue here: [code] switch (gateNumber) { case 1: Gate addGate = new Add(new Vector2(ms.X, ms.Y)); gates.Add(addGate); break; case 2: Gate subtractGate = new Subtract(new Vector2(ms.X, ms.Y)); gates.Add(subtractGate); break; case 3: Gate constantGate = new Constant(new Vector2(ms.X, ms.Y)); gates.Add(constantGate); break; } [/code] Gate is the base class and Add, Subtract etc. derive from that, as you can probably tell. Now how would I go about implementing easy to expand constructors? So that I can add the name of a new Gate in an enumerator somewhere and call the constructor of that, so that in the end I don't have 50000 switch : case statements... ?[/QUOTE] Have a dictionary somewhere, with the key being int (or whatever type gateNumber is), and the value being Type. To create an instance of the gate, lookup the type from the dictionary, then use the Activator class.
[QUOTE=s0ul0r;31355132]some sort of question[/QUOTE] You might be better off posting it here: [url]http://www.facepunch.com/threads/1092921-What-do-you-need-help-with-V.-3.0[/url]
[QUOTE=s0ul0r;31355132] Now how would I go about implementing easy to expand constructors? So that I can add the name of a new Gate in an enumerator somewhere and call the constructor of that, so that in the end I don't have 50000 switch : case statements... ?[/QUOTE] Something like this? [cpp] Type type = Type.GetType("Subtract"); ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(Vector2) }); try { Gate g = (Gate)constructor.Invoke(new object[] { new Vector2(ms.X, ms.Y) }); } catch (TargetInvocationException e) { // deal with e.InnerException } [/cpp]
[QUOTE=icantread49;31355280]Something like this? [cpp] Type type = Type.GetType("Subtract"); ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(Vector2) }); try { Gate g = (Gate)constructor.Invoke(new object[] { new Vector2(ms.X, ms.Y) }); } catch (TargetInvocationException e) { // deal with e.InnerException } [/cpp][/QUOTE] Jup ty, should've googled inb4 ;D Got it already: [csharp] Type gateType = Type.GetType("FlowGraphEditor." + currentGateName); Gate addGate = (Gate) gateType.GetConstructor(new Type[] { typeof(Vector2) }).Invoke(new object[] { new Vector2(ms.X, ms.Y) }); [/csharp] where currentGateName is "Add", "Subtract" etc.
[QUOTE=s0ul0r;31355525]Jup ty, should've googled inb4 ;D Got it already: [csharp] Type gateType = Type.GetType("FlowGraphEditor." + currentGateName); Gate addGate = (Gate) gateType.GetConstructor(new Type[] { typeof(Vector2) }).Invoke(new object[] { new Vector2(ms.X, ms.Y) }); [/csharp] where currentGateName is "Add", "Subtract" etc.[/QUOTE] Alternatively: [csharp]Type gateType = Type.GetType("FlowGraphEditor." + currentGateName); Gate addGate = Activator.CreateInstance(gateType, new Vector2(ms.X, ms.Y)) as Gate;[/csharp]
Alright, since my arrival here I was told to post my things here, here is 0.1.4 of my work in progress game, where I am basically just fooling around with OpenGL until I can get to an actual game. [url]http://www.mediafire.com/?0fb38ofnr9hlvn8[/url] If anyone has a source for better OpenGL tutorials than Video Rock's (Or whatever it is) I will gladly take it up.
Again, nothing visual. But documentation is surprisingly fun after being stuck due to a silly design issue. Really, that happen to anybody else? Just having a small problem that you can't figure out how to fix then just get stuck in programmer purgatory or whatever until you're taking a piss at 3AM and think 'Hey, that's an obvious yet simple solution, I'll try that'. Then a day later you look at the post mortem of the design issue that stopped months of productive work: [code]commit a0d8189c889e4a7911655f1eae7fd2879e3a5f47 Author: Jookia Date: Wed Jul 27 00:07:31 2011 +1000 Fixed copying vector<string> for findPathChildren. findPathChildren now takes a reference to a vector<string>. findPathChildren now returns a bool indicating success. source/filesystem/CFilesystem.cpp | 5 ++++- source/filesystem/CFilesystem.hpp | 5 ++++- source/filesystem/POSIX.cpp | 9 ++++----- source/filesystem/POSIX.hpp | 5 ++++- todo | 4 ---- 5 files changed, 16 insertions(+), 12 deletions(-)[/code]
[QUOTE=thomasfn;31355570]Alternatively: [csharp]Type gateType = Type.GetType("FlowGraphEditor." + currentGateName); Gate addGate = Activator.CreateInstance(gateType, new Vector2(ms.X, ms.Y)) as Gate;[/csharp][/QUOTE] Which obviously is way cleaner, thanks :D implemented. [editline]26th July 2011[/editline] [QUOTE=awfa3;31355031]What is this editor going to edit? A shading language?[/QUOTE] I don't know yet, as for now this is just a concept to see if I can actually implement it nicely, and it's working, I just made a lerp, sinus and multiplay gate, now I can already create sin wave generators when attaching the output of an add gate to itself with a small constant as input.
[QUOTE=AgentBoomstick;31354506]I can't wait to play this eventually. Make sure once it gets advanced enough to add races, spells and all that jazz. It could be really great.[/QUOTE] Someone... wants to play my game? ... [img]http://i.imgur.com/6FX8W.jpg[/img]
[QUOTE=Jookia;31355711]Then a day later you look at the post mortem of the design issue that stopped months of productive work: [code]commit a0d8189c889e4a7911655f1eae7fd2879e3a5f47 Author: Jookia Date: Wed Jul 27 00:07:31 2011 +1000 Fixed copying vector<string> for findPathChildren. findPathChildren now takes a reference to a vector<string>. findPathChildren now returns a bool indicating success. source/filesystem/CFilesystem.cpp | 5 ++++- source/filesystem/CFilesystem.hpp | 5 ++++- source/filesystem/POSIX.cpp | 9 ++++----- source/filesystem/POSIX.hpp | 5 ++++- todo | 4 ---- 5 files changed, 16 insertions(+), 12 deletions(-)[/code][/QUOTE] a filesystem wrapper issue (easily avoided by not reinventing the wheel) halted months of productive work? wat :v:
How to make a city: Step 1: Generate a ring road with some other roads [IMG]http://i.imgur.com/ao3EX.png[/IMG] Step 2: add tons of crappy "buildings" [IMG]http://i.imgur.com/ZXh2P.png[/IMG] Step 3:D! [IMG]http://i.imgur.com/rvihl.png[/IMG]
[QUOTE=icantread49;31356174]a filesystem wrapper issue (easily avoided by not reinventing the wheel) halted months of productive work? wat :v:[/QUOTE] Yes, but my wheel is better than other wheels, so I think that justifies it.
[QUOTE=ZomBuster;31356374]How to make a city: Step 1: Generate a ring road with some other roads [IMG]http://i.imgur.com/ao3EX.png[/IMG] Step 2: add tons of crappy "buildings" [IMG]http://i.imgur.com/ZXh2P.png[/IMG] Step 3:D! [IMG]http://i.imgur.com/rvihl.png[/IMG][/QUOTE]Is that procedural? What's the algorithm like for the roads?
[QUOTE=TerabyteS_;31356710]Is that procedural? What's the algorithm like for the roads?[/QUOTE] The roads have 2 vectors for the position and direction, and (smaller) roads can branch of any road. For the ring road I just forced it to constantly rotate 1 direction, for the rest it slightly rotates it randomly or sometimes at a 90 degree corner.
I think the circular center road looks very fake in a lot of the Procedurally generated. If you look at google maps, you rarely find them. [img]http://i56.tinypic.com/29pvkm0.png[/img] Notice the big roads and then smaller ones crossing between? There's very rarely a center turnpike thing... Maybe generate smaller ones as roundabouts, but those are usually only put in if the traffic conditions require it or the intersection meets up weird.
Was really confused about how to get a quaternion to transform a non-rotated cube to the correctly rotated cube when all you have is the normals of the target cube (or, in this case, a rectangular prism). [img]http://eagle.undo.it:8083/img/kintel_57_crop.png[/img] [i]Debugging block creation. Three position vectors showing arbitrary local Forward, Left, and Up directions; and a small cube showing the height. The third position vector is locked to a plane produced by the normal between the first two points. The small cube is moved along one degree of freedom and is positioned by finding the closest point on the plane from a point 1.0 meters away from the camera. Note that the closest (biggest) position vector is rotated to match the local axes of the block to be created - this was the part I was having difficulty calculating. Note that the small cube is on the same line as one of those axes, and that the first two position vectors are on another axis.[/i] From WDYNHW: [quote] I figured it out. Use the plane the cube is sitting on. Then, calculate the left vector of the resulting quaternion (calculated from between the global forward vector and the aforementioned plane). Find the quaternion between that left vector and the left vector of the cube. Now, multiply the conjugates of those quaternions (in order of how they are listed here), and viola! [/quote] I love quaternions.
Almost done with my Hardware Scraper. So far I've got Memory (Cross-Platform), Battery (Windows Only (Mono doesn't have any battery stuff implemented yet)), Computer (Cross-Platform), and a manual scraping tool that lets you grab information with Table names and property names. Most of the effort was creating the generalized scraper that worked on both Unix (Applies to OSX and Linux variances) and Windows. Also WMI is stupid.
Hey, bit off topic, how does everyone like to organise their projects?
[QUOTE=NorthernGate;31357638]\Battery (Windows Only (Mono doesn't have any battery stuff implemented yet))[/QUOTE] On Linux you can parse files in /proc/acpi/battery/*/state: [code]q3k@rageface:~$ cat /proc/acpi/battery/BAT1/state present: yes capacity state: ok charging state: charged present rate: 0 mA remaining capacity: 3157 mAh present voltage: 12476 mV[/code]
[img]http://eagle.undo.it:8083/img/kintel_58_crop.png[/img] Yay! Arbitrarily positioned, rotated, and scaled blocks placed [i][u]intuitively[/u][/i]! X, Y, Z, pitch, yaw, roll, width, depth, and height; nine degrees of freedom in 4 clicks. I'll post a demo if this works on my Windows test machine. I have a feeling there will be problems with compatibility due to how OpenGL is set up. Worked fine on my Windows 7 installation last time I checked, though...
[QUOTE=Lord Ned;31357349]I think the circular center road looks very fake in a lot of the Procedurally generated. If you look at google maps, you rarely find them. [img]http://i56.tinypic.com/29pvkm0.png[/img] Notice the big roads and then smaller ones crossing between? There's very rarely a center turnpike thing... Maybe generate smaller ones as roundabouts, but those are usually only put in if the traffic conditions require it or the intersection meets up weird.[/QUOTE] American towns are generally built like your example, but in Europe it's generally different. Most European town and cities are originally built around the town's church, and so it is build in circle around it. If you look at the brussels ring ([url]http://maps.google.com/maps?q=Brussels,+Belgium&hl=en&ll=50.833047,4.360199&spn=0.174337,0.439453&sll=37.0625,-95.677068&sspn=55.279921,79.013672&t=h&z=12[/url] ), or Namur ( [url]http://maps.google.com/maps?q=namur&hl=en&ll=50.464061,4.894753&spn=0.175711,0.308647&sll=50.833047,4.360199&sspn=0.174337,0.439453&t=h&z=12[/url] ) you'll see that the town is build around a circle. But I admit that the circle he generated is too perfect to be real.
[QUOTE=OrYgin;31359534]American towns are generally built like your example, but in Europe it's generally different. Most European town and cities are originally built around the town's church, and so it is build in circle around it. If you look at the brussels ring ([url]http://maps.google.com/maps?q=Brussels,+Belgium&hl=en&ll=50.833047,4.360199&spn=0.174337,0.439453&sll=37.0625,-95.677068&sspn=55.279921,79.013672&t=h&z=12[/url] ), or Namur ( [url]http://maps.google.com/maps?q=namur&hl=en&ll=50.464061,4.894753&spn=0.175711,0.308647&sll=50.833047,4.360199&sspn=0.174337,0.439453&t=h&z=12[/url] ) you'll see that the town is build around a circle. But I admit that the circle he generated is too perfect to be real.[/QUOTE] I think to really generate something semi-realistic, you'd have to generate terrain first, and then lay a road by deciding "Let me pick a start and an end point, and then shift the points based on the terrain's height" to try and try to make it so you pick similar heights (going around a mountain for example instead of up and down it). Then you'd have to create a smoother curve between them... It'd get really complex really fast, trying to decide bridges, when to tunnel through a mountain, etc, etc, etc.
[QUOTE=OrYgin;31359534]American towns are generally built like your example, but in Europe it's generally different. Most European town and cities are originally built around the town's church, and so it is build in circle around it. If you look at the brussels ring ([url]http://maps.google.com/maps?q=Brussels,+Belgium&hl=en&ll=50.833047,4.360199&spn=0.174337,0.439453&sll=37.0625,-95.677068&sspn=55.279921,79.013672&t=h&z=12[/url] ), or Namur ( [url]http://maps.google.com/maps?q=namur&hl=en&ll=50.464061,4.894753&spn=0.175711,0.308647&sll=50.833047,4.360199&sspn=0.174337,0.439453&t=h&z=12[/url] ) you'll see that the town is build around a circle. But I admit that the circle he generated is too perfect to be real.[/QUOTE] Yes, usually "main street" in America is straight rather than round. However most cities end up some sort of circular-shaped freeway. Just check out Houston, it looks like a spider web: [img]http://i.imgur.com/UkWjD.jpg[/img]
So, I'm going in for an interview with RDI, a firm whose purpose is primarily to do programming for the government and school district (thought they serve any client who requests work). For anyone here who's done interviews for programming positions, are there any good tips you can give? (They do their programming in C# mostly, if it matters)
[QUOTE=NorthernGate;31361981]So, I'm going in for an interview with RDI, a firm whose purpose is primarily to do programming for the government and school district (thought they serve any client who requests work). For anyone here who's done interviews for programming positions, are there any good tips you can give? (They do their programming in C# mostly, if it matters)[/QUOTE] Don't try to program anything personal at work, it's possible that anything you make with their tools at their place automatically belongs to them. If you have an idea for a program, email it to yourself or something. :) Content [media]http://www.youtube.com/watch?v=_jW-41SUhHY[/media]
Base64 or hex or binary are security by obscurity, at best. Binary and hex being pretty damn obvious.
[QUOTE=Quark:;31362105]Don't try to program anything personal at work, it's possible that anything you make with their tools at their place automatically belongs to them. If you have an idea for a program, email it to yourself or something. :) Content (vid) [/QUOTE] MD5 doesn't (de)encode. It hashes data, so change the text on the buttons in MD5 mode. Other than that, good work!
Sorry, you need to Log In to post a reply to this thread.