xynapse

Members
  • Content count

    135
  • Joined

  • Last visited

Community Reputation

151 Neutral

About xynapse

  • Rank
    Member
  1. I am thinking about developing something small but 'intelligent' in free time. Everybody knows 'Tamagotchi' series, 'Virtual pet' clones and so on - they all share one common thing: you get an egg from which:[list] [*]your pet borns, [*]then you need to take care of him (turn off the light to force him to sleep, feed him, cure him, play with him) [*]your pet grows [*]and grows [*]and finally dies. [/list] States can be programmed within a single FSM, but what about the pet moving within those states? What should decide what state the pet is besides the human intervention ( like forcing pet to go to sleep ). Let's imagine a situation where a pet is born, it gets some default/randomly generated stats. Now i could easily hardcode something like: if(m_fHunger > 50) FSM->ChangeState(PetHungryState::Instance()) But that is something i want to avoid. It can be very easy and predictable like for kids, on the other hand it can be very challenging and 'intelligent' if i choose the right approach from the beggining, and i am targetting the second option here. I would like it to be unpredictable but intelligent, behaviouristic, AI driven. So my question to you guys is: what kind of AI approach should i choose / algorithm / technology to make it a small but fascinating project ? What can be managed by correctly choosen AI and what has to be managed by a code ? Thanks very much!
  2. Ok, i don't think i will ever invent that so i better ask before spending another days looking for something related to the problem... [u][b]SOLUTION FOUND HERE[/b][/u]: http://www.gamedev.net/topic/567310-platform-game-collision-detection/ My game uses AABB's for collision detection, and i check objects for collision with: [source lang="cpp"] int CBoundingBox::classify(const CBoundingBox& rOther) { if( rOther.min.x >= min.x && rOther.max.x <= max.x && rOther.min.y >= min.y && rOther.max.y <= max.y && rOther.min.z >= min.z && rOther.max.z <= max.z ) { return INSIDE; } if( max.x < rOther.min.x || min.x > rOther.max.x ) return OUTSIDE; if( max.y < rOther.min.y || min.y > rOther.max.y ) return OUTSIDE; if( max.z < rOther.min.z || min.z > rOther.max.z ) return OUTSIDE; return INTERSECTS; } CVector3 CBoundingBox::closestPointOn(const CVector3& vPoint) { CVector3 xClosestPoint; xClosestPoint.x = (vPoint.x < min.x)? min.x : (vPoint.x > max.x)? max.x : vPoint.x; xClosestPoint.y = (vPoint.y < min.y)? min.y : (vPoint.y > max.y)? max.y : vPoint.y; xClosestPoint.z = (vPoint.z < min.z)? min.z : (vPoint.z > max.z)? max.z : vPoint.z; return xClosestPoint; } bool CBoundingBox::hasCollided(const CBoundingBox& rOther) const { if( min.x > rOther.max.x ) return false; if( max.x < rOther.min.x ) return false; if( min.y > rOther.max.y ) return false; if( max.y < rOther.min.y ) return false; if( min.z > rOther.max.z ) return false; if( max.z < rOther.min.z ) return false; return true; }[/source] That works perfectly fine but i need to implement sliding with AABB's so i will need to find out collision normal between AABB1 colliding with AABB2. Can somebody *please* help me out with this and show me how do i calculate a collision normal between two AABBs ( the normal of the face of the AABB that the player is colliding with ) / find colliding AABB faces ?
  3. Hi, i've got my own 3ds exporter plugin (supports physique for bones) - what's your problem?
  4. 3DSMax: Baking textures #1

    As my iOS engine cooperates with 3DSMax via my custom plugin i would like to ask you guys one thing. - Can i select all objects in the scene ( having different textures ) and bake their textures into a single one (like atlas) ?
  5. you better, debug the frame with xcode frame grabber and check whats going on step by step.. your description doesnt say anything ...
  6. polyfrag, show us your aabb - tri method first.
  7. Hey guys, sorry for a delay - but i was off for some time. @JWalsh - sure thing, go on and let me know where can i read about this - i am very interested in this. @Cornstalks && @Postie - i already have events driven system implemented, and yes this is a great solution - everything within a level can dispatch 'messages' to it's receivers and thanks to that i can react on any kind of events happening in the game. Just need to 'pack' it somehow into a generic solution, that i could use within all levels in the game... Well i think that i could delegate that 'logic handling' to the script files instead of going in C++ - i think it would be better to separate that from the main game code, and just let scripting handle the logic 'somehow' - but from the other side, it will take time to prepare the scripting implementation - and that time could be used to code the logic handling within the game. It's my first public title, and i would like to avoid using 3rd party libs with licenses. I am still interested how people handle logic in their games, not everyone has scripting implemented - so how do they handle their game logic clean and clear ? I'll prepare a sketch for the first level and drop it in here so we can all see what kind of game we're talking about. Maybe that would be more useful than my YT post. Thanks for any input guys, it is great we can share ideas.
  8. @kuramayoko10, Servant of the Lord - yes my engine is OO, so polymorphism is a known practice. Thanks to both of you for a bit of light on this. I just need more sleep to finish up this title ;)
  9. Guys, what are the approaches used to handle the game/level logic, which prevent you from falling into a spaghetti code? I have a player in 3d isometric adventure game where you escape from a set of rooms. Each room is different and sometimes you will need to go back, to pickup an item which is needed in your current ara ( you pickup a wrench in room 3, which you will use in room 6 to open up the safe ). [url="http://youtu.be/TmiTJPjdTzU"]http://youtu.be/TmiTJPjdTzU[/url] Let's imagine a simple level : [img]http://extraordinaire.pl/0.jpg[/img] [color=#00ffff]Player[/color] [color=#ff0000]Doors[/color] [color=#ff0000]Key[/color] Ok, now that is easy aye?You can make this easily with a single BOOLean like: [CODE] // PSEUDOCODE // bool bHasKey = false; // Event handler case ITEM_PICKEDUP: { if(item == key) { bHasKey = true; } } break; case PLAYER_COLLIDES_DOORS: if(bHasKey == true) { pDoors->Open(); pKey->Destroy(); } break; [/CODE] It's easy but i would like to avoid this kind of coding game logic - as it turns very quickly, that if you handle 10 rooms per level in one game state, and you have 5 levels, your game state class for level handling will grow into a piece of if/else/switch/case stuff that you'll debug continously scratching your head and asking - why is this here, and that there..? Let's go to another theoretical room. So, this time player has tu pull 3 switches in specific order - which in return opens the door for 5 seconds. [color=#000000][img]http://extraordinaire.pl/1.jpg[/img][/color] [color=#00ffff]Player[/color] [color=#0000ff]Switch[/color] [color=#ff0000]Doors[/color] [color=#000000]Now this level plus the previous one are slowly moving towards a mess - but as long as there are three to four rooms per level - you can handle it somehow.[/color] [color=#000000]What if my Level (map) has 10 rooms, each one more and more complicated, and i have 5 levels ready - making 50 rooms in total.[/color] This kind of coding would be a disaster sooner or later... [color=#000000]How do you approach that ? single state machine per level ? ( how would you apply it to this model ? ) anything else? I just can't figure out how to do it - my brain is empty after several days of decoding ima4.[/color] [color=#000000]Thanks ![/color]
  10. Clear, thanks ;) I have made it more complex, by creating a - [url="http://gamedevgeek.com/tutorials/managing-game-states-in-c/"] Game State manager[/url] and - Internal messaging ( [url="http://www.gamedev.net/page/reference/index.html/_/technical/game-programming/simple-event-handling-r2141"]Event handling[/url] ) [img]http://extraordinaire.pl/gd/logic/1.jpg[/img] So thanks to this, when my GUI button is clicked i get message sent to Engine, which then forwards this to m_pCurrentGameState ( which is a Game State that has been activated by the client ). Now after loading the level ( via Level Manager Class ) - when collision occurs, message is sent through the disptacher (singleton) to the engine. This message has additional payload that consists of ObjectA and ObjectB pointers, but every message payload can be customized. So this message is received in Engine Class and then forwarded to Current Game State, where inside this Game State i just handle incoming messages from engine by doing 'switch' - thanks to this i can write down the level logic by testing messages coming in like: COLLISION PLAYER WITH "ObjectX", GUI BUTTON CLICKED "GUI control ID" and i have finally managed to generalize my internal engine messaging system. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  11. I am thinking of a way to handle level logic in the game. Let's imagine we have a situation like this ( quick drawing ) [img]http://extraordinaire.pl/gd/logic/0.jpg[/img] We have two rooms ( Room1, Room2 ) and Doors. Player has to go from Room1 to Room2 in order to progress with the game. To achieve that, - he has to grab ( collide with ) the key, - collide with the doors ( what will check if he has the key and if true, doors will open ) - after he goes through the doors to Room2 player hits 'trigger object' ( collides with it ) and doors close - so there is no way you can go back to Room1. How is this normally handled in small games ? How is logic handled for levels like the one above and more complicated situations ? Is it called Event Handling ( [url="http://www.gamedev.net/page/resources/_/technical/game-programming/effective-event-handling-in-c-r2459"]http://www.gamedev.net/page/resources/_/technical/game-programming/effective-event-handling-in-c-r2459[/url] ) ? Thanks!
  12. Post processing - approaches

    @Ashaman73 - thanks, looks like a nice idea - will have a closer look to a similar thing after the weekend.
  13. Ok, just replying to let you know i have finally solved the issue. The problem wasn't the export, it was due to the fact i wasn't rotating vertices around the bones positions.. seems silly, but simple things fail most often.. Happy now, taking a weekend break Thanks Rob.
  14. Yes, thank you very much. Now it makes more sense. Thank's again for your help, much appreciated!
  15. Post processing - approaches

    dpadam - hi again ;) true, you're right but i can [CODE] // Imagine Blur here, first Blur Horizontal, second Blur Vertical // Vertical gets input from Horizontal output in this situation.. for(effectN = 0; effectN < effects_size; effectN++) { pass the resulting texture of effectN-1 to effectN as the input. } then i can multiply the last effectN output texture with the original frame texture. [/CODE] Yes, this won't be a 'typical' blur as we're bluring in Vertical from Horizontal instead of original - but it can be tweeked a bit to achieve it. And i believe few other effects can be also achieved with this approach.. Will have to check, Anyways, seems like you say there is no good effects management solution around to have a look? So when people code effects in their engines, how do they manage them ?