Page 14 of 25 FirstFirst ... 491011121314151617181924 ... LastLast
Results 131 to 140 of 247

Thread: My Summer Project

  1. #131
    Code Monkey NightrainSrt4's Avatar
    Join Date
    Jun 2007
    Location
    Your cookie jar
    Posts
    2,679

    Default Re: My Summer Project

    You can now break walls down in addition to putting them up. I've tied the wall breaking attribute to the hammer status. I currently haven't made a hammer set of sprites, so I gave the morningstar the hammer attribute. This just means that its alternate click (right click) has the ability to break down walls. Seemed fitting, for now at least.

    Trying to improve the animation engine. I original only thought of looping animations, and the ability to tell it to play and to stop playing. I know I had a way to make it only play the animation once, but I didn't make it an explicit function, so I have to remember how I wanted to go about doing that. I can do it by just making a function in the main game class, but I feel like it should be within the animation class, but I failed at getting that working. Shrug, maybe I'll just take the easy route and go back and get it within the animation class at a later point.

  2. #132
    Code Monkey NightrainSrt4's Avatar
    Join Date
    Jun 2007
    Location
    Your cookie jar
    Posts
    2,679

    Default Re: My Summer Project

    Pretty large improvements today:

    *I can now loop animations for those I want looped, and play individual animations when I need that.

    *Clicking when using a weapon now plays the animation once. If you hold it, it will play the animation repeatedly until you release the button and it completes that final animation. After each time playing the animation, a trigger goes off, allowing me to do other things such as: fire a projectile, cause damage to a block, etc.

    *Blocks now have hit-points, and weapons have tile type specific damages. A pickaxe will do more damage to a block than to a wall, while the hammer excels at breaking down walls. If a block takes more damage than it has hitpoints, the block gets destroyed and a block item is spawned.

    *Damage over time is now dependent on not only how hard the weapon hits, but how fast it swings. A wooden pickaxe swings at 2 full swings per second, and can hit a tile for 50 damage. A dirt block with 100 hit points will break in two hits, which takes about one second. A stone block with 150 hitpoints would take three hits, and can be destroyed in 1.5 seconds. So the rate of destruction depends on how much damage the weapon can do, how many times it can swing each second, and how many hitpoints the block has.

    *I also figured out a way to save A TON of memory. . . again. I'm storing a lot of data in each of the 5million+ blocks, much of which is specific to the block type and not the individual block itself. All blocks of that type are the same in that specific regard. I don't need each block to store that data, I can store it in the base blocks and look up the data when needed. 5 million blocks each storing a bunch of 32-bit integers adds up to a lot of memory I can save. Going back and changing the references to the individual blocks will take the most time.

  3. #133
    The floppy drive is no longer obsolete. AmEv's Avatar
    Join Date
    Nov 2010
    Location
    Idaho, USA
    Posts
    3,052

    Default Re: My Summer Project

    Are you able to use the "find and replace" to update names (of vars and functions)?
    Two years. They were great. Let's make the next ones even better!

    Tri.fecta

  4. #134
    Code Monkey NightrainSrt4's Avatar
    Join Date
    Jun 2007
    Location
    Your cookie jar
    Posts
    2,679

    Default Re: My Summer Project

    Yes, I just have to figure out what the current calls are for each, and figure out what I need to replace it with.

    Example:

    Replace something like this:
    Code:
    if (map.tileMap[indexY, indexX].isSolid == true)
    {
         doThis(indexY, indexX);
    }
    With something like this:
    Code:
    int blockID = map.tileMap[indexY, indexX].ID;
    
    if(Map.tiles[blockID].isSolid == true)
    {
         doThis(indexY, indexX);
    }
    I didn't mean it would necessarily take a long time, just that finding each and changing it to the right thing would take the longest of the entire implementation. It will be quick to remove the attributes that never change from the maps blocks and place it into its own data structure; it will take longer to change all the references.


    Also, working on a new player character. The bubbly funky proportions should help ease the animation side of things.


    @800x600 to enlarge the character a bit:


    Still needs work, but I like where it is going. Also, his backpack either isn't necessary, or needs to have straps. It's just hanging on his back, lmfao. I'll make his helmet give off a bit of light, as its a pain falling into a pitch black hole and not knowing where your character is, where you can place torches, etc.

  5. #135
    Code Monkey NightrainSrt4's Avatar
    Join Date
    Jun 2007
    Location
    Your cookie jar
    Posts
    2,679

    Default Re: My Summer Project

    Spent nearly 12 hours today working on the lighting. Why I started to work on it, I'm not sure.

    Before:


    After:


    Still needs some work, but I now have a more intuitive system going. I can set the light easily to any color I want or need, and set colors individually for different objects. The banding you see in the first image is now gone.

    The way the light looks depends on the gradient (or not in the case of flat colors. A better gradient and color choice will get me closer to the look I was going for. Easily changed via textures now.

    This paves the way for a more natural dawn / dusk / sunset / sunrise. Instead of timed jerky lighting, with a few tweaks I should be able to have a smooth transition.

    I could do a vector based blocky style lighting like Terraria, but this really helps differentiate things visually. I'm working on a way to hide parts that wouldn't be hit with the light, but keep the type of lighting I have. Lots of math.

  6. #136
    Code Monkey NightrainSrt4's Avatar
    Join Date
    Jun 2007
    Location
    Your cookie jar
    Posts
    2,679

    Default Re: My Summer Project

    I almost forgot one of the most important things, and the big reason I spent so much time reworking the lighting:

    The game should now run on non Nvidia / AMD DX10+ gpu's. Integrated Intel DX10 GPUs and most DX9 GPUs in general could not run the game. According to Steams hardware surveys, this is only ~5% of the market, but still something I wanted to get fixed.

    This should now be solved. I am getting set to test this on the integrated Intel gpu in my laptop that could not run it due to the lighting system before. I will report back once I do.

  7. #137
    One Eye, Sixteen Cores. Kayin's Avatar
    Join Date
    Jun 2009
    Location
    Birmingham, AL
    Posts
    1,921

    Default Re: My Summer Project

    If you want me to put backpack straps on your bro there I can, just need the .PNG.
    Project:Mithril, sponsored by Petra's Tech Shop and Sidewinder Computers-MOTM Nominee October '08




  8. #138
    Code Monkey NightrainSrt4's Avatar
    Join Date
    Jun 2007
    Location
    Your cookie jar
    Posts
    2,679

    Default Re: My Summer Project

    Feel free to have at him. It was my first try at him. I still have to make all his different frames and animations, on top of cleaning him up, etc. But, have a go at him if you want to. The image size for each frame is 28 wide by 56 high. This way he easily fits in one block wide holes and 2 block high ceilings.



    The game now works on integrated DX10, and should work fine, even better, on a dedicated DX9 card. Playing on a 1.6Ghz CPU with an intel 4500 played well at 800x600. Playing at 1366x768 chugged a bit. The water simulations are expensive and they are applied on more blocks the higher the resolution. There are still a lot of optimizations I can make, but I'm going to worry about that at the polish stage. I will start looking into what I can thread, as the game is running high usage on one of these cores.

  9. #139
    Code Monkey NightrainSrt4's Avatar
    Join Date
    Jun 2007
    Location
    Your cookie jar
    Posts
    2,679

    Default Re: My Summer Project

    I'm going to have to start watching the performance and thinking about ways to speed things up.

    This is on a rig with a 3Ghz CPU and a GTX470. I'm getting these figures in debug, so I know to not worry too much, but there are some definite considerations I need to think about. To hit a steady 60fps, which the game needs or it starts running update more frequently than the drawing to catch up, I need everything to complete in under 16ms. The lower the better as it means it will run well on much lower spec'd computers.

    @1680x1050
    Code:
    Water Simulation:     ~3-4ms
    Draw Calls:            6-7ms.
    Everything else:       <<<< 1ms
    @800x600
    Code:
    Water Simulation:     ~1.7-2.2ms
    Draw Calls:            2ms
    Everything else:       <<<<<1ms
    The water simulation is expensive as its a nested loop running a cellular automata algorithm. Every block on the screen plus a buffer zone gets run through and checked with its neighbors every frame. The higher the resolution the more blocks it has to run through and compare.

    The drawing is similar in that the tiles are run through on a nested loop (run through each tile in a row, move down a row and run through that row, etc), but it is doing this multiple times for each layer it has to draw. If you don't draw things in the correct order you end up with random funniness with blocks being drawn behind things, in front of things, the wrong order.

    I think I can speed up the drawing quite a lot by only running the loop once, but grabbing everything I need for all the different types of drawing I need to do and putting them in a different data structure. The water simulation I'm going to have to think about. I might be able to save some time by converting it to integer based instead of calculating water masses with floats. *Shrug*. If it gets to be a problem I'll simplify the modeling. I tried putting it into its own thread, which helped cpu load across the board, but randomly something bugs and the water then starts multiplying.

  10. #140
    Code Monkey NightrainSrt4's Avatar
    Join Date
    Jun 2007
    Location
    Your cookie jar
    Posts
    2,679

    Default Re: My Summer Project

    Trees now have tops / leaves. When the block below the top gets destroyed, the top will disappear. Trees will get destroyed at a whole tree, and the amount of damage needed will be based on the size of the tree. Currently you have to break each block of the tree trunk to get rid of it, like trees in Minecraft.

    Blocks now display how much damage they have taken, giving a visual indicator to how many more hits you need to destroy it.

    Textures, as always, need work, but the code is there and placeholders are better than putting off getting it in until I get a texture I'm relatively happy with. Will get pictures sometime along.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •