• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

154 Neutral

About Wildfire

  • Rank
    Advanced Member
  1. [Starting C++]Need opinions

    I've never been a textbook learner myself. I do own a few books, but they're mostly used for reference. Simply reading about things I don't really know yet is indeed boring. My personal way is learning by doing or "trial and error". Really depends on personal preference though :) My advice would be: Start programming. Find a few samples, compile them, try to change them, toy around. Get a feel for the language. Once you've got a little experience the book should make more sense and become more interesting. Of course I'm not telling you to ignore the theoretical part completely. The most important "philosophies" that make a good programmer are not language dependant though. Also, I found the C++ FAQ LITE quite helpfull, albeit a lot of this might be over the top of your head if you're just starting to learn.
  2. Core 2 quad behaviour.

    Say you had a computer with a 1 GHz single core CPU and another computer that has a 1 GHz quad core CPU. A single threaded application should run at the same speed on both, provided the remaining hardware is equal. At least in theory. As others have pointed out, a modern OS does a lot "under the hood". Access to the hardware may be handled asynchronous, allowing your application to continue when you'd expect it to wait. Also modern GUI applications (think .NET) usually have several threads "built-in", without you needing to know or care about it. Another thing that happens in the background is a kind of load balancing. The OS may shift long running tasks from one core to the other in order to distribute heat dissipation evenly across the CPU (read this somewhere, don't remember the source). It will also distribute processes running at the same time to different cores. So instead of having four single threaded applications share 25% of a single core, they now each get 100% of a separate core (depends on how CPU intensive they are, of course). ~edit Quote: Quote:Original post by Marmin If you go to the "Select Columns" option in the menu in Task Manager I can't find this option, really. I can see only 1 process running for my (fairly simple) application. I'm running Vista home premium. Start Task Manager. Go to the Tab "Processes". No click "View > Select columns" in the menu. There should be lots of additional columns to select. Unless they removed that from Home Premium. Otherwise, get Process Explorer from Sysinternals (now owned my MS), it's got a lot of additional "toys" ;).
  3. In other word's I'll have to use a try-catch-block, and be prepared to handle the case this race condition actually happens. There's no way to prevent this by some kind of lock. Thanks for the fast answer(s).
  4. [.net] Useful/obscure .Net classes

    Quote:Original post by RipTorn have you ever done this? if (myString != null) return myString; else return "Empty"; well.. how about: return myString ?? "Empty"; Both are equivalent [wink] Another usefull abbreviation is this: int? x; //short for: System.Nullable<int> x; Nullable Types (C# Programming Guide) ?? Operator (C# Reference)
  5. I'm running another application from within my own through System.Diagnostics.Process. At some point I may be required to kill the other application. So far I'm doing this with the following code block: if (!process.HasExited) proceess.Kill(); My experience with multi-threading tells me there is a possible race condition, which I could prevent by using a lock when we were talking threads. The .HasExited might tell me "false" and by the time .Kill() is executed the process may have exited on it's own. The documentation doesn't cover this, and I haven't found any example on Process that even mentions this. Every example seems to be comfortable using the above statement. Is there some mechanism that already prevents this, or is it a risk I just have to take? Or would you just wrap it in a try-catch-block and hope this never actually happens?
  6. I know this is a little off-topic, and maybe you did this in the actual code, but I suggest making use of the "using" keyword. using(OpenFileDialog open = new OpenFileDialog()) { open.Filter = "Rich Text Format (*.rtf)|*.rtf|Text files (*.txt)|*.txt|All files (*.*)|*.*"; open.FilterIndex = 1; open.DefaultExt = ".rtf"; if (open.ShowDialog() == DialogResult.OK) { // -- code -- } } This will Dispose the OpenFileDialog on close. Probably not a big issue right now, but still a good thing to get used to early on. Your code works fine here also.
  7. Quote:Original post by Catafriggm Or you could use public key encryption on all data files, and make it impossible to disable the hash checking how? (since there wouldn't be a hash needing to be checked). That doesn't change the fact that they can load the data another way (the data doesn't have to come from the archives, you know - regardless of how you coded it). Ah, but this is exactly what I meant... go ahead, sign the files with your private key. Have the game engine check the signed file (which is done through a hash code...) against the public key for validity. Is this any better? Nope... find the public key, change the public key and you're free to sign the game files with your own private key. As long as the key is inside your binaries and the gamer is able to change those binaries you're screwed. Even if you require your game to contact an online server to verify the signature of the file, you can alter the game to always report the correct signature to the server even if files have been altered. This makes is harder to crack but not impossible. Quote:Original post by Bregma Unless someone gets a hold of your private key, this is fairly secure. No. They do not need your private key. They simply modify the application so that it checks the file against a public key of their own, which enables them to use their own private key. You don't even need to disassembly/recompile the game if the key is stored in a way that it can be modified by a hex-editor. If the player is proficient enough (s)he can simply circumvent the whole check-on-load algorithm. The casual gamer may not be able to do this, but there are enough people around who can and will. And if they're willing to share the crack even the casual gamer can and will alter game files.
  8. sin(), cos(), Headache()

    Quote:Original post by Ra 180 * PI / 180 Those 180s are integers. You're trying to do intger math with pi, and that's going to be a mess. Try using 180.0f or 180.0 instead. Since PI is not an integer the compiler should be clever enough to upgrade the ints to floats before doing any maths. You'd have to worry about that if you were writing "int x = 3 / 2;" for example. Even then you'd only have to change one of the values "int x = 3 / 2.0f;" How about declaring a const float rad = PI/180.0; though? Or if you truly are using the same sin() and cos() values all the time, cache those.
  9. Legality of Remakes

    Quote:Original post by chao51 One thing that I am still curious about is, if you make a game, and have it completely for free, does the same copyright/trademark stuff still hold? And a second thing, if you do a remake, dedicated, to the original, still claiming the original is best, but your just honouring the memory. Does that have any legal bearings? Yes. Whether you offer the game for free or not does not have any influence on the owners copyright. Even if you "honour" the original by mentioning its name the owner is free to sue you. They could even claim you are using their name to advertise your game or that due to the lacking quality of the remake you are damaging the image of their brand. Simply said, whenever you create something you implicitly have a copyright, or "the right to copy" your work. Anyone else copying your work without your explicit permission is violating your copyright. You can waiver those rights by putting your work into the public domain, or using a license (the infamous GPL for example) that expressly allows others to copy your work. If you want to go a step further you can establish a trademark. This registers the name/image/character as your icon of trade. Usually the name of a company, their logo, the characters used in their games and even the games engine (think: Steam™) are trademarked. You can usually tell by the little icon "™". Like I said before I'm not a legal expert, so my understanding is a bit vague, but basically a trademark is an "upgraded" version of copyright ("more official"). You usually need to pay a fee to register a trademark and and even larger fee when violating someone elses trademark [lol]. The last of the bunch is the patent (think: MP3). Unlike the trademark it doesn't protect a certain symbol but rather an abstract idea or a certain process. What exactly can be patented depends on where you live. For example, software patents are possible in the US, but, so far, not in Europe (which is the source of a lot of heated debate). Also a patent must not be valid worldwide, so while you might get into trouble someone in Zimbabwe might not when reproducing a patented work (same thing goes for trademarks and probably copyright). Like I and others said before, be very cautious about remakes. Even if your game is original, a company might feel the need to sue you if for example they think your character too closely resembles one of their own. Even if they have no chance of winning the cost of the lawsuit alone might be enough to break you. However unless you're threatening their market shares this is an unlikely event. That being said, get up to date on copyright laws before you put something online, and best consult a lawyer before trying to sell stuff. Better safe then sorry =) (...and, possibly, broke).
  10. Legality of Remakes

    First of all, I'm not a lawyer or any other kind of legal expert. If you want to be sure consult someone with a professional background in law. Before you remake a game you should probably try to find out the following: a) If there is there a (valid) copyright (most likely) and who is the current copyright holder? b) If there is there a trademark (the game's name for example), who owns it? c) Maybe there are even one or more patents covering the game or techniques used therein (mp3 for playback comes to mind). Your first source of information would be the owner's website, the game manual, the EULA or a similar license agreement. As for the rest you should check out your countries law on how long a copyright is valid, if it can be sold etc.
  11. I think I have found a (partial) solution: ProcessStartInfo psi = new ProcessStartInfo(); psi.StandardOutputEncoding = Encoding.GetEncoding(System.Globalization.CultureInfo.CurrentUICulture.TextInfo.OEMCodePage); This will change the encoding to the codepage used by the specific language version of windows. Does anyone know if this will work in all cases? The command line seems to "speak" the language of the operating system not paying attention to the users language and regional settings. So I should get away with using the OEMCodePage? I tried using the ".ANSICodePage", the description suggests that this will return the code page used by the current culture. However, even though the culture is set to "de-DE" it gives me CP 1252 (US) instead of CP 850 (German) as I would expect.
  12. Quote:Original post by markr And I would tend to suggest that games programming is WAY more complicated. As a professional developer of business software of nine years, I know a few things about it. My evidence is: 1. The quality required of games programming is much higher; business software is absolutely *FULL* of bugs which make the application go wrong (e.g. corrupt data, get the wrong answer) and fail (e.g. crash) constantly, and most of all, nobody minds too much. Patches are much easier for business software. 2. Most games programmers I've met are of a MUCH higher standard, as developers. I've met a few good business application programmers, but I've also met a lot of absolutely useless ones. Granted this is somewhat subjective, as I've mostly met business programmers on a professional level and mostly met games programmers socially. Mark 1. The required quality of a product does not necessarily reflects its complexity. The more complex a system is the less likely it is to have a good quality in the same timeframe as for a less complex system. Therefore I would actually put it the other way around: Business software is more prone to crashes due to its very high complexity and thereby induced lack of quality. 2. The quality of the programmers also does not reflect the complexity of the software. What exactly would you define as "complex software"? For example a game with a physics engine is not necessarily complex. The code could be very simple and easy to understand, even though the mathematics and physics involved are very complex. 90% of the code could simply be mathematical expressions. A spyware scanner on the other hand probably does not require the same level of maths. However, you may need to have a very good knowledge about Windows, file systems, security concepts, domains, user rights management etc. because they could affect your application. As such the code may be very complex because it must take all these things into account. My personal view is that both business software and games are complex in their own unique ways. As such they cannot really be compared.
  13. I agree with Zahlman for single-player or "offline" games. What harm is there to a player modifying their copy of the game? The worst they can do is ruin the game for themselves. If you still want to go the pain of making your game files hard to tamper with, you could use digital signatures or hash codes (SHA1 for example). However, depending how good the signature is hidden within the executable a simple hex-editor might be enough to alter it. In the worst case the player would have to decompile/recompile the executable or library file. Thanks to the internet anyone could enjoy the cracked game if the hacker decides to distribute it. When it comes to online games you should prevent modifications that break the game or give unfair advantages (cheating) to certain players. For one thing you could use the same technique described above. You should, of course, verify the signature against a server side key and not one that is stored within the executable. This can, again, be circumvented by using a cracked executable that always reports the correct signature. The next step, like Excors said, would be to counter-check any user input against server side rules. You could/should still have client side checks for the sake of speed and a server side "sanity" check every few game ticks. If the players position or any stats have changed in an impossible way you could re-position the player, alter the stats of kick the player of the server.
  14. [.net] MSDE .Net 3.0 Upgrade

    Visual Studio 2002 : .NET 1.0 Visual Studio 2003 : .NET 1.1 Visual Studio 2005 : .NET 2.0 Visual Studio 2005 with Extensions : .net 3.0 Any .NET Framework is coupled with a specific IDE. So, yes, you need a whole new IDE (VS 2005) to be able to write (or rather: compile) .NET 2.0/3.0 code. You could write the code in notepad if you are so inclined ;) The .Net Redistributable contains the runtime. The runtime is required to be able to run programs written for the specific .NET version. To be able to write/compile programs for a certain framework you need the matching IDE. To see .NET Framework information for classes go to msdn2 (Example). At the end of the page you'll find the following: Version Information .NET Framework Supported in: 3.0, 2.0 Some pages also have a note at the top like this: "Note: This property is new in the .NET Framework version 2.0." There are some new 3.0 features, however generics are not among those (they have been introduced with 2.0). ~edit, btw: MSDE = Microsoft Desktop Engine, a free (limited) database server related to SQL Server 2000. MSDN = Microsoft Developer Network (which is what you're looking for).
  15. Quote:Original post by Fimbulvetr everything is possible you can let him or her supply the browser, you can add a setting button a global configuration file :P are you that lazy? XD Like others said before... it is not me who is lazy but the users of your app. Why force them to chose every time, or enforce an application specific setting? Besides, there already is a global configuration: When I install a new browser it will ask me if it should be the default. Your solution does work but it's not very user friendly. And if there's one way to drive your users mad, it's asking the same question again and again.
  • Advertisement