Jump to content

Road Kill Kenny

Members
  • Posts

    667
  • Joined

  • Last visited

Posts posted by Road Kill Kenny

  1. Hi all,

     

    I decided to make a topic out of this considering there was so much talk about it under my status thread and I think it would be interesting for people to know the good the bad and the ugly of using SQLite or and sql databases for you game.

     

    There also seems to be some uncertainty as to 'why' use this over a simple text file parser and I'll get to that in a moment. Feel free to add your own information / experience with SQLite I have only been using it for a few days now but It's just that easy.

     

    How it works:

    Ok so instead of storing data trivially in a text file you store it in a very structured was in tables that have columns and rows. Each table holds data about specific things such as Amour, Weapons, Abilities, BodyModels etc etc.

     

    Within those tables every record or row has an ID which is unique to that record and a number of fields. So in our example in our armor table we could have: Armor_ID, Name, Model_Path, Health, Dmg_Reduction etc etc.

     

    Now we can see that things are being stored in a much more structured way. Now each field gets assigned a variable type such as integer / text / bool/ etc. You can also put constraints on different fields such as "Not Null" this basically means that that field will not accept you creating a record with a Null value in that field which is good because what if you tried to load a path that was Null... <ERROR> Text files won't help you in that regard.

     

    Ok so we have our database and now we want to use it in game. These are pretty much all the commands you need. Pretty simple ....

    #include "sqlite3.h"
    
    
    sqlite3 *database;
    
    sqlite3_open("ElementalDatabase.s3db", &database)
    
    sqlite3_stmt *statement;
    
    sqlite3_prepare_v2(db, "SELECT columnA, columnB FROM TableA;", -1, &statement, 0)==SQLITE_OK
    
    sqlite3_step(statement)
    
    sqlite3_finalize(statement);
    

     

    Anyway the cool thing is that you can set it up in a function that returns a std::vector<std::vector<Type>> array that that basically represents a table or a number of columns in a table like this

     

    std::vector<std::vector<int>> QueryDatabase(std::string);

     

    So once you have setup your QueryDatabase functions like above its as easy as calling it like this

     

    QueryDatabase("SELECT columnA, columnB FROM TableA;");

     

    Ok so I hope that gives you an overview. Keep in mind the above function is only for reading from the db.

     

    The Pro's:

    1. Well structured information that is easy to read and easy to find what you are looking for.

    2. No need to write long winded text file parsers for each textfile. Everything can be efficiently stored in 1 file if you wish.

    3. If you set up your database correctly SQLite won't allow you leave Null values or type in wrong types.

    4. Can store extremely large amounts of data and access any of it easily and quickly. Much faster than reading from a text file especially a really big one.

    5. Perfect tool for data driven design

     

    The Con's:

    I can't think of any.... tbh someone fill me in if you know any Cons.

     

     

     

    So on a final note. You can also download SQLite database editors that allow you to visually go into tables etc and edit your data. The one I use is SQLite Administrator and it looks like this: So easy to use and you are less likely to make a mistake than if you are writing into a text file:

     

     

     

     

     

    post-3220-0-36363800-1327713317_thumb.jpg

  2. [/size][/font][/color]

     

    If that was a joke then smile.png otherwise (it's the internet so I can't read emotion all that well smile.png ) I think Zaphos plans on adding attachable gear and many textures like some MMO's do. He'll sell the gear to be prebuilt to be easily attachable to his models. I'm really excited about that because you don't see that all that much in the indie modeling world and I think there is a huge market for it as most everyone wants to make some kind of RPG it seems (including me) and gear is generally a pretty big part of those games.

     

    Yes was a joke

  3. I run the game. It seems frozen. I press the buttons to move. Nothing seems to happen. I then move the window. The window updates to the current frame - no animation, just jumps from the old to the current one. Press more buttons. Nothing moves. But as soon as I move the window it updates again. I'm probably one of very few people who this happens to.

     

    Oh wow. Thats odd :(

  4. "Josh, on 23 January 2012 - 04:34 PM, said:

    Most of the forums are for registered developers only.

     

    Then You replied:

    This has no logic whatsoever what does this mean? and whats with the hostility? is that how you treat all new members? sheesh... really know how to make somebody feel welcome... "

     

    And now I say:

    Now I'm assuming that what was said was in a PM or something but I can see where it originated as above.....

     

    Judging by the way you reacted to this simple statement I'm not surprised. There is nothing hostile about what Josh said here... and I'm guessing everything escalated from there.

  5. +1

     

    I would very much like to know if anyone has a good source for fx. I have been looking for this for a while without much success. Most sound FX that you find on the web seem to be very horrible and that doesn't seem to be different whether they are free or not. despite a few.

     

    Dexsoft has some nice sounds but there are not that many. Good footsteps and some good ambient sounds.

     

    As far as music goes. I have found that there is a lot of free (Creative Commons Licence) music that is proffessionally done and better than most paid music. My fav site is www.incomptech.com for music

  6. This is very cool. I was born in South Africa so I grew up seeing animals like this and going on Safari in holidays. I've seen all the big five many times in my life. This is very very cool. It captures the feel very well. nice work.

  7. @Everyone. Thanks ;)

     

     

    PS: if you dont like to ancounter you tube for an walkthrough video - its basically like "game of death".

     

    I'm don't understand what this means? what's 'ancounter'. Whats basiclaly like "game of death".

     

    I honestly can't understand what this line says. :|

  8. This is the game that I have been working on creating. I recently got to a point where I can start adding in game play elements so I thought I would post how things are going.

     

    The game is called Elemental. I'm going to leave the in depth explanation for the video but for a 1 sentence sum up, Elemental could be called:

    'A game with the fast paced feeling of an FPS but with a mmo pvp style combat system on steroids.'

     

    Sounds confusing? watch the video to find out what I mean.

     

    Note: This is not an mmo in anyway (just thought I'd clear that up)

     

     

    The idea for this game stems from a few things.

    1. People who love mmo's but don't have the time to grind levels and gear.

    2. People who love fast paced PvP but again don't have enough time to grind levels and gear so that they can compete.

    3. Not limiting players but allowing them customisation on a level that is not about the look of your character but how your character plays.

    4. more.. but watch the video to get an explanation.

    • Upvote 2
  9. Yup, that's it. I can make a video if you want to see it in action.

     

    No that's fine. I know what it does. I'm just confused by what you were saying.

     

    "the game doesn't update for me unless I move the window"

     

    not sure I understand what you mean by that because it sure doesn't do that on my computer. Probably just a misunderstanding lol

  10. Very cool idea. It would be nice to see the latest and greatest from the projects that in their later stages.

     

    I think you pretty much summed up what would be good in it in your first post:

    1. Video

    2. Screenshots

    3. Bio / Features

    4. Latest news (for that game) section.

     

    From what I gather from your tone (lol tone...) it would be more about the game and less about the technical things? Am I corret?

  11. I'm guessing you have Flip(1) in your code. tkunze found that it makes it so the game doesn't update for me unless I move the window.

     

    Huh? Flip(1) means v-sync is on. Flip(0) v-sync is off

     

    Also Clackdor you can completely eliminate pic number 2 if you use multiple raycasts. as shown in the following picture:

     

    post-3220-0-10516500-1326885142_thumb.jpg

    Note: When I say in the pic fire 4 'arrays' I actually mean ray-casts lol.

     

    Off course this is just my method and by no means the only way. However, it does eliminate any possibility of things being clipped on the sides above and below.

  12. I don't know if there is an "official" way to do this... Maybe cycling through all bodies and setting the mass to 0 on pause and then, setting them back to their normal values after pause..... This is just a guess. I have no idea if it will work.

     

    Perhaps try this -

    On Pause:

    1. Record all Velocities & Omegas.

    2. Set Velocities & Omegas to 0.

    3. Turn off Gravity

     

    On UnPause:

    1. Set the Velocities, Omegas back to normal.

    2. Turn on Gravity

     

    Neway it sounds like a messy way to do it but I guess it could work.

     

    Dadonik was trying to pause physics recently. Not sure how far he got with it.

  13. Lol. My wife wouldn't appreciate it either but looks like you have a taker. Goooo Scotty!

     

    Oh and there's almost no such thing as spam in an off topic forum. Unless its someone trying to sell something.

  14. The DrawImage() command takes 5 inputs:

    - image path

    - xPos

    - YPos

    - XDims

    - YDims

    Now this is how you draw a healthbar that dynamically scales with health

     

    DrawImage("abstract:HP_Bar.dds", xPos, YPos, XDims*(HP/maxHP), YDims);
    

     

    ^^ so thats the code for a dynamically changing Health bar. Your player class will have to have the variables for HP and maxHP. Now for taking damage..

     

    It really depends what type of game you are doing because there are a number of options. However, basically the concept is the same. Losing health is just a reaction to an event and as said in the above post that even could be colliding with another body at a velocity (eg. 5m/s to 10m/s does x damage.... or you could make it a function of the velocity eg)

     

    if(velocity>2) HP -= 2*velocity^2; (You would have to convert velocity to a scalar instead of a vector for this to work)

     

    Something like that.

     

    1. So figure out what your event trigger is for causing damage.

    2. Find a way to determine it that event has occurred,

    3. Come up with a function or method for determining damage from that event and then,

    4. Subtract the damage from the HP

  15. The best way for performance is to use it cleverly, like on the character Hero only, or not all ennemies, or using it only on one part for each character.

    The number of points (vertex) or bones and precision, update frequency is what will affect performance.

    Once again i don't know if it is possible to upadte physics cloths each second , than interpolate ? it would be a lot of performance gain perhaps.

     

    Yeh you don't say...... I wasn't asking a question I was making a statement.

  16. When you say seperate entitiys, that would seperate gmf's, so the bike example would be 2 .gmf's? (frame and wheel x 2) and then you use lua two make them a "model"?

     

    Thanks

    Andy

     

    So for the bicycle example you make 1 frame and 1 wheel. Then you code the LUA script for the frame to load two wheels to positions relevant to the frame and parent them to the frame on Initialization.

     

    So yes multiple gmf files. That way you can have a separate origin point for each of them. Essentially you have one "model" and you load 1 mesh and paint it... Unless the fan is also a model with some LUA code and a .phy file. You can really do it whichever way you want but its best to have separate .gmfs. thats the was I do it at least.

×
×
  • Create New...