CIJolly

Members
  • Content count

    237
  • Joined

  • Last visited

Community Reputation

282 Neutral

About CIJolly

  • Rank
    Member
  1. Hey everyone, after 7 weeks of coding, I've got my first complete game ready to publish. However, that process is somewhat hampered by the fact that it only runs on my own computer. The problem occurs when the game tries to load levels which are stored as .bin files. When I install it on another computer, the menus load, but when a level is loaded it hangs. The same error happens whether the level files are in the directory or not, and the error stops occuring when I have the game open a hard coded test level. Thus, I'm fairly certain that the ecternally stored levels are the cause, and that it's not finding them. I am using this code to find the current directory: string currentdirectory = System.IO.Directory.GetCurrentDirectory(); Then, to get the full path of the level to load string pathofleveltoload = currentdirectory + "\\" + leveltoload; This works fine when I run the project from the debug directory, but after I publish it it wont work on my own or anyone elses computer. Where should I be storing the .bin level files, and how can I tell the program where to load them from? As an aside, when I just copy and paste the entire debug folder into the target computer, the levels load with or without the directory specifying code above. However, none of the sounds play. How come all of the sprites load automatically, and it can find the levels, but not the sound effects? Thanks for any help.
  2. Thanks for the suggestion. I hadn't even thought about that aspect of the visual style. Outline or backgrounded really would be an improvement.
  3. Hey everyone, I've been working on a 4 player single PC game for a while, and am experimenting with different display directions. The idea is that home pc users are being indiscriminately recruited to pilot remote combat drones. So, the display has to be low tech enough to run on the lowest common denominator pc. If anyone has any ideas as to how to carry on with the low tech but (hopefully) aestheticaly pleasing them, I'm all ears! Also, is the Scanline/LED look better, or the Softsprites/Grid look? Basic, prototype graphics [url=http://www.freeimagehosting.net/][img]http://www.freeimagehosting.net/uploads/11d587fd79.jpg[/img][/url] [url=http://www.freeimagehosting.net/image.php?cf286add64.jpg][img]http://www.freeimagehosting.net/uploads/th.cf286add64.jpg[/img][/url] Experiment with Scanlines and LED type display [url=http://www.freeimagehosting.net/][img]http://www.freeimagehosting.net/uploads/fdd430e2dd.jpg[/img][/url] [url=http://www.freeimagehosting.net/][img]http://www.freeimagehosting.net/uploads/th.839aee5c55.jpg[/img][/url] [url=http://www.freeimagehosting.net/][img]http://www.freeimagehosting.net/uploads/th.c5c73e5552.jpg[/img][/url] Experiment with Softer sprites and grid background [url=http://www.freeimagehosting.net/][img]http://www.freeimagehosting.net/uploads/fe0b7604a1.jpg[/img][/url] [url=http://www.freeimagehosting.net/image.php?3b86df05ba.jpg][img]http://www.freeimagehosting.net/uploads/th.3b86df05ba.jpg[/img][/url] [url=http://www.freeimagehosting.net/image.php?8d50de244a.jpg][img]http://www.freeimagehosting.net/uploads/th.8d50de244a.jpg[/img][/url] http://droneuplink.webs.com/
  4. Thanks for that. Just thought I'd double check before I committed to the method.
  5. Hey everyone, just wanted to gauge what the general opinion was before I commited to this system for storing and loading my levels. I'm using XNA 3.0 to create a top down shooter, and am at the stage where there is enough content that hard coding is impracticcal and I need a level editor. My basic plan is to create a level class. The level class will contain lists of terrainclass, enemyclass, and pickupclass, and a few specific bits of data like level number, next level, level dimensions etc. This will be able to be loaded and saved using binary serialisation. One question I had is if I would be better off using XML serialisation. As near as I can tell, binary seems to be much easier to impliment, and should be perfect for my purposes. No other programs are going to be using these files, so would there be any advantage of XML? My second question is is this level saving system a good idea at all, or is there some looming pitfall that rookie binary serializers fall into. It's really going to be the system I structure my entire level editing code around, and thus a huge potential for disaster if I'm hamstrung from the get go. Paranoid, I know, but this isn't an area I have much expertise on, never having gotten past one screen game prototypes before.
  6. Ideas for a Modular Enemy AI

    Thanks for the advice everyone. You've given me a lot of things to check out.
  7. I am working on a top down run and gun, and have finished the weapons. By making weapon modules which added things like submunitions, explosions, freezing, poison, etc, I was able to approach the situation in such a way as to make a wide variety of weapons using combinations of exisiting code. (Diablo style, really). I am interested in doing the same thing with AI. That way, I can make modules for gun wielding enemies, melee chargers, healers, kamakazi bombers, etc, and load them in a modular way such that I can make a large variety of enemies by mixing things around. Any advice on what the best way to go about this would be? I handled modular weapons by giving them indexes which, when a collision occured, went to a lookup table to see the special effects. I'm getting the feeling that doing this with AI will be somewhat more involved. At the moment I was thinking having logic along the following lines: Loop through list of modules, giving the current game state to the modules decision making functions. These will return an int based on how beneficial the module is at this time (Eg, a melee module would return 0 when the player was out of melee range, a heal myself module would return 70 if critically damaged). These values could be modified based on AI personality. (Eg, a fearless enemy will have their run-away value slashed). The modules will then be randomly decided between, with those returning highest after the decision making process being more likely to be picked. Carry out the modules commands in the update method, checking periodically to see if the module should break (Eg, if taking large amounts of damage, stop heal module and reevalute. On the reevaulation, run away would evalute highly and be the most likely to be picked and acted upon). Once module the module is completed, reevaulate situation. Does that sound like a sensible plan? Hopefully it will allow me to make interesting and varied enemies. Has anyone else tried something like this before and has a suggestion to make it go smoothly? I'm using C#, if it's important. Thanks for reading.
  8. XNA viewport zoom

    After a lot of searching, I never found how to to simply and automatically scale the entire screen the way the program did when I set the position to half the screen dimensions and didn't change the width. I ended up simply scaling all sprites and positions by whatever the zoom was. A little more ugly and a little more work, but it worked. I would still be interested to know if there is a coding solution to the problem, seeing as somewhere along the line it must know how to scale the view automatically, as that's what it does by default in one situation.
  9. AI Advice, Basic Zombies

    You're correct. I meant 49+48+47...etc, which is what my loop should do.The last zombie wont have to check any collisions, the first will check 49.
  10. I am making a 4 player 2d game, and want 4 viewports on one screen. Each player will see a half scaled version of the game in their quarter (Eg, circles or radius 16 become radius 8) If I set the viewport Height and Width to half screen height and width and leave the viewport X and Y as 0, it draws a viewport in the top left corner of the screen. All of the sprites are regular sized, but when I draw primatives, they are scaled to one quarter of their size and position. However, if I set the viewport X and Y to halfscreen width and height, but leave the viewport width alone, something different happens. The scene is drawn the same as a fullscreen viewport, but with everything, txt, sprites and all, scaled down to half size. This is the effect that I want for all 4 corners. At the moment I stumbled across how to get it to zoom out to half on the bottom right corner just by changing the viewportX and Y and leaving everything else alone. It's like it had to zoom out to squeeze everything to fit, and this is exactly what I want for the other 3 viewports. I'm using a 3rd party class PrimativeBatch to draw my primatives, and would rather not have to learn about transformations if I can avoid it, seeing as it looks like XNA has figured it out once by itself already! Any ideas how to go about this? [Edited by - CIJolly on March 11, 2009 7:22:08 PM]
  11. AI Advice, Basic Zombies

    On your "expensiveness of 50 zombies" problem. The first optimisation is to bring it down to 50! rather than 50*50. To do this, when you iterate through the zombies to check collision, start each sub loop advanced by one, so: for (int i = 0; i < numberofzombies; i++) { for (int i2 = i+1; i < numberofzombies; i2++) { Checkforcollision(zombie[i], zombie[i2]); } } So, each zombie starts checking collisions from the next one in the list. It doesn't have to check with the one before it, because that one already checked that pair when it was it's turn to go through the loop. More advanced would be to do some broad phase collision detection. Grid based (where you add each object to a grid, and then iterate through the grid only checking for collisions between objects in adjacent squares) and Sweep and Prune (Where you built a 1dimensional list of all the objects in the game and only check between objects with overlapping left and right edges) are two simple ways to bring it down greatly. Just by using sweepandprune in one dimension I can handle 700 enemies bunched up colliding with each other.
  12. Wow, as easy as that! Thanks for the help.
  13. I have made a list of a class called PhysicalObject. ProjectileObject and CharacterObject are derived from PhysicalObject. These are all stored in the same PhysicalObject list, in order to perform the collision detection routines that are the same for both object types. However, when the code detects a collision between physicallist[i] (which, the way the detection code works, will always be a ProjectileObject) and physicallist[i2] (which will always be a CharacterObject) I want to call a CharacterObject function called ImHit(ProjectileObject projectilethathitme). I tried using physicallist[i2].ImHit(physicallist[i]); but it said that I was giving it the wrong type. True, I had given it a PhysicalObject rather than a ProjectileObject. But I know that in this setting, the PhysicalObject always WILL be a ProjectileObject. How can I pull the ProjectileObject from the PhysicalObject list to hand it to ImHit(ProjectileObject projectilethathitme); ?
  14. At Devfred. Wow. It's funny, that is exactly how I first tried to get things to target each other in C++. Of course, it all turned out to be much more complicated than that. But this...wow, that's really, really logical. Thanks for the heads up, who knows how long that would have taken me to figure out! At Cignox. Interfaces are another thing I hadn't encountered. I'll have to look into them for my program. Thanks for the answer.
  15. Hey all. I'm returning to game coding after a long absence, and have switched to C# and XNA on the grounds that it makes everything a million times easier for a hobby coder such as myself. However, from what I am reading, pointers are something to be avoided in C# where possible. I've read that "unsafe" code isn't as ominous as it sounds, but all the same... So, there are a couple of things I would do with pointers in C++ that I am wondering how to replicate in C#. The first would be allowing objects to "target" other objects. This could be a heat seeking missile that would have previously given a pointer to it's target, or a player that is given a list of pointers to objects in his inventory. I thought about tracking the objects by their place/index in the linked list (eg, missile target = int targetindex where targetindex is the target enemies position in a list) but when objects get removed from the list these indexes change. Is the solution to just add code to keep up with these changes (eg, whenever something is deleted before the missiles target, have a function iterate through the list and change any out of date indexes). The other problems was with derived/child classes. I want to have an array of physical objects that behave the same way in many respects (eg, collisions and physics) and reside in the same list. However, special objects like players need to be handled differently. In C++ I would make an array of pointers to the players, and iterate through it to perform special player code like input. How can I replicated this in C#? Is it a case of going through the list and finding index entries to the player's objects?