Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


canary40

Member Since 01 Dec 2009
Offline Last Active Jan 14 2013 12:50 PM

Topics I've Started

(Many)AI Acquire Targets

23 July 2011 - 02:01 PM

I'm coding a game where there are many ships controlled by AI pilots.
Ships are split into 2 teams, team 1 and team 2.
I'm trying to determine the basic AI decision process, and the problem I've run into is that I want each ship on either side to "acquire" an enemy target on the other side,
by finding the closest enemy target (I'm open to suggestions on other ways to find enemy targets), but in the worst case, this is a O(n^2) problem, not to mention calculating
distances can be quite expensive (although, I can use distance squared). The map itself also happens to be very large.

Some other notes:
- For simplicity we can assume that all ships can see each other.
- For broad-phase collision detection I've used a box-pruning algorithm (similar to sweep and prune), and I thought I could maybe use query boxes to see if there are any enemy ship close to the AI ship (like a radius check), but the radius would have to be a constant, and the AI ship might not be able to find a target close enough.

Any ideas?

Story Mangement For Games

26 May 2011 - 10:35 AM

Game stories are once again becoming increasingly important to modern games, and the complexity is growing rapidly.
With a good story model, we will be able to create immersive stories for games, making complicated scripts more manageable...

From an abstract level, what kind of models are there to manage game stories?
For example, I know that the use of a directed acyclic graph is suitable for modelling locations/quests (nodes) and actions/events (edges).
- What kind of drawbacks are there to this model?
- - Can we use this model easily for all games with non-linear stories?
- Are there any other models?
- What are some of the current technique that is employed for games with non linear stories?

I realize this is a bit of a loong "question", but if any of this interests you, I'd love to hear your thoughts.

A moving texture layer with a transparent background?

01 December 2009 - 03:44 PM

Hello, I have not been able to find a solution to my somewhat unique problem on the internet. If anyone finds interest in this problem, I would greatly appreciate any help. The problem that I am about to describe is a little complicated. I hope I can make myself clear enough- if not, please ask for clarification. I am trying to program a simple little game in C++ where you can move a 2D doughnutshape (some PNG) around with arrow keys. However, there is a complicated graphics requirement. The doughnut must take its texture from another texture file (another PNG). However, the when the doughnut moves, the texture should change it's appearance. IMAGINE that the texture is sheet, and then another background sheet is placed over this sheet. If you could cut a hole in the background sheet and move the hole around, you would see different parts of the texture sheet underneath it. It is somewhat like a moving window. This is the effect that I hope to achieve. The biggest problem I am encountering is how to deal with the texture of the doughnut as well as how to keep the irregular shape of doughnut sprite's/PNG 's background transparent at the same time. In some sense, my problem how to reveal different backgrounds on different parts of the doughnut. I am using the Allegro and LoadPNG libraries, but I am open to new ideas as long as they are implementable. I realize that despite my best efforts to explain, there will still be much confusion regarding to what my problem still is. I will try my best to answer any questions if there are. The code looks something like this: ... set_color_depth(32); set_alpha_blender(); ... if (key[KEY_RIGHT]) x+=5; bmp = create_bitmap(SCREEN_W, SCREEN_H); blit(background, bmp, 0, 0, 0, 0, SCREEN_W, SCREEN_H); blit(texture, bmp, x, 0, x, 0, doughnut->w, doughnut->h); draw_trans_sprite(bmp, doughnut, x, 0); blit(bmp, screen, 0,0,0,0, SCREEN_W, SCREEN_H); ... The doughnut PNG has a transparent hole, but an opaque background. This will produce the effect of a moving window, but there is still the opaque background.

PARTNERS