Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mbuckley2000

Pages: [1]
1
General / Re: 2D Tile Based RPG Questions
« on: December 22, 2013, 01:25:51 pm »
OK thanks that's very helpful :)

2
General / 2D Tile Based RPG Questions
« on: December 22, 2013, 01:05:37 pm »
Hey,
I am developing a Tile Based 2D map editor for my game (Zelda style). So far, all is going well except I am noticing rather slow FPS in some scenarios. I have a few questions regarding this, and would appreciate any help :)

1. To store the sprites for each tile, I have been declaring an array like this in the globals:
sf::Sprite TileSprite[MaxXTiles][MaxYTiles][MaxZTiles];
My assumption with this was that this wouldnt slow down performance unless the sprites were being drawn, which only happens when they are textured. Is this a correct assumption to make? if not, should I be using another system such as dynamic arrays?

2. This is more of a general RPG game theory question.. At the moment, when a tile is selected from a tileset, that tile's texture rectangle, texture pointer and tileset filename are stored. When placed, I set the new tile's rectangle and texture equal to the one on the tileset. When saving, I save the rectangle and the tileset filename. Is this is the best way to do things? If not, how should I be doing it?

3. What is the usual way to save map data for this kind of game? I have seen other projects use XML, but I am unfamiliar with XML, so I am wondering whether it is viable to use the fstream commands included with C++?

Matt

3
Graphics / Re: Why doesn't this work?
« on: December 16, 2013, 10:14:04 pm »
OK, thanks for the advice.. I was planning to try and learn on the job as I have coded games previously in other languages but I will take your advice and learn more of the theory first :)

4
Graphics / Re: Why doesn't this work?
« on: December 16, 2013, 08:17:04 pm »
I did read it.. I suppose what I should have asked is how can I perform this action without creating more images?

5
Graphics / Re: Extremely slow FPS drawing large sprites
« on: December 16, 2013, 07:52:32 pm »
OK, I made a minimal complete example, and couldn't reproduce the problem.. Unfortunately, I have no idea what is causing it. Are there any known issues with using sprites with global / cross file functions and variables? So basing it's coordinates on a function which is in another file?

6
Graphics / Why doesn't this work?
« on: December 16, 2013, 07:45:38 pm »
Hey,

I am trying to set one sprites texture to be the same as another's, but it wont compile..

Like this:
Sprite.setTexture(Sprite2.getTexture);

I also tried:
Like this:
Sprite.setTexture(Sprite2.getTexture());


Any help would be greatly appreciated :)

7
Graphics / Extremely slow FPS drawing large sprites
« on: December 15, 2013, 11:02:47 pm »
Hey,
I am just starting to learn C++ and SFML, so if there are any really stupid mistakes in my code, please don't hate me :)

I am trying to draw a fairly large (960x976) sprite to my screen, but when I do, it slows down to less than 1 FPS. I am also drawing 10,000 16x16 sprites to my screen, and this runs at 60 FPS no problem. I have an HD 5770 with 1gb GDDR5, so that isn't the issue I don't think.

Any help is much appriciated :)

if (sf::Keyboard::isKeyPressed(sf::Keyboard::LAlt) && EditorMode == 1) {
                                        TileSetSprite.setPosition(sf::Vector2f(GetLeftPixel(0), GetTopPixel(0)));
                                        Window.draw(TileSetSprite);
                                }
 

Pages: [1]