Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

244 Neutral

About Toadhead

  • Rank
  1. Toadhead

    Unmaintainable code

    Wow theres one hell of an if statement in there:   if(((((findLengthfast(&rotatetarget)>150&&(i!=0&&k!=0))||(findLengthfast(&rotatetarget)>50&&player[0].rabbitkickragdoll/*currentanimation==rabbitkickanim*/&&(i==0||k==0)))&&normaldotproduct(rotatetarget,player[k].coords-player[i].coords)>0)&&((i==0||k==0)||((player[i].skeleton.oldfree==1&&k!=0&&animation[player[k].currentanimation].attack==neutral)||(player[k].skeleton.oldfree==1&&i!=0&&animation[player[i].currentanimation].attack==neutral)||(player[i].isFlip()&&!player[i].skeleton.oldfree&&(i==0||k==0))||(player[k].isFlip()&&!player[k].skeleton.oldfree&&(i==0||k==0))||(i==0||k==0))))||((player[i].targetanimation==jumpupanim||player[i].targetanimation==jumpdownanim||player[i].isFlip())&&(player[k].targetanimation==jumpupanim||player[k].targetanimation==jumpdownanim||player[k].isFlip())&&(i==0||k==0)&&(!player[i].skeleton.oldfree&&!player[k].skeleton.oldfree)))
  2. Toadhead

    loop break

    I love it! What does it do?
  3. Toadhead

    Applications vs. Webapps

    Biggest advantage for native apps is higher speed, read this for instance: In addition, not all native (advanced) features are availible to webapps.   Another reason for choosing native apps is that it will get some free promotion from the Google Play/App store. If you build an webapp youll need to do your own advertising. The advertising itself will be easier for a webapp however and with the large amount of applications in the app stores your native app will most likely get only a slight attention the first day when it appears in the 'new apps' category.   There are pros and cons for each, ultimately you might just want to write 3/4 apps: webapp, android and ios (and perhaps windows) This depends on the succes of your app.
  4. Toadhead

    Game state management (C++)

    Yeah you are right, guess I'll have to make a couple of small changes to my code. I want it to work as easy as possible, implementing a new state at this moment only requires me to have new code files for the state, but guess ill just need to implement some kind of enumeration somewhere that has all possible states.
  5. Hi guys,   My gamestate management uses classes (gamestates) with a init(), run() and close() function, When Changestate(state) gets run, it closes the old state, inits the new one and runs it.   Here is my problem, whenever I use Changestate() in my current state, e.g. someone presses the "Game Menu" button so Changestate(gamemenu) is called, it still has to finish the old state. For instance take this example:   //some gamestate remove_old_gamestate()   while(running) { update(); draw(); }   update() { if(button.pressed()) { ChangeState(menu); } }   The Changestate() makes a copy of the old gamestate (which will be removed using remove_old_gamestate() later, and inits the new one. This is not very efficient as in this period the game needs about double the memory (old one is not closed down yet, new one is already initialized). However it is nessacary, because using "currentstate->close(); delete currentstate; currentstate = newstate" does not work, as soon as the ChangeState() function is over, the call stack goes back to where it was called: the old gamestate, and the draw function still has to be called, in a state already closed/deleted. I dont understand how I can overcome this problem without using gotos (which I prefer not to use). Anyone has an idea?  
  6. Toadhead

    Never Team Up with the Idea Guy

    The three guys in the social network had a great innovative idea, which is much more special and worth much more then knowing how to code. Mark basicly just stole their idea/project to fill his own pockets. You can be the best programmer in the world, but if you have no inspiration and cannot come up with a good programming idea, you will never become succesfull.
  7. Toadhead

    future game development

    You should start by defining what you actually want to achieve, as soon as you have this clear you can ask more specific questions. For instance, do you want to produce apps for the iPhone? In that case Objective C is the way to go and I would advice to get yourself a mac and use Apple's tools for the production. For Android, Java is the way to go and Eclipse is a good tool (IDE) to use. For Windows/Linux programming, I would advice to start with something like Python and perhaps move on to C/C++ later on. If you want to focus purely on Windows and especially applications and not games, I think C# is by far the best choice for a language in combination with the excellent Visual Studio IDE.   Although these are rough generalisations and are open for debate (better not :) ), I just want to point out there is no such thing a 'the' best language or tool. It totaly depends on your requirements.
  8. Toadhead

    Pointer to an abstract class

    You cannot produce an 'abstract object' at all, abstract classes are used for inheritance, as interface for a concrete class derived from it. If Object and Goods are in fact not abstract, just use 'Target = new Goods()' and 'Actor = new Objects()' into the constructor or something if thats what you want (although I would probably just use static objects by deleting the asterisk if thats your plan).
  9. Toadhead

    Simple MORPG project planning

    Well I voted you up KnolanCross, simply because I don't think you deserve negative points. I too think Python isn't the right choice for a project like this. I'm not saying it cannot be done, but I simply think there are better alternatives. Although I would not advice him to use C++ either. Why not using C# for both server and cient? Its easy to learn and it makes interaction with the C# client easier too.   I think it will increase productivity and performance in the end. Just download Visual studio 2012 express and play around with the language. I think on a project of this scale it really doesn't hurt to spend some extra time figuring out the alternatives, you can easily learn the basics of C# within a couple of hours. If you really mastered the Python language it might be a different issue, but my intuition tells me its not like you're using it for years too. It never hurts to learn and use a new language in my opinion, and if it doesn't work out you can always drop it and go back to Python.
  10. Toadhead

    I want to make a 2D game engine! Where do I start?

    I don't think a beginner is really considering all kinds of low-level stuff when he talks about a game engine. And telling him to just code the game without thinking of the engine, might let them think they should rush into programming the game logic and skipping a good game design. But I tend to agree to most points of the last posts here and in the end it might actually be a good thing if you let the beginning programmers find out their code is not re-usable, so they can learn from their mistakes :)
  11. Toadhead

    I want to make a 2D game engine! Where do I start?

    Servants post very cleary states the opinion of most people here: make a game not an engine. Although I agree with most of its points, I personally think it is a good idea to start with the engine.   The question to ask yourself is; what is an engine? I like Servants definition; reusable components fromt the game. Although everyone has its own programming style, I personally don't think you should start with the game logic of the game without getting any visual output. I like to start setting up the core components in order to draw a screen, implement all input/visual/audio APIs in an easy to use manner, setting up a basic gamestate system, entity manager incl. messaging etc. etc. I think this is actually a good programming behaviour, start by making a planning and design of what you actually need for your game. For instance in the first game you make you could decide to leave out the audio and you could just use if-statements for handling the gamestates.   Later one when you make another game, you can then re-use these core components of your game for the next game, while slowly introducing something new (if you feel that you actually need it or makes development easier), such as a scripting language. If you implemented something in the engine and you don't need it for the next game, you can just leave out these code files.   I got the same advice when I started: make a game not an engine. But after finishing a couple of games I felt like I realy couldn't re-use much of my code. Mostly because I thought things weren't done efficiently or weren't easy to use. At that point I started doing things the way I described above, using carefull design and starting from the ground up and now I can just use this framework I made and start coding the game almost right away.   So to summarize my advice: spend some time making a good design, if you write a very good reusable piece of code it'll safe time in the end by avoiding having to recode everything again. But don't try to implement all kinds of features you're not going to use in the current game, you can easily implement those features as soon as you write the game you'll need it in.
  12. Ok thanks guys, guess I'll just play around with the C API and if I feel I need more I'll go to these wrappers. And I know I can staticly link to Lua but I prefer dynamic, especialy since its very unlikely that I will ever need to change the source code.
  13. Took me some time to find it out, but it turned out I had to write  "#define LUA_BUILD_AS_DLL", this also produces the import *.lib file along with the *.dll. I don't think this was mentioned in the manual, at least not easy to find.   About the wrappers, still no good answer. I think most of the wrappers such as tolua and Luabind were last updated in around 2010, not sure if they support lua 5.2 and/or if these projects are dead, but in general I dislike to be dependent on too much third parties. I'll just see how far I get with Lua C API alone and if i need more I'll take a look at them.
  14. Hello guys,   I was just wondering, I downloaded the newest source files, compiled them and ended up with a .dll file and the compiler and intepreter .exe files. But don't I also need a .lib file to link with my program? (as right now I'm getting linking errors when compiling example files). If so, how do I obtain this .lib file from the source? I am using Visual studio 2012 (btw I know I could just download the binaries).   Second, I was wondering why people use the LuaBind or other wrappers, the buildin C API seems quite easy to use, what are the advantages of using these third party wrappers? Wouldn't it give trouble with newer versions of Lua? (having to wait til these wrappers update as well).   Kinds regards, Rob  
  15. Toadhead

    Help make the MMO game engine c + +

    I think taking some English lessons would really help you if you want to become a better programmer. And if you really know C++ that well, well enough to build an MMO game engine, you would know where to start. That aside, heres a general strategy you should take: Start building some text based games, move on to graphic games such as tetris, move to more advanced games, start looking into network programming, learn some extra programming languages such as C# for quick development of map editors and other tools, at that point you should have a general idea about what a MMO engine would look like and you can start thinking again about building a MMO game engine and whether you really want to invest years of development and/or lots of money on this project. Good luck!
  • 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!