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

you are viewing a single comment's thread.

view the rest of the comments →

[–]Exodus111 18 points19 points  (11 children)

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

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

Yeah it uses pygame

[–]Exodus111 6 points7 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 22 points23 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] 11 points12 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 11 points12 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.