• Advertisement

McGrane

GDNet+ Basic
  • Content count

    210
  • Joined

  • Last visited

Community Reputation

1745 Excellent

About McGrane

  • Rank
    Member

Personal Information

  • Interests
    Programming
  1. Rip internet 2017-12-14

    They tried to bring in a water charge in Ireland in the last year or two inline with EU regulations, and are now currently refunding the minority of people who paid bills as a mass boycott ensued- I could imagine the backlash of something similar happening in this case. I'm pretty sure the EU has regulated for net neutrality in some form here any way- so ive no real concern of this happening anytime soon in Europe. I admittedly haven't been following this too much, as it doesn't really affect me, but the impression im getting is that no one in the public wishes for this to happen, but yet the government are going to do it anyway, regardless of all the protesting.. It seems to be public corruption, that no one seems to be able to stop, which is worrying. Maybe it will backfire, and will open competition - I could only image if one company started advertising services where they would not throttle connections etc. they would suck up customers- and then to stay competitive, the other ISP's would have to follow suit- but from the comments above, it doesnt look like there is much choice in ISP's around America- maybe this will also change
  2. Yeah, so in the above, you are creating a shader- and then telling opengl to use this shader: glUseProgram(shaderProgram); If you wish to use another shader, you do the same as you have done above in creating, compiling and linking another shader. You may want to extend your above to read shaders from text files instead of implementing them in code, and maybe making a shader class to encapsulate all these methods to just make it easier for maintainability. However to just get this working as is, say you have two shaders, and have compiled the into shaderProgram1 and shaderProgram2 then too use them you could just do something like: If you haven't already, check out https://learnopengl.com/ there are sections on shaders, and code examples for how he has set up his shader classes - along with alot of other great information
  3. Without seeing how you are currently doing it, I can only really give a generic example, but you basically just want to create all your shaders, select the shader you wish to use - render all items that use this shader, switch to the next shader, render all items that use that shader, and so on Switching shaders can be expensive, so thats why you will want to do all items for each shader before moving to the next, rather then switching shaders depending on what your rendering at the time. If you can show a small bit of code of how you are currently doing this, im sure you will get more specific anwers
  4. Tilemap rendering 2D RPG

    You should assign your indexer to an int, and step through it to ensure it is getting what you expect, there isint much information in what you showed - but i suspect its your m_layerColumns id suspect that this is accessing the wrong value, depending on what its value actually is ( isint shown )
  5. Tilemap rendering 2D RPG

    As Endurion mentioned, the problem lies in your index: Once you move your tileX or tileY - it goes out of bounds. You should maybe instead use something like: for (int y = 0; y < m_layerRows; y++) { for (int x = 0; x < m_layerColumns; x++) { tileValue = m_tileMap[(y * m_layerColumns) + x]; ... } } And use another method to translate your map, maybe even something like: m_sourceRectangle.left = (int)(m_currentDrawPosition.x + (long)((tileValue % textureColumns) * m_tileDimensions.x); Im not sure what you are using to do your rendering, but if its opengl or directx or using shaders, maybe just use the modelview to translate the whole map. Id get a whole map working and moving as you want first, and then maybe think of optimizing it to only display the parts you want when you need to, it may never come up Also apologizes if i just misunderstood what you wanted, i honestly just had a min to scan over the code
  6. Favourite cocktails?

    Just from an Irish perspective i couldn't help but comment - This is the first time I have ever seen someone say they enjoy canned Guinness Don't get me wrong, I love a pint of Guinness, but the cans just don't compare ( in my opinion ), they have tried a few ways, including the draught cans, but I never thought they came close. The shelves are full of them here, as they don't sell well. *Rant over* As far as cocktails, no real favorite, ill try them all once - or maybe twice
  7. deleted

    Getting closer - the reason it is not red, and/or other issues you may see may be due to your error handling. As you mentioned, you are seeing a linker error, but you are not doing anything but outputting the error, and then carrying on, this could be cascading the problem to the next shader, and causing unknown issues. The easiest way to handle this is to turn your compileShaders method into a boolean method, and return false once an error is detected (after outputting your error somewhere) - this way your program will stop at the stage it fails, rather then going on to do whatever craziness it might do after a section fails.. A shader failure is not something you really need to try to recover from, as if its incorrect its incorrect- you fix it, recompile, and hopefully it will move onto the next shader, and you fix it then and so on.. If you havent already, check out https://learnopengl.com/ Its a great resource for getting you up and going in opengl, and is quite easy to follow, unlike alot of the opengl tutorials out there
  8. deleted

    Apologies, you are correct, i had said 12x rather then 9x. Are you getting any warnings in your code, I would expect the returning of the address shown below would cause a warning: You are returning the address of a local variable, which may also cause an issue, in this case you could just return what the value actually is. Maybe just step through your program and see what you get for your shader ID's VAO etc. when you generate them, and compare them when they are later called, for example with the above mentioned, see if the below is what is expected
  9. deleted

    Just on this, although it appears correct, when you pass an array like this, you are passing a pointer to its first element, if you check the sizeof function, it will say the size of your array is only 4 bytes so when you pass your array using glBufferData, you are saying to pass the 4 bytes. Your coordinates array is 12 floats - which is 12 x 4 bytes = 48 bytes. So you are not sending the whole array
  10. deleted

    At a very quick glance over you code, I suspect this is an issue (there may be more), you appear to be passing in the sizeof( pointer ) - what you need here is the size of the array you are passing in - so something like sizeof(float)*countVertices If the above doesnt help, maybe just add some error checks to ensure that your shaders are compiling and linking as expected- I know you dont want to add error checks yet, but maybe just start with these
  11. I have my doubts that anyone is going to download ( im not going to download some random zip file from a forum ) and fix your code for you considering you haven't said what the problem is, how you attempted to fix it, or what part you don't understand / is broken. Its a huge time investment considering you haven't invested the time in explaining the problem Maybe put your code on github or something similar that someone can just browse to safely, and explain your problem in more depth, and you are more likely to get help in my opinion
  12. 2D The missing triangle.

    I know the article you referenced mentions that they wish to use Xwindow and makes points of how easy it is, but could I just suggest you use something like glfw if your main aim is to just do graphics programming - and once you get used to it you could switch back to X if you wish. Your above code also seems to mix legacy OpenGL and modern opengl quite a bit, and commenting on what parts are wrong would take more time then i have at the minute, can i suggest reading through learnopengl.com It is a great starting point and talks through most if not all issues you are seeing - even if you want to get your own program running and carry on with those tutorials - just have a look at the hello triangle page, and it will show you how to correctly set up your buffers and render to the screen
  13. My first post was probably something similar, although Ive never had much interest in MMO RPGs, it was probably a FPS or something along those lines. The same advice would have been given to me, and I also just shrugged my shoulders at the people, we all probably have. I'm not discouraging you. I, like most people here would like you to prove me wrong. I think when we all start we all have a little bit of a Expert Beginner complex. When i do see posts like yours, i always see them with a little fondness and nostalgia as like most of us its where my journey in gamedev started. The point of doing smaller projects is that you will learn these concepts quicker, and then build up to larger projects. Your code is like lego, you can reuse pieces and blocks of code in your project, but you need a strong base if you want to build something huge - its harder to go back and fix it after you realize the design was wrong from the start. This is all off topic from the original question, so I'm going to leave it at that and wish you all the best with your game.
  14. Im not sure its really discouragment, Once you are on these fourms long enough, even a few weeks, you will see a lot of people (weekly/monthly) who all have the same post, "I want to make an MMO RPG". People advise against this, and thats because it is a mammoth task, it could take 20/30 people years to make this type of game, and as 1 person you could be 20/30 years. While it is good to use something you are interested in to learn, what happens 99% percent of the time you will hit a road block, and become very discouraged very quickly, and a lot of people give up. Its not out of malice that people tell you not to do this, its from personal experience, and its echod here on a daily basis by professional people who work in the gaming industry. The advantage of doing smaller projects first, is that you hit more of these problems early on, and learn from them. When your touching on so many systems of an MMO RPG, its easy to just jump to some other part when you get stuck at something, you could spend weeks avoiding problems that you may already learn how to fix doing smaller projects. I respect the drive and willingness to learn and not give up, but to see your looking at server code, while in another post wasnt sure about what try{}catch{} are, and a few other posts about not understanding some language basics, Id compare this to learning to walk before you run, but an MMO RPG is more like several back to back marathons. I agree with the above, learn what you can on RPG maker, and when/if you outgrow it move on to the next stage. You will be more likely to stick with a project as long as you can see progress. And learn from your mistakes. Make as many as possible, The more mistakes you make, the more you will learn as to why they where mistakes
  15. Picking a real-time strategy engine

    I personally think that an RTS game would be quite a huge undertaken for you to take on, as a person who knows how to program, let alone for someone so young. Im not saying not to go for it, but maybe just start off on something smaller, and a little easier to keep interest levels up. I think rather then using a RTS engine like spring, you should look into using something like Unreal/Unity. They will show results quickly, and keep things more interesting, plus there are hundreds of tutorials etc for them, and will get usable experience for any other projects you may choose to do, 2d platformers/3d/whatever. Just even google unity/unreal RTS and you will see tutorials already available to help things along
  • Advertisement