canary40

Members
  • Content count

    14
  • Joined

  • Last visited

Community Reputation

114 Neutral

About canary40

  • Rank
    Member
  1. Game Component Architecture

    Component oriented programming and entity systems have piqued my interest lately. There are quite a few articles online that I think you should read to understand more. One good source is here: http://stackoverflow.com/questions/1901251/component-based-game-engine-design One implementation of entity system involves separating data from functions. So, components will only contain fields, and subsystems will contain the logic that uses the data from the components. For example, you may have a spatial component (x y position) that zombie entities contain, then you will need a Movement subsystem that updates the zombie's spatial coordinates every game tick. Subsystems may also manipulate data from multiple components. This is needed for interactions between components. E.g. Change the graphics component's data based on your spatial component's data, so that your renderer knows where to draw your zombie. I've just provided simple examples based on my understanding, but if you are interested I encourage you to read more about this topic starting with the link above.
  2. (Many)AI Acquire Targets

    @ApochiPiQ I see. By box pruning, I really meant a variant of sweep and prune. You're probably right in that I should consider different ways to use my current system to do the checks. I had some difficulty before but I think with some extra effort, I can work something out. Thanks for your help.
  3. (Many)AI Acquire Targets

    @ApochPiQ - For spatial hashing, I was hoping I could do something with the box prune code that I had set up already instead of adding a new broad-phase technique just for acquiring targets. In addition my map is very large, I'm guessing spatial hash would take a lot of memory - I think the random check would be easy to do, and if I have nothing better, I will use it, - in combination with the prioritization of enemies based on their toughness as well as distance. There was this game I played recently called Gratuitous Space Battles, and they had many ships and lasers flying around. My game is similar in style to that, but map size is larger.
  4. 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?
  5. Project AI

  6. My idea is similar to some of the others' ... make an area in the center of the screen neutral zone. Then whenever the mouse is outside of the neutral zone have the player move along a vector with points at center of neutral zone and mouse position. You can kinda emulate an analog stick this way...
  7. A Newbie, A Vision, No budget.

    Hi, To be honest, it already sounds like you are biting off more than you can chew! I remember when I first started wanting to make a game, oh the ideas and features I had planned, but once getting into actually making the game, I realized why the no one had made such a game before... it was too hard/not practical... etc. I think you should reevaluate just exactly what you want, whether it be just making a game this one time and never to do something like it again: - find a coder and pitch your game idea to him/her (read game design book beforehand maybe..) - use game maker or something similar (as for your wish for making it seem like you didn't use game maker... once you start, you may realize just what qualities in a game will reveal its game-maker-esque nature and find a way to conceal it maybe or perhaps you will realize that it's not important at all...) Use making a game as a learning experience for game development in the future: - learn coding (it will a long time between starting to learn coding and making a game with lots of frustration in between- not a decision to make lightly) yeah, bye
  8. Machinegun's fire sound mess

    In a game I made, I also found that when playing a sound many times can get really messy... it might be because of the limited number of sound channels and once those channels are all used by other sounds (the other bullets in your case) then something strange happens when you try to play a new sound... Limiting the number of bullet sounds seems to be the simplest solution as said by #2
  9. Story Mangement For Games

    [quote name='sunandshadow' timestamp='1306857372' post='4817912'] I think that if you made a generalized set of instructions for creating the story structure of a game, you'd probably have to make it for the most heavily structured game, but then you wouldn't be using 80% of the instructions for a simple linear game. Is that what you want to do? [/quote] Yes, something like that. I'm working on a domain specific language (DSL) aimed at managing stories in games -particularly non-linear stories. The main concern now is what kind of features should/can be included and would it be worth it (in terms of spending the resources and time) for others to learn this DSL. In any case, thanks for all the help, I think I have a good idea of which direction I should be heading in now.
  10. Need advices to get started

    I'm a new game programmer too. I find that SDL is a good place to start. It has all the basic things you need... creating a window, image loading, drawing... it's lightweight and very popular!
  11. Story Mangement For Games

    Both quality posts. Thanks for the insight. Prior to this post, I have never heard of strings modelling stories, but it does seem like a neat idea. I think that as far as story managing goes, DAGS and strings+beads seem to be equally powerful... although the addition of beads allows for some modular components to be included. I wonder if we can generalize story, arrays, meters and state machines (or a combination of) so that we can apply the same rules every time for aiding the creation of any story driven game... Thanks again.
  12. 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.
  13. Thanks very much for your replies. I am currently taking a look at SDL and OpenGL. I believe I will be able to solve my problems thanks to your inputs.
  14. First of all, thank you for your prompt reply. Stencil buffering seemed like a really interesting idea to solving my problem. However, after some hours of fruitless searching for simple 2D examples, it seemed that I would have to learn some OpenGl at the very least to use it. This is not a bad thing, but perhaps there is another way. Inspired by the stencil buffer concept, I tried processing the bitmap pixel by pixel. If a a certain specified colour of pixel (e.g. HOT PINK) is identified, the program will put a pixel from the texture bitmap to the doughnut bitmap. This method, however requires a lot of looping through bitmaps. I have achieved the desired result, but am worried about optimization. Is this a valid way to do this? If I am making a more complex game with more sprites and textures, will I be able to keep the framerate of the game up? Here is some updated code. ... for (int x = 0; x <= blit(buffer, screen, 0,0,0,0, SCREEN_W, SCREEN_H);->w; x++){ for (int y = 0; y <= doughnut->h; y++){ if (getpixel(doughnut, x, y) == -65281){ //hot pink putpixel(bmp, x, y, getpixel(texture, xx+x, y)); //the xx+x is //just a way to move the texture accordingly when the dougnut moves } else if (getpixel(doughnut, x, y) == -16711681){ //cyan putpixel(bmp, x, y, getpixel(bg, xx+x, y)); } } } ... blit(bmp, buffer, 0,0,xx,0, bmp->w, bmp->h); blit(buffer, screen, 0,0,0,0, SCREEN_W, SCREEN_H); ... Hot pink pixels will be replaced by texture pixels, while cyan pixels will be replaced by background pixels. But is there a more efficient method? I am willing to learn some OpenGl to implement this (but will have to use AllegroGl if I do decide to use OpenGL) A side Allegro-specific question: Will set_draw_mode(); have any uses to solving this problem? I'm not quite sure how to use it, but it seems to have some relevant uses.
  15. 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.