Re: [pygame] Re: Need a lot of help with 'virtual' board game
Michael, it just occurred to me that people on this thread cd probably help you better if they knew something of the programs you have written so far, in whatever language. Regards, Tom .. "If you're not having fun, you're probably f*cking up." Alfred E. Neuman On 7/2/15, Michael wrote: > So while looking around the internet today, I came across this little gem: > http://www.baumanfamily.com/john/risk.html > > The amount of code in it that help is outstanding, and really helps with > learning how to code a board game. > > > > -- > View this message in context: > http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1983.html > Sent from the pygame-users mailing list archive at Nabble.com. > --
Re: [pygame] Re: Need a lot of help with 'virtual' board game
Ian, i agree with you if the tasks for experimentation are kept small. and the experimenting is above all a lot of fun. people hang themselves in systems work by biting off more than they can chew. writing a system from scratch can be a good learning experience, but it is rarely done in the world of professional programming. "piecing together code other people have written..." that is usually the shortest path to at least the first version of a large system and even a little one sometimes. also, one of the chief reasons OO came into existence was the desire to increase the amount of reuseable code in the world. but i think you have actually implied this in the last part of yr msg. the topic here is really about the situation of the beginning programmer and i think yr advice on it is very true and very valuable. thanks for taking part in the discussion. regards, tom . Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency. They try to make the words of sounds and things their property and use them to divide us. But they will never own the words in our eyes. On 7/2/15, Ian Mallett wrote: > Since this has turned into an advice thread . . . > > Having taught Python for several years, I find that the best way to learn > any language, but Python in particular, is to just sit down and try a lot > of things, without assistance. It sounds like you're trying to make a game. > That's great, but you shouldn't try to do that by piecing together code > other people have written. You will learn more by writing it all from > scratch. *After* you have done this, then you'll have a better idea of what > goes into making a game, what code is best reused, and what code is best > left outsourced to dedicated projects. >
Re: [pygame] Re: Need a lot of help with 'virtual' board game
Since this has turned into an advice thread . . . Having taught Python for several years, I find that the best way to learn any language, but Python in particular, is to just sit down and try a lot of things, without assistance. It sounds like you're trying to make a game. That's great, but you shouldn't try to do that by piecing together code other people have written. You will learn more by writing it all from scratch. *After* you have done this, then you'll have a better idea of what goes into making a game, what code is best reused, and what code is best left outsourced to dedicated projects.
Re: [pygame] Re: Need a lot of help with 'virtual' board game
Michael, congratulation on yr find! BTW, people who program for a living will always start a project by looking around for a similar system. i wd bet that in the majority of cases, systems running today have used another system as a starting point and in many cases just modified it to suit their needs, and that only rewrites approach anything like completely new systems. regards, tom .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency. On 7/2/15, Michael wrote: > So while looking around the internet today, I came across this little gem: > http://www.baumanfamily.com/john/risk.html > > The amount of code in it that help is outstanding, and really helps with > learning how to code a board game. > > > > -- > View this message in context: > http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1983.html > Sent from the pygame-users mailing list archive at Nabble.com. > --
[pygame] Re: Need a lot of help with 'virtual' board game
So while looking around the internet today, I came across this little gem: http://www.baumanfamily.com/john/risk.html The amount of code in it that help is outstanding, and really helps with learning how to code a board game. -- View this message in context: http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1983.html Sent from the pygame-users mailing list archive at Nabble.com.
[pygame] Re: Need a lot of help with 'virtual' board game
I am not familiar with the names, again, I am a VERY novice coder, have watched one tutorial, whilst going through the book 'invent with python' as well. -- View this message in context: http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1982.html Sent from the pygame-users mailing list archive at Nabble.com.
Re: [pygame] Re: Need a lot of help with 'virtual' board game
i suspect your answer is with tongue in cheek, but just in case it's not ... here is a bit of pseudo code in the style that i use. every programmer who uses pseudo code has his own little version get the records for each record get next record check if it contains 'jackpot' if it does write record to file just the thought of writing even a simple program, without pseudo coding it first, makes me shudder. next stop, programmer hell. and if a program develops a bug which i suspect has to do with the control structure, i will rewrite the pseudo code for the suspicious section and then rewrite the section, scavenging code from the old section which deals with assignments and other non-control-related detail. unless it's some kind of trivial thing in a single line, never change the code first. always change the pseudo code first, then make the old code conform to the new pseudo code. it's been working for me for a very long time and i never feel like i'm working hard. and sweating is definitely not part of my idea of fun unless i have a tennis racket in my hand. do you know about unit testing and test-driven development? On 7/1/15, Michael wrote: > No, I am not familiar with that at all. > > > > -- > View this message in context: > http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1980.html > Sent from the pygame-users mailing list archive at Nabble.com. > -- .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency. They try to make the words of sounds and things their property and use them to divide us. But they will never own the words in our eyes.
[pygame] Re: Need a lot of help with 'virtual' board game
No, I am not familiar with that at all. -- View this message in context: http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1980.html Sent from the pygame-users mailing list archive at Nabble.com.
Re: [pygame] Re: Need a lot of help with 'virtual' board game
" I am going to start coding a simple strategy game today..." do you know about pseudo code? On 7/1/15, Michael wrote: > >Create an image of the board. > >Save the countries as coordinates that refer to the centre of > >the country. > >For each country, save a list of countries that are connected. > >When units are in a country, display them at the centre > >coordinate. > >When moving, only allow a unit to move to one of the connected > >countries. > > This was a ton of help! Thank you so much! :D > > I am going to start coding a simple strategy game today (hopefully) to > experiment with unit movement and combat. > > > > > > > -- > View this message in context: > http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1977.html > Sent from the pygame-users mailing list archive at Nabble.com. > -- .. Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency. They try to make the words of sounds and things their property and use them to divide us. But they will never own the words in our eyes.
[pygame] Re: Need a lot of help with 'virtual' board game
>Create an image of the board. >Save the countries as coordinates that refer to the centre of >the country. >For each country, save a list of countries that are connected. >When units are in a country, display them at the centre >coordinate. >When moving, only allow a unit to move to one of the connected >countries. This was a ton of help! Thank you so much! :D I am going to start coding a simple strategy game today (hopefully) to experiment with unit movement and combat. -- View this message in context: http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1977.html Sent from the pygame-users mailing list archive at Nabble.com.
Re: [pygame] Re: Need a lot of help with 'virtual' board game
On Tue, 2015-06-30 at 18:51 -0700, Michael wrote: > For my game I want territories that are different shapes, not tiles, is it > done the same way? or is there another process completely? You basically just need to work out what you want, then figure out a way to go about it, programming is very free-form. For example, if I were creating a Risk board, one approach could be: Create an image of the board. Save the countries as coordinates that refer to the centre of the country. For each country, save a list of countries that are connected. When units are in a country, display them at the centre coordinate. When moving, only allow a unit to move to one of the connected countries. Hope that gives you an idea. signature.asc Description: This is a digitally signed message part
Re: [pygame] Re: Need a lot of help with 'virtual' board game
Folks! Thanks for the discussion. Very helpful. I'm a newbie also with pygame. Not very far along with python either. Thanks Michael for starting the discussion. The advice to work on parts of the stuff and to find examples is important. I have written a lot of software in other languages and those ideas were fundamental to my mastery of those environments. Above all, "IF YOU'RE NOT COMFORTABLE AND HAVING FUN AS YOU WORK, YOU'RE F*CKING UP!" Keeping problems small relative to one's level of competence is fundamental to our bliss. Always keep the tasks simple, keeping in mind that what is simple grows as one's competence grows. Also, if possible, begin a project using the framework someone else has built for a similar application. The Pygame site contains and links to lots of game apps. Many of them include valuable commentary. Regards, Tom -- Faced with the possibility of its extinction, every species finds within itself powers unimaginable in the days of its complacency. On 6/30/15, Michael wrote: > Quick question: > For my game I want territories that are different shapes, not tiles, is it > done the same way? Or is there another process completely? > > > > -- > View this message in context: > http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1973.html > Sent from the pygame-users mailing list archive at Nabble.com. >
Re: [pygame] Re: Need a lot of help with 'virtual' board game
There are several ways to do that - you could make territories be a collection of small tiles, or you could use some sort of polygon system. On Tue, Jun 30, 2015 at 7:51 PM, Michael wrote: > Quick question: > For my game I want territories that are different shapes, not tiles, is it > done the same way? or is there another process completely? > > > > -- > View this message in context: > http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1973.html > Sent from the pygame-users mailing list archive at Nabble.com. >
[pygame] Re: Need a lot of help with 'virtual' board game
Quick question: For my game I want territories that are different shapes, not tiles, is it done the same way? or is there another process completely? -- View this message in context: http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1973.html Sent from the pygame-users mailing list archive at Nabble.com.
[pygame] Re: Need a lot of help with 'virtual' board game
Thanks a ton guys! When I finish the game I am ultimately trying to make (The first Balkan war) I will post it on these forums :) -- View this message in context: http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1972.html Sent from the pygame-users mailing list archive at Nabble.com.
Re: [pygame] Re: Need a lot of help with 'virtual' board game
On Tue, 2015-06-30 at 12:48 -0700, Michael wrote: > I actually coded my own pong game, I forgot to add a pause menu though. > However, I still need to know how to code in 'combat' (die rolls, > causalities ETC.) > Movement of troops > and still alll the others listed above. As said, these things will be covered in various tutorials, you just have to work out how to apply them to your project. For example: # Die Roll roll = random.randint(1, 6) # Causalities num_lives = 5 # When unit is hit... num_lives -= 1 if num_lives < 1: # Unit is dead And so on... If you follow a couple more tutorials and get started, then come back when you have some more specific questions, people will be happy to help you solve some problems. But, your current questions are essentially, 'how do I make a game?' which is better answered through the various tutorials on offer. signature.asc Description: This is a digitally signed message part
Re: [pygame] Re: Need a lot of help with 'virtual' board game
You can look up how to do combat 'die' rolls here: http://programarcadegames.com/index.php?chapter=loops&lang=en#section_4 That site has a lot of example code if you look under the 'examples' section. Paul Vincent Craven On Tue, Jun 30, 2015 at 2:48 PM, Michael wrote: > I actually coded my own pong game, I forgot to add a pause menu though. > However, I still need to know how to code in 'combat' (die rolls, > causalities ETC.) > Movement of troops > and still alll the others listed above. > > > > -- > View this message in context: > http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1968.html > Sent from the pygame-users mailing list archive at Nabble.com. >
Re: [pygame] Re: Need a lot of help with 'virtual' board game
As Winkleink said, the Invent With Pygame stuff is awesome; tons of good hands-on examples. The author is very cool and will probably help you out or recommend a blog post if you have specific questions on how something works. http://inventwithpython.com/ For troop movement, if you're making a grid-based game, I recommend this tile map tutorial: http://sheep.art.pl/Tiled%20Map%20in%20PyGame That will help you understand how to break up an area into 'cells'. For combat, again, you just need to break things down: - Characters need data for HP, Attack Power, Accuracy, Dodge Chance, Defense - Use something like: - # see if the attacker hits the defender (there are a LOT of ways to do this) - hit = False - if ( random.randint( 0, 100 ) + attacker.accuracy ) > defender.DodgeChance: - hit = True - # If the attack hits, lower the defender's HP, adjusting the damage by the defender's defense - if hit: - damage = attacker.attack_power - defender.defense - if damage >= 0: - defender.hp -= damage - # check if the defender is dead; if so, remove hide sprite, etc., - if defender.hp <= 0: - defender.kill() On Tue, Jun 30, 2015 at 3:48 PM, Michael wrote: > I actually coded my own pong game, I forgot to add a pause menu though. > However, I still need to know how to code in 'combat' (die rolls, > causalities ETC.) > Movement of troops > and still alll the others listed above. > > > > -- > View this message in context: > http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1968.html > Sent from the pygame-users mailing list archive at Nabble.com. >
[pygame] Re: Need a lot of help with 'virtual' board game
I actually coded my own pong game, I forgot to add a pause menu though. However, I still need to know how to code in 'combat' (die rolls, causalities ETC.) Movement of troops and still alll the others listed above. -- View this message in context: http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1968.html Sent from the pygame-users mailing list archive at Nabble.com.