• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
louie999

How to create games using Python

8 posts in this topic

I'm creating a game,and I'm new to these Programming stuff.I would like to create an good(or hard)Ai for my game How do I create an Ai that can do these things:

 

1.When it sees an enemy it will shoot it.

2.When getting shot it will take cover or run away/retreat.

3.Will NOT shoot allies.(If on Team games)

4.When an Ally is near and getting shot the Ai teammate will help.

5.Can camp and/or hide from the enemy or ambush an enemy.

6.Will protect and stay in the base if there are no one guarding it(On Kill the Base mode)

7.Will capture the enemy flag and bring it to back to base.(On capture the flag mode)

 

I'm planning on creating many game modes,like:

Deathmatch - No teams just kill anyone you see.

Team Deathmatch - Up to 4 teams.

Defend the Base - Defend the base against waves/hordes of zombies.

Kill the Base - Kill/Destroy the enemy base and not letting your get destroyed.

Capture the Flag - Capture the enemies Flag and bring it back to your base.

Elimination - Each player has there set of lives if it gets to 0 you lose,Team or No teams

 

0

Share this post


Link to post
Share on other sites

I would suggest reading this free beginners book to programming, that also teaches basic game prigramming [LINK]  .

Here is another free, but bit more advanced book to read on Python game creation [LINK] .

 

 If you would like to learn the basics of programming and Python, this free book is great [LINK] !

2

Share this post


Link to post
Share on other sites

do you know the language already? 

then I would suggest to use pygame (http://www.pygame.org) as base for

your game. IF you not know the language yet, I say go a step back.

Start with some easier topics. Don't try to do something where you lack

to much of programming experience. Start slow and take it step for step.

 

  • Learn your language
    • train Text Input / Output on the console
    • train File Input/ Output
    • program an calculator first
    • learn about algorhythm
    • wrote a programm which try to organise simple data( e.g. table numbers and names )
  • Learn the API of PyGame
    • learn to initialize a Window
    • try to draw a picture
    • try to move a picture
    • try to clip a picture
    • try to play sound
    • try to handle input
    • try to move a picture with your input
    • try to move a picture with your input and check if it hit something.
    • try to move a picture with your input and check if it hit something and play a sound.
    • try to write something on the screen
    • try to read some user input over the screen and print what the user wrote on the screen

If you have done all this you can take the next step and write and game like tic tac to or an sidescroller, etc

but important is you go step by stepstep by stepstep by step into the topic. Otherwise you will get frustrated and stop.

The clue is if you go small steps you will see progress and progress ends often in success. both progress and success let you

feel very good. belive me, perhaps that takes some time, but that is an relative save way to go. of course is my list above only

a example/suggestion( my example only includes graphical stuff ;) ). which way you will go is up to you.

 

If you want learn something about AI's use this site there is really a lot stuff you could use: http://aima.cs.berkeley.edu/index.html

 

 

Considering you just started, none of those are questions you should be asking. They cannot be answered in a (to you) helpful way either.

 

Start with something small. Like Guess-a-number. The program creates a random number and asks the user to guess it. The program tells the user "right" or "wrong" after each guess, the program ends when the user guessed right.

If you have never programmed anything before, this is a very significant challenge.

 

 

I would suggest reading this free beginners book to programming, that also teaches basic game prigramming [LINK]  .

Here is another free, but bit more advanced book to read on Python game creation [LINK] .

 

 If you would like to learn the basics of programming and Python, this free book is great [LINK] !

HAHAlaugh.png  You people just ruined this guy dreams.. Louie..yea. You must start small. If this will be your first game, learn firstly how to programm and how is structured a game. Don't jump directly to AI! 

1

Share this post


Link to post
Share on other sites

 

1.When it sees an enemy it will shoot it.

class Coord:
 def __init__(self, x = 0, y = 0, have_enemy = False):
  self.x = x; self.y = y; self.have_enemy = have_enemy

# global array Coords, you must set this as all your game cells and change later in game loop
Coords = (Coord(0, 0, False), Coord(0,1,False), Coord(1,1, True))

def shoot(coord):
 pass # change to your code

def collision_with_enemy():
 for coord_item in Coords:
  if coord_item.have_enemy:
   shoot(coord_item)

 I dont understand this sad.png ohmy.png

its so complicated(for me)

0

Share this post


Link to post
Share on other sites

 

 

1.When it sees an enemy it will shoot it.

class Coord:
 def __init__(self, x = 0, y = 0, have_enemy = False):
  self.x = x; self.y = y; self.have_enemy = have_enemy

# global array Coords, you must set this as all your game cells and change later in game loop
Coords = (Coord(0, 0, False), Coord(0,1,False), Coord(1,1, True))

def shoot(coord):
 pass # change to your code

def collision_with_enemy():
 for coord_item in Coords:
  if coord_item.have_enemy:
   shoot(coord_item)

 I dont understand this sad.png ohmy.png

its so complicated(for me)

 

Why you jump already to AI? Make a simple game for start. My first game was a tic tac toe clone (without AI) and my first game including artificial intelligence was PONG.

Check my profile to see them.

And here is a book about making games in Python and Pygame. Read It!

http://inventwithpython.com/makinggames.pdf

 

Edited by Bratie Fanut
2

Share this post


Link to post
Share on other sites

 I dont understand this

you can learn draw cells example, mainly "live_grid_2d" class - perhaps it helps to understand how to divide the screen into areas for further work with them

2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0