I just finished a project, and am about to work on another one...I wanted some input from some smart people.

I have a habit of separating my files by room. So the first room I made, I called all the associated files room01. tiled file, room 01. rle file, room 01. etc. And I had 25 rooms, all names like this. But I added 5 rooms after I made the boss room 25...So now it goes like 23,24,26,27,28,29,30,25.

which is annoying, but I wrote a little note to myself, in a readme file, but still confusing.

and I'm thinking of this other project, and I planned 100 rooms, and the order is 100% going to be heavily rearranged. I already have half of rooms files done and named 01,02,03,etc....So if I rearrange the rooms, I will either have to rename every file...possibly multiple times, or keep a (error prone) readme file, explaining any rearranging, or some 3rd option that eludes me.

and it's far worse than that. I have endless arrays of room data, that will be a nightmare to rearrange by hand.

If I had put them in some kind of excel spreadsheet, and export to csv, and wrote some program to auto-generate an included file that would have worked better. I'm not even sure how to rearrange an excel file easily.

Is there some convenient way of managing a large project like this? like even the naming issue. It won't make sense if the rooms go 23,02,17,29,53,etc. how do you even have a conversation about room 6 if all the files are called room 51?

_________________nesdoug.com -- blog/tutorial on programming for the NES

"Level 25" could be called "boss room", and you could create a txt file your export program loads to control the order at a really basic level. If you don't have a separate export step (you're including the files themselves, rather than including something created by a second program from the files themselves), all you need is that second step.

Inside levels.txt

Code:

Introducing BridgesHappy HillsRabbit Fight

Introducing Bridges would be the first level because it's the first line, Rabbit Fight would be the 3rd level because it's the third line.

If you needed to add two levels before Rabbit Fight, you'd just add their names before Rabbit Fight in that txt.Inside levels.txt after revision

Introducing Bridges would be the first level because it's the first line, Rabbit Fight would be the fifth level because it's the fifth line.

No existing levels would need to change or be renamed as you add or even rearrange levels, and there would be no confusion. As another step, you can put all the level files in a folder with the right name, but have a set name for every piece of data the level needs.

There are a few file formats that are basically named zip files with specific named files contained inside just like this. Pyxel Edit's .pyxel is one that comes to mind, as well as many openoffice formats. (Last I checked.)

Then to rename a level, you only need to change one thing's name. (The folder). You could even write a program that would load say... "levelpreview.png" from each folder in the txt, and then when you click and drag the levels around and save, a new txt is generated with that new order and no renaming takes place at all.

Edit: I guess in short: I'd give everything actual, memorable names (even if they don't appear in game) and let something else handle the ordering. I definitely suggest the folder thing if nothing else, so that if you do want to continue as you are (the names are numbered) you only have to rename one thing per level.

Irfanview's batch rename support can rename things by increasing index. So if you wanted to insert level 99 in between levels 2 and 3, you add levels 3-whatever to the list of files (removing level 99), start at named level 4 and you're done, except for renaming level 99 to level 3.

Edit: Removed spacetornado Renamer reference, if it can do the thing I can't find how in the docs.

If your levels will be linked (i.e. there's a door in level 3 that goes to level 99), you just use the actual "memorable" names and you'll almost never have problems regardless of how you reorder them.

I'll get into a similar situation with my new game where it scrolls screen-by-screen.

Each screen is defined by its own data array and then I have one array where all the screen arrays are referenced, so that you can access the screens by an index.

So, how do I call each separate screen variable?

Using a number would be problematic if I want to reorganize them and keep the order clean.

Naming each screen individually is bothersome. I don't want to find a name for 16 x 16 screens + dungeon rooms.

So, I will probably name each screen with a random letter combination, like gdjz, nbhe or bdfr. This way, the name is not tied to any actual position in the array and you can switch them around at will without the naming scheme getting screwed-up.

I had the same problem and ended up having to draw myself a map with the room numbers. I have separate MapEd "projects" for each area. The only time I have to reference the numbers is when making connections between rooms.

A part of me wants the room numbers to be in a logical order, but at this point it's too tedious to try and manage it.

In this situation, I'd probably draw the entire thing as if it was one single map, and let the encoder script take care of dividing the large map into rooms and encoding them all, creating all the necessary tables on the fly, so that the actual numbers don't matter to me (and might even be different each time the map is encoded).

For the scrolling thing, you don't name the individual screens, they're just named automatically in the export step too. They don't have to be randomly named, they can be sequentially named. Because the idea behind any of this is you (the programmer) are not the one doing the naming anyway. So if something changes, the names change automatically, rather than being a thing you worry about.

So to state a bit more, I only recommended naming the levels because that's the easiest thing to add for his final use case. But you can avoid naming anything with good enough tools. (Need a door to connect to another door in another level? Click the 2 doors in the GUI you created and link them. The link is automatically updated when the levels change order or get renamed or anything else.)

I am working on levels. They will never change order.I am working on levels, they need to change order. (Add a .txt with the names, so order can be changed without you having to think about it.)I am working on a scrolling game, with many collections of screens in each individual level. (Make the exporter export the the screens named something like level0_screen0 so the names don't collide and you don't have to think about it.)I am working on a scrolling game with many collections of levels that I want to place freely in some greater world map. (Make a map format that stores references to the levels. The exporter can export the levels freely, then the map freely so you don't have to think about it)

Whenever you have to think even a little about it, think about if your tools can be improved.

And a giant binary blob that those labels are in reference too. And you'll notice there is 16x16 metatile data and 32x32 metatile data in the middle of what might be considered 128x128 metatile data. It's "random" because the data is stacked on top of similar things for compression, all automatically. Me changing a single tile anywhere could wildly change what gets exported, but the end result (what the player sees) will be the same, because the exporter is designed to deal with all of that. Even the order of my tilesets can change after being exported (it'll dedupe tiles, and strip unused tiles by shifting the stack down.)

I can delete levels, insert levels, change the size of levels, change the order of the tiles in the tilesets and I don't have to think about anything while doing it. There are some things I currently need to think about (arranging enemy sets so enemies outside the CHR for the level can't be placed), but even that could be handled automatically by doing the reverse. Creating the CHR sets based on the enemies in levels in the export step. I'll probably eventually do this.

Tools programming isn't always the most fun, but it's worth the time spent, I promise. One doesn't necessarily need to spend all the time writing an all in one tool like I've done, but definitely add new things whenever existing things are making you think about things you shouldn't be.

I had the same problem and ended up having to draw myself a map with the room numbers. I have separate MapEd "projects" for each area. The only time I have to reference the numbers is when making connections between rooms.

A part of me wants the room numbers to be in a logical order, but at this point it's too tedious to try and manage it.

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum