Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 27 Nov 2012
Offline Last Active Oct 31 2014 01:53 PM

#5107398 Need a good 2D graphics program

Posted by on 06 November 2013 - 05:00 AM

If you are looking for a grid based tool, PyxelEdit is pretty nice. It is still in beta, I believe, so the tools may vary in perfection, but it's pretty nice with automatic tiling and you can also create animations in it. It's a single developer developing the tool and from my experience he is really quick and helpful when asking for help in the forums. He also takes suggestions on new tools to implement or feedback on older tools.

The program costs $8 dollars minimum, totally worth it. Check the videos hereand decide if this is something you need. I recommend it.

#5095893 C++ DirectX 11 Problems

Posted by on 22 September 2013 - 02:50 AM


Well, there is a difference in how you set up the Direct3D device between DX10 and DX11. In DX11 they have split the device up into device and deviceContext so the set up is slightly different. Are you 100 % sure that you have done it correctly? Which Graphics Card do you have?

Yes, I'm 100% sure. I downloaded the VC++ project from Microsoft and directly opened it in VC++ 2010 Express. And I have some P.O.S. Intel HD Graphics Family card.


Here is a link to the different cards from Intel and what DirectX versions they support. Find out exactly which one you have and know for sure.


#5086873 C++ EXERCISE HELP (pancake challenge)

Posted by on 17 August 2013 - 03:47 PM

for(int index = 0; index < 10; index++)
tempA = person[index];
tempB = person[index + 1];

if(tempA > tempB)
highest = tempA; 

cout << highest << " was the most pancakes eaten\n"; // i need to some how edit this line to print out who ate the most

So this part is troublesome. When the for-loop hits the final index, i.e 9, your tempB variable will attempt to gain access to person[10] which would mean that you will try to access the 11th(arrays goes from index 0-9!) index of the array. Since you are looping through 10 iterations I'm assuming that person[] is 10 in size, which would mean that the 10th index is out of bounds thus crashing your application.

I'm assuming that person[] is an int array, otherwise highest would not be able to be given tempA value. First of all I would make the person array an array of playerInfo structs, but rename it a bit like the post before me suggested:

struct PancakeEater
    std::string name;
    int nrOfPancakes;

PancakeEater persons[10];

// fill PancakeEater with the correct data.

int highestIndex = 0; // Now this will be the index on which the person with most pancakes eaten would be at.
int mostPancakes = 0; // This will store the amount of pancakes eaten, only used for comparison reasons.

for(int index=0; index<10; index++)
    if(persons[index].nrofPancakes> mostPancakes)
      highestIndex = index; //This will store on what index the pancake eater with most pancakes is located in the persons array.
      mostPancakes = persons[index].nrOfPancakes; // store the new highest amount of pancakes eaten.


cout << persons[highestIndex].nrOfPancakes<< " was the most pancakes eaten\n and was done by " << persons[highestIndex].name;

Note that it's very late for me, and that this code won't work completely copied. This is also not the best naming convention or the most good looking way to do it, but it doesn't seem like that is your major concern at the moment. I gave you the essential stuff here, hopefully this will help you complete the task. Good luck! smile.png

#5066672 Starting out with graphics

Posted by on 01 June 2013 - 08:28 AM

I think frob summarized everything well. If you would like to learn about DirectX and/or OpenGL this guy is presenting easy-to-digest-tutorials in my opinion: http://www.rastertek.com/tutindex.html 


I've followed these a few times myself and there haven't been a problem at all so far. The tutorials are built upon each other so you are wise to start at the very first lesson ^^! Good luck

#5064380 Getting started with C++

Posted by on 24 May 2013 - 12:52 AM

As previously said DirectX and OpenGL are not 2D libraries even if they can be used to for 2D rendering. SFML is something I've worked with, but only during 2 months or so. Me and some friends did a 2D game with it in college last autumn and it was pretty easy to work with. On the other hand I've programmed C++ for 3 years prior to this, so dunno how well you can code and if you can manage SFML.

When I started my first year in college we instantly started with C++ and after 6 months or so we were introduced to a 2D engine called HGE. We used that to make a simple(very simple) game for mobiles. It was 3 years ago so I'm not sure how I would feel about HGE now when I know a lot more, but I remember HGE being pretty easy to use - even as a beginner. But then again, programming was generally confusing at that time so maybe HGE isn't good at all ^^!

Might be worth checking up on, though. If HGE turns out to be too confusing I would really recommend SFML due to its helpful community and its broad usage.

HGE: http://hge.relishgames.com/ There are some example games posted on this link as well, might be interesting to check them out as well.


Good luck coding! biggrin.png

#5012424 Calculating prime numbers with memoization

Posted by on 19 December 2012 - 07:19 AM

I'm not entirely sure what's going on in the loops, but break will simply terminate that for-loop and jump back to the first one. So this is a performance gain since isPrime is set to false the first time you get into that if-statement. You don't need to continue that for-loop. So you will gain all those checks against the if-statement that are left to do once isPrime is false.

I might be wrong though ^^

#5012422 a few questions

Posted by on 19 December 2012 - 07:14 AM

I'm not going to answer any questions you had, since I don't know the possibilities of java that well and everything else I had to say was already said in previous posts.

What I am going to say though is that I think you should NOT look at any tutorials when making those simpler games. What I experience, as a 3 ½ year into college of C++, is a problem when I code projects is that I have a hard time breaking up the system. Making those smaller games from scratch by yourself will expand your mind when it comes to designing(which is really damn important).

These smaller games are a great practice of trying to split huge problems down into smaller ones and to start learning simple design. I would start by identifying everything the game has to offer. Starting with the features, such as eating pills, controlling a player, being attacked by enemies, running around in a maze etc. Then I would try to identify what I need to make this happen, for instance: Rendering in 2D, input with keyboard, collision detection to name a few.

Then I would try to think of how these systems should be connected. Every problem I bump into I will write down, think about for a while and If I can't see the solution myself I would go online and see where I can get some pointers.

To reach your goal of that MMORPG game, you really need to design it well. You won't get very far by just coding, so don't underestimate the design part.

Hope I was of any use ^^ make sure to show us your progress! :D

#5011996 Finding float elements have the same value in an array

Posted by on 18 December 2012 - 05:39 AM

Hmm, I would do this in three steps, I think.

In the first step I would create an int array to store all the indexes for each value in the float array and create an exact copy of the float array(assuming you still want it to be intact and have the values not being moved around).

I would then implement some sorting algorithm(which one I decide to use depends on the amount of numbers and how important the efficiency is required to be). This algorithm will then sort from smallest to largest in my copy of the float array and at the same time swap the corresponding value in the int array I created.

When this is all done my copy of floats will store its values from smallest to largest and my int array will have the indexes of these values corresponding to their initial value in the original float array. Then I would need to check the first element in my copy and compare it to the next element. If they are not the same I would stop checking that first element since the array will be stored in order of size. If the next element isn't the same size then there are no values that are the same size as this one. I would then continue with the next element.


1. Create a float array which will be a copy of your float array to check. Also create an int array to store the indexes of the float array. This int array will simply have 1,2,3,4,5 etc. The use of the int array will come when sorting the float array.

2. Implement a sorting algorithm to sort the copy of the float array by size. Move their corresponding index value in the int array. Example: number 38.2 is on index 3. 38.2 is the lowest number generated. Move the number 38.2 to position float array[0] in your copy. Move the value 3 to position int array[0] in the int array.

3. Go through each index in your sorted array and compare it to the element next in that array. If that value is not equal then your element does not appear more than once in your array. Go to the next element, i.e element [1]. Compare it against element [2] and if they are the same, then do what ever you are supposed to do if there are more than one of an element. In the int array at position [2] the value of its corresponding index in the original float array will be listed.

Note: This is a solution on top of my head and is quite a lot of work ^^ There are probably several other efficient ways of doing this, but this is the first solution that came to mind.

#5010237 I feel paranoid about taking programming/CS classes

Posted by on 13 December 2012 - 08:58 AM

Well, the way I see it you can't do worse than last time, right? Even if you know it felt horrible and you were all depressed, you still moved on afterwards, right? Otherwise you wouldn't consider doing the course again.

I've been studying at a university for 3 ½ years now, and I can tell you that I have failed a lot of courses. A lot. All I need to do is buckle up, retake the course with the mindset that it can't be worse than failing again. Since I already can handle the failure, since I've failed before, retaking the course will only make it a better experience than last time.

Go for it, there are plenty of times in life where you will fail and have to try again, and again, and again and maybe even again until you finally are successful.

#5006249 Best language to start programming in?

Posted by on 02 December 2012 - 03:49 AM

It depends on what kind of games you are set out to do. I like C++ and started without programming experience. On the other hand I study programming, but still ^^. C++ is one of the widely used programming languages when it comes to triple A games. On the other hand C, C# and C++ are quite similar and once you know one of them transitioning into another isn't hard.

I would recommend C++, good luck!

#5006092 Could Not initialize Direct3D

Posted by on 01 December 2012 - 03:03 PM

I've also done a few tutorials on that site and if your card can't support DX11 that error message will show up. You can go pass this by changing to your CPU to take care of the graphics, but this will lower your fps to like 0.1/s and it will take a lot of time to start the project. But it works.

result = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, &featureLevel, 1,
D3D11_SDK_VERSION, &swapChainDesc, &m_swapChain, &m_device, NULL, &m_deviceContext);

To change to run it on the CPU instead you change this part



so it will be like this: result = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, 0, &featureLevel, 1,
D3D11_SDK_VERSION, &swapChainDesc, &m_swapChain, &m_device, NULL, &m_deviceContext);

This should fix your problem. If it doesn't work then there is something else in your code that isn't working, but I'm pretty sure this will fix it since me and a friend did a project together on one computer that didn't support DX11 and thus had to do this change.

Hope it works, gl! :D

#5005691 Game states?

Posted by on 30 November 2012 - 08:13 AM

Several game states:

Well, a game state should hold all the game logic. The way you COULD do this is to have game state with sub states that are called like level1State, level2State etc. The problem here is that when doing level transitions I'm guessing you'd like something like "Now entering level 2" or something, and that is more like a menu state and when entering that state you will remove the game state which could cause problems. There are probably several ways to get around this as well, but I can't really think of one on the top of my head^^

One game state:

I guess you need something that indicates that you would load the next level. As you said, you don't want to load all levels at once. I can't really see what the problem here is since you just need to divide the logic on what to load and what to not load depending on what level the player is at. I'm just brain storming here, but you could have a class for each level and just create instances for each level when needed, I guess ^^

I'm not that good at programming and haven't used states yet, even if I know the basics concerning it.

Hope I was of any help ^^!

#5005638 self taught programmer, becoming more well rounded and earning some money to...

Posted by on 30 November 2012 - 03:17 AM

Hi there, I read your entire post and I will give you some of my thoughts. It's important for you to understand that I have no working experience and in programming skills I would place myself at your level - but with C++ and 3D programming. Java and its market is beyond my experience, except for a few small projects in freshman year of my 5 year long education(I'm currently 3 ½ year in).

A few weeks ago we had field trips to some game studios. Like...big ones, who have done work on Farcry 3 and Assassin's Creed. Both these studios said that grades are pretty much useless when it comes looking for work. They don't care. They don't care what you SAY you can do. They care about what you've already done and can show them. This is the only thing they are looking for. I can imagine that the java market might be a bit more flexible when it comes to this since games for smartphones and browsers and whatnot have pretty much exploded these last few years. I still think that your portfolio will be the most important tool you can have when applying for work.

That said, I think you should try to make different kinds of projects - from start to end. Unfinished work is not of use to anyone. Make an app, it can be pretty much anything. It doesn't have to be super unique you only want to show off your skills. And your indie game? That is a great idea, with one flaw; Don't aim to make money off of it. Relying on making money of your indie game when you have no marketing skills( I assume) and none to assist with graphics is too much of a long shot, in my opinion. However, making a playable, interesting game that actually works will be an incredible addition to your portfolio -it will also be a lot of fun.

Another thing I've noticed is that a lot of studios are using, at least when it comes to games, a development method called SCRUM or KANBAN. In fact, a lot of game studios demands that you have read a course in either of them. Not sure how it is in the java world or outside my own country, to be honest. I really think you should look into it, at least read up on it on wikipedia if you don't already know what it's about.

To sum it up: Make projects from start to finish. No matter what kind of projects they are, working projects are always good to present. Try to make a few different projects, like an indie game, an app(maybe for your indie game even) and something else. I'm not really familiar what can be done in java since I only use C++. Build your portfolio, it's a great way to start.

Hopefully I was of assistance and if you need someone to help you with ideas for games or apps or w/e feel free to pm me. And, again, I haven't seen the outside world yet, I'm still in college so I haven't yet applied for work, but every teacher and every developer I know says that grades are useless and that every employer wants to see what you've actually done.

Good luck!

#5005348 DirectX11 2D Book

Posted by on 29 November 2012 - 10:26 AM

As other people already pointed out Spritebatch in DirectX 11 looks pretty nice. Unfortunately I haven't tried it yet, but it looks really neat. Here is some simple documentation, i didn't look too much into it, but it seems fairly simple and there are some further reading in it as well(which I haven't read).


Hopefully this can be of any help. If you do anything nice I would love to see the result as well!