Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

107 Neutral

About Deprecated

  • Rank
  1. Deprecated

    Checksum testing

    Self-encrypting Code to Protect Against Analysis and Tampering (J. Cappaert, et al.) comes to mind. A simpler way to provide strong security against reverse-engineering would be polymorphic encryption. Oddly enough it's a technique that originated from the malware hobbyists and although it's nowadays used by serious software developers a lot of good documentation and examples can be found on sites focusing on malware development and (software) security analysis. It is disputed whether or not it is possible to create a software that can't be detected and therefore analyzed (see Blue Pill malware), although it is possible to protect the code good enough so that the effort of cracking it outweighs the worth of cracking it. Although you could write every single function of your program so that it could be encrypted and loaded into memory only one function at a time (which makes both recursion and object-oriented programming impossible, by the way) it is highly unlikely that you'll find a graphics library that works with that kind of programming. It is also highly unlikely that you'll need that kind of security. As frob said, you need to consider who you're protecting yourself from and how much your data/code is worth to them.
  2. You're looking to create a TUI ([Text|Terminal] User-Interface). There are several resources available to do this with far less work than a graphics library like SDL/SFML/OpenGL/DirectX would require, if you're willing to use Linux for the clients suggestions can even be found in the wikipedia article I linked.
  3. The symbolic links [font=courier new,courier,monospace].[/font] and [font=courier new,courier,monospace]..[/font] represents the current and the previous folder. [font=courier new,courier,monospace]'C:\Program Files\.\.\.\..\Program Files\..'[/font] should place you in[font=courier new,courier,monospace][font=arial,helvetica,sans-serif] [/font]'C:\'[font=arial,helvetica,sans-serif], assuming that there is a directory called Program Files in your root.[/font][/font] [font=courier new,courier,monospace][font=arial,helvetica,sans-serif]Edit: Added the quote I was responding to.[/font][/font]
  4. You're not understanding me... The code I posted will output a sequence of data that represents the image. Below are some examples on how to work with the above example in python. Although I haven't tested the code, in the first example, [font=courier new,courier,monospace]bytestream[/font] should be accepted by SFML as an image in memory. 1. To read the data as a stream of bytes in python import urllib.request bytestream = urllib.request.urlopen('http://localhost:80/~username/gamedev.php') 2. To read the data as an array of bytes in python import urllib.request bytearray = [c for c in urllib.request.urlopen('http://localhost:80/~username/gamedev.php').read()] 3. To read the data as a stream of bytes and save it to file in python import urllib.request open('image.png', 'wb').write(urllib.request.urlopen('http://localhost:80/~username/gamedev.php').read())
  5. Remember that your browser will interpret images and render them for you, instead of outputting the bytes they consist of. The code I posted will output the raw data from the image, meaning the bytes it consists of. I'm not sure whether or not C# [font=courier new,courier,monospace]Texture2D.LoadImage()[/font] accepts data containing the file-header, but unless you plan to output something that could be evaluated and parsed by C# I think you'll have to output the actual file. $ lynx -source http://localhost:80/~username/gamedev.php ?PNG ? IHDR2??? pHYs???o?d OiCCPPhotoshop ICC profilex?SgTS?=???BK???Ko RB???&*! J?!??Q?EE? ...
  6. There is no [font=courier new,courier,monospace]to_str()[/font] method that will convert your array to readable data in PHP. If you want to display the content of an array (or any other object) you'll have to use [font=courier new,courier,monospace]print_r($mixed)[/font]. If you want your PHP script to output an image you could use the code below; <?php $file = 'creature.png'; header('Content-Type:image/png'); header('Content-Length: ' . filesize($file)); print(readfile($file)) ?> P.S It is very important that you do not output any kind of data (not even a newline, space or tab) anywhere else in the code. D.S
  7. Deprecated

    Another Go at Programming - Advice appreciated

    The first problems at are pretty easy to solve, although they should provide some challenge if you're not familiar with conditional statements, loops and/or functions. Write a simple text-based game where the computer picks a random number and you have to guess that number. Make the computer tell you whether your guess was greater than, or smaller than the actual number. Create a deck of cards, write functions to shuffle the deck, sort the deck, display the deck, pick a card from the deck and anything else that you would normally do with a deck of cards. Write a simple text-based blackjack game where you play against the computer using the deck you designed earlier. Try to solve the first 20 problems at, and make sure to read the papers you get for completing each challenge.
  8. Deprecated

    Simple Class Problem

    Oh sorry! [font=courier new,courier,monospace]this[/font] will refer to the actual instance created from your class. You don't have to use it, but since I used the same names for parameters as instance variables it depends on the implementation of that particular language whether it'll work without [font=courier new,courier,monospace]this[/font] or not. Think of it like [font=courier new,courier,monospace]the_variables_that_are_defined_on_the_very_top_of_the_class.strength[font=arial,helvetica,sans-serif] , it is the same as when you're using [font=courier new,courier,monospace]numGen[font=arial,helvetica,sans-serif] to call [/font]numGen.Next(...)[/font] but as there is no name for the instance yet you can use the keyword [font=courier new,courier,monospace]this[/font].[/font][/font]
  9. Deprecated

    Simple Class Problem

    Even though there is a great difference between a hero and his/hers nemesis in real life, if you look at your code there is (almost) no difference at all. I'd suggest that you create a class Creature/Human/Entity instead and create two separate instances instead. class Entity { private int health, strength, weaponStrength, defence; private bool isAlive, isEvil; private string identity; public void Entity(int health, int strength, int weaponStrength, int defence, bool isAlive, bool isEvil, string identity) { = health; this.strength = strength; this.weaponStrength = weaponStrength; this.defence = defence; this.isAlive = isAlive; this.isEvil = isEvil; this.identity = identity; } public int getStrength() { return this.strength; } public Calculate(Entity enemy) { return this.strength - enemy.getStrength(); } } ..... Entity hero = Entity(100, ..., "Good Guy"); Entity nemesis = Entity(100, ..., "Nemesis"); Heads up, I've never written a single line of code in C# so the syntax may be a little off.. Took a guess from the code you provided. Although the concept should be correct. P.S You should be using getters and setters instead of public variables, gives you more control over you code; google "getters and setters C#" and it should be one of the first results. D.S Edit: Added a getter for strength.
  10. Deprecated

    Identifying events

    I'm guessing your building your own engine/library intended for other people to use? Either way, my most personal opinion is that you can't protect another programmer from every silly mistake he or she might do. If it's documented that you should use enum values and someone attempts to use [font=courier new,courier,monospace]'4'[/font] it should simply fail, preferably with an error message telling that programmer to read the .. manual. If you actually try to protect someone from every possible error you'll realize that you can never do that good enough. What if one programmer uses the string 'cast' hoping that you'll provide typecasting while another programmer uses the same string 'cast' hoping that his or hers character will throw a fireball? Summary: Use integers if only one option is available; if there's several options (flags) available you could use bitmasks. Make sure to document it.
  11. Deprecated

    I'm new and need advice

    No, there is no program you could use to help you make a "simple" game like mario. You write everything in code and you test everything in code. I hate to be blunt, but on the other hand I wish someone had told me the same thing a couple of years ago so I didn't have to spend 2 years figuring out that I wasn't the best programmer the world had ever known. Here goes, you are not yet good enough to write your own game, not even mario, tetris or pong. Start with figuring out how that calculator you wrote with the help of a tutorial really works, change something and see if it breaks, make addition work like subtraction for a while, try to rewrite the calculator without looking at the tutorial or your previous code. Have a look at and see if you can solve some of the first 10 problems using the programming language of your choice. Read the papers you get for completing each problem. Try to write a "guess the number" game like this one, then change it from 1-10 to 50-1000, add something else... And if you're really into programming, read a book about the programming language you're learning (although I can't recommend any good books for C#, guessing Microsoft has one). If you start your career in programming with attempting to make something great I can promise you that you'll end up with nothing but a bad experience.
  12. Deprecated

    [SDL] Frame Limiting

    I asked about the same question yesterday, you can find the answer I got here ( But to be honest, you're trying to get 60 FPS and you've got it already. You will never get exactly 60 FPS (unless casting to int) for 2 reasons. 1) (I'm assuming) you're not in total control of the system you're running on. Your application probably wont get 100% of the CPU time, at the very least the OS will keep some to render your desktop, move your mouse etc. 2) You're not in total control of the code. What if SDL_GetTicks() takes about 1 ms to generate the answer? As SDL_GetTicks() is part of your frame limiting you'll always be a little off. Same goes for variable assignment, addition, division, increment, if/loop -statements.
  13. Deprecated

    How to handle update-rate?

    Thanks! As it is tile-based and I'm only working with integers for positions and angles I figure each entity should have internal "countdowns" for the amount of updates needed before moving or communicating with other entities (assuming it takes more than 1 timestep)?
  14. Deprecated

    Handling sprite (array or vector)

    (A standard implementation of) dynamic arrays are usually pretty slow at inserting and/or removing elements from the middle of the list as all data has to be copied. Although they are really fast for iteration and lookup. Depending on your definition of a lot you might want to initialize the dynamic array so you don't end up doubling a dynamic array containing 20M elements in the middle of an update. (A standard implementation of) lists are pretty fast at inserting and/or removing elements anywhere in the list. Although they are not as fast when it comes to iteration and slow (in comparison) to arrays when it comes to lookup. Depending on how you're using the container you'll get different results, although it's impossible to tell from the description you gave. Although if you want to analyze the performance of your program based on the type of container used you can find the complexity of each operation at wikipedia, or you could simply change the type of container and time your functions. Edit: been working too much with python lately, a standard implementation of arrays are of course fixed size.
  15. I have to say that I disagree with the people above. Logic is a part of math, but math is not logic. Programming is almost nothing but logic, but logic is not programming. Understanding the syntax of a programming language and the semantics of the paradigm of your implementation makes you a great programmer. Although there are things you might have to implement with programming that requires math, physics for example. There was very recently a kid (from Sweden, unless I'm mistaken) who wrote an iPhone application to summarize the information from various sites such as wikipedia, wolframalpha, etc. which was downloaded by several thousand people and which made their life simpler. And there's really not much math needed to append a string to another string or display it in a user-friendly way. You do not need to understand math to become a programmer, and you do not need to understand the science of nutrition to become a bodybuilder.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!