Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


Member Since 13 Jul 2012
Offline Last Active Aug 25 2015 10:35 AM

#5225932 Learning programming well

Posted by FantasyVII on 27 April 2015 - 03:33 PM

Honestly for me, I never liked using an engine to make games. Because I want to learn what is happening behind the scene. I want to learn the ins and outs of graphics programming. Using an engine to make a game does not really help me learn the depth of graphics programming that much. That is why I prefer diving into DirectX or OpenGL right away. However I feel like diving into OpenGL or DirectX right away has a very very steep learning curve, especially if you have never programmed a game before. That is why when I first tried to make a game, I used a friendly easy library like SFML, XNA, MonoGame, SDL, Allegro etc... After I learned the basics of those libraries I dove right into DirectX which made learning the API much easier.


of course if you don't care about programming much and you just want to make a game or become a game designer then using an existing engine is not a bad idea at all. It's actually better to use an engine because the time it would take you to code everything from scratch is a lot harder and longer.

#5217505 How 3D engines were made in the 80's and 90's without using any graph...

Posted by FantasyVII on 18 March 2015 - 07:00 PM


I would really love to know how to do that. I need to see some code. biggrin.png


Have "fun": https://github.com/id-Software/Quake/blob/master/WinQuake/d_draw.s smile.png



Ohh dear lord....



Here is some code which uses the old approach (and a new approach using GDI):



Mode 13h : http://en.wikipedia.org/wiki/Mode_13h




In x86 assembly language the mode is entered when AL is 13h, AH is 0 and BIOS INT 10h is executed.


If you want to have fun, I recommend the tutorials linked to from the mode 13 wiki page:



For true authenticity, though, you need to grab Borland C++ 3.1 from here: https://winworldpc.com/product/borland-c/30

Id Software used that for Wolf3d..


This is amazing.

#5217493 How 3D engines were made in the 80's and 90's without using any graph...

Posted by FantasyVII on 18 March 2015 - 06:27 PM

Back in the day, you could get a pointer to the array of pixels that the monitor was reading from, and just write your own pixel data into that memory.
You can do the same thing today, but using a minimal amount of D3D/GL/SDL/etc code to manage that array of pixels for you.

Then you just have to implement your own software rasterizer so that you can draw pixels biggrin.png


I would really love to know how to do that. I need to see some code. :D

#5217489 How 3D engines were made in the 80's and 90's without using any graph...

Posted by FantasyVII on 18 March 2015 - 06:20 PM

Hey ya.


With this Link. one hell of a good book.

Great, Thanks. I will definitely check it out.

#5217484 How 3D engines were made in the 80's and 90's without using any graph...

Posted by FantasyVII on 18 March 2015 - 06:07 PM

Hello everyone,


I'm really interested in knowing how games were made in the 80's and 90's before OpenGL and DirectX API existed. How the Doom engine and even the Wolfenstein 3D engine used to render 3D scenes without using any hardware acceleration or graphics API's?


I found this video talking about how the Doom and Quake engine rendered things back in the day and I found it really interesting. However I really want to read more about this.




#5210305 What's the point of obfuscating managed code?

Posted by FantasyVII on 12 February 2015 - 10:50 AM

How much did Terraria get hurt by releasing non-obfuscated binaries at first, and then having hackers grab the source and release their own version?  They are probably the main case I can think of for a C# game that was released without obfuscation and was popular enough that someone cared.


(Though as a counter-point, someone got annoyed with FTL's lack of moddability, and just recoded the whole thing from scratch and used the same art assets)



I'm kind of on the fence, doing a mild amount of work to give hackers a slightly tougher time might be worth the effort, it's hard to say.


Woho, I didn't hear about the Terraria thing. I'm Googling that.


Shouldn't there be a license like Creative Commons Attribution NonCommercial included with the game?



Well Terraria dev said "I didn't obfuscate it for a reason". I guess he wanted the community to mod his game, which is cool.

#5210128 What's the point of obfuscating managed code?

Posted by FantasyVII on 11 February 2015 - 04:03 PM


Not everyone wants their game to be modded. There can be multiple reasons for this, but multiplayer cheating is one of them. While obfuscation will not prevent the more skilled teams from hacking/reverse engineering your product, it may prevent or at least delay the script kiddies from doing so. There are much better ways to make a game moddable, such as by providing an api with hooks etc.

Also, sometimes there are legal requirements to obfuscate your product due to included libraries or whatever. The worst part about obfuscation is that it completely messes with anything dealing with serialization and reflection.

The problem is that, with the internet, everyone is a "skilled team". I don't have to hack anything, I just need to know how to find someone who did the work already and packaged it into a handly little installer I can double-click.

"Modding" (and cheating) cannot be stopped. Period. The user's machine is always hostile, always running code you cannot trust, even if you wrote it. The best you can do is verify on the server side to prevent cheating, and have a GM team who can verify cheating behavior and apply appropriate bans. (Or better yet - release server executables so people can run and manage their own servers)

I can think of a few ways to easily reverse obfuscation - someone wrote a program that transforms A -> B, I can write one that goes the other way (especially if the transformation is non-lossy). Symbols that "look alike" don't bother a computer after all smile.png

And if you're a single-player game? Psh. Let the user go nuts. They'll love you for it. And if you release the editor next time you'll have one of the longest sales tails in gaming without spending a cent. (Of course, your game has to be good - but we're operating on that assumption already)



Yap, honestly thats exactly what I was thinking. In the end, I'm making a game for people to play. Its their game. yes I wrote the code, but in the end it's the consumer game. They have the right to do whatever the hell they want with it. (as long as they pay for it tongue.png)

#5210001 What's the point of obfuscating managed code?

Posted by FantasyVII on 11 February 2015 - 05:46 AM

The act of obfuscation is not done on the original code in the source control section only done on the final build machine and never gets checked into your source control. The reasons behind it are that it is hard to find proprietary solutions to problems.


I dont think you should have any problems debugging because if you sync to the release label of your source code and just attach to the remote symbols, it should be able to match up with your actual source. It should in theory compile down into the same IL as nothing more than variable renaming has happened.


Yes, I know that my original source code does not change (as in my .cs files do not change). What I meant by remote debugging is when you output an exception to a Messagebox in C#, the exception will be obfuscated and hard to debug.


Here is an example:-

namespace Test
    class Program
        static int[] test;

        static void Main(string[] args)
            catch (Exception ex)


Here is the output of an obfuscated exe.



And here is the output of a non-obfuscated exe.


#5209968 What's the point of obfuscating managed code?

Posted by FantasyVII on 11 February 2015 - 03:54 AM



So I'm close to releasing my alpha version of my first commercial game to the public. So the question that rises now is whether or whether not to obfuscate my C# code? What are the benefits of obfuscating managed code? 


I feel like there is no point of obfuscating my code? Why do it? Why hide my source code from people? I'm already planning on releasing the source code after a year or so from the game release date.


The downside I'm seeing of obfuscating managed source code is,

  1. It will make it harder for me to debug errors and exceptions remotely.
  2. It will make it harder to mod the game.


So, Why obfuscating managed source code?


You know what they say, Sharing is caring ^_^

#5206886 Some programmers actually hate OOP languages? WHAT?!

Posted by FantasyVII on 27 January 2015 - 04:14 AM


Now I did not fully hear what he was saying, because I tuned in to the stream a bit late, so I missed the beginning of his talk.

Just as a small note, all the streams are archived on YouTube (usually it's up roughly a day after the stream is done):



If you miss parts of a stream or want to watch a particular episode again, they're all there.



Yah I know. But when he was talking about OOP he didn't start recording the video yet. It should be up on twitch past broadcast. I should re-watch that.




You know, this thread is an eye opener for me. Honestly just reading through the thread and all the links provided by you guys, I'm actually started to get anxious. Its like when I was a kid and some teacher starts screaming at me for doing something wrong, when I didn't know it was wrong, and instead of teaching me that this is the wrong way of doing things, they just keep screaming at me and telling me how stupid I am (probably not a good teacher to learn from him, but still).


After reading this thread, I'm honestly more scared to share my source code with the public than ever. Because I might be doing something stupid and someone will just come along and start bashing me for writing shit code. Problem is, I will never learn the right way to code from the wrong way if I don't share my code and no one explains it to me.


I don't know......

#5206827 Some programmers actually hate OOP languages? WHAT?!

Posted by FantasyVII on 26 January 2015 - 10:28 PM

Hello everyone,


So today I was watching this stream about making a games from scratch. And he was talking about OOP and how bad it is. Now I did not fully hear what he was saying, because I tuned in to the stream a bit late, so I missed the beginning of his talk. But from what I understood is that OOP is bad.


So I went ahead a Googled "object oriented programming languages is bad" and I was shocked that there are people who actually hate OOP. Now I'm not that experienced in programming. I graduated from college three years ago and I only have five years experience in programming. Its not a lot but I would say I'm an ok programmer. Now in all these five years of programming I have only used four programming languages, C#, Java, python and C++. My favourite one out of all four is C#. Its easy. It has a nice syntax and overall its served me well.


So my question is, How and why do some programmers think OOP is bad? and why do some say if you are using OOP you are a bad programmer? I don't understand since every language I have used is OOP based and that's what I was taught in college. It absolutely makes no sense to me.


I'm really confused. Can someone more experienced than me please explain?


Do these programmers hate OOP because of a genuine reason or is it like your grandpa when he would say "In my day we used to do so and so, but now you kids have it easy". is that it. I'm genuinely confused. 




for anyone who is interesed in hearing what Casey actually said about OOP here is the link. He starts talking about OOP at 12:00 min and then stops then starts againg at 18:45 min

#5142829 smoth fog of war

Posted by FantasyVII on 28 March 2014 - 06:43 AM

ok, thank you guys. that really helped.


I just have one more question. I want know how to implement the other type of fog of war. specifically this type:-






How is this implemented? does it use some kind of pixel shader?

#5052859 Shader Model 2.0 runs faster than 3.0 !

Posted by FantasyVII on 13 April 2013 - 12:01 PM

heh. silly me happy.png


In debug mode:-

SM 2.0 = ~125 FPS;

SM 3.0 = ~85 FPS;


In release mode:-

SM 2.0 = ~131 FPS

SM 3.0 = ~132 FPS

#5052623 Shader Model 2.0 runs faster than 3.0 !

Posted by FantasyVII on 12 April 2013 - 06:41 PM

Hello everyone,


So I been making a pixel shader lighting system in XNA with SM 3.0. I was getting around 70FPS with 4 lights. However when I changed the SM version in the fx file from 3.0 to 2.0, I got around 120FPS !!! Why?


obviously I can't use SM 2.0 because it's very limited with the amount of arithmetic that I can do. But why is it that SM 2.0 faster than 3.0? You would think 3.0 would run much much faster !!


Also in SM 3.0 I can have an array size of 15 elements. I can use all 15 lights and I get 70FPS. If i use 1 light I get 70FPS so it doesn't really matter. However when I set the array to 16 elements in the fx file my FPS drops to 10FPS !! even if I only use 1 light. why is that?!


struct Light
	float2 Position;
	float4 Color;
	float Radius;
	float Intensity;

Light lights[15];



#4982253 Convert 1D array to 2D array C#

Posted by FantasyVII on 21 September 2012 - 12:33 AM

Feel free to play around with this and learn how it works but this is a very basic example of writing and reading your map data from a file written in binary, I also wouldn't call myself an amazing programmer but this works.

	public class MapLocation
		public int TileNumber = 0;
		public bool Blocked = false; //if the tile itself is blocked
	public class MapManager
		MapLocation[,] MapData = new MapLocation[100, 100]; //create a 2d Array with our map class
		// ////////////////////////////////////////////////////////////////////////////////////////////////////////
		public int GetTileAtLocation(int X, int Y)
			//check bounds
			if (X < 0 || X > 100 || Y < 0 || Y > 100)
				return 0;
			else //its in bounds of our array
				return MapData[X, Y].TileNumber;
		// ////////////////////////////////////////////////////////////////////////////////////////////////////////
		public void SaveMap()
			using (FileStream stream = new FileStream("Map.dat", FileMode.Create))  //create our file
				using (BinaryWriter writer1 = new BinaryWriter(stream)) //create writer
					//write header
					writer1.Write(1000); //File Version increment this anytime you change data below
					for (int x = 0; x < 100; x++) //loop through all of our tiles
						for (int y = 0; y < 100; y++)
							writer1.Write(MapData[x,y].TileNumber); //write tile number
							writer1.Write(MapData[x,y].Blocked); //write blocked flag
		}//End SaveMap()
		// ////////////////////////////////////////////////////////////////////////////////////////////////////////
		public void LoadMap()
			if (!File.Exists("Map.dat"))
				//file does not exist return
				Console.Write("File Does not Exist\n");

			using (FileStream stream = new FileStream("Map.dat", FileMode.Open))
				using (BinaryReader reader = new BinaryReader(stream))
					//Read Header
					int ThisFileVersion = reader.ReadInt32(); //pull our version from the file and make sure it matches what we think we are reading
					//Check our file version
					if (ThisFileVersion != 1000)
						Console.Write("Exp File Version Mismatch\n");
					for (int x = 0; x < 100; x++) //loop through all of our tiles
						for (int y = 0; y < 100; y++)
							MapData[x,y].TileNumber = reader.ReadInt32();
							MapData[x,y].Blocked = reader.ReadBoolean();
		}//end LoadMap()

	}//end MapManager

I assume the save method will produce this file in binary:
0false 1false 2true 3false 2true

anyways your code looks really good and believe it or not I learned 2 thing by looking at your good.

1- what and how and when to use "using" statement.
2- garbage collection. Posted Image

The reason I want my Map File to look like this is because it easier to place tiles according to the file:-


so I would do something like this

MapX = 100, MapY = 100;
TileX = 32, TileY = 32;

int[,] map = new int[100, 100];

GrassID = 1;
StoneID = 2;

			for (int x = 0; x < MapX; x++)
				for (int y = 0; y < MapY; y++)
					TilePosition.X = (float)x * TileX;
					TilePosition.Y = (float)y * TileY;

					if (map[y, x] == this.GrassID)
						spriteBatch.Draw(this.GrassTile, TilePosition + ScreenScroll.ScreenOffset, Color.White);

					if (map[y, x] == this.StoneID)
						spriteBatch.Draw(this.StoneTile, TilePosition + ScreenScroll.ScreenOffset, Color.White);

so if there is number 1 in the array it will take it position which lets say will be at map[1, 2]. so 1*32 = 32 and 2*32 = 64. So the tile will be placed at position(32, 64).

anyways I like your code and I'll actually use some parts of it to put in my code.

Thank you very much :)