Murmix

Member
  • Content count

    12
  • Joined

  • Last visited

Community Reputation

154 Neutral

About Murmix

  • Rank
    Member

Personal Information

  1. C++ Tic Tac Toe

    [quote] [color="#000088"]void[/color][color="#000000"] resetBoard[/color][color="#666600"]([/color][color="#000088"]char[/color][color="#000000"] array[/color][color="#666600"][[/color][color="#006666"]3[/color][color="#666600"]][[/color][color="#006666"]3[/color][color="#666600"]])[/color] [color="#666600"]{[/color] [color="#000088"] for[/color][color="#666600"]([/color][color="#000088"]int[/color][color="#000000"] i [/color][color="#666600"]=[/color] [color="#006666"]0[/color][color="#666600"];[/color][color="#000000"]i [/color][color="#666600"]<=[/color][color="#006666"]3[/color][color="#666600"];[/color][color="#000000"]i[/color][color="#666600"]++)[/color] [color="#666600"] {[/color][color="#000000"] array[/color][color="#666600"][[/color][color="#000000"]i[/color][color="#666600"]][[/color][color="#006666"]0[/color][color="#666600"]][/color] [color="#666600"]=[/color] [color="#008800"]'*'[/color][color="#666600"];[/color] [color="#666600"] }[/color] [...] [/quote] Hello, in your resetBoard function, the for loops actually iterate four times, i=0,1,2,3, then assigning a value for (non-existing) [b]array[3][n].[/b] This will in best case produce an error, and in worst case undefined behaviour. Use [b]for (int i = 0; i < 3 ; i++)[/b] to loop three times: 0,1,2 Cheers, Daniel
  2. Need a new name...

    [quote name='Sereath' timestamp='1321883540' post='4886194'] [quote name='JustChris' timestamp='1321654268' post='4885425']try to keep it as searchable on the internet as possible, because Google tried to correct my spelling of "Cwerky". [/quote] Very good point. If Google can't find it, or intensively point to something different with a similar name, you failed. [/quote] ...which is funny, considering Google is a quirky misspelling of the number googol.
  3. Hello Miles, I recommend XNA too: There's plenty of tutorials and sample code, It's easy to get started. Also, it's incredibly fun to see your game on a smart phone (or Xbox). I would like to help if I can. Don't be shy about asking basic programming questions here, and feel free to add me (Murmix) on Skype if you want to ask or discuss something. (I don't use a mic, chat only.) Cheers, Daniel
  4. Communication with a database

    Hello Ndraskovic, Refresh only redraws the actual graphical object, you probably want to call DataBind() after every action that adds or deletes something from the database. Here's a great quick start video from (my hero) Scott Gu, about easily filling a gridview with data using LINQ: [url="http://www.scottgu.com/blogposts/video/linqtalk1.wmv"]http://www.scottgu.com/blogposts/video/linqtalk1.wmv[/url] Cheers, Daniel
  5. Hello Gamedev'ers, I recently started coding a simple multiplayer turn-based strategy game. My tools of choice (for now) are C#, XNA for Windows, Lidgren Network and MSSQL. Now, I haven't done any multiplayer stuff since experimenting with DirectPlay last millenium, so I sat down and drew some pseudocode how I imagine the game server would work. I'm starting coding it right now, and it would be of great value to me if you wanted to look at my pseudocode, to see if something is horribly wrong or give general feedback. Thank you in advance. Best regards, Daniel Molnar ******************************************************** Pseudocode for the GameServer application below: ******************************************************** [code] //// enum GameServerStates { Error = 0, Initializing, WaitingForPlayerSelectBaseTile, WaitingForPlayerMove, GameOver etc. } //// enum DataMessageTypes { Error = 0, PlayerLogin, StartNewGame, MovementUpdate, SelectedBaseTile, AttackUpdate, RequestFullClientSync, SendFullClientSync, PlayerChat, etc } //// the main GameServer class class GameServer { start Lidgren server with DAL.LoadConfiguration(); Loop forever: for each incoming message { read [GameId] from Message and send it to the specific game instance Game[GameId].HandleMessage(); } for each active Game instance { //do special and timed events for all active games Game.SendTimedUpdateOrWhatever(); if (Game.ServerState == GameOver) { game.ShootFireworksAndStuffAndThenDisconnectOrWhatever(); DAL.SaveGameDetails(); } } } //// one class instance per active game Game { int myGameId; GameServerStates myGameServerState; List<Player> ConnectedClients; HandleMessage(DataMessage) { switch(DataMessage.DataMessageTypes) { case DataMessageType.MovementUpdate: //do movement update server logic //send relevant messages back to all clients break: case etc etc (do relevant server updates for each DataMessageType) } } } ////connects to a MS SQL Server with LINQ GameServer.DAL { //Server configuration, ip address, port, etc. is read from the database LoadConfiguration(); //when a game is finished/paused/cancelled, the details are flushed to the database: game id, players, result, etc. SaveGameDetails(); //Bring back a saved/unfinished game from the db LoadGameDetails(); //read statistics (high-score lists, etc.) from db LoadStatistics(); //simplest possible login: username and password (password only needed if you want to "register" your username) LoginPlayer(); EtcEtcDBrelatedstuff(); } [/code]
  6. basic XNA problem

    Hello. The list thingy returns a copy of the vector, so there's no point in modifying it. Try something like: for (int i = 0; i < fireList.Count;i++) { Vector2 newpos = fireList[i]; newpos.X -= 1; fireList[i] = newpos; } Cheers, Murmix Turtle Boogie concept demo download is available here: http://www.murmix.com/TurtleBoogie
  7. Hello game programmers, I've been coding professionally for most of my life, sometimes games, sometimes other stuff. The reason I write this post is that I feel that I keep make (at least) one reoccuring "newbie design flaw" over and over again. Let me try to explain with the current example: I build a game. It's object oriented C#, everything is beautifully encapsulated and working fine. There is a main "game" class and declarations of my objects: public class MySuperGame : Microsoft.Xna.Framework.Game { MyPlayerClass thePlayer; MyTilemapClass theTilemap; //(...) } Problems begin when these objects need access to each other. In this fabricated example, the "Player" class is doing collision checking with stuff on the Tilemap. So, my options, I can either 1) Break out the logic, and do everything in the game class MySuperGame.DoCollisionStuff(MyPlayerClass thePlayer, MyTilemapClass theTilemap) or 2) cross-reference the pointers, for example initialize the player class with a reference to the tilemap public MyPlayerClass(MyTilemapClass theTilemap [, textures and stuff] or 3) just pass a pointer when it's needed: protected override void Update(GameTime gameTime) { thePlayer.HandleCollisions(theGameTilemap); //(...) } I have been mostly doing #3, but I feel that it's flawed design and it quickly becomes cluttered with unnecessary cross-referencing pointers and variables. My next step is to make an "achievement system". I imagine an AchievementHandler class that keeps track of everything that happens in the game, so this class needs to be accessible from every single corner of the code. MyPlayerClass.DoJumpyStuff() { theAchievementHandler.Add(AchievementType.PlayerJumpCount, 1) //(...) } MyLevelHandler.StartNewLevel() { theAchievementHandler.Add(AchievementType.LevelsPlayedTotal, 1) //(...) } //etc.etc. This makes me think even more urgently of a "good code"-solution to this dilemma. I hope this makes sense. Thanks for reading, I value all feedback. Cheers, Murmix PS: The game in question is Turtle Boogie, a little arcade action fun. A concept prototype demo download is available here: http://www.murmix.com/TurtleBoogie
  8. XNA platformer help

    Hello PoisonMushroom, There is a "Platformer Starter Kit" included in the XNA 3.1 templates. It's quite nice and simple to understand. Cheers, Murmix
  9. Functions using class objects

    Oops, sorry about my faulty reply and thanks for the correction. Pass by reference sounds much better. =) pointer-to pointer is evil and confusing, hehe. /Murmix
  10. Functions using class objects

    Hello Dark_Glitch, Let's see... maybe something like this in C++? Use asterisk "Player*" which means a pointer to a player object when it is a pointer, you use "->" to access members void CreateCharacter(Player* aPlayer) { aPlayer = new Player(); aPlayer->Lives = 3; } // And when it gets used: Player* firstPlayer; CreateCharacter(firstPlayer); Cheers, Murmix
  11. Hello all, Greetings from sunny Scandinavia! I have been lurking around GameDev.Net for quite some time, and finally decided to start a hobby game project, so I am posting here for some feedback and (hopefully) motivating constructive criticism. The working title of my game project is "Beetle Battle", a 2D arcade/action game. The player controls a tank which also has a freely rotating gun turret, so it can move in one direction and fire in another. I randomly found and chose the Gorgon library to start working with a few days ago, and have so far only added some basic game elements like object creation, drawing, "acting", tilemapped scrolling backgrounds and collision detections. Here is a demo of the game so far: http://www.youtube.com/watch?v=9nVEEhE121Q I am almost ready* with the foundation stuff, and can start on the actual gameplay. Envisioning these two basic game modes: Multiplayer (Capture the fort): Two teams, maybe 4 vs. 4 players who are battling to hold a fort in the center of the map. The team who holds it for a longer period of time wins the game. Single player: Combined "slalom skiing" with target shooting. The player has to maneuver the vehicle through gates on a scrolling map, while shooting on targets. I used to work for a game company eight years ago that made silly little 2D games like this, so I have a decent understanding of the game concepts, the difficulties and obstacles even a small project like this will face. By the way, my old games are still available for download at www.e-game.com. I have no idea who owns the domain now, and they seem to affiliate with some online casino thing, but the games seem to be still safe to download and play. (stand-alone EXE-files of ~400kb each) Despite the stickied guidelines, I am not asking for feedback for just one particular thing. As I already wrote, I am just hoping for some general motivating discussion (and for people to watch the Youtube video and say that it looks like the most fun game that they haven't played yet). :o) Will post more videos and look for pixel artist friends once I made a little more progress towards an actually playable game. Thank you for reading this. Looking forward to hear any comments and feedback. Best Regards, Daniel