SRL Archive - Other Scripts

Map generation tools


mixster

2008-03-30 17:12:15

Recently, I started trying to port my Delphi map editor into Scar. So far, so good and I have actually improved upon it a lot. So far I only have the map generation part in scar and the map loading and reading, but luckily that does allow a little bit of fun. Attached is my compilation so far. You can check it out in action by running the mapeditor.scar file (the ScaRPG folder has to be placed inside your includes folder) a few times and watch it randomly make a map, write it, read it then paint it. It's made up of 5 layers and I think it's quite cool so far. Of course, you can use your own bmp's instead of my default ones and you can write out the map by hand rather than randomly generating it, so it's actually quite flexible for really only 1 aspect. You can also look forward to the Scar map editor soon which will allow you to design it on the fly rather than having to manually edit it/randomly generate it. Well, that's enough talking from me, so here we go!

Update[8pm - 2/4/08]: Added 'dragging assignment' to the map editor as well as scrolling to the tool image to allow a massive amount of tiles to be placed and stole a tile sheet from somewhere to use as the basic until I can be bothered to make my own. Also, improved the tile repainting to improve time drastically (literally from 150 ms approx to 5 ms approx per tile). Lastly, updated the repainting method to allow for better accuracy and added guide lines to show tile borders for easier map-making.

Dan Cardin

2008-03-30 17:21:43

thats quite nifty, and i hope you get the editor working, because that would be cool for a zelda-type game, i think :).

EDIT: the only thing i can say to improve it, is make the tiles smaller. They seem kinda big

mixster

2008-03-30 17:29:54

The only expected problem I can see is recompiling the map while editing it. Though it could very well work out fine, but if not then it may be a while until I finish the importing. After that, it should be clear sailing and the next version will be about making a console to actually 'play' the maps in where you can move etc. After that tile attributes will hopefully be added and after that a battle system. Of course, this could all take years, but hopefully in the end I'll help bring a whole new dimension to Scar.

mixster

2008-04-01 12:55:26

Sorry for the double post, but I finished the map editing part and for some reason I had 9 downloads and 1 reply, so it's a bit hard to avoid it… Anyway, added the map editor to it. You can now load and save maps (save as an ini file otherwise you won't be able to select it to open) and it works off a 6 x 10 tile sheet and you can load it up with your own custom graphics as long as they're 32 x 32 px. The radio button refers to the layer with the left most being the bottom layer and the furthest right one being the top layer. You click on a tile on the right to select a tile and it should come up on the the bottom tile that's separate. You then click on the map and it'll appear. Now, hopefully the next version will allow a larger tile sheet to be used, but I'm lazy and can't be bothered to add a scroll bar at the moment, so it'll be a while.

The only known bug so far has been that some of the co-ords are a bit off so you have to make sure you click in the middle of the square otherwise it may paint the tile onto another tile and also avoid setting a tile right on the edge of the map (on the right side) as it gives an array length error (doesn't stop it running though).

On a last note, make sure you extract it into your includes folder so there's a ScaRPG folder inside the include folder otherwise it won't run properly (well, shouldn't).

Edit: There are 2 tile sheets inside - the main one has a basic little set with a few signs and a well while the 2nd has a lot of ground/water stuff.

Dan Cardin

2008-04-01 14:29:12

And whats up with this?!!. people these days, not even replying to a perfectly cool thread :confused:. maybe they just dont like you :p.

EDIT: that is even more nifty! now you just need a game engine and more tiles for unskilled photoshop people like me :). One thing i think you should add is dragging, so you dont have to click 400 times to fill in the whole map :).

mixster

2008-04-01 14:34:38

Have you definately downloaded the new one and deleted the old one, as line 24 for me is a blank line with a forward above it and the next procedure being BlankMapC which definately works? It looks like the old file though and maybe they don't like me, who knows, I blame *insert prohpet here*.

Dan Cardin

2008-04-01 14:41:26

sorry, i was busy making a map and forgot to edit that i just hadnt put it in my scar folder and it was trying to use the old one. read above post for my actual post :).

mixster

2008-04-01 14:51:12

Dragging could be complex to do to say the least. Also, I'm thinking about making it generate the 144 tiles on the map separately - it would reduce painting time when editing the map, but would increase initial loading times, so I'm not sure. It really would be easier to improve upon this if I had more input, but I guess unless it has to do with 0wn1n9 at RS, then no one cares :( (except Dan ;))
I'll try and add the dragging anyway, but it will probably take a while, or maybe not. I actually had the tools setup within an hour and just had an error to fix, but it was Photoshop's fault that it wasn't working. Lastly, there will be plenty more tiles when I get the tool part scrolling

Dan Cardin

2008-04-02 15:52:56

wow, this has come really far!
tis quite amazing how cool this is :).

now for my suggestions :stirthepot:

1. make it stretch when you resize the form, cuz trying to look through all of the files is kinda weird.

2. possible tabs for the tiles, to make catagories, for tile browsing :).

3. changeable map size, which probably would mean making the map scrollable too. (the map you have is small for an outdoor type-thing.

4. a picture cutter - user puts in a picture and it breaks it into minibitmaps, so they'd be tiles. Then put it into a "custom" catagory if you make the tiles tabbed.(maybe, maybe not?)

5. ability to rotate the tiles once they've been put on the map.(would get rid of the need for some of the tiles you have :).

and thats it, other than great job so far, and i hope you have good luck with the game part when you get to it and continuing to update this :).

Brain

2008-04-02 18:57:00

hmmm, i guess its kinda cool
but i suck at it….
and its not a very fun game :p lol
keep it up tho, works well, and I'm too lazy to make a cool looking thing like your example :O

GoF

2008-04-05 13:19:01

Cool thingie >_> .. I'll check it better later, still slightly drunk.

From: Dan Cardin
And whats up with this?!!. people these days, not even replying to a perfectly cool thread :confused:. maybe they just dont like you :p.


I still love mixster.

Negaal

2008-04-06 08:27:47

I do like, the map editor and mixter. WoW, this one took a lot of time I guess…

Rep for this dude:)

BUMPBUMPBUMP

ShowerThoughts

2008-04-06 08:34:54

lol,BUMP!

Good Job How did you convert this from delphi to scar? manualy?
And how you made this it is cool :)

mixster

2008-04-06 13:08:41

Manually converted of course, there's actually very little similarity between the code now, with only basic concepts linking them. Also, I've had lots of input from Dan Cardin, so the next version will be much more awesome, though it will take a while as I'm gonna make Read/Write MapDNA procedures so I can speed up load times (currently takes longer to read or write a map than paint the map bitmap!) based off a string rather than an INI file. You can expect tabbed tool tile sheets, customizable map sizes, toggle layer visibility, custom tile importer (imports a bitmap then splits it into tiles so you can use any size images) and a custom tile editor (with added choose transparent colour) - should be done by tomorrow or maybe Tuesday :)
I'm just really happy other people like it and it hasn't turned into a conversation-style topic between Dan and I (Yay for the SRL IRC!) ;)

Zezi

2008-04-22 17:01:37

Very nifty and sweet
But explain what the buttons are for beside the picture of the piece? :S

I think i found abug, when you load your example map, then try to place at ile on the grass, it doesn't replace the tile (for me at least XD)

mixster

2008-04-22 17:07:57

I've got an updated version that runs much better and has a massive maximum size and runs much better etc. but I haven't finished yet, mainly because I've realised Scar's limitations and that I probably will be unable to push it anymore before it just stops working (which it has already done once and I was lucky to find a solution), so I've stopped working on it and instead put my time to better use learning c++ and catching up on stuff I shunned while coding it, though DanCardin (who does have my latest version) has said that he may continue it, but he only mentioned it once, so not sure whether or not he actually will.

Dan Cardin

2008-04-22 17:25:50

i will try :), i just dont know how far i'll get because of my lack of knowledge of drawing, and since i didnt write the code its kinda hard for me to understand (thats just the way i am).

also im working on other stuff right now, but if i have time…which i probably will, ill attempt to add some stuff :).

Gu3st...

2008-04-27 16:07:36

This is great! Rep++ to you! :)

mixster

2008-04-27 16:17:29

Thanks even though it is a bit late :)
How come more people post here after I decide to give up than when I script it?
Also, how do I get 29 downloads of my 2nd version and only get 7 people reply :(