Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (flink, AndrewAMD), 656 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[CODE] Tilemap generation based on images #412958
12/05/12 16:20
12/05/12 16:20
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Hi Guys,

I came across this code I had once written, figured someone might wanna make use of it. (tested and works with A7 and A8)

It's very crude, it reads all images from a folder, and based on that creates blocks (per pixel) that are colored with the image's pixel color. To make any use of it, you'd have to spawn certain tiles based on the RGB values (commented in there too), but it's a start.

It stores all the images in an array too, you can load "levels" that way. by default it loads the first image in the array (and will probably crash if there is none, but hey, I told you it was rough code!).

Hope someone finds use of it, if I come across more stuff I'll upload it for you all to enjoy laugh

Download link: TileCreationImageBased.rar

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: [CODE] Tilemap generation based on images [Re: Helghast] #412963
12/05/12 16:42
12/05/12 16:42
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Nice, thanks for sharing man! laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: [CODE] Tilemap generation based on images [Re: 3run] #413697
12/16/12 13:03
12/16/12 13:03
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Helghast@ I wanted to know, have you worked on something that could save tiles on image, and load them back if needed? I would try to create a simple tile editor laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: [CODE] Tilemap generation based on images [Re: 3run] #413753
12/17/12 11:14
12/17/12 11:14
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Turned out this was rather easy!

I have re-uploaded the source (same link as before), it contains 2 new functions.
One generates a random level, and the other stores that to an array.

Check my comments for more info laugh

regards,
(PS: loading images was ofcourse already available, but wrapped in a quick function, you'll have to write your own pieces of code based on this to expand it)


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: [CODE] Tilemap generation based on images [Re: Helghast] #413754
12/17/12 11:29
12/17/12 11:29
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you man! laugh This is very useful!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: [CODE] Tilemap generation based on images [Re: 3run] #413761
12/17/12 13:48
12/17/12 13:48
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
I found an issue, where the BMAP that is being saved, is not compatible to be loaded again. I will investigate, and if needed file a bug-report.

Once I've got it fixed, I'll upload the new files again laugh

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: [CODE] Tilemap generation based on images [Re: Helghast] #413771
12/17/12 15:54
12/17/12 15:54
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Same link again,

I expanded the code slightly, changed saving (and loading) of BMP files to PNG files (as I was having issues reading the directX BMP format).

You can save and load from a dialog file.

Hope this helps you!
regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: [CODE] Tilemap generation based on images [Re: Helghast] #413772
12/17/12 15:58
12/17/12 15:58
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you for your time man!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: [CODE] Tilemap generation based on images [Re: 3run] #419997
03/18/13 08:30
03/18/13 08:30
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Helghast@ I've noticed something strange (or maybe I just don't get it). In the example, I create random map (100x30) and save in into .png.. And I can see on the screen, that there are 3000 entities. But when I load it back, it creates only 2875? Why that happens?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: [CODE] Tilemap generation based on images [Re: 3run] #420056
03/19/13 08:41
03/19/13 08:41
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline OP
Expert
Helghast  Offline OP
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
very good question, haven't noticed that yet. Lemme take a look, I'll get back to you on this laugh


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1