Jump to content
  • Advertisement
Sign in to follow this  
Willy The Vinyl Frog

Knowledge of instance positioning, memory of positioning, etc.?

This topic is 2344 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Since I can't tackle the mechanics of physics implementation in a pong game, I thought it would be pretty much basic to make, using SDL, a small game with both a player and AI.

The player:

A small 20x20 bitmap image with no animation that moves within a 2-D coordinate system integrated with possibly friction and speed variances.

The computer:

Another small 20x20 bitmap image(possibly a different color, shape, or something)that will independently move around and stop every now and then, and avoid the player, but ALSO be able to "remember" the character's last and current positions in both an implemented system of short and long term memory.

I feel that this project is much easier in terms of physics than ping pong, which I do NOT want to attempt again until I'm very comfortable with SDL and more simpler games(ones without collision variances and bouncing balls).

The problem is ... how do I implement?

I thought maybe using stacks and vectors, along with a short and long term memory system applied with basic maths and timers.

Any info though? Because I could use some tips! Thanks.

EXTRA: Maybe I could push and pop stacks with a self-made timing little system, call random waits, and have a function looped to constantly check the player's now and then positions in relation to more "sophisticated" choices of movements? Edited by Willy The Vinyl Frog

Share this post


Link to post
Share on other sites
Advertisement
You haven't really described how this remembered information will be used, so it would be difficult and premature for us to give advice on implementation. It isn't entirely clear what you mean by "previous" position. Is this a turn based game? Tile base? Is it line-of-sight based, the last place the A.I. saw the player?

If you fully describe the behaviour of the A.I., then we can give more advise.

Share this post


Link to post
Share on other sites
Yes, exactly what you said.

Line-of-sight would be good considering I know of no ways to implement any "useful" AI in games, nearly anything AI related, including examples with code, will help me get around AI basics.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!