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 - Tukimitzu

Pages: 1 [2] 3 4 ... 8
16
SFML projects / Re: Pointless Wars - [Turn-Based Pointless Strategy]
« on: October 27, 2016, 12:45:30 pm »
The weird thing is that it isn't the recording, because that's how I see it when I'm not recording nor have FRAPS opened. I'm guessing it has something to do with some specific graphic card setting that I'm unaware of, because when I run it on linux it looks fine. I'll figure it out eventually.

17
SFML projects / Re: Pointless Wars - [Turn-Based Pointless Strategy]
« on: October 25, 2016, 06:04:25 pm »
More menu things.
This is how the intro looks like right now:

http://www.youtube.com/watch?v=sAs4uMJYT0g

The only thing I'm yet to find the problem is why the SFML logo looks bad. I'm using the small .png file available here, and I'm sure I did not resize it. Or am I?

Anyway, I'm liking it!

18
SFML projects / Re: Pointless Wars - [Turn-Based Pointless Strategy]
« on: October 05, 2016, 02:28:55 am »
Like animals reacting if you click on them or something.

Done.  ;D

19
SFML projects / Re: Screenshot Thread
« on: October 01, 2016, 04:16:42 pm »
My next #screenshotsaturday submission.

20
SFML projects / Re: Screenshot Thread
« on: October 01, 2016, 04:13:17 pm »
@Raincode
Nice!

21
SFML projects / Re: Pointless Wars - [Turn-Based Pointless Strategy]
« on: October 01, 2016, 12:13:51 am »
My main menu is turning out pretty great if you ask me. Thank you, you're welcome.


22
General / Re: Questions about making tiled game
« on: September 28, 2016, 08:45:47 pm »
Alright, good to know, thank you both.

23
General / Re: Questions about making tiled game
« on: September 27, 2016, 03:50:32 pm »
Interesting... But is it always faster than multiple draw(sf::Sprite) calls? Or if your map is super duper large then it becomes more efficient to draw only the tiles within your sf::View?

24
SFML projects / Re:creation - a top down action adventure about undeads
« on: September 25, 2016, 05:29:26 am »
Any tips on not over engineering and being okay with some your code?

If you know something can be done better, save it for the next game. Only change things that are precluding something else to work. It's not like players care if you are scripting or hardcoding anyway.

And as I say this I'm writing my own version of strtok::)

25
General / Re: Questions about making tiled game
« on: September 19, 2016, 01:20:13 am »
You only have to draw the tiles that are within your window sf::View boundaries.
Example:

int tileHeight = 32;
int tileWidth  = 32;
int worldHeight = 1024;    //in tiles
int worldWidth  = 1024;    //in tiles

double viewWidth  = 1280;
double viewHeight = 720;
double viewTop = 0.0;
double viewLeft = 600.0;

int viewHeightInTiles = viewHeight/tileHeight;
int viewWidthtInTiles = viewWidth/tileWidth;

// Note that you also want to draw the tiles that are partially shown in your view.
// That's why -1 here...
int i0 = max(0, viewLeft/tileWidth - 1);
int j0 = max(0, viewTop/tileHeight - 1);
// and +1 here
int iMax = min(worldWidth, i0 + viewWidthInTiles + 1);
int jMax = min(worldHeight, j0 + viewHeightInTiles + 1);

for (int i = i0; i < iMax; i++){
  for (int j = j0; j < jMax; j++){
    tile[i][j].setPosition(i*tileWidth, j*tileHeight);
    window.draw(tile[i][j]);
  }
}

No matter how big your world is, you will always draw a maximum of (viewWidthtInTiles + 1) * (viewHeightInTiles + 1).

26
General / Re: Questions about making tiled game
« on: September 18, 2016, 06:21:49 pm »
Your questions are too broad, so I'll give you a broad answer:
1.1) How to draw:
A tile has at least 3 properties: width, height and a drawable (which can be a sprite, a colored rectangle, etc). A map is composed of multiple tiles, which can be represented by a 2 by 2 matrix:

int TileMap[width][height] =
{1, 0, 0,
 0, 2, 0,
 0, 0, 3};

Given that you know which tile should be drawn at each position of the map, your drawing function will iterate through each position, get that tile and draw at that position.

for (int i = 0; i < width; i++){
  for (int j = 0; j < height; j++){
    tile[i][j].setPosition(xOrigin + i*tileWidth, yOrigin + j*tileHeight);
    window.draw(tile[i][j]);
  }
}

1.2) and interact with a large map:
If by interact you mean edit it, there are many ways. See how this guy did it. For you that are just begining, hard-coding your tile matrix is the way to do it (just like I did at 1.1).
If you mean player interactions with tiles, like collision, somewhere in your game loop (which is a key expression that you should google), you will check if the tile is, let's say, solid, and if the player is inside that tile. If so, you will correct the player position, because he's not supposed to go there.

2.1) How to make mobs and player damageable?
What is damage? Damage is a decrease of health. What is health? Health is a number. If your mobs have these members defined inside their classes, it's just a matter of manipulating these values. Let's say the player loses health if he collides (touches) with a mob:

player.health -= enemy.damage;

2.2) I mean how to watch when mob is attacked and when not (should I place this logic inside player, world class or somewhere)?
Do it the way it feels more natural to you. Back to the game loop, you can make it one of 2 ways (and all the other ways I'm choosing to ignore):

while (game.isRunning()){
  for (GameObject& object : objects){
    updatePosition(object);
    updateHealth(object);
  }
}

while (game.isRunning()){
  for (GameObject& object : objects){
    object.updatePosition();
    object.updateHealth();
  }
}

First approach the object contains only data (position, health, speed, ...), and this data is updated by a third party. Second approach the object contains both data and the manipulators of this data.

27
General / Re: Multiple tile layers
« on: September 18, 2016, 04:55:30 am »
Rather than having:

Tile tiles[width][height];

You could have something like:

vector< vector< list<Tile> > > tiles;

Then each position could store an ordered list of the tiles to be drawn at given position. Let's say you separate them with ";" in your xml:

    <Map>
        <Row>75;1  4   75  1   1   1   0   0   1   0   0   0   0   0   0   0</Row>
        <Row>0    1;4   75  1   0   0   0   0   0   0   44  0   1   57  0   0</Row>
        <Row>0    1;4   0   75  0   0   0   1   1   0   4   0   0   0   0   0</Row>
        <Row>0    40   24  1;72  0   0   0   0   0   0   4   0   0   0   0   0</Row>
        <Row>0    0    0   1   0   0   0   0   0   1;57  4   0   1   0   0   0</Row>
        <Row>0    0    0   0   0   0   0   1   1   0   4   0   0   0   0   0</Row>
        <Row>0    0    0   0   0   0   0   0   0   0   4   0   0   0   0   0</Row>
        <Row>0    0    0   1   0   0   57  0   0   0   4   0   1   0   0   0</Row>
        <Row>0    0    0   1   0   0   57  0   0   0   4   0   1   0   0   0</Row>
        <Row>0    0    0   0   0   0   0   1   1   0   4   0   0   0   0   0</Row>
    </Map>

And drawing is easy enough:
for (int i = 0; i < width; i++){
  for (int j = 0; j < height; j++){
    for (auto& tile : tiles[i][j]){
      window.draw(tile);
    }
  }
}

28
General / Re: Can't track this SegFault
« on: September 16, 2016, 09:58:30 pm »
Alriiiight, I found the issue. I'm either the smartest man on earth or the dumbest one.

I googled GBIEH.dll and it turns out it is from the security plugin my bank requires to access online banking. It installs itself like a virus, so it took me a while to hunt it down, but I did it and it solved the problem.

Anyway, sorry for taking your time.
Man, don't you hate when your bank interrupts your game development?

29
General / Re: Can't track this SegFault
« on: September 16, 2016, 07:42:59 pm »
all right all right, I've made progress. Drmemory finally cought the error:

Error #3: GDI USAGE ERROR: DC 0x8a011ee0 that contains selected object being deleted
# 0 system call NtGdiDeleteObjectApp
# 1 GDI32.dll!DeleteDC                            +0x154    (0x745b0e65 <GDI32.dll+0x80e65>)
# 2 GDI32.dll!DeleteDC                            +0xd      (0x745b0d1e <GDI32.dll+0x80d1e>)
# 3 GBIEH.DLL!SpecialFunction                     +0xb9302  (0x1070e7ad <GBIEH.DLL+0xee7ad>)
# 4 GBIEH.DLL!SpecialFunction                     +0x56d46  (0x106ac1f1 <GBIEH.DLL+0x8c1f1>)
# 5 GBIEH.DLL!SpecialFunction                     +0x566ae  (0x106abb59 <GBIEH.DLL+0x8bb59>)
# 6 GBIEH.DLL!SpecialFunction                     +0xd11f1  (0x1072669c <GBIEH.DLL+0x10669c>)
# 7 GBIEH.DLL!SpecialFunction                     +0xd0ebd  (0x10726368 <GBIEH.DLL+0x106368>)
# 8 KERNEL32.dll!BaseThreadInitThunk              +0x23     (0x764b38f4 <KERNEL32.dll+0x138f4>)
Note: @0:00:27.386 in thread 5456
Note: DC was allocated here:
Note: # 0 system call NtGdiCreateCompatibleDC
Note: # 1 GDI32.dll!CreateCompatibleDC                      +0x10     (0x745b2031 <GDI32.dll+0x82031>)
Note: # 2 GBIEH.DLL!SpecialFunction                         +0xb9336  (0x1070e7e1 <GBIEH.DLL+0xee7e1>)
Note: # 3 GBIEH.DLL!SpecialFunction                         +0x56c85  (0x106ac130 <GBIEH.DLL+0x8c130>)
Note: # 4 GBIEH.DLL!SpecialFunction                         +0x566ae  (0x106abb59 <GBIEH.DLL+0x8bb59>)
Note: # 5 GBIEH.DLL!SpecialFunction                         +0xd11f1  (0x1072669c <GBIEH.DLL+0x10669c>)
Note: # 6 GBIEH.DLL!SpecialFunction                         +0xd0ebd  (0x10726368 <GBIEH.DLL+0x106368>)
Note: # 7 KERNEL32.dll!BaseThreadInitThunk                  +0x23     (0x764b38f4 <KERNEL32.dll+0x138f4>)

But the question is: what am I looking at?

30
Audio / Re: Having multiple sf::Music open
« on: September 16, 2016, 06:55:10 pm »
To confirm or deny that I'm doing things right.
I'm trying to find this leak so I'm looking for it everywhere.
Thanks!

Pages: 1 [2] 3 4 ... 8