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

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

0 Members and 1 Guest are viewing this topic.

CytraL

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • GitHub
Mappy tilemap engine playback library port for SFML
« Reply #30 on: July 03, 2010, 08:31:01 pm »
Hi! Thank you for responding :)

The problem I have it when I want things away....

With x2 Zoom:


With x0.5 Zoom:



Thx!


P.D: Sry for my bad english :\
dev@redneboa.es | WordPress | GitHub | YouTube

Victoria

  • Newbie
  • *
  • Posts: 2
    • View Profile
Compile Errors
« Reply #31 on: July 04, 2010, 04:01:44 am »
Hey, I'm using Code::Blocks 10.05 with the mingw-with-gcc-4.4 package on the sfml-dev site. When I try to compile Demo.cpp I get:

SFMLMappy.h|132|error: extra qualification 'SFMLMappy::' on member 'SFMLMappy'|
SFMLMappy.h|147|error: extra qualification 'SFMLMappy::' on member 'GenerateMapYLookup'|
||=== Build finished: 2 errors, 0 warnings ===|

Can you point me in the right direction? Thanks.

PS: I tried removing the 'extra qualification', and it just gives me different errors.

CytraL

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • GitHub
Mappy tilemap engine playback library port for SFML
« Reply #32 on: July 04, 2010, 08:11:25 pm »
Ok..i fixed my problem ;)
dev@redneboa.es | WordPress | GitHub | YouTube

Victoria

  • Newbie
  • *
  • Posts: 2
    • View Profile
Fixed
« Reply #33 on: July 04, 2010, 10:56:25 pm »
I fixed my problem too  :wink: It turns out if I remove the 'SFMLMappy::' in the header, it does fix it. The other errors I got were just user error.

Thanks.

Hugo

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Great
« Reply #34 on: July 08, 2010, 11:53:27 pm »
Great! Now I don't have to write my own tiling/map engine, this engine's free though right? And it it has it's own map editor and it can load maps into sfml? And can it show any image size and any #of Images right?

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #35 on: July 09, 2010, 10:30:49 pm »
Yes, the playback library I made plus the standard version of the map editor are free.  The mappy editor will complain if you try to create a tile size greater than 128x128 but I believe size of the images it can display are really only limited by size of your graphic card's texture memory.  I believe it has a map limit of around 10,000 x 10,000 tiles.

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
Mappy tilemap engine playback library port for SFML
« Reply #36 on: August 15, 2010, 12:02:06 pm »
Is their a way to load the .FMP from memory?
that would be a real useful feature
John Carmack can Divide by zer0.

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #37 on: August 16, 2010, 04:25:46 pm »
Yes, there is a function for that.

Use DecodeMap which you pass a pointer to the FMP file you already have stored in memory.

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
Mappy tilemap engine playback library port for SFML
« Reply #38 on: August 18, 2010, 04:58:05 am »
Cool! It works, thanks

now does any one know of a version of mappy that supports alpha transparency? Other than magic pink? Like blending?
John Carmack can Divide by zer0.

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #39 on: August 20, 2010, 06:43:03 am »
Are you sure it doesn't already?  

I was pretty sure I tested 24-bit graphics with alpha blending and I definitely wrote code to handle them in the playback library because the 8-bit and 16-bit graphics are converted to 24 to work with SFML.

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
Mappy tilemap engine playback library port for SFML
« Reply #40 on: August 20, 2010, 11:06:40 am »
i don't think so, its either fully transparent or fully opaque, doesn't seem to allow png's that are inbetween
John Carmack can Divide by zer0.

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Mappy tilemap engine playback library port for SFML
« Reply #41 on: August 20, 2010, 04:41:31 pm »
I took a look around on the Mappy forums and it looks like 24-bit FMPs still use colorkeys for the transparency, but if you create a 32-bit FMP and use 32-bit pngs the alpha channels should work.

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
Mappy tilemap engine playback library port for SFML
« Reply #42 on: August 21, 2010, 01:17:21 am »
Nope, just tested it out to be double sure, created a 32 bit (+ alpha) FMP and importing a transparent png image causes the tiles that are partially transparent to become fully opaque and ungodly ugly :s



EDIT:
new question, how do you use
       'SetMapStartPosition'
and
   'SetMapDimensions'
?

im trying to convert my camera from using mappy's functions to using Views, but when i do, I see that Mappy automatically culls tiles that are not suppose to be visible, but they are cuz I'm using views now. and i thought that with these functions, i can set the map Dimensions to the size of the map, so it would stop culling but i was wrong.

Am i on the right track here?

EDIT 2:
nvm, got it working! was resetting the Map start pos, and Map dimensions every time i draw a layer because of an incorrect call. fixed now
John Carmack can Divide by zer0.

Naufr4g0

  • Full Member
  • ***
  • Posts: 112
    • View Profile
Some issues with Tilemap engine
« Reply #43 on: November 07, 2010, 04:08:05 pm »
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;

to get the ID of a tile under the player sprite, the program gimme a runtime error that I can't solve.
The definition of the method containing this code is:
Code: [Select]
void Ninja::CollisionDetection(SFMLMappy& map)
When I comment the line:
Code: [Select]

this->tileID = tileID;

the problem disappears.
Why?
Thanks for your very useful SFMLMappy, and for your future answer.

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
Mappy tilemap engine playback library port for SFML
« Reply #44 on: November 08, 2010, 08:49:08 am »
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;

John Carmack can Divide by zer0.