Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

Bacterius

Member Since 28 Feb 2011
Offline Last Active Today, 10:50 PM
*****

#5051441 Luminance

Posted by Bacterius on 09 April 2013 - 03:39 AM

Luminance isn't a radiometric quantity. It's basically radiance weighted by an observer's luminosity function. If you compare the definition of radiance and luminance, you will see they are exactly the same with the exception that radiance uses watts whereas luminance uses candelas (which are just watts weighted by "perceived brightness", loosely stated).

 

I have to agree with Juliean, this is probably not the definition of luminance you were thinking of, and I think what you are looking for is pretty much just what you already know - it's just radiance, weighted to match our tristimulus color matching functions (this is what photometry is about - how humans and other species perceive light, not just a radiometric physical interpretation of it)




#5049419 Antivirus false positive

Posted by Bacterius on 02 April 2013 - 08:44 PM

Is there a way to prevent anti-virus from false flagging my program?

Yes. Whitelist the program in your antivirus, report it as a false positive to the antivirus developers and be on your way. Unless you really want to hack your way around this particular antivirus (and run the risk of being flagged by another one).




#5048459 Linked lists question

Posted by Bacterius on 30 March 2013 - 08:34 PM

im learning about arrays and lists in java and i come across linked lists and i have yet to think of a useful way of using them... mabe im not fully understanding their capabilites? if anyone could clear this up greatly appreciated!

 

Linked lists are good when you are doing a lot of random insertions, in a linked list this operation is very cheap whereas in an array you need to shuffle things around. For instance, say you have an array with one billion items in it, and you want to insert some item right in the middle. You will need to take the 500 million items after the insertion point, and shift them up 1 place up the array to make space for the element you're about to insert. In a linked list? No problem, find the element before and the element after where you want to insert your element, and simply modify their "next element" (and "previous element", if applicable) pointers, which naturally inserts the new element into the list without touching any element other than the two surrounding the insertion point.

 

On the other hand, you cannot have random access in a traditional linked list - if you want to read the Nth element, you need to walk through the linked list until you reach it, costing you N operations, instead of 1 operation for an array, since you can just directly get the element you want in an array. As you can see, they both have pros and cons.

 

The way you use the list is exactly the same, because they ultimately perform the same function (they are both lists) but depending on what you do with the list - what kind of operations, what sort of data you're manipulating - you should select the most appropriate one for your particular situation to optimize performance.

 

It is worth noting that unless you are in a very particular situation, linked lists do not win over arrays, simply because arrays are faster in modern hardware due to cache coherency and sequential memory access, whereas linked list traversal tends to jump all over memory. So the places where you would realistically use a linked list, other than for learning, are quite limited.




#5047899 Which is easier to program C# or Java?

Posted by Bacterius on 29 March 2013 - 12:30 AM

Hello, I am not trying to start a language war here.

Unfortunately that's not how it works. Language war initiated... tongue.png

 

I am looking to learn a second language and use it for things like making GUI applications quicker and easier than c++.  The type of application that absolute speed of the application is not paramount, but making it quickly and easily is more important.

 

So it seems like for general purpose languages that strive for productivity, C# and Java are the top 2.  Which is the easiest to use for making general purpose programs with GUI's?

 

From my limited experience, I've found C# to be more straightforward to create nice-looking GUI apps, and I still have nightmares about Java's horrible "swing" UI and painful implementation. I hear C# inherits some UI development aspects from Delphi (since it's the same guy behind both languages) and so I'd be more inclined to pick that one if I had to choose, but this is subjective. But I'm sure they both have good libraries and tools to create UI's. Have you tried giving each of them a little trial?




#5047533 How to create a more efficient Health System for my character

Posted by Bacterius on 28 March 2013 - 12:06 AM

I agree with the first statement. But the second statement seems odd, wouldn't the method work all the time for that following condition. A screen width can be an integer value of 580 which is always certainly greater than an arbitrary value of 20 hearts.

 

Yes, but what if you want more than 20 hearts later on? Or add more things (like armor, ammo indicators, which also take up screen space and reduce the amount of screen estate available for showing life)? I believe this is what was meant.




#5046718 Terraforming / Destructible Terrain / Run-Time Terrain Modification

Posted by Bacterius on 25 March 2013 - 06:56 PM

I think there's a graphics engine that supports marching cubes and hence arbitrary terrain destruction.. C4 engine by Eric Lengyel. An extra feature is it supports LOD without cracks, which is difficult to get right. The author is a member here too smile.png It's a bit expensive though but it's what first popped into my mind when you mentioned fully destructible terrain.




#5046453 A quick question about organizing my folders

Posted by Bacterius on 25 March 2013 - 01:32 AM

Well it depends on your programming language, what I usually have, for C or C++, is as follows:

 

project
 |- bin/           (for binaries and required DLLs.. you can also have a lib folder)
 |   |- debug/
 |   |- release/
 |- data/          (for assets, such as databases, images, sounds, and so on)
 |   |- images/    
 |   |- sounds/
 |- doc/           (for your documentation, either generated or written)
 |   |- html/
 |   |- pdf/
 |- src/           (for the source code files, organize in subfolders)
 |   |- folder1/
 |   |- folder2/
 |- include/       (for the header code files, if applicable)
 |   |- folder1/
 |   |- folder2/
 |- misc/          (anything left that you want to include)

 

 

When it comes to DLL's, though, you might not want to drag around a bunch of common DLL's when distributing your program, so you might want to ask the user to install the required frameworks instead of providing the DLL's yourself, this makes it easier on you and ultimately on the user, since there will be no duplication.

 

As for how to get your program to find those DLL's, well, unless you are loading them dynamically, they need to be in the program's PATH variable for the system to find them, this PATH includes your system PATH (operating system library folder, and other programs tend to write themselves in this variable too) in addition to the directory where the program was launched, which generally means you need your custom DLL's to be right next to your program, at least under Windows.

 

This also applies to resources to some extent, so for release you probably don't want a bin/ folder.

 

If you use an installer you can make things more consistent, but this is more advanced.




#5046134 Monday morning code...

Posted by Bacterius on 23 March 2013 - 11:07 PM

Might want to fix the second x < 0 to y < 0 too. I mean, it doesn't change anything, but at least it looks right happy.png




#5045536 Tetris clone in BASH script

Posted by Bacterius on 22 March 2013 - 01:27 AM

echo this is great




#5045027 Can't figure out an unique and exciting idea for a computing project

Posted by Bacterius on 20 March 2013 - 04:02 PM

This project can involve anything,

 

It's generaly easier to use Java for a project like this.

 

So in other words, someone told you Java was easier to use for everything. I smell fanboyism!

 

But in any case, how about trying to combine elements from two different ideas? That's how good ideas generally come. For instance, you mention fractals and the game of life - what would they look like together? Perhaps a game of life simulation warped around on a fractal surface, for interesting and unique visuals? Another idea: snake and... pacman? Snake with enemies? Not exactly unique, I admit, but it's getting better. Now if you need sophistication, how about a fully 3D fluid simulation? You can also create some gameplay to go with it, too.

 

Whatever you end up doing, it will always - always - be derived from something you've already seen or heard about. That's how the human brain works. That's also why sitting around thinking about game ideas rarely yields anything of interest. You need to look around, and manufacture innovative gameplay by connecting ideas together.

 

Here is a last one to really get you going: a four dimensional maze game. You could write about how humans have difficulties navigating such environments, and show how it can give rise to interesting gameplay, you could also experiment with the use of ambient music and atmosphere and its impact on the problem solving skills of the average human being, if that's your thing (psychology student, maybe). I'm guessing there's a lot to write about here.

 

And finally, if you are really passionate about an idea, you won't have any trouble writing 5000 words on it, so I wouldn't sweat the final report since it should not be a problem if you chose something you find really interesting.

 

There was an inspirational usenet post somewhere but I can't dig it up sad.png




#5044475 What language do I use?

Posted by Bacterius on 18 March 2013 - 11:20 PM

 

Still stuck on the decision.

If you hit all the languages with a dart, you set them up on your dart board wrong ;)

I can't find a dartboard xD

 

Make one! Where are your problem solving skills? tongue.png  (tongue in cheek)




#5044470 Eight, Nine, Ten...

Posted by Bacterius on 18 March 2013 - 10:56 PM

But they could have made it useful by adding pluses!

#define ONE     +1
#define TWENTY  +20
#define HUNDRED +100
 
// Here's a little example
#include <iostream>
 
int main()
{
    int x = ONE;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED TWENTY;
    std::cout << x << std::endl;
 
    x = ONE HUNDRED TWENTY ONE;
    std::cout << x << std::endl;
}

 

Or even worse:

 
#define ONE     +0x001
#define TWENTY  +0x020
#define HUNDRED +0x100

 

Sadly this doesn't fully work: 

 

 

TWO HUNDRED == 102

But don't worry - we can fix it! We just need to be "clever"...

 

 

#define AND +0
#define ONE +1
#define TWO +2
#define TWENTY +20
#define HUNDRED *100
 
// Here's a little example
#include <iostream>
 
int main()
{
    int x = TWO HUNDRED AND TWENTY ONE;
    std::cout << x << std::endl;
    // prints 221
}

 

This way you even get to write grammatically correct numbers. happy.png




#5043192 Is it time to move on to c++?

Posted by Bacterius on 14 March 2013 - 04:58 PM

What do you mean by "move on"? You don't "move on" to another language, you just learn it. And do you think raw C++ will be any easier?

 

Also, I doubt you'll get a 30x speed increase anyway. Or even close to 4x. The entire graphics pipeline is language-agnostic and those parts of the game logic which require some CPU power are generally compiled to C by Python for efficiency (even more so if you use stuff like scipy for arrays). Obviously it's going to suck if you are using text-based dictionaries to store tile cells...

 

Sure, you can give C++ a shot - it will only take you a week or two to get comfortable with the basic C++ syntax and libraries, and then you can try and write stuff with it and see if you find it easier, more comfortable/productive or simply enjoyable to you.

 

And PS: you can always distribute your sources along with the compiled executable, if you so desire.




#5043007 Camera for Raytracing

Posted by Bacterius on 14 March 2013 - 04:20 AM

Everything works fine by now though I still have a question. When I choose a wide angle for the horizontal field of view, let's say 120°, I see spheres getting oblong at the border of the screen.  Is this the so called "fisheye"-effect due to a wide field of view?

Yes, a flat image plane doesn't work well at high fields of view because it tends to cause extreme distortion at the edges. A flat image plane works best for fields of view between 30 and 80 degrees, in my experience. For such wide-angle shots you'll want a different kind of camera, probably spherical or fisheye (though distortion is unavoidable, but at least you'll be expecting it in that case).




#5042924 Camera for Raytracing

Posted by Bacterius on 13 March 2013 - 06:19 PM

I think what the diagrams indicate is the x-focal length and y-focal length, such that the actual focal length should be equal to sqrt(fx^2 + fy^2), by the Pythagorean Theorem. Though I don't fully understand the diagrams.

 

What I like to do is calculate only the corners of the focal plane, and interpolate the focal point for an arbitrary pixel using bilinear interpolation. It's clearer and a bit faster. Then the camera direction is just the focal point minus the camera position (normalized, of course). You might find some of my code useful: this, along with this.






PARTNERS