• 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
tracegame

how to write a Worms Reloaded AI

5 posts in this topic

new to the pixel world,i have just read a topic about how to run on pixel terrain.and shoot holes.

i want to write a simple game like Worms Reloaded,but now get no idea how AI works.

 

basicly if i shoot a missile,i solve a parabola equation,and i get the answer.

but the missile may be block by the map terrain by its shape,and different ways to shoot at target.

so i think it's infinite solution,and not effective to loop a lot possible solution and check if they are right solution.

 

guess maybe there is some better idea?

0

Share this post


Link to post
Share on other sites

Hummm... I think its a misunderstanding about AI...

 

Are you talking about Physics?? AI is the process of decision making, I mean, what kind of weapon the 'computer characters' will use in each situation ( assuming they may change weapons ) and how the characters will decide witch player to attack...

 

If the problem is how the projectiles interact with the map, so you may search for help with physics or something like that... 

 

So.. you need help with Physics or AI? or both? :)

0

Share this post


Link to post
Share on other sites

new to the pixel world,i have just read a topic about how to run on pixel terrain.and shoot holes.

i want to write a simple game like Worms Reloaded,but now get no idea how AI works.

 

basicly if i shoot a missile,i solve a parabola equation,and i get the answer.

but the missile may be block by the map terrain by its shape,and different ways to shoot at target.

so i think it's infinite solution,and not effective to loop a lot possible solution and check if they are right solution.

 

guess maybe there is some better idea?

 

I think it's pretty reasonable to try lots of different solutions and pick one that works, computers are fast!

 

There's no reason not to solve the parabola equation for 10 or so different launch speeds and collision test all the results you get. You could probably multiply that up by a number of different launch positions your AI might consider walking to too, and still not really tax the CPU. Put a bit of effort to make sure you can distribute the work over multiple frames (extra marks if you multithread it), and it'll be fine.

0

Share this post


Link to post
Share on other sites

Yeah I converted a golf game and that's how the AI worked for that (take loads of shots, give them a score based on distance to hole, terrain the ball ends up on, etc.). And that was on PS1 (so slow compared to PCs these days, and it was 3D too). In order to not get a hole in one on all par 3s if it was possible to do it the computer randomised the shot taking algorithm (power bar etc.) by adding on a parameter drawn from a normal distribution table (mean was best shot power/ball strike location, standard deviation depended on AI level).

 

The normal distribution was just a table but I think C++11 has Gaussian (normal distribution) random distributions in the <random> library. Picking a utility value for a shot (i.e. the score awarded to each test shot) is probably a lot easier for a Worms type game since you can score damage dealt (although positioning could be a factor too for counter attacks).

Edited by Paradigm Shifter
0

Share this post


Link to post
Share on other sites

Hummm... I think its a misunderstanding about AI...

 

Are you talking about Physics?? AI is the process of decision making, I mean, what kind of weapon the 'computer characters' will use in each situation ( assuming they may change weapons ) and how the characters will decide witch player to attack...

 

If the problem is how the projectiles interact with the map, so you may search for help with physics or something like that... 

 

So.. you need help with Physics or AI? or both? smile.png

both i think,first for AI to pick a right way to shoot,and this shooting algorithm requires physics about terrain,actually need Math and Physics i guess?

and because is's a 2d game,it may also need some graphics algorithm to run parabola on pixels and effective?

so many things involved...

Edited by tracegame
0

Share this post


Link to post
Share on other sites


So.. you need help with Physics or AI? or both? smile.png

both i think,first for AI to pick a right way to shoot,and this shooting algorithm requires physics about terrain,actually need Math and Physics i guess?
and because is's a 2d game,it may also need some graphics algorithm to run parabola on pixels and effective?
so many things&nbsp;involved...

Learn about one thing at a time.

Step 0: showing a window, accepting keyboard output, and shutting down properly.

Step 1: displaying moving sprites.

Step 2: displaying animations of projectiles (according to physical models).

Step 3: collision handling and explosions.

Step 4: destroying terrain.

Step 5: falling terrain.

Step 6: worms and pickup items, supported by terrain.

Step 7: walking and falling worms (player-controlled).

Step 8: a full game for human players, without AI (hotseat).

Step 9: AI-controlled worms who do anything player-controlled worms can do, with pluggable AI modules. This is a game architecture task, not an AI task; the first AI modules should be simple demos (e.g. walk in a random direction as far as possible then shoot a random weapon in a random direction).

Only at this point you should begin to worry about what AI behaviour is fun; you might discover, for example, that lobbing a cannonball on a perfect parabolic trajectory is too effective because there are too many open spaces and the player needs several attempts before hitting, resulting in frustrating mortality (this is what happens in Scorched Earth against the best AI).

Golf is completely different from Worms clones because if the AI opponent has a great shot the consequence is a slightly more challenging score to compete against, not immediate and unfair defeat.

Regarding AI, I recommend planning with straightforward strategies that the players can recognize: shooting obstacles until there is a clear path to shoot an objective, walking to safe places, erecting walls and walkways, digging a relatively safe pit and taking advantage of wind to shoot vertically out of it, etc.
0

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