Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Any Very Basic 2D Tile Map Editor AGK Project Available?

Author
Message
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 19th Dec 2016 18:51
Hey there.

I decided last night to make a tiny Christmas / Winter themed game this week hopefully in time for a Christmas release.

First thing I decided was I need to get some basic dev tools set up over here in AppGameKit for me to use.

The priority right now is a tile map editor.

I've searched the forums and found code for working with Tiled .tmx maps. I do like the Tiled map editor and have used it before. However, I don't like the data format it uses. I consider it to be pretty wasteful just to load and process. Just my opinion there of course. Beyond that, I really want an AppGameKit project based one that I can update as I see the need to do so.

I also came across numerous threads showing custom 2D tile map editor projects. WIPs that seem to have never been finished or if they had they now link to sites that are no longer online. Or they are for DarkBasic not AGK.

I'll knock out a map editor over the next 2 to 3 days. But it would be awesome if someone had a very basic 2D map editor project in AppGameKit that I could use as a jump start. Because that should save me a bit of time.

Regardless, I will release my map editor project here when complete so other people can have one to easily work with.

I am not looking for anything super fancy. Basically it will have support for 8 layers, flipx, flipy, and that is about it.
So if you have something even super basic that would be fine and I can simply add on to it.

I plan to start on this tonight so hopefully someone with such a project they are willing to release here in source form will see this within the next few hours.

Thank you!
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 19th Dec 2016 23:49 Edited at: 19th Dec 2016 23:51
Workday is finished so I mocked up the application screen designing the GUI.

This is based heavily on a tile map editor I made in the early 90s on the Amiga using Blitz. The difference is SED supported only 3 layers instead of 8.

However, I actually just noticed there is something called the Placement Editor that comes with AGK. So before I spend time building this dev tool I will check out the Placement Editor. If it does what I need I can just use that and save some time.


TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Dec 2016 10:05 Edited at: 20th Dec 2016 10:06
In case you're not aware, the source code for the editor is in the viewer folder. Might be a good starting point for you to enhance.

Quote: "I decided last night to make a tiny Christmas / Winter themed game this week hopefully in time for a Christmas release."

You've seen the date right? and you know when Christmas is, right?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 20th Dec 2016 15:01 Edited at: 20th Dec 2016 15:03
@BatVink Thanks. I did not know that. I will take a look at the source. You are right that would be an excellent starting point.

However, now I may have another solution to it. I was talking over on the Unity forum that I may need to make a 2D map editor. I like Tiled but dislike the bloated XML data format. Someone suggested writing a convertor.

I decided to do a search thinking surely someone else must be of the same mind as I am and sure enough I found this...

Tiled to Binary Converter

It even supports RLE on the binary data. This is more along the lines of what I am thinking of for the resulting data. It was made for GMS but like the developer mentions it can be used by anything that can read binary data.

Looking forward to checking it out after work this evening. If it works I can simply use Tiled and then use this convertor to package the data up into a clean easily parsed binary format without any need for XML and TMX frameworks in my game programs.
That is the ideal I think.

Ha ha! Yeah I know time is short. That is one reason why I am trying to find alternatives to having to build my own map editor. It will just be a tiny game anyway so if I have say 8 to 12 hours I should be able to complete it.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 20th Dec 2016 15:21
@GarBenjamin: Tiled has also a TXT export format. I was looking into this before I dropped my Monkey related developments this weekend. I would go this way if I would be you.
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 20th Dec 2016 15:31
@MikeHart I'll have to take another look at Tiled tonight. Haven't used it in several months and I only remembered it packaging everything up in XML and giving options to use CSV or Base64 encoding of the values.

Simple text would also work although I'd prefer just binary. Thinking I could simply not use any RLE on the data and load it into a membank and use that for rendering and checking for map collisions. Assuming there is no performance hit in using the membanks over using an array.

I'll do some testing on all of this stuff tonight. Thanks for the info.

Out of curiosity... why did you drop Monkey X for your project(s)? I seem to remember you being one of the more ambitious & active developers in MX.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Dec 2016 20:51
There are Tiled map importers here, one by me and one by another. But I would advise converting the file to a custom binary format. The XML parsing is too slow on larger maps.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 21st Dec 2016 06:01 Edited at: 21st Dec 2016 06:05
@Phaelax I spent a lot of time messing around tonight trying to use that Tiled to Binary Convertor tool I found.

In the end, I just threw it out and thought "you know I am making this way too hard!". So I opened the Tiled data file and copied out the actual CSV data for my two map layers and pasted it into a new text file.

Then wrote a super simple loader for it. This is the approach I will use going forward. All I need is the actual layer tiles data. That is all I use. Sure, binary would be my preference but at the end of the day I figured why is it so important to me. I don't have time to screw around on this stuff.

Anyway, then I started designing my tile map scrolling engine. AppGameKit makes this so darn easy because it basically supports something very much like hardware scrolling back on the C64 and Amiga!
I'm talking about SetViewOffset of course. So it became a simple matter of "hardware" scrolling via SetViewOffset then doing a coarse scroll of 1 tile.
Basically I just have a grid of sprites on the screen. And of course I have a border of sprites as well. Meaning the grid extends one tile in size all around the screen.
The "coarse scrolling" is in reality simply updating each of those sprites images according to the current map position.
And this allows for scrolling through maps of unlimited size (well limited by RAM of course). It supports horizontal, vertical and diagonal scrolling.

I must say I am really enjoying AGK. It just makes everything so darn easy. What a wonderful api.

And here is a huge gif showing the current result. Sorry for choppiness but I had to optimize the gif to get it down to 5 MB. lol And of course the original video was fairly choppy as well. In the "game" it is smooth as silk.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 21st Dec 2016 12:15 Edited at: 21st Dec 2016 12:18
GarBenjamin wrote: "Out of curiosity... why did you drop Monkey X for your project(s)? I seem to remember you being one of the more ambitious & active developers in MX. "


I had my issues with Monkey 2. I loved Monkey X, but Monkey 2 gave me some hard time when I tried to port my fantomX framework to it. Which was not a five minute job. There are quite some differences. Adding to that and off an on, the parser through shit at me where no shit was surpose to be. So I got frustrated and voiced it in a civil manner. Asking how others cope with the frustration. Now the creator of the product jumps in, suggesting I should leave bug reports in his github. I did so before but they were never adressed by him, basically ignored. So why bother. He also said, that the tool is a running target and I should accept it. And if I am not happy with Monkey 2, he suggested to leave. And that is what i did. Dropped everything BRL related. AGK2 is now my main tool of choice as long as it is supported.

GarBenjamin wrote: "I must say I am really enjoying AGK. It just makes everything so darn easy. What a wonderful api."


Isn't it! Not much to ask for more.
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.
damothegreat
User Banned
Posted: 21st Dec 2016 16:18
AGK is the way forward for me too - Well done @Paul and @Lee and the rest of the TGC team - its a cracker of an tool.

Its a wonder how I have missed this product as its been out for many years now


Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Anything is possible if put mind to it
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 21st Dec 2016 19:29 Edited at: 22nd Dec 2016 00:07
Okay folks.

As you recall I originally used SetViewOffset to simulate hardware scrolling.

Now I just finished a second method not using SetViewOffset and simply repositioning the grid of tile sprites as needed for the scrolling.
Not sure which method I like best but I have done more work on this new function so far.

In fact, I then went ahead and created a simple demo for it.

I thought before I get into working on my game I would go ahead and release this barebones FUSTME project so anyone interested in how my tile map engine works can check it out.
Many of you have likely already done the same thing but I figured it might be helpful for some people. Hopefully. In case, you don't know (and I know I haven't been here long) I am a big believer in giving to the community and helping each other out.

You can check out the demo in your web browser at GameJolt by clicking here

You can download the AppGameKit Tile Map Engine Demo here. <-- a whopping 13.4 KB

This is a piece of what is seen in the demo. Just very basic but enough to illustrate it I think.
Yes, the gif is choppy as heck. Sorry about that. The actual demo is smooth as silk here.


I should point out that I won't be creating a custom Tile Map Editor because there is no need too. I can simply used tiled.

By the way the original tiled.tmx file is included in the media folder as well.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 21st Dec 2016 19:36
@damothegreat I thought the same thing! I had seen the name many times and I skipped it because I thought was just another point and click GUI based dev tool and also thought it was only for mobile games.

I wish I had found this years ago!

And yes I also want to thank the TGC dev team for doing such an awesome job on AGC.

Is there some way to donate some money to you folks or otherwise support your efforts with some cash? I'm happy to do so especially considering I bought this on sale at Steam a few weeks ago so you didn't get your normal money.

Do you folks receive any of the money for the sales at the asset store or is that completely a separate entity?
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
damothegreat
User Banned
Posted: 21st Dec 2016 20:19
I have read somewhere that I think TGC would be very happy if you place their logo (don't resize it) in your App and mention "This was made with AGK" somewhere (maybe on the title screen).

If you click the Help in the browser window ----> (over there at the bottom)

and ask if would like a donation - I'm sure they would oblige to answer how about doing such things

Or maybe guys here would guide you in the right direction of this, Not sure

I would certainly do so too
Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
Anything is possible if put mind to it
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 23rd Dec 2016 04:37
Been bookmarking this topic. Sorry to hijack about tilemap editor...my questions are
1. After uhv done creating level in editor, do u load the map as image and the collision in form of data Or both r loaded as data?

2. If the level is loaded as image and collision as data is there any disavntages?

Sorry OP.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 23rd Dec 2016 05:09
@hoyoyo80 When making a game what I do is have visual data layers and level information layers.

Like say it is a parallax scrolling platform game. Maybe there are 3 visual layers for the parallax display. So I'll have 3 map layers for those. Then I'd need an enemy placement layer. I just create an image called markers. And add a new map layer for the Enemy positions ( or enemy spawner positions). Then using the marker tiles I can visually position the enemies in the level. I might have another layer for other information such as interaction. This would have things such as the collision data you are talking about and it can have other information such as portals, doors, etc.

Basically you can use layers as needed to define anything needed for your game. The player won't ever see those. And internally I pull that information out and process it as needed. Maybe I will set up an EnemyPosition array for the level, scan the map layer and build a list of the data. We can do things any way we want to. These things such as tile maps and map editors are just tools. So just design how you would prefer to work with the data. You can then pull it out of the map layer and package it up as needed. For me a lotnof it depends on the game. For a scrolling shmup I usually just scan the column that is about to be scrolled on screen checking the Enemy layer and spawning enemies directly from that layer.

For a very basic game you can just build a interaction table in code that maps certain tiles to certain interaction types. And use the visual tile ID for your collision checking. You can also organize your tiles in such a way that all walkable tiles are together, all door tiles are together and so forth. In that case you can check a visual tile get its id and then check against the ranges to know what type it is.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
computercoder
9
Years of Service
User Offline
Joined: 27th Dec 2014
Location: USA - NC
Posted: 13th Jan 2017 05:12
Its always interesting to see people from other forums be on the new forums I've migrated to as well!

@MikeHart: I have the book you wrote for Monkey, and I've used some of your ideas. I also grew tired of Monkey 2, and frankly how unstable it was. *over it* I've written a LOT of code in BRL languages too.

@GarBenjamin: I've written SOOO many tile map editors over the years. I even wrote one using BRL's BlitzMax with the HORRIBLE GUI module. It was SUCH a memory hog, but partly MY fault there too. I used too many objects based on the OpenGL Window object and basically ran the app into the ground; until I rewrote it. Eventually, I abandoned BlitzMax in favor of REALbasic/Xojo. I wrote an extremely smooth running application that worked well on all OSes (Mac/Win/Lin) but I never finished. Work got in the way. I eventually decided to give that up and use Tiled. I created several TMX readers and was fully compatible with up to version 9.2. Even ported from REALbasic/Xojo into C#, BlitzMax and finally Monkey X. The XML is rather wasteful. You could convert into JSON, which IS smaller and somewhat lighter, but still takes a long tome to render. C# was BY far the fastest loading TMX MXL files.

I have some remnants of my 2DWD (2D World Designer) on my website: [href]www.computercoder.org[/href] if you'd like to see it. After reading this post, it makes me want to play with building something like that in AppGameKit too. Why not?

Before I even started using BRL stuff, I used DarkBASIC. I loved it! I still have it, but I moved on to Mac OS a few years after I started with it. TGC didn't have ANYTHING for Mac at the time so, there you have it. BlitzMax was the answer. I always felt TGC had more polish, and better tools. I just wish they had cross platform languages and tools! They do now, and have for some time. So here I am, back to play with AppGameKit by TGC!

Your project looks pretty cool!
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 16th Jan 2017 09:21
Hi computercoder. Thanks for getting the book! Always good to see people from other places. I have switched completely and I am not regretting it one day!
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.

Login to post a reply

Server time is: 2024-11-25 03:08:12
Your offset time is: 2024-11-25 03:08:12