C++ isn't my strength, but I don't see anywhere where you update the position of the rectangle on the sprite sheet. I'm assuming that you intend to do that in your moveTextureRect functions, where you update the Player's position but then set the textureRect for playerSprite with the playerRect object, which never changes.
KhaiyMember Since 27 Jan 2010
Offline Last Active Yesterday, 04:54 PM
- Group Crossbones+
- Active Posts 851
- Profile Views 9,327
- Submitted Links 0
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
Posted by Khaiy on 11 January 2016 - 04:59 PM
I'm always a fan of basic (linear) dungeon crawlers, text based with menu style actions rather than an input parser. Though, if your problem in the past has been with finishing projects it might be better to go with kseh's suggestion of Blackjack where feature creep will be less likely.
Posted by Khaiy on 15 October 2015 - 10:15 PM
I think you are on the right track, but might be overdoing it on creating classes.
For the menu situation, a common approach is to have a high-level class called "Game" or something similar with a member variable to represent the game's state, called, say, "State". The game state would be represented by a class with public methods for whatever data needs to be passed from the state to Game, along the lines of a Draw() method that renders things onto the screen. So you have an instance of State called MainMenu, which has the code for the start button, and when the player clicks on that button the Game class (or another class, depending on your design) swaps out the MainMenu state for the next state (maybe "Playing", or whatever). The Game class keeps working along in the same way, for example calling currentState.Draw(), and your current state handles itself.
For input you see something similar. You have a class that receives input by listening for key presses, mouse clicks, reads the mouse cursor position, and so on, with switch statements, sets of if-else statements, or some more exotic arrangement. This class would also be a member of a high-level class, like Game. That input then gets passed into whatever the current state is, and logic inside of the state class' definition decides what to do with it. In general you probably won't want a lot of classes for this but instead have specific classes implement logic so that they have the behaviors you want.
For example, say your input listener notes that the D key is pressed, and passes along that information to currentState. If currentState == MainMenu, and the main menu doesn't respond to the D key, then nothing happens. If currentState == Playing, and the D key moves the player to the right, then the state passes the key press on to the PlayerCharacter object. The PlayerCharacter object then responds, maybe by checking if moving to the right is valid and if so, updating the PlayerCharacter's currentPosition variable accordingly as well as setting the PlayerCharacter's own state variable to "movingRight". Code within PlayerCharacter notes that movingRight == true, and implements the animation for moving to the right for as long as that is the case.
I hope that got at your question and makes sense.
Posted by Khaiy on 05 October 2015 - 08:58 PM
I don't know how much programming experience you have, but I'll suggest that before you start planning out a city and filling it with things you try a single room. Then implement some of the things you'd like to simulate, like interacting with another person in the room. After that add a second room, and implement the features that multiple rooms would require, like the ability to move between them, update a room while the player is not there, etc.
It's amazing how many design steps you can miss when you start with content in a type of program you haven't written before. I've been amazed by it in my own projects.
If you are going to stick with the design as you've laid it out (and for all I know you already have all the details planned for how everything will fit together), it may be better to use a more general Location class as Dragoncar suggested. But your needs and style will inform the specific design approach you use, and there is always more than one way to accomplish a programming task. The right way is a way that works, and you can refine things after the basics are running.
Posted by Khaiy on 14 June 2015 - 05:03 PM
I tried asking questions on other websites on what tools/books I should learn to get the job done, and I was asking for advice to see if there's a more efficient way to creating my game, such as if one language makes things more efficient. (In terms of less bugs, runs faster or w.e else an educated person would know about.)
For a beginner, this question is basically meaningless. The sorts of issues you're describing just won't come up until you're far more experienced. For example, C++ has an internet reputation as one of the "faster" languages, and while that may be true in some circumstances you won't be dealing with a code scenario where that will come up for a long time, nor will you be able to take advantage of what C++ offers in that dimension. By far the best answer for someone starting out is what you describe-- you just need to pick one and get working.
Is game development really that simple as, I read a book on a language and I get straight to making my ideal game just like that?
It's that simple in the sense that coronary bypass surgery is just removing a clogged tube and replacing it with another tube. Actually doing it is harder than that description may suggest.
If I take peoples advice I might run into a problem that might make me scrap my whole game or remake everything all over again because of a single issue.
You might run into a crippling problem no matter what you do. If you could predict that sort of thing right now you wouldn't be a beginner. In ten years' time you might be able to make very good, nuanced choices about this sort of thing, but you'll develop that skill as a result of overcoming challenges between then and now. There is no path to programming games that is straightforward, easy, and has no risks of issues down the line.
Is it really a bad idea for me to post my game idea, then ask people what languages/tools they recommend I learn about to get the job done?
Because I asked this question on many sites and never had a single suggestion.
The real answer is the same as what you say you've gotten elsewhere-- it doesn't matter much what you choose, because most languages can do what you want. If you just have to have a specific answer before starting, then stick with Ruby because you already have some experience working with it. I promise you, any choice you make will still leave you with issues you didn't predict, and you will be able to address them.
As has been said above, it's easy for a beginner project to get out of hand in terms of complexity. Before diving into a multiplayer networked game, you may want to focus on something smaller. You could try coding a couple of sample characters, a couple of rooms/dungeon areas for them to explore, something like that. It's still plenty of work, but it's a realistic task and you can build on it for the future.
I also recommend not starting with your dream project because beginners are very likely to 1.) imagine something way beyond their ability to create right away, 2.) produce incomplete or problematic game designs which are very difficult to implement in code (whatever the language and tools being used), and 3.) focus on the "fun" game elements and neglect the utilitarian aspects of the program which must exist but are dull to create and debug. A smaller project that isn't as close to your heart will be easier to create, less frustrating, and ultimately bring you closer to what you'd like to accomplish.
Posted by Khaiy on 10 June 2015 - 05:37 PM
I only have a little to add to the above. Programming is a pretty attention-intensive activity, and if 20 minutes is the maximum amount of time you can focus on a tutorial video then you might be better off using written tutorials, even if you enjoy videos more.
Paying attention, for me, is always about will power; I don't know any tricks, you just have to make a firm decision to work and then stick to it. If your cursor starts drifting towards a link to a fun video while you're working, there's nothing to be done except to move the mouse away and get back to work. It might help to set specific project goals and then dedicate fixed amounts of time to working towards them. When I set aside exactly one hour of work time a day for programming, and don't allow myself to spend more or less time than that each session, I have a much easier time staying on task. My mind still wanders from time to time but it's easier to draw it back. No trick in the world will keep you engaged with a hobby that you don't enjoy.
Posted by Khaiy on 29 April 2015 - 07:14 PM
What i wanna know is if you guys think i know enough to start getting to know how to work with Slick2D and how to make games in it, or i have to learn more (maybe more than in that tutorial is) to get to that point.
It's hard for anyone to say how much skill you've developed just from a link to a tutorial you looked at for a week. It's also hard to say whether or not you're equipped to tackle a project of undefined scope.
It's really easy to underestimate the difficulty of a programming project-- and it's especially easy to underestimate what's involved in tasks you haven't successfully undertaken before. If your programming experience is one week's worth of following tutorials, that's going to be a long list even for a very simple game. For what my opinion is worth, if you are still looking exclusively for tutorials and have not completed an original project of your own (similar in scope to the 2D game you'd like to make, save for graphics) then making any 2D game might be too ambitious.
Are you dead set on making a 2D game, and no other type of project will do? Is there a particular style of game you're thinking of making, or a similar game you might be interested making a clone of? Answers to these will help figure out what might be a good project for you.
Posted by Khaiy on 24 April 2015 - 02:42 PM
Valve are a retailer, and as such, they should be expected to care about the products they sell (Nb: I do believe the original developers are the ones who should care the most). I'm sure Valve do not want to garner a reputation for selling poor quality mods any more than developers want to gain a reputation for allowing poor quality mods for their games.
They already have that issue, and address it through reviews from a huge user base. Steam has plenty of low-quality games, but it isn't known as "the place with the crappy games". User ratings go a long way towards persuading me whether or not to buy a game, and I imagine it won't be any different for mods. The best will rise and the worst will fall, and Steam will be known as a convenient way to access lots and lots of great mods.
Posted by Khaiy on 06 April 2015 - 08:29 AM
I think that thisis a good resource for programmers new to design patterns. There aren't distinct sections for the particular patterns you are asking about, but managers and factories do come up in various places.
I also think it's important to point out that they aren't exactly pieces of game engines so much as they are solutions to common programming problems. It isn't that game engines use a pattern in scenarios A, B, and C, but rather that games need to execute tasks often have needs that are met by patterns, like any other software.
For your specific questions, SmkViper has already provided good answers.
Posted by Khaiy on 05 February 2015 - 09:30 PM
I think you can keep a lot of the elements of RPG-style combat in any game that uses an RPG-style format. What if, instead of encountering monsters and fighting them by using weapons and magic while losing HP, the player encounters recipes and applies cooking techniques and ingredients while losing dish quality? The format could be essentially the same as, say Final Fantasy.
The key things for me would be to give enough background to make the cooking seem worthwhile and to have enough depth in the cooking system that I feel there interesting options for me to explore. Those are equally important in any other RPG I might play, so I definitely think that a cooking-themed RPG could work.
I remember an old anime called Fighting Foodons in the U.S. (Kakutō Ryōri Densetsu Bisutoro Reshipi in Japan, which may or may not be an equally stupid sounding name) that was combat based, like Pokemon, but the monsters were food and you powered them up with recipes and special ingredients or something. It doesn't have to be fighting, but if the food could do something other than be eaten or sold that would open up your options a bit.
Posted by Khaiy on 01 February 2015 - 06:50 PM
This is a shot in the dark, but if you can't get more detail from the group that posted the job I would brush up on Decision Analysis concepts, specifically Bayes' Theorem and one- and two-way sensitivity analyses. Even if that's not exactly what they're looking for I think you could make a convincing argument that you could bring some applicable skills to whatever they want balanced.
Posted by Khaiy on 24 January 2015 - 10:49 AM
It does not make sense to me from mathgematical point of view (of course I don't deny players not always do what's optimal or mathematically correct )
Assuming you need 10 turns to research some tech:
If you spend 5 turns researching weapons and got it half done and 5 turns on propulsion and get it half done you still have nothing at the moment. If you spend 10 turns on weapons and 0 on propulsion you already have one working weapon tech (and you can start destroying the enemy now). In 20 turns you would get both weapons and propulsion tech no matter which route you went, but with 100% focus you get first benefits at turn 10 (instead of turn 20). Therefore 100% focus is clearly superior strategy, always, no exceptions.
Not really. I could see that being the case if all techs at a given level take the same amount of time to research, have zero cost to deploy, and produce instant benefits, but that doesn't come up too often. A game where you can assign research percentages but it is always a mistake to do so is one that has a poorly designed research tree.
I really like valrus' suggestion if you want to get away from that system altogether. Having research priorities like in the OP feels to me like a nerfed version of the research system you don't like, but valrus' is a new system that shouldn't chafe people who don't mind the "old", standard way for research in a 4x.
Posted by Khaiy on 23 January 2015 - 07:13 PM
What about Master of Orion IIs system? You could only research one thing at a time, but if you tried to tech up evenly across all the different fields you're almost guaranteed to lose on anything but the easiest difficulty level. And for most species builds you can only choose one technology from each field per level to research at all, so while you can choose the order of research you can never have everything. Pax Imperia II had a percentage allocation system, and I very rarely put all 100% into a single field because it's a worse option than a mix.
The system you're describing, as I understand it, sounds really restrictive to me, and for not much of a reason. I don't think it would be a game breaker for me, but it would be annoying. What is the gameplay value of forcing me to research something I don't really want, even just a little, versus specialization? I would rather see a system that makes "total focus" impractical or suboptimal than one that forces me to play in a way that I don't want to, to no purpose other than satisfying the developer's arbitrary preference.
Posted by Khaiy on 18 January 2015 - 09:04 PM
What sorts of combat mechanics are you intending to simulate? I could imagine something like to-hit modifiers making smaller ships harder to target, so capital ships' guns are less effective for combating fighters or other small ships. You could simulate more detailed ship capabilities so that larger ships could have specific abilities crippled, which the player can make more likely by sending specialized ships along with others. Crew requirements? Large ships might need more crew to operate effectively, making them more expensive, or maybe require better trained crews, making them harder to field.
I don't know how the rest of your game is set up, but for an outside-of-battle idea it might work to have higher-tier ships be too expensive to just keep on hand and too slow to build to pump them out in time for a conflict. Mechanics like these could help create an incentive for balanced fleets regardless of in-battle performance.
Posted by Khaiy on 18 January 2015 - 03:24 PM
- What language would be best... [?]
It doesn't really matter. I think Java is a major language to use with Android, so that coupled with Java's gentle early learning curve might make that a good choice for you if you're really focused on mobile development. C# is also popular and easy to get into. I don't recommend C++ because it can be fussy and it's very easy to make mistakes, particularly when you are inexperienced. Learning to program games is a special subset of programming in general and so you would be better served if you focus on developing programming skills now rather than zeroing in on the exact type of product you want to make and how you plan to deploy it.
I don't think that your friend's language choice should be much of a factor for you. You've no guarantee that he will be successful in learning it well or at a pace that will suit your own, and a huge amount of the benefit of having other people to learn with will be about things like code structure and design. These are less language-specific than particular syntax requirements and other linguistic details.
- What program should I use? ...
I can't help you with specific recommendations for Java, but the compiler or IDE you use is not too critical a decision. You can always switch to a different one, and the language you program in doesn't change from one to another.
What program would you recommend for the type of programs I could be using?
It's not very important. You can use MS Paint all the way up to professional versions of Photoshop and Illustrator. The term "programmer art" is used for exactly what you're describing-- low-quality art used in development, and it's frequently replaced with better art later. The program doesn't really change in this process as long as the type of picture (like a 2D image or a 3D mesh) doesn't change either. It will just look better with the better art.
Do you have any tips or maybe pointers for beginning tutorials for me in regard to the games I want to learn to create first ... [?]
My main advice is that if you're just starting, even Tetris is ambitious. Learn the basics of your chosen language first, like the syntax rules, and make very very small projects. The list you linked to may start with Tetris, but a standard first "game" project is Guess the Number. Bigger projects have different challenges than smaller ones and deal with problems that are addressed with design choices. It's easier to make good design choices once you have a stronger grasp of the language, which you can develop most easily in projects small enough that design is less critical.
Other advice includes avoiding tutorials for the most part. There are thousands of them and you will not be able to judge their quality for a while, which can lead to bad habits which will make it harder, not easier, for you to make what you want. Tutorials also lend themselves to copy-and-paste approaches. Even if you aren't actually hitting ctrl+c and ctrl+v, it's hard for the tutorial format to teach the problem solving aspect of programming. And unfortunately, that aspect is the major piece of programming.