Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by KanonBaum

  1. KanonBaum

    Re-Lease the Kraken Beta

    Game is still unfinished, but reaching a closing point. Mac Demo here. Windows, Linux, and iPad ports when it's finished. (Sorry! Just takes time, ya know.) Read the text files. Finished product soon!
  2. I've found several mini-tutorials with setting up Android projects in Xcode and that it is possible to use C++ language too. However, I have other libraries I'd like to use that are, as I've read, Android compatible. I'm just not sure how to set this up. The libraries are all cross-platform. OpenGL for graphics and OpenAL for audio. Let me know if I need to tell you anything else to help me out. Thanks!
  3. Dijksta in this case sounds like an interesting approach. However, it did lead me to think about using a simple flood-fill algorithm alongside the ray-casting. All the tiles beginning from the light will be filled and dissolve with greater distance. Along with the ray-casting, it would lead to an instant check if there is an initial blockage. Thanks for the brain storming! I'll reply with any results.
  4. I have an implemented algorithm to generate these shadows and lights and it does fine. My problem is with the speed. Observe some screenshots: Screenshots. Several Multi-colored Lights with NO Shadows. Get a solid 60 fps.... Lights WITH shadows. Generates 20-30~ fps. Speed reduces even further after 5 or so more lights in the map... The Concept. 1. Pre-Lighting. It the checks to see if any light_groups have been added to the map and iterates through each visible tile on screen and applies each light to it. If the tile is off-screen or pitch black, it simply isn't drawn. 2. Light Calculation. Each light casts line checks to see if the tile is blocked by a wall tile (to reduce the light value the final tile may receive.) If so, the light value is cut immensely and is returned. If not, full light value is returned. 3. Light Baking. The final color value from the lights are applied to the tile (keeping a threshold between 0-255). This process is repeated for each tile on-screen until all tiles are affected by the light sources. The Problem. Each tile through each light is costly. The screen is 600x400, so there are about 950 tiles to iterate through. Currently 5 light sources. That's a lot of calculation that I'm sure could be reduced. The Code. Light Group and calculation. #include "MapLightGroup.h" MapLightGroup::MapLightGroup(GenericTiledMap *generic_tiled_map) { map = generic_tiled_map; } MapLightGroup::~MapLightGroup() { } const Light::Color MapLightGroup::calculateLight(const Vector2D point) { Light::Color final_color, current_color; final_color.r = 0; final_color.g = 0; final_color.b = 0; final_color.a = 1; // Map cell dimensions int cell_w = map->getCellWidth(); int cell_h = map->getCellHeight(); for(int i = 0; i < getSize(); i++) { bool blocked = false; if(get(i)->getPosition().distance(point) < get(i)->getCutoffDistance()) { if(map->lineIntersection(get(i)->getPosition().x/cell_w, get(i)->getPosition().y/cell_h, point.x/cell_w, point.y/cell_h, 0, 0, 0)) { blocked = true; } } /*else { }*/ // If the light source is beyond a block, darken it. if(blocked) { current_color = get(i)->calculateLight(point); final_color.r += current_color.r/10.0; final_color.g += current_color.r/10.0; final_color.b += current_color.r/10.0; final_color.a += current_color.r/10.0; } else { //final_color.r = 0; //final_color.g = 0; //final_color.b = 0; current_color = get(i)->calculateLight(point); final_color.r += current_color.r; final_color.g += current_color.g; final_color.b += current_color.b; final_color.a += current_color.a; } } // limit threshold to 0-255 final_color.normalize(); return final_color; } The individual light calculation code: const Light::Color Light::calculateLight(Vector2D point) { Light::Color final_color; double dist = light_position.distance(point); if(dist <= 1) dist = 1.0; if(dist >= light_cutoff) { final_color.r = 0; final_color.g = 0; final_color.b = 0; final_color.a = 1; return final_color; } double dist_light_factor = dist*light_tightness; double light_scalar = 1.0/(dist_light_factor/(light_radius*light_spread_weight)); final_color.r = light_color.r * light_scalar; final_color.g = light_color.g * light_scalar; final_color.b = light_color.b * light_scalar; final_color.a = light_color.a * light_scalar; final_color.normalize(); return final_color; } The map drawing code. void ZombieGameTiledMap::draw(Camera *cam, LightGroup *lights) { if(cam == 0) return; int cell_width = getCellWidth(); int cell_height = getCellHeight(); for(int k = 0; k < getNumLayers(); k++) { if(!map_parser->getLayer(k).visible) continue; for(int i = 0; i < getMapWidth(); i++) { for(int j = 0; j < getMapHeight(); j++) { GenericTiledMap::Tile tile = getTile(i, j, k); if(tile.getCellID() - 1 < 0) continue; if(!cam->isPositionInView(Vector2D(i*cell_width, j*cell_height))) continue; Gosu::Color c = Gosu::Colors::white; c.setAlpha( map_parser->getLayer(k).opacity * 255 ); Vector2D coord = cam->worldToScreen( Vector2D( (i*cell_width), (j*cell_height) ) ); // CALCULATE LIGHT COLORS TO TILES if(lights != 0) { Light::Color color; Vector2D point = Vector2D(i*cell_width, j*cell_height); color = lights->calculateLight(point); // PITCH BLACK. DON'T DRAW! if(color.r == 0 && color.g == 0 && color.b == 0) continue; // RED double red = color.r; if(red > 255) red = 255; c.setRed( red ); // GREEN double green = color.g; if(green > 255) green = 255; c.setGreen( green ); // BLUE double blue = color.b; if(blue > 255) blue = 255; c.setBlue( blue ); } double scale = cam->getZoom(); // NOW DRAW v_img[tile.getCellID()-1].draw(coord.x, coord.y, k, scale, scale, c); } } } } The Help. If there is any more information needed (i.e. more code), please let me know. I want to be able to have decent results with better speed. Also, another achievement I'd like is less blocky shadows if possible. If some kind of smoother interpolation between shadow'd tiles is possible, inform me. Thank you.
  5. But even if I changed the location of the logic (i.e. update() and storing the data in some buffer for the draw() phase), wouldn't it still be slow? Color value at each edge isn't a bad idea instead of center-point light values. I believe that will solve my smoothing problem at least.
  6. I have been writing games lately that I ultimately want to see as an app for the iPad and other iOS touch devices. I have everything but an iOS to test the porting on. I was going to buy a refurbished iPad1 for testing purposes only as I figured I didn't need a brand new one just to see if something runs right. However, are there aspects I'm not thinking about that will really determine what I need to buy? (iPad, iPad2, or the newer one?) Any feedback would be greatly appreciated.
  7. Thanks for the reading, I very much appreciate it Felix Ungman!
  8. Luckily most of my projects are 8-bit styled, but can you tell me more about retina resolution? How do I "design" for that?
  9. KanonBaum

    Re-Lease the Kraken -> Implemented Title Screen

    [quote name='Gaiiden' timestamp='1339886233'] Yep we have vimeo embed codes too [img][/img] [/quote] Today I Learned. Thanks!
  10. Made a video to show the menu in action and not just a photoshopped concept: [media][/media] [color=#71767A][font=helvetica, arial, sans-serif]Things seen: Fully functional menu Normal mode Particle effects Player Kraken Level-reset on death Temporary(?) In-game tune Things to do: Decide on the musical direction for the game Write and design the levels for easy and hard Write AI for easy and hard predators Add an Options screen (?) Cleanup Credits Windows Port[/font][/color]
  11. Made some music a while back for an "action anime RPG game" but the director of the game wanted music more arcade-like (with metal guitars strumming in the background and cheesy synths). I straight-up told him that I felt it would not be a good direction for the game (as it was a really impressive one) and I wouldn't make such music knowing the music he wanted wouldn't fit. I couldn't have that on my consciousness. He politely informed me that there were others that would make his music. So that was that. So anyways, I have music free to use and currently only a few: 3 alternative title screen pieces 2 alternative "gear"/mech dungeon level pieces 1 catacombs piece Download the current Archive. Just slap my name somewhere and include the copyright .html files in your game. I do plan on expanding this library to be a full-fledge free-to-use background-music-for-games library, so when I make more pieces, I'll either update here or make a new post. Enjoy.
  12. KanonBaum

    Re-Lease the Kraken

    There was a Kraken-related comp here on the 'ol GDnet Lounge to which I figured I should join. Initially I knew I wouldn't have time to make a full game, but I could at least make something playable since I started much later into the comp. Then my release app didn't work. Then the comp ended. So I never technically had anything to submit. Dang. Anyway, here I am a week or so later (I'm terrible at determining the passing of time) and I have three game modes and a flashy title screen in the works. My goal now is to complete it as a full-fledged simpleton-of-a-game that people can play, enjoy, while I gloat about it among my friends with some sense of false superiority. Here's an old video (but still close to the current game play) to watch. I can't help but push my limits in competitions regarding themes. In this case, it's a play on words "Re-Lease the Kraken": the Kraken needs a new lease on yet another car, that greedy bastard, but his credit is bad and he should feel bad. Play as the car to avoid the wrath of the Kraken all the while collecting money so the Kraken can straight-up afford it. Giving the Kraken the car is the only way thousands of lives can be saved by this slimy, self-centered, salt-squid. The things left to do are: Finish coding the flashy menu (Objects slide in and move around on selection) Lengthen the levels. This will give players the feeling of time worth spent since there are only three modes (three levels) Game State where the Kraken is approved for a re-lease on the car and one where it is not. Make sound, music, and place it in the game. More updates on the way.
  13. KanonBaum

    A way to Delete my account? Please?

    [font=arial, helvetica, sans-serif]"you can check out anytime you like, but you can never leave".[/font]
  14. "Use" as in with your application and free to parse without needing to buy a license. Also, preferably have audio as well. I did find Theora. Has anyone used this before? If so, what was your experience with it?
  15. Sure. Do you have anything in mind? [/quote] I'm not sure how well you can render water, but it would be cool to see it bursting out from the ocean a couple of miles away (to show its size) with large waves of water being displaced. All of this with dark red lighting (more black than anything for contrast). Perhaps even spice it up with debris of ships floating closer towards the camera. Just an idea.
  16. Oops! See if this made it work. Newer version.
  17. When I'm making progress with my game development or pretending to, I like to bob to music. I felt that I needed a piece I could "chill" to as well. So I wrote this. I figured other people might like this head-bobbin' music too. Hope y'all enjoy.
  18. 10.7? That's out now? I'm still on 10.6! That -could- be the problem. Can you run it with to see what else happened? And yes, it is very possible to get better. I've been revamping it a lot. Basically, the Kraken moves at a speed relative to the distance to be 50 pixels behind you. In short, if you're always accelerating, the distance will be constant and the kraken will never get you. However, deceleration minimizes the distance between you and the kraken, making it easier for you to die. Here's a video of current progress post-comp. Normal Mode (2 of 3 modes).
  19. what was the problem out of curiosity? [/quote] It was a mix of a few things that didn't have much to do with the library actually. I've been using a new map editor that saves the tileset you use exactly where it is on the machine from the root drive. I had been using it and thinking it was local. That's just the first part. The second was that I'm still in no way used to Xcode 4 for the mac (I liked Xcode 3's layout. Made more sense I thought.) I wanted to bundle the media for the game in the application itself this time around and finally found out how to do that via Xcode. With this solution and the previous problem, I discovered that the map file wasn't pointing to the tileset in the app as already state. (This whole process led me to think that it was something to do with the library's graphics loading). The third part was that the location of the release build was placed wrong (probably by me in a rush). As a solution, I truncated the file path when the map got parsed and loaded it via resource prefix (points inside the app). So everything got fixed.
  20. Found the release problem and fixed it. But I'm more than likely too late. Anywhere, here's the game from the video. No modifications to it to prove that this is what I had before the bug. (Mac OSX only atm) However, I do plan on fully implementing all the other futures and I'll release it on the forum under Announcements.
  21. Although I didn't officially get judged, I will appreciate the feedback Cornstalks! It's a shame I had library issues. I -would- like to reiterate we should have another competition in a few weeks and have a longer deadline perhaps? Like a whole week? Great job guys!
  22. Well, here's a link to the video of me playing one of the levels. I have no idea why release mode crashes. Wish I could have submitted something people could play instead of watching. Gag: Re-Lease the Kraken. The Kraken's newest-favorite sportscar was on sale, but he needed to get another lease since his old one (that materialistic bastard). However, the Kraken's credit score is bad (and he should feel bad). The player, the car, must drive far away from the Kraken or until you make the amount of money he'd need to buy the new car. Since I didn't have enough time, the money concept is kind of just "there" in the game. It became pointless without implementation (was originally going to be one of the main concepts of the levels: have enough money AND survive). But that was the idea.
  23. Okay. My release mode is not working. But the game's done. Will a video suffice since it works in debug?
  24. I have something! *hurries to upload*
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!