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

Author Topic: Mappy tilemap engine playback library port for SFML  (Read 44915 times)

0 Members and 1 Guest are viewing this topic.

Naufr4g0

  • Full Member
  • ***
  • Posts: 112
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #45 on: November 08, 2010, 05:09:26 pm »
Quote from: "WitchD0ctor"
Probably wont fix the problem but why not save a line with,
Code: [Select]

this->tileID = map.GetMapBlockInPixels(pos.x + 6, pos.y + 6)->bgoff;



'Cause, as you guessed, it doesn't work!
The problem is I can't store the value in a private data member of the class, but if I simply read the value, I have no errors.

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Some issues with Tilemap engine
« Reply #46 on: November 08, 2010, 08:10:46 pm »
Quote from: "Naufr4g0"
Hi, Breakman79!
I'm using your Mappy playback port for SFML intensively, and I had no problems so far.
I'm using layer #2 of the tilemap as a trigger map for some gameplay actions.
But when I use this code in a method of a class:
Code: [Select]

map.ChangeMapLayer(2);
long int tileID = map.GetMapBlockInPixels(pos.x + 6, pos.y + 6)->bgoff;
this->tileID = tileID;


Sorry it took me a while to get back to you.  

Hmm, are you sure that you aren't requesting the bgoff for a position outside of the map dimensions?  The library has no bounds checking so it will definitely throw a runtime error if you try to request a position that doesn't exist.

Naufr4g0

  • Full Member
  • ***
  • Posts: 112
    • View Profile
SOLVED!
« Reply #47 on: November 08, 2010, 08:51:19 pm »
Quote from: "Breakman79"

Hmm, are you sure that you aren't requesting the bgoff for a position outside of the map dimensions?  The library has no bounds checking so it will definitely throw a runtime error if you try to request a position that doesn't exist.


Don't tell my why, but now the code works, without errors.
I made some other modification to the code and now it works with no apparent reason (maybe pos.x and pos.y returned an incorrect value)! :'D

Anyway here is a video of the game I'm working on:

>>> Ninja game preview <<<

darekg11

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #48 on: November 12, 2010, 02:58:59 pm »
Helo, I have a question:
I have to use normal Mappy editor and then use Your file to probably handle it in SFML?

toddcarnes

  • Newbie
  • *
  • Posts: 2
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #49 on: February 09, 2011, 08:23:16 am »
Quote from: "Ashenwraith"
Mappy is closed source so you cannot quickly adapt it to your engine, it will always be a generic map editor and you have to write external converters/tools if you want more.


Actually...

The code was made freely available for anyone to use and/or modify a long, time ago. So, you can adapt it and make it as "non-generic" as you want. All the original author asks is that you give him credit and NOT name your resulting editor "Mappy".

FWIW, I just downloaded the source for Mappy 1.01 and found that it still compiles just fine on Ubuntu 10.10. (As long as you don't mind ignoring the 384 warnings issued by the Allegro libraries for using deprecated code <grin>). It runs natively on Linux, loads fmp files, etc.

There is actually a more up-to-date version of the source available, but it's for the Windows version. I haven't tried to compile it yet.

Todd

toddcarnes

  • Newbie
  • *
  • Posts: 2
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #50 on: February 09, 2011, 08:25:16 am »
Quote from: "darekg11"
Helo, I have a question:
I have to use normal Mappy editor and then use Your file to probably handle it in SFML?


Yes, that is correct.

Anata

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #51 on: December 12, 2011, 02:12:26 am »
hello

Is there an update of SfmlMappy for use with smfl2 or someone have a modified version ?

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #52 on: December 13, 2011, 04:39:32 am »
Sorry, but I haven't upgraded the playback library for version 2 yet.  I've been waiting for the graphics API to stabilize before I dive in and see what has changed.  

It's possible someone else has already modified it to version 2 for their own use, but I haven't been notified.

Anata

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #53 on: December 26, 2011, 06:35:15 pm »
How to get the X and Y block position of a layer with sfmlmappy ?

I have make a layer with a tile for collision, and would like to get X and Y from this block for my collision.

I've try with tl/tr/bl/br for collision, but difficult to use when you have slop tile :(

Neomex

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Mappy tilemap engine playback library port for SFML
« Reply #54 on: January 01, 2012, 10:32:37 pm »
And how does it handle drawing many sprites? Is it actually able to run over 60fps with 1024x768 screen fullof 16bit tiles? Does it use OpenGL to render it or SFML graphics?

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #55 on: January 03, 2012, 11:32:08 pm »
Quote from: "Neomex"
And how does it handle drawing many sprites? Is it actually able to run over 60fps with 1024x768 screen fullof 16bit tiles? Does it use OpenGL to render it or SFML graphics?


That really depends on a lot of things such as the power of your video card and how many layers you are trying to draw at once.  The 1.6 version is using SFML sprites for rendering so there is some overhead there.  Also, mappy supports multi-frame animations for tiles so it needs to redraw every tile every frame for that.

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
Mappy tilemap engine playback library port for SFML
« Reply #56 on: January 19, 2012, 09:04:00 pm »
I downloaded the zip with the sample code and the header and cpp file and I added them to my project, etc. When I try to run the program my debugger breaks at all of the points in the SFMLMappy::LoadMap() where it tries to edit the boolean entitled map_error. Whether it's going to true or false... it throws an exception.

Quote
Unhandled exception at 0x013caeab in App.exe: 0xC0000005: Access violation writing location 0xcdcdce31.
-Wander

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #57 on: January 19, 2012, 10:52:07 pm »
That's strange.  It's just a simple static variable that is private to the SFMLMappy class.  I can't think of a reason why you would get an error like that; I've only seen that message when trying to write to a pointer that is out of bounds.

Wander

  • Full Member
  • ***
  • Posts: 170
    • View Profile
    • Email
Mappy tilemap engine playback library port for SFML
« Reply #58 on: January 19, 2012, 11:18:08 pm »
Hahaha. I figured this one out. I feel stupid.

I had:

Code: [Select]
class Map
{
    SFMLMappy *map;
}


But then I forgot to say:
Code: [Select]
map = new SFMLMappy();

Hahaha. Stupid me.
-Wander

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Mappy tilemap engine playback library port for SFML
« Reply #59 on: January 20, 2012, 07:43:48 pm »
A problem (among many) you wouldn't have if you used
Code: [Select]
SFMLMappy map;
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: