Gabriel Marincu

Members
  • Content count

    15
  • Joined

  • Last visited

Community Reputation

238 Neutral

About Gabriel Marincu

  • Rank
    Member
  1. Could a game programmer ever achieve mastery? I guess that even if you work like 5 years in a domain (like the physics engine programmers for a modern FPS), how can you say that you are an expert in Game programming,when, for example you can't do the graphics part, or the structural organisation part? For me, everyone has room for improvement.   Let me give you one of Bjarne Stroustrup's quotes: "People who think they know everything really annoy those of us who know we don't". For me, the quote suggests that he acknowledges the fact that there is always room for improvement.   Meh, my opinion is pretty fixed, and i would never say that I am an expert even if at 60 years old i would have invented some awesome algorithm that produces pizza from my own programming language code. Especially if a teen comes to me with his own language that would give me soda with a while(1) loop.  
  2. Isometric map problem

    This change makes it work, but i'm not sure whether it is...good...or elegant...and i'm sure it will mess with getting the tile positions and so forth... for (tileNum in range(length(line))) { if (line[tileNum] == '0') tiles.append(Tile((t*32)+160,(tileNum*32)-32,grass)) if (line[tileNum] == '1') tiles.append(Tile((t*32)+128,(tileNum*32)-64,cube) } it gives me this:
  3. Sprite and Animation

    I don't get what you are asking for exactly, but I am asuming that you need to animate a Sprite.   From what I understand from your post, you seem to be the kind of programmer that has found OOP and thinks it is the best and most elegant solution for everything.   You don't need all those classes to animate a sprite. You just need an array that holds all the animation frames, and you loop over it once per main loop tick, changing the sprite's image with the one that the array index reaches. At the end of the animation just have an image that shows the sprite being idle.   for example, have only a Sprite class like this (pseudocode - also encompasses an animation function that goes over the frames in an array once per loop tick): class Sprite: constructor::set(x,y,image,moving,frames,currentFrame,extraTime) // give it some attributes assign_attributes { x = 100 y = 100 image = image1 moving = False //this is a boolean that changes state when a movement key is pressed frames = [image1,image2,image3,image4] // array of animation frames, taken from a spritesheet currentFrame = 0 extraTime = 0 } function AnimateSprite(int secondsPast) { if moving == true { extraTime += secondsPast timeBetweenFrames = 1.0/30.0 while (extraTime > timeBetweenFrames) { extraTime -= timeBetweenFrames currentFrame+=1 if currentFrame > maxNumberOfFrames: currentFrame = 0 } image = frames[currentFrame] } else image = image1 }
  4. Isometric map problem

    Hello everyone!   Recently I have been trying to transmute all the knowledge I have about 2d top-down RPG games into knowledge about isometric tile maps.   After an hour of not having a fully functional internet connection and struggling with a pen and paper to translate the cartesian coordinates into isometric ones, i've finally found the formula (a damn easy one, indeed).   Once i've applied it to all my top-down tiles it seemed to give them an isometric view. Awesome!   But something went wrong. I've drawn a "grass" rhombus and a cube and I applied the same procedure with them. Bong!   The cubes are not joined together and the grass is way off from the center of the cube space.   I've uploaded a screenshot so you can see exactly.   This is my tile loading function (i'll cough up some pseudocode so everybody can understand) function load_tiles(filename) // loads the level file { file = open(filename) content = file.readlines() + [\r\n\] /* reads it as a two dimensional array (keeping the spaces)*/ for (t in range(length(file))) { line = content.strip(\r\n) //takes it line by line for (tileNum in range(length(line))) { if (line[tileNum] == '0') tiles.append(Tile(t*64,tileNum*32,grass) /* appends a Tile class reference (first argument being the x (index * imageWidth), second the y(index*imageHeight), and third the image)*/ if (line[tileNum] == '1') tiles.append(Tile(t*64,tileNum*64,cube) } } } function 2dToIso() /* transforms the tile cartesian coordinates to isometric ones*/ { for tile in tiles { newX = tile.x - tile.y newY = (tile.x+tile.y)/2 tile.x = newX tile.y = newY } } the level file looks like this:   1111 1001 1001 1111
  5. 2D Tile World Generation

    In tile-based games I'd see plenty of solutions. Perlin noise is only one of the many solutions. As nox_pp above pointed out you would need to model the "standards" to best suit your needs. You can use a tile based approach for small things where you "select" a tile and only consider it's neighbours. It's more or like cellular automata but I think it's only suited if you want to design small stuff because it gets lost in large map generation. One solution that is greatly used also is by dividing your "map" into parts and specifically coding these out.(if you want, biomes like in Minecraft,Terraria or DF).For those Perlin Noise does its charm. You can always read Notch's (Minecraft's creator) map generation article (just google it).His world generation algorithm, for me, is a technical marvel (In the early versions of Minecraft I suspect a Perlin Noise *again* heightmap was used). Whatever method you decide to approach, Good Luck!
  6. RPG Inventory HUD

    Thanks for your help...I've managed to put together an algorithm and i've also integrated a small GUI for the inventory. Cheers!
  7. RPG Inventory HUD

    Ok...I'll try my best explaining my current situation (I am not a native english speaker so that could make it harder for me). To begin with...I have implemented a 2d top-down tile based game. It works perfectly until now (basic tilemaps,a bit of AI for mosters, Random map generation using Perlin Noise) So to describe the logic behind my inventory: - It currently allows adding, and removing items (when the character walks over the sprite of a dropped item and presses P the item is picked up and added to the inventory.If the player presses I a list of items shows up and he can select the item he wishes to drop and presses R to drop it) - My items are class based (references of a base Item class which passes a Use() (a sword gets and attack function,a potion a healing function and so on) function which i load from a .txt file for every item i want. - Yes it is a fixed sized inventory system (16 items) Graphics experience: Now I think I was harshly misinterpreted at this part...i think i may have expressed myself wrongly and that led to wrong conclusions (in my head I thought that you must have read my previous posts but now I realise that I must provide the necessary details). - My experience with graphics (+1 year of 2d graphics programming) - My experience with PyGame: about 9 months I'll try to attach a screenshot of my first level .[attachment=11026:screen.png]
  8. RPG Inventory HUD

    I am having difficulty with handling the UI interaction (like arranging items in the inventory, equiping them and so forth) As i have told you before i've already made an inventory but it works with string commands...Now i want to Make all that into a GUI.
  9. RPG Inventory HUD

    Ahem...i'm sorry if I didn't make myself clear (i still think i did). [quote name='Djfix' timestamp='1346420236' post='4975139'] I have a bit of a problem with a drag-and-drop,Diablo 2-like inventory HUD/GUI. [/quote] I said [quote name='Djfix' timestamp='1346420236' post='4975139'] .i can accept pseudocode, Python,Java,and C++ ideas [/quote] Still my language of choice is Python (PyGame library) but i honestly think this does not make any difference because i can handle myself in each language so i would have been able to port anything you gave me to Python. What have you tried? [quote name='Djfix' timestamp='1346420236' post='4975139'] I figured out how to handle the data part of the inventory (using an array) [/quote] The result: A working inventory system...only that it accepts string commands (it's all text) My Main problem: Linking my already working inventory system to a Heads Up Display (If you have played Diablo 2 you know what kind of inventory i am looking for)
  10. RPG Inventory HUD

    Hello again gentlemen! As the title of the topic suggests I have a bit of a problem with a drag-and-drop,Diablo 2-like inventory HUD/GUI. I figured out how to handle the data part of the inventory (using an array) but my main problem is Linking the data part to a GUI. Any ideas on that? I am just asking for ideas,suggestions (not plain solutions, i want something to challenge my brain not take them by granted)...i can accept pseudocode, Python,Java,and C++ ideas because i can relate the solutions to my language of choice. Thank you in advance!
  11. Pygame Image Problem

    When you initialise the screen variabile do it like this [source lang="python"]screen = pygame.display.set_mode((ScreenWidth,ScreenHeight),0,32)[/source] If this doesn't work try to remove the .convert from the image loading function and replace it with convert_alpha (so it retains its transparency).If even that doesn't work make your own image loading function and dump Pygame's
  12. colorkey problems

    Thanks! I've applied this function to my images and it has reduced the lag but I found out that most part of the lag was because i was calling the map loading function each time the game loop iterated.I fixed both of those problems and now it works like a charm.
  13. colorkey problems

    Hello everyone...I've recently managed to put up some code for a tile based game and it's working well but i've encountered a problem. I want to use non-colorkeyed images as base tiles(grass,dirt,rock,road), but if i draw a higher resolution image and load it with Pygame's basic image loading function (pygame.image.load) it lags a lot, but if i make the (0,0) pixel white and colorkey that, it works with no lag but it wrecks my tile grid's appearence. Any ideas why that might happen?
  14. 2d overhead tiling "engine"

    Thank you for the great explanation! I've applied an extremely similar principle but I complicated myself by using a Map class instead of just an array. The layer concept was a bit cloudy in my head but now you cleared it up. Thanks again!
  15. Hello gamedev. This being my first post i'd like to first introduce myself.My name is Gabriel and I am 16 years old. I've always had a great hunger for 2d adventure games.By this age I've played more than I could count (metaphorically speaking). Now that my highschool has introduced me to programming I am baffled by the idea that I could make my own 2d adventure game. Now with the formalities done I'd like to get to it. I am quite confortable in the C++ language (doing it in school for 1 year plus my home learning), up to the point of classes and structures (I can implement something using these concepts but it doesn't come as natural as the other features of the language do), but my real experience in developing games comes with the Python programming language along with the SDL spinoff Pygame. I dived in the Pygame documentation and learned all the functions and methods I deemed necessary for my game and shortly after that I started working on my first game: a Space Invaders clone. It turned out quite nice and it surely was a playable game but my dream is a overhead adventure game. I know that for this type of game tile engines are the most widespread because of flexibility and memory conservation, so i set out on the stupendous journey of designing my own tile engine but as I advanced with the engine it simply became too overwhelming.Finally i managed to put together a simple,clean (this is a big lie), 1 layer engine that could load, display,and save levels quite nicely. I now see how childish I was when i made my tile engine.My code seemed now like a zombie with only duct tape holding it in part. Now I am sorry to have bored you with the stupidly long story but I have one thing to ask: Can you please point me in the direction of basic multi layered tile engine making (not i am not asking for code snippets)? Just the logical steps of designing a multi layered tile engine. (links to tutorials, some pseudocode-ish ideas would be a bonus) Thank you! PS:Excuse my english please...