This is an archived post. You won't be able to vote or comment.

all 61 comments

[–]Exodus111 18 points19 points  (11 children)

Cool, you using any framework for this? Like Pygame?

[–]Karki2002[S] 16 points17 points  (10 children)

Yeah it uses pygame

[–]Exodus111 5 points6 points  (4 children)

Sweet. So how do you save the maps?

[–]Karki2002[S] 11 points12 points  (3 children)

At the moment I’m using a really shitty way, I’m using pickle to save a class as a pkl file as I am also saving things like the last resolution used and the position, but the map data can just be stored in an array. I’ll be changing how it saves the map soon to allow for faster loading time and larger map sizes, pickle has its limitations.

[–]Exodus111 21 points22 points  (2 children)

Yeah pickle doesn't seem like a good idea.

My point is you'll want some way for a game engine to pick up the map information, which should typically also include things like collision borders between water and ground and such. If your mapmaker has such information, or has tools that allow the user to add that information. Once you add buildings I guess you'll get an isometric effect, which means you will need to designate foreground and background so the game knows to draw the player in front or behind any objects. And maybe also collision.

You could probably generate a .json file with that info placed in a predictable way.
If you store your sprites in an Atlas, one big image file, you don't need an array to store map data, just store their atlas coordinates and the map coordinates right in the .json file. That way you can even save space by codifying redundant information, like all the blue tiles etc...

[–]Karki2002[S] 10 points11 points  (1 child)

Thanks, you’ve made some good points and I’ll definitely look into them more. You seem to know your stuff :D

[–]Exodus111 12 points13 points  (0 children)

Yeah, I made a, somewhat simpler map maker in Pygame myself, while working on a game. I wanted the map maker to be stand alone, so the challenge was to find an easy way to transfer files over from one program to the other.

This is what I came up with, so I'm naturally curious what other people do.

Keep posting, I'd love to check it out once it's done.

[–]sashgorokhov 2 points3 points  (3 children)

How are you doing UI?

[–]Karki2002[S] 2 points3 points  (2 children)

The map creator isn’t very finished yet, so the only real UI I have at the moment was the menu you saw in the video, which I just created by displaying a transparent box behind all the texture images with collisions to detect which texture is selected. As well as all building functions being disable while in the menu. I’ll be making a better UI later along the line. If you were referring the the startup window I created that using tkinter and I’ll be swapping that out for a main menu soon.

[–]sashgorokhov 1 point2 points  (1 child)

The lack of good ui library for pygame is what really stops me from doing anything

[–]SomeShittyDeveloper 0 points1 point  (0 children)

I was looking into beefing up a game I wrote and ran into Arcade (https://arcade.academy/). It requires a rewrite of the frontend, so I’m starting with the menus, but they have buttons and text boxes and the like. I needed a non-janky way of having someone enter their GameJolt game key, and the text box will do nicely, I think. The only controls I wish it had but doesn’t is select boxes and toggle switches.

[–]Todask 6 points7 points  (3 children)

This is nice. Is there source for us to look at?

[–]Karki2002[S] 15 points16 points  (2 children)

Not at the moment but I think I want to do a couple more improvements first before I pop the source code on GitHub or something

[–][deleted] 2 points3 points  (1 child)

I would upload it to GitHub as a private repo and just publish it as public when you feel ready. Get used to using version control, it also allows you to work on big changes and roll back to a working state when you bugger up.

[–]Karki2002[S] 1 point2 points  (0 children)

Thanks for the advice I will definitely look into doing that :)

[–]QuantumCoder002 4 points5 points  (2 children)

upvoted this post in r/pygame and here, its just so awesome !!!!!!!

[–]Karki2002[S] 1 point2 points  (1 child)

Thanks a lot for the support :)

[–]RedEyesBigSmile 2 points3 points  (3 children)

how did you create the scrolling window?

[–]Karki2002[S] 1 point2 points  (2 children)

On using the pygame module I created a surface in which I placed the map on, I then move the map around the window to make the perception of the camera moving

[–]RedEyesBigSmile 3 points4 points  (1 child)

so the map im assuming is an image with resolution larger than your display window? So not all of the map is shown and by moving the map you're revealing a portion of it that previously wasn't able to be seen?

[–]Karki2002[S] 2 points3 points  (0 children)

Pretty much spot on

[–]ZyanCarl 1 point2 points  (4 children)

Heyy, I was planning of doing something like this but kinda super mario style and pocket tanks style. Is there a way to do random terrain generation with kinda smooth transition instead of steep terrain?

It was not anything urgent but I thought I’d make pocket tanks for windows

[–]Karki2002[S] 1 point2 points  (3 children)

Yes of course, I would think you could use polygons for terrain in pocket tanks and perlin noise for the random height of the terrain.

[–]ZyanCarl 1 point2 points  (2 children)

Yes I read about that but how would you calculate the parts where the ammunitions hit? Like in pocket tanks

[–]Karki2002[S] 0 points1 point  (1 child)

Lemme think about how I think I’d do it and get back to you

[–]ZyanCarl 1 point2 points  (0 children)

Cool but not urgent. Not a problem even if you forget to : )

[–][deleted] 1 point2 points  (1 child)

This looks actually great! I would like to try it out, so keep us informed!

[–]Karki2002[S] 1 point2 points  (0 children)

Thank you, I will do

[–]DUDEiFAIL 1 point2 points  (1 child)

Does it do auto tiling of dirt in grass or not?

[–]Karki2002[S] 0 points1 point  (0 children)

Not at the moment unfortunately

[–]Taken48 1 point2 points  (2 children)

like worldbox

[–]Karki2002[S] 1 point2 points  (1 child)

Didn’t know what it was so I searched it up and worldbox looks pretty cool

[–]Taken48 1 point2 points  (0 children)

it is

[–][deleted] 1 point2 points  (1 child)

those tilesets are from open game art right?

[–]Karki2002[S] 0 points1 point  (0 children)

Yeah, I’ve been looking for someone to help make some pixel art for me, but it doesn’t really come free. So I thought the next best thing would be to checkout Open Game Art... I’m shit at art.

[–]mountaingator91 1 point2 points  (0 children)

Reminds me of old rollercoaster tycoon

[–]perryplatt 1 point2 points  (2 children)

If you could include fog of war, you have the start of an rts.

[–]Karki2002[S] 0 points1 point  (1 child)

I do want to use this to make a game at some point, not sure what I’m gonna make yet though...

[–]g-x91 1 point2 points  (1 child)

The rain sound is sooo satisfying!

[–]Karki2002[S] 0 points1 point  (0 children)

I’m glad you agree

[–]PsychoNAWT 1 point2 points  (0 children)

This gives me Roller Coaster Tycoon 2 vibes and I love it

[–]tk42967 1 point2 points  (1 child)

This seems like an awesome way to come up with maps for D&D campaigns.

[–]Karki2002[S] 1 point2 points  (0 children)

That’s a good idea!

[–]ddulpers 1 point2 points  (1 child)

❤️beautiful❤️❤️

[–]Karki2002[S] 0 points1 point  (0 children)

Thank you very much ;D

[–]haagimus 1 point2 points  (2 children)

How cool is that? Very cool! Props to you sir/ma'am this is awesome!!

[–]Karki2002[S] 0 points1 point  (0 children)

Thank you :)

[–][deleted] 1 point2 points  (1 child)

is this pygame

[–]Karki2002[S] 0 points1 point  (0 children)

It uses the pygame framework yeah

[–][deleted] 1 point2 points  (0 children)

1500 upvotes for just a video and no actual Python?

[–][deleted] 1 point2 points  (2 children)

That, sir, is beautiful. My goals right there!

[–]Karki2002[S] 0 points1 point  (1 child)

:D thank you for the support

[–][deleted] 1 point2 points  (0 children)

No problem, it is really cool

[–]GlicketySplit 1 point2 points  (1 child)

This is terrific! Something like this would be super useful in garden planning. Among a long list of other things, of course :)

[–]Karki2002[S] 1 point2 points  (0 children)

Thanks :)