Jump to content
  • Advertisement

MustSeeMelons

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

134 Neutral

About MustSeeMelons

  • Rank
    Newbie
  1. Hi all, First off, I hope that I have posted in the correct section of the forum, If not feel free to move it around ;) I' building a simple puzzle game in Unity in which I want to utilize the LineRenderer to create a rope between two points. Imagine shooting a harpoon. I get the line and it's fine, but I can't change its material - its greyed out. I can choose what ever shader, cant do a thing. Any ideas what could cause this behavior?   And while I'm here, back to the harpoon. I indeed have a shooting harpoon and was thinking on making the rope a bit more dynamic than just a simple line. For example loses tension hitting the target and when start to pull back, regains the tension and starts to move the object to the shot point. I think I can't use physics as it would make the shooting imprecise and end up like Surgeon Simulator.. Currently the shooting is fine, would like to make it prettier though. Any ideas how to approach this?    
  2. MustSeeMelons

    Managing game worlds

    Sorry for the late reply and thanks for the answers! I was mainly interested in 2D isometric games, because I'm slowly building the engine. I just was thinking about how other games take care of the logic and the rendering. If for example I have a large map, it would be silly to go through all of the game objects currently present to check if I need to render them, or no? That's why I was thinking of AoE or any other RTS game. At the momment i have come up with the following: the game level is made of a 2D array of tile-objects, which have all kinds of properties. I just could create a sub list of objects on screen from looking at which tile the player is. The same for game logic, as I dont need to simulate what's hapening too far away. Also, would it be good if a tile knew what was on it? A mere pointer. Another thing, in a game like Skyrim, it seems that some NPC's are doing something when I'm not there.. How do they accomplish that? Or is it just hardcoded where one should be at a given time?
  3. Hey! I've done some thinking on how game levels are managed and have come to the conclussion - I'm not sure. Maybe there is a good read on the topic of handling game levels and their logic? Do all game levels consist of some kind of a tile map? As far as i know, for example, in 3D games the game worlds are split in to chunks, and only the few closest to the player are rendered and there logic processed. Am I right? What about RTS ganes in which units move all around a map? AoE2 is on my mind, also AoE3 because it's 3D.
  4. MustSeeMelons

    Creating simple isometric tiles

    Hey! I'm not an artist myself, but I'm in need of some very simple iso tiles. I couldn't find any that would fit me needs, so I guess I will have to make them myself. Where could i do it the fastest? Photoshop, 3DSMAX, Illustrator? The idea is to create a tile engine similar like AoE2: flat tiles, slope tiles and tiles in which slopes meet. Any suggestions would be greatly appriciated :)  
  5. Hi. I have a question regarding character movement in an isometric turn based strategy game, characters move from tile to tile only. As of now, I'm using linear interpolation to move the character from tile to tile, but that causes a problem: the character lags when switching movement. Did some research, and found out, that I should be using "Piecewise linear interpolation" - how does it work in the real world? I found articles about it, but they weren't so easy to understand, mostly because they are very mathematical and English is not my native tongue. Could someone please describe it more understandably? For now, I'm using the following code to traverse between two nodes: void Character::MovementUpdate(){ if(!moving){ movesLeft=moveTime; } else{ float rate=(float)(moveTime-movesLeft)/moveTime; posX=(int) ( (float)(currentTile->x+20)*rate + (float)posX*((float)1-rate)); posY=(int) ( (float)(currentTile->y-25)*rate + (float)posY*((float)1-rate)); movesLeft--; if(movesLeft==0){ if(moveList.size()>0){ Move(moveList.at(0)); moveList.erase(moveList.begin()); }else{ moving=false; characterSprite->UpdateAnimateSprite(moving); } movesLeft=moveTime; } } } If the character is moving, calculate it's coordinates. There are 30 steps for the character to move from A to B, and if there are more nodes to go to, go to the next node. For path-finding A* is being used, which returns a list of moves the character has to make, for example: North, North, West; etc.
  6. HI!   Me and a few of my friends are making an isometric tile based RPG, and I have a question regarding the structure of the tile map - how to save it? For now I am using a simple 2D vector of my Tile class, but I have a feeling that's not such a good idea, or is it?   I'm building a class so that I can store game levels and everything associated with the level (characters, items, tile textures etc.) and I'm having trouble with the scope of vectors push_back();   The class itself has the variable gameLevel, which is the 2D vector, containing the tiles. The class has a function, to read from a file all the necessary information regarding the level(which tile textures to load, how big the map is, and the tiles.. {1,1,1} {2,1,2}). Textures are loaded to a map, so that the Tiles can have their pointers to the texture (Is it OK?), then come the tile map, the code is as follows:   EDIT: Found the problem, it was a silly one, std::string::find() was returning a garbage value, because I was searching for the wrong delimiter, so embarrassing. void GameLevel::CreateLevel(std::string dataFileName){ std::ifstream levelData; int lineCounter=0; std::string line; std::string delim=" "; levelData.open(dataFileName.c_str()); gameLevel=std::vector<std::vector<Tile> >(levelHeight); //std::vector<std::vector<int> > tempLevel=std::vector<std::vector<int> >(levelHeight); unsigned int row=0; while(!levelData.eof()){ std::getline(levelData, line); if(lineCounter==0){ int pos=line.find(delim); std::string temp=line.substr(pos+1, pos+1); TILE_WIDTH=atoi(temp.c_str()); } else if(lineCounter==1){ int pos=line.find(delim); std::string temp=line.substr(pos+1, pos+1); TILE_HEIGHT=atoi(temp.c_str()); } else if(lineCounter==2){ int pos=line.find(delim); std::string temp=line.substr(pos+1, pos+1); levelWidth=atoi(temp.c_str()); } else if(lineCounter==3){ int pos=line.find(delim); std::string temp=line.substr(pos+1, pos+1); levelHeight=atoi(temp.c_str()); } else if(lineCounter>4){ if(line.find(",")!=std::string::npos){ int delimPos=0; std::string token; while((delimPos=line.find(delim))!=std::string::npos){ token=line.substr(0,delimPos); tempLevel[row].push_back(atoi(token.c_str())); NOT BEING SAVED! //tempLevel.at(row).push_back(2); line.erase(0,delimPos+delim.length()); } row++; } else{ int pos=line.find("."); std::string key=line.substr(0,pos); tileTextures.insert(std::pair<std::string, GameTexture>(key, GameTexture(*render, line))); } } lineCounter++; } std::cout<<"Tile count: "<<tileTextures.size()<<" "<<"Temp array size: "<<tempLevel.size()<<" "<<"Temp array first row size: "<<tempLevel.at(0).size()<<"\n"; levelData.close(); } tempLevel is just an 2D int vector to save the corresponding int's to textures. Any help would be very nice Any other topics or good reads would be appreciated too.   P.S. The screen of the current state - the ability to walk with a dude around.   [attachment=18077:shot.png]
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!