|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
|
|
On October 23 2013 16:38 Tobberoth wrote:Show nested quote +On October 23 2013 16:32 v0rtex wrote: I'm interested in learning game programming. My main language is Java and I have dabbled in C++ for a while. I wouldn't say im a novice coder but I have mainly focused on Java due to studies. Should I learn Android game programming (I have already done 2D games with Swing etc...) or should I focus on C++ and learn SDL? My goal is to eventually become a game developer but I am unsure of what to focus on now? I think android is good as I can get apps out there and expand my portfolio plus it seems easier as Java is my main language? Or should I not take this detour and just focus on C++ and SDL then go into OpenGL?
Any advice is appreciated. Thanks! I guess it depends on what you want to do. If you want to work at a company doing cellphone games, android is obviously the way to go. If you want to work on PC/Console AAA titles, C++ will probably be more important to know. Java is just not really useful for games, it's so rare to use it. I would assume most "real" commercial android games are programmed in other languages than java, such as C++. If I were you, I would go with C++ and SFML. SDL works I guess, but SFML is just much cleaner and powerful, and modern for that matter. An android/iOS port for SFML is also in the making as of right now. If you're more comfortable with Java there is a port for that too, although mobile support will take longer.
|
hi guys, i currently have some university level CS courses. They are either general stuff or Java related. So, i wanted to learn C# "on the side" because a lot of companies in my area use it.
Does anyone have a good source for exercises and little projects? I learned C++ this way in my youth and i still remember most of it, so i think its a very good way for me to learn, but i dont have the time atm to come up with my own projects like i did when i was still in school.
I have Murach Csharp book, but the exercises are very simple.
|
On October 23 2013 21:40 LaNague wrote: Does anyone have a good source for exercises and little projects?
Use it or lose it... your own imagination that is
|
On October 23 2013 21:40 LaNague wrote: Does anyone have a good source for exercises and little projects? http://projecteuler.net/
|
Can someone on here who knows their way around CSS/HTML and keyframe animations PM me? I have some questions/issues and want to bounce a few ideas off of someone who knows what they're doing. Would be suuper helpful!
|
For a class assignment I have to produce a simple "pokemon" game in C# to get used to object orientated style ("object orientation"?)
The game is turn-based:
player1 chooses 6 monsters player2 chooses 6 monsters each monster has 4 skills
game starts: player1 selects 1 of his monsters player 2 selects 1 of his monsters
player1 clicks a skill on his monster; damage is dealt to opponent's monster player 2 clicks a skills on his monster; damage is dealt to opponent's monster
repeat until a player's monster's health is 0. when this occurs, that player must choose one of his remaining monsters to continue to battle with
i am just trying to figure out the logical process of it...
we are supposed to start with classes then try to write use case texts
so i have classes: ability monster player GUI
for use case text i am looking at something like this:
Attack With a Monster:
1. user clicks on a monster's attack button 2. system calls monster's attack function 3. attack function checks to see what is opponent's monster 4. attack function completes with effect (damage/heal) (end turn) 5. system calls endTurn function 6. system checks health of opponent's monster 7. if opponent monster has health, call nextTurn function passing in needNewMonster as 0 8. nextTurn changes activePlayer to player2 and nonActivePlayer to player1 9. system triggers startTurn function which sees needNewMonster 0 and opens activePlayer's currentMonster attack GUI
alternative from 7: 7. if monster has no health, call nextTurn function passing in needNewMonster as 1 8. nextTurn changes activePlayer to player2 and nonActivePlayer to player1 9. system triggers startTurn function which sees needNewMonster 1 and opens activePlayer's chooseNewMonster GUI
if anyone with a fast mind would like to have a quick read through of this and see if i'm overcomplicating it ...
i want to check the health of opponent's monster at the end of the turn - if it's 0 then that player needs to select a new monster before we allow player2 to make his attack
THANKS ps i dont really want solutions unless its an example of how to condense this better 
|
ps , my tutor wrote his in a different way (for prototype purpose)
what i thought was to check a player's array of monsters - if they are all null then that player has lost.
however , my tutor instead set an attribute of each monster object to isDefeated , and instead checked these.
a side-effect of this is that he retains a list of which monsters belong to each player even after they're dead, so can do things like grey them out on the monster select screen.
can you see how my thinking differed from his, here?
its interesting
|
A few notes:
Your number 7 in your use case could as well call a function only when you need a new monster. You have an if statement after all.
Number 9 is then looking at some variable you probably set in the player object to figure if you should open the attack GUI or select monster GUI
Why do you want to set the references to the monster to null? You're effectively losing the information and if you forget a null check your program dies (which, depending on how well you have structure your program also can take considerable time to figure out where happens)
I would go with your teachers suggestion because you don't lose information then
|
i think this is what you mean:
6. system checks health of opponent's monster 7. if opponent monster has no health, set opponent's needsNewMonster attribute to 1 8. system calls nextTurn, changing activePlayer to player2 and nonActivePlayer to player1 9. system calls startTurn function which checks needsNewMonster 10. if needsNewMonster if 1, system opens activePlayer's selectMonster GUI 11. (go to select monster use case)
edit: my tutor said i should also have a Main or Game class instead of putting lots of stuff in the GUI class
|
Your use cases are too big. Make them smaller/split them up.
|
So if I want to read different board puzzles from files which I then store as objects each, what List should I choose if I don't need thread-safety? I think LinkedList would suit me because of fast insertion. However, if I need to get the object of puzzle No "x", then it would be O(n) which is still fine by me. Thoughts?
|
On October 25 2013 22:35 darkness wrote: So if I want to read different board puzzles from files which I then store as objects each, what List should I choose if I don't need thread-safety? I think LinkedList would suit me because of fast insertion. However, if I need puzzle No "x", then it would be O(n) which is still fine by me. Thoughts? Unless we're talking about tens of thousands of entries it really doesn't matter.
Additionally, if your code uses interfaces instead of concrete classes (I assume you're programming in Java or C#), it should be quite easy to change the underlying implementation of List.
|
On October 25 2013 22:35 darkness wrote: So if I want to read different board puzzles from files which I then store as objects each, what List should I choose if I don't need thread-safety? I think LinkedList would suit me because of fast insertion. However, if I need to get the object of puzzle No "x", then it would be O(n) which is still fine by me. Thoughts? Think about that fast insertion thing again: You're reading files. From disk. The slowest thing in the whole computer by a factor of like 100,000. Does insertion time matter?
|
|
|
Hyrule19167 Posts
That's...essentially true.
|
It very much depends on the implementation. LoL games can be a draw as far as I know.
Typically, such a game works in frames; all things that happen in one frame are calculated and in a seperate, later action triggers like winning are checked based on the new frame state. And if the game is programmed such that it checks if both teams fulfill the win/lose condition during the same frame, it is a draw, then it is a draw. If it doesn't care about the second team and just declares a winner as soon as it finds someone met the winning condition, then it's not a draw.
It is however not out of the realm of possibility that the game enters winner-determined-mode as soon as some condition is met during frame update.
I'd say it is very likely that draws are possible in DotA2.
Also: clearly both.
(and that other guy certainly has no idea about game programming)
|
On October 25 2013 23:36 spinesheath wrote:It very much depends on the implementation. LoL games can be a draw as far as I know. Typically, such a game works in frames; all things that happen in one frame are calculated and in a seperate, later action triggers like winning are checked based on the new frame state. And if the game is programmed such that it checks if both teams fulfill the win/lose condition during the same frame, it is a draw, then it is a draw. If it doesn't care about the second team and just declares a winner as soon as it finds someone met the winning condition, then it's not a draw. It is however not out of the realm of possibility that the game enters winner-determined-mode as soon as some condition is met during frame update. I'd say it is very likely that draws are possible in DotA2. Also: clearly both. (and that other guy certainly has no idea about game programming)
I just think whether ties can or can't be implemented has nothing to do with the actual CPU only being able to execute one instruction at a time, which is what the other guy seems to be arguing.
|
On October 25 2013 23:48 devilesk wrote:Show nested quote +On October 25 2013 23:36 spinesheath wrote:It very much depends on the implementation. LoL games can be a draw as far as I know. Typically, such a game works in frames; all things that happen in one frame are calculated and in a seperate, later action triggers like winning are checked based on the new frame state. And if the game is programmed such that it checks if both teams fulfill the win/lose condition during the same frame, it is a draw, then it is a draw. If it doesn't care about the second team and just declares a winner as soon as it finds someone met the winning condition, then it's not a draw. It is however not out of the realm of possibility that the game enters winner-determined-mode as soon as some condition is met during frame update. I'd say it is very likely that draws are possible in DotA2. Also: clearly both. (and that other guy certainly has no idea about game programming) I just think whether ties can or can't be implemented has nothing to do with the actual CPU only being able to execute one instruction at a time, which is what the other guy seems to be arguing. This is absolutely, certainly and without a shadow of a doubt true (source: CS student with actual programming practice).
if(x && y) draw(); else if(x) win(team1); else if(y) win(team2);
|
You're sort of right but I'd have argued it slightly differently. Since really processing is so fast there is always going to be one action occurring before the other, one event being processed before and while you could do some sort of win state check it doesn't seem like something that would scale well to large games, at least based on my very limited understanding.
Since DotA2 is a multiplayer game though latency could come into play and two clients may both claim to have the winning blow, in which case you could consider that a tie provided they are within a close enough time window, but that's assuming I know how the game is implemented, which I don't and its probably far more elaborate and doesn't allow for that kind of situation.
The guys reasoning is technically OK I suppose, he's just not engaged his brain and thought about the question, the question is whether its possible within the game, unless its been seen to happen that can only be known by a developer. He made a reasonable assumption as to why they wouldn't be forced to include a draw condition (ie the winner could always accurately be determined) but of course they could just throw one in any way, there are no rules saying they can't so really its a bit of a daft argument and I don't know why you continued it as long as you did.
|
|
|
|
|
|